summaryrefslogtreecommitdiff
path: root/system
diff options
context:
space:
mode:
authorDaniel P. Berrangé <berrange@redhat.com>2026-07-06 14:58:11 +0100
committerMarkus Armbruster <armbru@redhat.com>2026-07-07 11:16:25 +0200
commit75f31e3a8a16fef89b103516646c70b723b64c39 (patch)
tree020549e4f1a4e518346a0dfb77339e90be1d436f /system
parentb465a08b0cf5634a5b9d88765b41d3d20800fcb0 (diff)
downloadqemu-75f31e3a8a16fef89b103516646c70b723b64c39.tar.gz
qemu-75f31e3a8a16fef89b103516646c70b723b64c39.zip
monitor: implement "user creatable" interface for adding monitors
Implement the user creatable QOM interface and define the monitor-qmp and monitor-hmp types in QAPI. This unlocks the ability to create them on the command line with -object or in HMP/QMP with object_add. For example: $QEMU -chardev stdio,id=monchr0 -object monitor-hmp,id=mon0,chrdev=monchr0 Initially the "prepare_delete" callback is hardcoded to return an error which means -object and object_add can be used, but object_del will fail. Support for deleting monitors will be introduced in subsequent commits. Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com> Tested-by: Peter Krempa <pkrempa@redhat.com> Acked-by: Markus Armbruster <armbru@redhat.com> Signed-off-by: Daniel P. Berrangé <berrange@redhat.com> Message-ID: <20260706135824.2623960-24-berrange@redhat.com> Signed-off-by: Markus Armbruster <armbru@redhat.com>
Diffstat (limited to 'system')
-rw-r--r--system/vl.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/system/vl.c b/system/vl.c
index 4737c03872..63bdd06dfa 100644
--- a/system/vl.c
+++ b/system/vl.c
@@ -1829,6 +1829,10 @@ static void object_option_add_visitor(Visitor *v)
{
ObjectOption *opt = g_new0(ObjectOption, 1);
visit_type_ObjectOptions(v, NULL, &opt->opts, &error_fatal);
+ if (opt->opts->qom_type == OBJECT_TYPE_MONITOR_HMP ||
+ opt->opts->qom_type == OBJECT_TYPE_MONITOR_QMP) {
+ default_monitor = 0;
+ }
QTAILQ_INSERT_TAIL(&object_opts, opt, next);
}
@@ -1970,7 +1974,9 @@ static bool object_create_early(const char *type)
/* Reason: property "chardev" */
if (g_str_equal(type, "rng-egd") ||
- g_str_equal(type, "qtest")) {
+ g_str_equal(type, "qtest") ||
+ g_str_equal(type, "monitor-hmp") ||
+ g_str_equal(type, "monitor-qmp")) {
return false;
}