From: "Daniel P. Berrangé" <berrange@redhat.com>
To: qemu-devel@nongnu.org
Cc: devel@lists.libvirt.org, "Alex Bennée" <alex.bennee@linaro.org>,
"Christian Brauner" <brauner@kernel.org>,
"Markus Armbruster" <armbru@redhat.com>,
"Marc-André Lureau" <marcandre.lureau@redhat.com>,
"Dr. David Alan Gilbert" <dave@treblig.org>,
"Paolo Bonzini" <pbonzini@redhat.com>,
"Philippe Mathieu-Daudé" <philmd@mailo.com>,
"Daniel P. Berrangé" <berrange@redhat.com>
Subject: [PATCH v3 04/35] monitor: rename monitor_init* to monitor_new*
Date: Thu, 18 Jun 2026 11:58:05 +0100 [thread overview]
Message-ID: <20260618105836.991609-5-berrange@redhat.com> (raw)
In-Reply-To: <20260618105836.991609-1-berrange@redhat.com>
The current "monitor_init" functions will clash with the methods of the
same name that are required by QOM. To ease the transition to QOM,
rename them out of the way.
Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Reviewed-by: Dr. David Alan Gilbert <dave@treblig.org>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
---
chardev/char.c | 2 +-
gdbstub/system.c | 2 +-
include/monitor/monitor.h | 8 ++++----
monitor/hmp.c | 2 +-
monitor/monitor.c | 10 +++++-----
monitor/qmp.c | 2 +-
storage-daemon/qemu-storage-daemon.c | 2 +-
stubs/monitor-internal.c | 2 +-
system/vl.c | 2 +-
9 files changed, 16 insertions(+), 16 deletions(-)
diff --git a/chardev/char.c b/chardev/char.c
index ca8b37ed8d..813c04d953 100644
--- a/chardev/char.c
+++ b/chardev/char.c
@@ -805,7 +805,7 @@ static Chardev *qemu_chr_new_from_name(const char *label, const char *filename,
if (qemu_opt_get_bool(opts, "mux", 0)) {
assert(permit_mux_mon);
- monitor_init_hmp(chr, true, &err);
+ monitor_new_hmp(chr, true, &err);
if (err) {
error_report_err(err);
object_unparent(OBJECT(chr));
diff --git a/gdbstub/system.c b/gdbstub/system.c
index e86c5870ab..20dcf7878d 100644
--- a/gdbstub/system.c
+++ b/gdbstub/system.c
@@ -388,7 +388,7 @@ bool gdbserver_start(const char *device, Error **errp)
/* Initialize a monitor terminal for gdb */
mon_chr = qemu_chardev_new(NULL, TYPE_CHARDEV_GDB,
NULL, NULL, &error_abort);
- monitor_init_hmp(mon_chr, false, &error_abort);
+ monitor_new_hmp(mon_chr, false, &error_abort);
} else {
qemu_chr_fe_deinit(&gdbserver_system_state.chr, true);
mon_chr = gdbserver_system_state.mon_chr;
diff --git a/include/monitor/monitor.h b/include/monitor/monitor.h
index 55649a8664..b9642b58ba 100644
--- a/include/monitor/monitor.h
+++ b/include/monitor/monitor.h
@@ -19,10 +19,10 @@ bool monitor_cur_is_qmp(void);
void monitor_init_globals(void);
void monitor_init_globals_core(void);
-void monitor_init_qmp(Chardev *chr, bool pretty, Error **errp);
-void monitor_init_hmp(Chardev *chr, bool use_readline, Error **errp);
-int monitor_init(MonitorOptions *opts, bool allow_hmp, Error **errp);
-int monitor_init_opts(QemuOpts *opts, Error **errp);
+void monitor_new_qmp(Chardev *chr, bool pretty, Error **errp);
+void monitor_new_hmp(Chardev *chr, bool use_readline, Error **errp);
+int monitor_new(MonitorOptions *opts, bool allow_hmp, Error **errp);
+int monitor_new_opts(QemuOpts *opts, Error **errp);
void monitor_cleanup(void);
int monitor_suspend(Monitor *mon);
diff --git a/monitor/hmp.c b/monitor/hmp.c
index 3dde52ddbe..4e4468424a 100644
--- a/monitor/hmp.c
+++ b/monitor/hmp.c
@@ -1524,7 +1524,7 @@ static void monitor_readline_flush(void *opaque)
monitor_flush(&mon->parent_obj);
}
-void monitor_init_hmp(Chardev *chr, bool use_readline, Error **errp)
+void monitor_new_hmp(Chardev *chr, bool use_readline, Error **errp)
{
MonitorHMP *mon = g_new0(MonitorHMP, 1);
diff --git a/monitor/monitor.c b/monitor/monitor.c
index 0b7b464ebe..a87597e606 100644
--- a/monitor/monitor.c
+++ b/monitor/monitor.c
@@ -715,7 +715,7 @@ void monitor_init_globals(void)
aio_co_schedule(iohandler_get_aio_context(), qmp_dispatcher_co);
}
-int monitor_init(MonitorOptions *opts, bool allow_hmp, Error **errp)
+int monitor_new(MonitorOptions *opts, bool allow_hmp, Error **errp)
{
ERRP_GUARD();
Chardev *chr;
@@ -732,7 +732,7 @@ int monitor_init(MonitorOptions *opts, bool allow_hmp, Error **errp)
switch (opts->mode) {
case MONITOR_MODE_CONTROL:
- monitor_init_qmp(chr, opts->pretty, errp);
+ monitor_new_qmp(chr, opts->pretty, errp);
break;
case MONITOR_MODE_READLINE:
if (!allow_hmp) {
@@ -743,7 +743,7 @@ int monitor_init(MonitorOptions *opts, bool allow_hmp, Error **errp)
error_setg(errp, "'pretty' is not compatible with HMP monitors");
return -1;
}
- monitor_init_hmp(chr, true, errp);
+ monitor_new_hmp(chr, true, errp);
break;
default:
g_assert_not_reached();
@@ -752,7 +752,7 @@ int monitor_init(MonitorOptions *opts, bool allow_hmp, Error **errp)
return *errp ? -1 : 0;
}
-int monitor_init_opts(QemuOpts *opts, Error **errp)
+int monitor_new_opts(QemuOpts *opts, Error **errp)
{
Visitor *v;
MonitorOptions *options;
@@ -765,7 +765,7 @@ int monitor_init_opts(QemuOpts *opts, Error **errp)
return -1;
}
- ret = monitor_init(options, true, errp);
+ ret = monitor_new(options, true, errp);
qapi_free_MonitorOptions(options);
return ret;
}
diff --git a/monitor/qmp.c b/monitor/qmp.c
index 27934206db..cb28a95efd 100644
--- a/monitor/qmp.c
+++ b/monitor/qmp.c
@@ -513,7 +513,7 @@ static void monitor_qmp_setup_handlers_bh(void *opaque)
monitor_list_append(&mon->parent_obj);
}
-void monitor_init_qmp(Chardev *chr, bool pretty, Error **errp)
+void monitor_new_qmp(Chardev *chr, bool pretty, Error **errp)
{
MonitorQMP *mon = g_new0(MonitorQMP, 1);
diff --git a/storage-daemon/qemu-storage-daemon.c b/storage-daemon/qemu-storage-daemon.c
index eb72561358..50dbfbd97a 100644
--- a/storage-daemon/qemu-storage-daemon.c
+++ b/storage-daemon/qemu-storage-daemon.c
@@ -330,7 +330,7 @@ static void process_options(int argc, char *argv[], bool pre_init_pass)
visit_free(v);
/* TODO Catch duplicate monitor IDs */
- monitor_init(monitor, false, &error_fatal);
+ monitor_new(monitor, false, &error_fatal);
qapi_free_MonitorOptions(monitor);
break;
}
diff --git a/stubs/monitor-internal.c b/stubs/monitor-internal.c
index 4fece49d53..23d58da184 100644
--- a/stubs/monitor-internal.c
+++ b/stubs/monitor-internal.c
@@ -8,6 +8,6 @@ int monitor_get_fd(Monitor *mon, const char *name, Error **errp)
return -1;
}
-void monitor_init_hmp(Chardev *chr, bool use_readline, Error **errp)
+void monitor_new_hmp(Chardev *chr, bool use_readline, Error **errp)
{
}
diff --git a/system/vl.c b/system/vl.c
index dbdd4f2257..21ef2dac51 100644
--- a/system/vl.c
+++ b/system/vl.c
@@ -1246,7 +1246,7 @@ static int fsdev_init_func(void *opaque, QemuOpts *opts, Error **errp)
static int mon_init_func(void *opaque, QemuOpts *opts, Error **errp)
{
- return monitor_init_opts(opts, errp);
+ return monitor_new_opts(opts, errp);
}
static void monitor_parse(const char *str, const char *mode, bool pretty)
--
2.54.0
next prev parent reply other threads:[~2026-06-18 11:01 UTC|newest]
Thread overview: 43+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-06-18 10:58 [PATCH v3 00/35] monitor: turn QMP and HMP into QOM objects Daniel P. Berrangé
2026-06-18 10:58 ` [PATCH v3 01/35] qom: replace 'can_be_deleted' with 'prepare_delete' Daniel P. Berrangé
2026-06-18 10:58 ` [PATCH v3 02/35] monitor: replace 'common' with 'parent_obj' in MonitorHMP Daniel P. Berrangé
2026-06-18 10:58 ` [PATCH v3 03/35] monitor: replace 'common' with 'parent_obj' in MonitorQMP Daniel P. Berrangé
2026-06-18 10:58 ` Daniel P. Berrangé [this message]
2026-06-18 10:58 ` [PATCH v3 05/35] monitor: minimal conversion of monitors to QOM Daniel P. Berrangé
2026-06-18 10:58 ` [PATCH v3 06/35] monitor: add 'chardev' property to Monitor base class Daniel P. Berrangé
2026-06-18 11:54 ` marcandre.lureau
2026-06-18 10:58 ` [PATCH v3 07/35] monitor: add 'readline' property to HMP Monitor class Daniel P. Berrangé
2026-06-18 10:58 ` [PATCH v3 08/35] monitor: add 'pretty' property to QMP " Daniel P. Berrangé
2026-06-18 10:58 ` [PATCH v3 09/35] monitor: remove 'skip_flush' field Daniel P. Berrangé
2026-06-18 10:58 ` [PATCH v3 10/35] monitor: move monitor_data_(init|destroy) into QOM init/finalize Daniel P. Berrangé
2026-06-18 10:58 ` [PATCH v3 11/35] monitor: use class methods for monitor_vprintf Daniel P. Berrangé
2026-06-18 10:58 ` [PATCH v3 12/35] monitor: use class methods for monitor_qapi_event_emit Daniel P. Berrangé
2026-06-18 10:58 ` [PATCH v3 13/35] monitor: use class methods for monitor_accept_input Daniel P. Berrangé
2026-06-18 10:58 ` [PATCH v3 14/35] monitor: use class method for I/O thread request Daniel P. Berrangé
2026-06-18 10:58 ` [PATCH v3 15/35] monitor: use dynamic cast in monitor_qmp_requests_pop_any_with_lock Daniel P. Berrangé
2026-06-18 10:58 ` [PATCH v3 16/35] util: use dynamic cast in error vreport Daniel P. Berrangé
2026-06-18 10:58 ` [PATCH v3 17/35] monitor: drop unused monitor_cur_is_qmp Daniel P. Berrangé
2026-06-18 10:58 ` [PATCH v3 18/35] monitor: use dynamic cast in QMP commands Daniel P. Berrangé
2026-06-18 10:58 ` [PATCH v3 19/35] monitor: use dynamic cast in monitor_is_hmp_non_interactive Daniel P. Berrangé
2026-06-18 10:58 ` [PATCH v3 20/35] monitor: drop unused monitor_is_qmp method Daniel P. Berrangé
2026-06-18 10:58 ` [PATCH v3 21/35] monitor: eliminate monitor_is_hmp_non_interactive method Daniel P. Berrangé
2026-06-18 10:58 ` [PATCH v3 22/35] monitor: implement "user creatable" interface for adding monitors Daniel P. Berrangé
2026-06-18 10:58 ` [PATCH v3 23/35] monitor: convert from oneshot BH to persistent BH Daniel P. Berrangé
2026-06-18 10:58 ` [PATCH v3 24/35] monitor: reject attempts to delete the current monitor Daniel P. Berrangé
2026-06-18 10:58 ` [PATCH v3 25/35] monitor: protect qemu_chr_fe_accept_input with monitor lock Daniel P. Berrangé
2026-06-18 10:58 ` [PATCH v3 26/35] monitor: implement support for deleting QMP objects Daniel P. Berrangé
2026-06-18 11:54 ` marcandre.lureau
2026-06-18 10:58 ` [PATCH v3 27/35] tests/qtest: add tests for dynamic monitor add/remove Daniel P. Berrangé
2026-06-18 10:58 ` [PATCH v3 28/35] tests/functional: add e2e test for dynamic QMP monitor hotplug Daniel P. Berrangé
2026-06-18 10:58 ` [PATCH v3 29/35] tests/functional: add a stress test for monitor hot unplug Daniel P. Berrangé
2026-06-18 11:54 ` marcandre.lureau
2026-06-18 10:58 ` [PATCH v3 30/35] qom: add method for getting the "id" of a QOM object Daniel P. Berrangé
2026-06-18 11:54 ` marcandre.lureau
2026-06-18 10:58 ` [PATCH v3 31/35] qom: add trace events for user creatable create/delete APIs Daniel P. Berrangé
2026-06-18 10:58 ` [PATCH v3 32/35] monitor: add support for auto-deleting monitors upon close Daniel P. Berrangé
2026-06-18 11:54 ` marcandre.lureau
2026-06-18 10:58 ` [PATCH v3 33/35] tests: switch from -mon to -object monitor-qmp Daniel P. Berrangé
2026-06-18 10:58 ` [PATCH v3 34/35] qemu-options: document new monitor-hmp and monitor-qmp objects Daniel P. Berrangé
2026-06-18 11:54 ` marcandre.lureau
2026-06-18 10:58 ` [PATCH v3 35/35] docs: mark '-mon' as deprecated in favour of -object Daniel P. Berrangé
2026-06-18 11:54 ` marcandre.lureau
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260618105836.991609-5-berrange@redhat.com \
--to=berrange@redhat.com \
--cc=alex.bennee@linaro.org \
--cc=armbru@redhat.com \
--cc=brauner@kernel.org \
--cc=dave@treblig.org \
--cc=devel@lists.libvirt.org \
--cc=marcandre.lureau@redhat.com \
--cc=pbonzini@redhat.com \
--cc=philmd@mailo.com \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.