From nobody Sat Apr 11 18:34:11 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=quarantine dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1775837202; cv=none; d=zohomail.com; s=zohoarc; b=HbsoMNjjfNuuZU4S8B+JZ18DVeNEVw52Db8ao6f7sF+2jmH02v4wBpSr9jACLQaSByh8GpkZqyTlkOq98w5oDVtM9wAJ58KfjpcC/HNE1vGH6jMyOGB9NxdeOmKybORKACf9812j07VBZR59VtWAPysjwAI4xEqxrT4UldePOR0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1775837202; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=aYljcxjAWI5mIsfVriofuWNiJ+RWRgV4TbNm/RQMm9g=; b=ggV6NwrGlgV8ZFKTOunVbIlGXk3RdabhPUCjbyg71uVoB1GipLbGmZDA6t7s8f53Dywn/sOezUXOFkctBm4qDuzk6sNGaUrdVef+QnMZp9DROAX9fXOgbrMxgsfpxbY0kdkswGJI9Mx4Hu+O2a7ey/2/lgacgsRLR7QviiMMWrY= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=quarantine dis=none) Return-Path: Received: from lists.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1775837202274199.27025550813244; Fri, 10 Apr 2026 09:06:42 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wBEMk-0004Aw-EX; Fri, 10 Apr 2026 12:05:54 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wBEMG-0003yd-I1 for qemu-devel@nongnu.org; Fri, 10 Apr 2026 12:05:26 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wBEME-0006OV-LY for qemu-devel@nongnu.org; Fri, 10 Apr 2026 12:05:24 -0400 Received: from mx-prod-mc-08.mail-002.prod.us-west-2.aws.redhat.com (ec2-35-165-154-97.us-west-2.compute.amazonaws.com [35.165.154.97]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-113-roai83NQMB-eLm_nU87jrw-1; Fri, 10 Apr 2026 12:05:16 -0400 Received: from mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.17]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-08.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 3565418002CA; Fri, 10 Apr 2026 16:05:15 +0000 (UTC) Received: from toolbx.redhat.corp (headnet01.pony-001.prod.iad2.dc.redhat.com [10.2.32.101]) by mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id E45DA195608E; Fri, 10 Apr 2026 16:05:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1775837122; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=aYljcxjAWI5mIsfVriofuWNiJ+RWRgV4TbNm/RQMm9g=; b=hOTOt95lF6KubWEzl0PJ9i+Fmb3RVYyJtyLbSebR4IHmYSB9g5hKN8Zq2qvF0UAhRROCD+ a5+aL9rSREce37Ak74D1q95N+QehPui/zluDAH91xn0b2UKzHphN7pn5PlACRA+VUXmyOM 9MBXuBfaWjpbJeXqDSVz0Ku1mJHp4Ew= X-MC-Unique: roai83NQMB-eLm_nU87jrw-1 X-Mimecast-MFC-AGG-ID: roai83NQMB-eLm_nU87jrw_1775837115 From: =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= To: qemu-devel@nongnu.org Cc: Paolo Bonzini , Markus Armbruster , Christian Brauner , =?UTF-8?q?Alex=20Benn=C3=A9e?= , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Fabiano Rosas , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , Peter Xu , Kevin Wolf , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= , qemu-block@nongnu.org, "Dr. David Alan Gilbert" , Eric Blake Subject: [PATCH 03/17] monitor: rename monitor_init* to monitor_new* Date: Fri, 10 Apr 2026 17:04:44 +0100 Message-ID: <20260410160458.3778874-4-berrange@redhat.com> In-Reply-To: <20260410160458.3778874-1-berrange@redhat.com> References: <20260410160458.3778874-1-berrange@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.0 on 10.30.177.17 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.129.124; envelope-from=berrange@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -25 X-Spam_score: -2.6 X-Spam_bar: -- X-Spam_report: (-2.6 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.54, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_BLOCKED=0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: qemu development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1775837204023158500 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. Signed-off-by: Daniel P. Berrang=C3=A9 Reviewed-by: Dr. David Alan Gilbert --- 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 48b326d57b..b59972f325 100644 --- a/chardev/char.c +++ b/chardev/char.c @@ -786,7 +786,7 @@ static Chardev *qemu_chr_new_from_name(const char *labe= l, const char *filename, =20 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 =3D 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 =3D gdbserver_system_state.mon_chr; diff --git a/include/monitor/monitor.h b/include/monitor/monitor.h index 296690e1f1..bfbb440550 100644 --- a/include/monitor/monitor.h +++ b/include/monitor/monitor.h @@ -19,10 +19,10 @@ bool monitor_cur_is_qmp(void); =20 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); =20 int monitor_suspend(Monitor *mon); diff --git a/monitor/hmp.c b/monitor/hmp.c index af346d190b..6dfeca84b5 100644 --- a/monitor/hmp.c +++ b/monitor/hmp.c @@ -1516,7 +1516,7 @@ static void monitor_readline_flush(void *opaque) monitor_flush(&mon->parent); } =20 -void monitor_init_hmp(Chardev *chr, bool use_readline, Error **errp) +void monitor_new_hmp(Chardev *chr, bool use_readline, Error **errp) { MonitorHMP *mon =3D g_new0(MonitorHMP, 1); =20 diff --git a/monitor/monitor.c b/monitor/monitor.c index 6b183edcf5..393fb7795e 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); } =20 -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) =20 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; } =20 -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; } =20 - ret =3D monitor_init(options, true, errp); + ret =3D monitor_new(options, true, errp); qapi_free_MonitorOptions(options); return ret; } diff --git a/monitor/qmp.c b/monitor/qmp.c index 69d9e40e32..9caee70624 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); } =20 -void monitor_init_qmp(Chardev *chr, bool pretty, Error **errp) +void monitor_new_qmp(Chardev *chr, bool pretty, Error **errp) { MonitorQMP *mon =3D g_new0(MonitorQMP, 1); =20 diff --git a/storage-daemon/qemu-storage-daemon.c b/storage-daemon/qemu-sto= rage-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[], boo= l pre_init_pass) visit_free(v); =20 /* 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; } =20 -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 246623b319..2391811a46 100644 --- a/system/vl.c +++ b/system/vl.c @@ -1244,7 +1244,7 @@ static int fsdev_init_func(void *opaque, QemuOpts *op= ts, Error **errp) =20 static int mon_init_func(void *opaque, QemuOpts *opts, Error **errp) { - return monitor_init_opts(opts, errp); + return monitor_new_opts(opts, errp); } =20 static void monitor_parse(const char *str, const char *mode, bool pretty) --=20 2.53.0