monitor: rename monitor_init* to monitor_new*

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>
Tested-by: Peter Krempa <pkrempa@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
Message-ID: <20260706135824.2623960-5-berrange@redhat.com>
Signed-off-by: Markus Armbruster <armbru@redhat.com>
This commit is contained in:
Daniel P. Berrangé
2026-07-06 14:57:52 +01:00
committed by Markus Armbruster
parent 7f0909bd80
commit fc500ce4d3
9 changed files with 16 additions and 16 deletions

View File

@@ -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);

View File

@@ -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;
}

View File

@@ -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);