From nobody Sun Apr 28 11:09:58 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1528466465703618.9828788118687; Fri, 8 Jun 2018 07:01:05 -0700 (PDT) Received: from localhost ([::1]:35850 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fRHwn-0005rI-OH for importer@patchew.org; Fri, 08 Jun 2018 10:00:57 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:56762) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fRH8R-0005WN-Qn for qemu-devel@nongnu.org; Fri, 08 Jun 2018 09:08:56 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fRH8Q-0006in-Pz for qemu-devel@nongnu.org; Fri, 08 Jun 2018 09:08:55 -0400 Received: from mx3-rdu2.redhat.com ([66.187.233.73]:40042 helo=mx1.redhat.com) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1fRH8Q-0006g2-Lk for qemu-devel@nongnu.org; Fri, 08 Jun 2018 09:08:54 -0400 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 0305A4023156 for ; Fri, 8 Jun 2018 13:08:49 +0000 (UTC) Received: from dgilbert-t530.redhat.com (ovpn-117-244.ams2.redhat.com [10.36.117.244]) by smtp.corp.redhat.com (Postfix) with ESMTP id 4D42F2157F45; Fri, 8 Jun 2018 13:08:48 +0000 (UTC) From: "Dr. David Alan Gilbert (git)" To: qemu-devel@nongnu.org, armbru@redhat.com, imammedo@redhat.com Date: Fri, 8 Jun 2018 14:08:40 +0100 Message-Id: <20180608130846.22234-2-dgilbert@redhat.com> In-Reply-To: <20180608130846.22234-1-dgilbert@redhat.com> References: <20180608130846.22234-1-dgilbert@redhat.com> X-Scanned-By: MIMEDefang 2.78 on 10.11.54.6 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.6]); Fri, 08 Jun 2018 13:08:49 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.6]); Fri, 08 Jun 2018 13:08:49 +0000 (UTC) for IP:'10.11.54.6' DOMAIN:'int-mx06.intmail.prod.int.rdu2.redhat.com' HELO:'smtp.corp.redhat.com' FROM:'dgilbert@redhat.com' RCPT:'' X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 66.187.233.73 Subject: [Qemu-devel] [PATCH v3 1/7] hmp: Add flag for preconfig commands X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" From: "Dr. David Alan Gilbert" Add a flag to command definitions to allow them to be used in preconfig and check it. If users try to use commands that aren't available, tell them to use the exit_preconfig comand we're adding in a few patches. Signed-off-by: Dr. David Alan Gilbert Reviewed-by: Markus Armbruster --- monitor.c | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/monitor.c b/monitor.c index 6d0cec552e..f4a16e6a03 100644 --- a/monitor.c +++ b/monitor.c @@ -128,6 +128,7 @@ typedef struct mon_cmd_t { const char *args_type; const char *params; const char *help; + const char *flags; /* p=3Dpreconfig */ void (*cmd)(Monitor *mon, const QDict *qdict); /* @sub_table is a list of 2nd level of commands. If it does not exist, * cmd should be used. If it exists, sub_table[?].cmd should be @@ -936,6 +937,19 @@ static int parse_cmdline(const char *cmdline, return -1; } =20 +/* + * Returns true if the command can be executed in preconfig mode + * i.e. it has the 'p' flag. + */ +static bool cmd_can_preconfig(const mon_cmd_t *cmd) +{ + if (!cmd->flags) { + return false; + } + + return strchr(cmd->flags, 'p'); +} + static void help_cmd_dump_one(Monitor *mon, const mon_cmd_t *cmd, char **prefix_args, @@ -2976,6 +2990,12 @@ static const mon_cmd_t *monitor_parse_command(Monito= r *mon, (int)(p - cmdp_start), cmdp_start); return NULL; } + if (runstate_check(RUN_STATE_PRECONFIG) && !cmd_can_preconfig(cmd)) { + monitor_printf(mon, "Command '%.*s' not available with -preconfig;= " + "use exit_preconfig after configuration.\n", + (int)(p - cmdp_start), cmdp_start); + return NULL; + } =20 /* filter out following useless space */ while (qemu_isspace(*p)) { --=20 2.17.0 From nobody Sun Apr 28 11:09:58 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1528467197174431.53716248027206; Fri, 8 Jun 2018 07:13:17 -0700 (PDT) Received: from localhost ([::1]:35956 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fRI8i-00085x-D1 for importer@patchew.org; Fri, 08 Jun 2018 10:13:16 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:56709) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fRH8Q-0005Ug-Aa for qemu-devel@nongnu.org; Fri, 08 Jun 2018 09:08:55 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fRH8N-0006gl-1a for qemu-devel@nongnu.org; Fri, 08 Jun 2018 09:08:54 -0400 Received: from mx3-rdu2.redhat.com ([66.187.233.73]:40044 helo=mx1.redhat.com) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1fRH8M-0006gR-TT for qemu-devel@nongnu.org; Fri, 08 Jun 2018 09:08:50 -0400 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id E915A40200AC for ; Fri, 8 Jun 2018 13:08:49 +0000 (UTC) Received: from dgilbert-t530.redhat.com (ovpn-117-244.ams2.redhat.com [10.36.117.244]) by smtp.corp.redhat.com (Postfix) with ESMTP id 3F9B12157F44; Fri, 8 Jun 2018 13:08:49 +0000 (UTC) From: "Dr. David Alan Gilbert (git)" To: qemu-devel@nongnu.org, armbru@redhat.com, imammedo@redhat.com Date: Fri, 8 Jun 2018 14:08:41 +0100 Message-Id: <20180608130846.22234-3-dgilbert@redhat.com> In-Reply-To: <20180608130846.22234-1-dgilbert@redhat.com> References: <20180608130846.22234-1-dgilbert@redhat.com> X-Scanned-By: MIMEDefang 2.78 on 10.11.54.6 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.6]); Fri, 08 Jun 2018 13:08:49 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.6]); Fri, 08 Jun 2018 13:08:49 +0000 (UTC) for IP:'10.11.54.6' DOMAIN:'int-mx06.intmail.prod.int.rdu2.redhat.com' HELO:'smtp.corp.redhat.com' FROM:'dgilbert@redhat.com' RCPT:'' X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 66.187.233.73 Subject: [Qemu-devel] [PATCH v3 2/7] hmp: Allow help on preconfig commands X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" From: "Dr. David Alan Gilbert" Allow the 'help' command in preconfig state but make it only list the preconfig commands. Signed-off-by: Dr. David Alan Gilbert Reviewed-by: Peter Xu Reviewed-by: Igor Mammedov --- hmp-commands.hx | 1 + monitor.c | 8 +++++++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/hmp-commands.hx b/hmp-commands.hx index 0734fea931..8bf590ae4b 100644 --- a/hmp-commands.hx +++ b/hmp-commands.hx @@ -15,6 +15,7 @@ ETEXI .params =3D "[cmd]", .help =3D "show the help", .cmd =3D do_help_cmd, + .flags =3D "p", }, =20 STEXI diff --git a/monitor.c b/monitor.c index f4a16e6a03..31c8f5dc88 100644 --- a/monitor.c +++ b/monitor.c @@ -957,6 +957,10 @@ static void help_cmd_dump_one(Monitor *mon, { int i; =20 + if (runstate_check(RUN_STATE_PRECONFIG) && !cmd_can_preconfig(cmd)) { + return; + } + for (i =3D 0; i < prefix_args_nb; i++) { monitor_printf(mon, "%s ", prefix_args[i]); } @@ -979,7 +983,9 @@ static void help_cmd_dump(Monitor *mon, const mon_cmd_t= *cmds, =20 /* Find one entry to dump */ for (cmd =3D cmds; cmd->name !=3D NULL; cmd++) { - if (compare_cmd(args[arg_index], cmd->name)) { + if (compare_cmd(args[arg_index], cmd->name) && + ((!runstate_check(RUN_STATE_PRECONFIG) || + cmd_can_preconfig(cmd)))) { if (cmd->sub_table) { /* continue with next arg */ help_cmd_dump(mon, cmd->sub_table, --=20 2.17.0 From nobody Sun Apr 28 11:09:58 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1528467590616841.3859344814359; Fri, 8 Jun 2018 07:19:50 -0700 (PDT) Received: from localhost ([::1]:36003 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fRIF0-0005I9-4i for importer@patchew.org; Fri, 08 Jun 2018 10:19:46 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:56710) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fRH8Q-0005Uh-BG for qemu-devel@nongnu.org; Fri, 08 Jun 2018 09:08:55 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fRH8N-0006gr-Bj for qemu-devel@nongnu.org; Fri, 08 Jun 2018 09:08:54 -0400 Received: from mx3-rdu2.redhat.com ([66.187.233.73]:40046 helo=mx1.redhat.com) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1fRH8N-0006gh-6d for qemu-devel@nongnu.org; Fri, 08 Jun 2018 09:08:51 -0400 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id D8E13401DEB2 for ; Fri, 8 Jun 2018 13:08:50 +0000 (UTC) Received: from dgilbert-t530.redhat.com (ovpn-117-244.ams2.redhat.com [10.36.117.244]) by smtp.corp.redhat.com (Postfix) with ESMTP id 300192157F44; Fri, 8 Jun 2018 13:08:50 +0000 (UTC) From: "Dr. David Alan Gilbert (git)" To: qemu-devel@nongnu.org, armbru@redhat.com, imammedo@redhat.com Date: Fri, 8 Jun 2018 14:08:42 +0100 Message-Id: <20180608130846.22234-4-dgilbert@redhat.com> In-Reply-To: <20180608130846.22234-1-dgilbert@redhat.com> References: <20180608130846.22234-1-dgilbert@redhat.com> X-Scanned-By: MIMEDefang 2.78 on 10.11.54.6 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.6]); Fri, 08 Jun 2018 13:08:50 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.6]); Fri, 08 Jun 2018 13:08:50 +0000 (UTC) for IP:'10.11.54.6' DOMAIN:'int-mx06.intmail.prod.int.rdu2.redhat.com' HELO:'smtp.corp.redhat.com' FROM:'dgilbert@redhat.com' RCPT:'' X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 66.187.233.73 Subject: [Qemu-devel] [PATCH v3 3/7] hmp: Restrict auto-complete in preconfig X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" From: "Dr. David Alan Gilbert" Don't show the commands that aren't available. Signed-off-by: Dr. David Alan Gilbert Reviewed-by: Peter Xu Reviewed-by: Igor Mammedov --- monitor.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/monitor.c b/monitor.c index 31c8f5dc88..c369b392db 100644 --- a/monitor.c +++ b/monitor.c @@ -3951,12 +3951,17 @@ static void monitor_find_completion_by_table(Monito= r *mon, cmdname =3D args[0]; readline_set_completion_index(mon->rs, strlen(cmdname)); for (cmd =3D cmd_table; cmd->name !=3D NULL; cmd++) { - cmd_completion(mon, cmdname, cmd->name); + if (!runstate_check(RUN_STATE_PRECONFIG) || + cmd_can_preconfig(cmd)) { + cmd_completion(mon, cmdname, cmd->name); + } } } else { /* find the command */ for (cmd =3D cmd_table; cmd->name !=3D NULL; cmd++) { - if (compare_cmd(args[0], cmd->name)) { + if (compare_cmd(args[0], cmd->name) && + (!runstate_check(RUN_STATE_PRECONFIG) || + cmd_can_preconfig(cmd))) { break; } } --=20 2.17.0 From nobody Sun Apr 28 11:09:58 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1528467387330397.0408454548217; Fri, 8 Jun 2018 07:16:27 -0700 (PDT) Received: from localhost ([::1]:35986 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fRIBm-0002x2-G3 for importer@patchew.org; Fri, 08 Jun 2018 10:16:26 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:56708) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fRH8Q-0005Uf-Ac for qemu-devel@nongnu.org; Fri, 08 Jun 2018 09:08:55 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fRH8O-0006hJ-8S for qemu-devel@nongnu.org; Fri, 08 Jun 2018 09:08:54 -0400 Received: from mx3-rdu2.redhat.com ([66.187.233.73]:48560 helo=mx1.redhat.com) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1fRH8O-0006h2-3x for qemu-devel@nongnu.org; Fri, 08 Jun 2018 09:08:52 -0400 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id CAFBE818BAED for ; Fri, 8 Jun 2018 13:08:51 +0000 (UTC) Received: from dgilbert-t530.redhat.com (ovpn-117-244.ams2.redhat.com [10.36.117.244]) by smtp.corp.redhat.com (Postfix) with ESMTP id 21E1E2157F44; Fri, 8 Jun 2018 13:08:51 +0000 (UTC) From: "Dr. David Alan Gilbert (git)" To: qemu-devel@nongnu.org, armbru@redhat.com, imammedo@redhat.com Date: Fri, 8 Jun 2018 14:08:43 +0100 Message-Id: <20180608130846.22234-5-dgilbert@redhat.com> In-Reply-To: <20180608130846.22234-1-dgilbert@redhat.com> References: <20180608130846.22234-1-dgilbert@redhat.com> X-Scanned-By: MIMEDefang 2.78 on 10.11.54.6 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.8]); Fri, 08 Jun 2018 13:08:51 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.8]); Fri, 08 Jun 2018 13:08:51 +0000 (UTC) for IP:'10.11.54.6' DOMAIN:'int-mx06.intmail.prod.int.rdu2.redhat.com' HELO:'smtp.corp.redhat.com' FROM:'dgilbert@redhat.com' RCPT:'' X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 66.187.233.73 Subject: [Qemu-devel] [PATCH v3 4/7] qmp: enable query-[chardev|version|name|uuid|iothreads|memdev] commands in preconfig state X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" From: Igor Mammedov subj commands, are informational and do not depend on machine being initialized. Make them available early in preconfig runstate to make the later a little bit more useful. Signed-off-by: Igor Mammedov --- qapi/char.json | 3 ++- qapi/misc.json | 12 +++++++----- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/qapi/char.json b/qapi/char.json index ae19dcd1ed..60f31d83fc 100644 --- a/qapi/char.json +++ b/qapi/char.json @@ -62,7 +62,8 @@ # } # ## -{ 'command': 'query-chardev', 'returns': ['ChardevInfo'] } +{ 'command': 'query-chardev', 'returns': ['ChardevInfo'], + 'allow-preconfig': true } =20 ## # @ChardevBackendInfo: diff --git a/qapi/misc.json b/qapi/misc.json index f83a63a0ab..1be1728c0e 100644 --- a/qapi/misc.json +++ b/qapi/misc.json @@ -117,7 +117,8 @@ # } # ## -{ 'command': 'query-version', 'returns': 'VersionInfo' } +{ 'command': 'query-version', 'returns': 'VersionInfo', + 'allow-preconfig': true } =20 ## # @CommandInfo: @@ -241,7 +242,7 @@ # <- { "return": { "name": "qemu-name" } } # ## -{ 'command': 'query-name', 'returns': 'NameInfo' } +{ 'command': 'query-name', 'returns': 'NameInfo', 'allow-preconfig': true } =20 ## # @KvmInfo: @@ -301,7 +302,7 @@ # <- { "return": { "UUID": "550e8400-e29b-41d4-a716-446655440000" } } # ## -{ 'command': 'query-uuid', 'returns': 'UuidInfo' } +{ 'command': 'query-uuid', 'returns': 'UuidInfo', 'allow-preconfig': true } =20 ## # @EventInfo: @@ -710,7 +711,8 @@ # } # ## -{ 'command': 'query-iothreads', 'returns': ['IOThreadInfo'] } +{ 'command': 'query-iothreads', 'returns': ['IOThreadInfo'], + 'allow-preconfig': true } =20 ## # @BalloonInfo: @@ -2902,7 +2904,7 @@ # } # ## -{ 'command': 'query-memdev', 'returns': ['Memdev'] } +{ 'command': 'query-memdev', 'returns': ['Memdev'], 'allow-preconfig': tru= e } =20 ## # @PCDIMMDeviceInfo: --=20 2.17.0 From nobody Sun Apr 28 11:09:58 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1528466291706276.54240994356894; Fri, 8 Jun 2018 06:58:11 -0700 (PDT) Received: from localhost ([::1]:35831 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fRHu7-0003WJ-1Z for importer@patchew.org; Fri, 08 Jun 2018 09:58:11 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:56713) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fRH8Q-0005Ui-Bg for qemu-devel@nongnu.org; Fri, 08 Jun 2018 09:08:55 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fRH8P-0006hl-7c for qemu-devel@nongnu.org; Fri, 08 Jun 2018 09:08:54 -0400 Received: from mx3-rdu2.redhat.com ([66.187.233.73]:38338 helo=mx1.redhat.com) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1fRH8P-0006hV-2W for qemu-devel@nongnu.org; Fri, 08 Jun 2018 09:08:53 -0400 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id BB6C5BB43B for ; Fri, 8 Jun 2018 13:08:52 +0000 (UTC) Received: from dgilbert-t530.redhat.com (ovpn-117-244.ams2.redhat.com [10.36.117.244]) by smtp.corp.redhat.com (Postfix) with ESMTP id 134742157F44; Fri, 8 Jun 2018 13:08:51 +0000 (UTC) From: "Dr. David Alan Gilbert (git)" To: qemu-devel@nongnu.org, armbru@redhat.com, imammedo@redhat.com Date: Fri, 8 Jun 2018 14:08:44 +0100 Message-Id: <20180608130846.22234-6-dgilbert@redhat.com> In-Reply-To: <20180608130846.22234-1-dgilbert@redhat.com> References: <20180608130846.22234-1-dgilbert@redhat.com> X-Scanned-By: MIMEDefang 2.78 on 10.11.54.6 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.1]); Fri, 08 Jun 2018 13:08:52 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.1]); Fri, 08 Jun 2018 13:08:52 +0000 (UTC) for IP:'10.11.54.6' DOMAIN:'int-mx06.intmail.prod.int.rdu2.redhat.com' HELO:'smtp.corp.redhat.com' FROM:'dgilbert@redhat.com' RCPT:'' X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 66.187.233.73 Subject: [Qemu-devel] [PATCH v3 5/7] hmp: Add info commands for preconfig X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" From: "Dr. David Alan Gilbert" Allow a bunch of the info commands to be used in preconfig. version, chardev, name, uuid,memdev, iothreads Were enabled in QMP in the previous patch from Igor status, hotpluggable_cpus Was enabled in the original allow-preconfig series history is HMP specific usbhost, qom-tree, numa Don't have a QMP equivalent Signed-off-by: Dr. David Alan Gilbert --- hmp-commands-info.hx | 12 ++++++++++++ hmp-commands.hx | 1 + 2 files changed, 13 insertions(+) diff --git a/hmp-commands-info.hx b/hmp-commands-info.hx index ddfcd5adcc..f4d0d7d2d0 100644 --- a/hmp-commands-info.hx +++ b/hmp-commands-info.hx @@ -19,6 +19,7 @@ ETEXI .params =3D "", .help =3D "show the version of QEMU", .cmd =3D hmp_info_version, + .flags =3D "p", }, =20 STEXI @@ -47,6 +48,7 @@ ETEXI .params =3D "", .help =3D "show the character devices", .cmd =3D hmp_info_chardev, + .flags =3D "p", }, =20 STEXI @@ -165,6 +167,7 @@ ETEXI .params =3D "", .help =3D "show the command line history", .cmd =3D hmp_info_history, + .flags =3D "p", }, =20 STEXI @@ -315,6 +318,7 @@ ETEXI .params =3D "", .help =3D "show NUMA information", .cmd =3D hmp_info_numa, + .flags =3D "p", }, =20 STEXI @@ -343,6 +347,7 @@ ETEXI .params =3D "", .help =3D "show host USB devices", .cmd =3D hmp_info_usbhost, + .flags =3D "p", }, =20 STEXI @@ -399,6 +404,7 @@ ETEXI .params =3D "", .help =3D "show the current VM status (running|paused)", .cmd =3D hmp_info_status, + .flags =3D "p", }, =20 STEXI @@ -457,6 +463,7 @@ ETEXI .params =3D "", .help =3D "show the current VM name", .cmd =3D hmp_info_name, + .flags =3D "p", }, =20 STEXI @@ -471,6 +478,7 @@ ETEXI .params =3D "", .help =3D "show the current VM UUID", .cmd =3D hmp_info_uuid, + .flags =3D "p", }, =20 STEXI @@ -613,6 +621,7 @@ ETEXI .params =3D "[path]", .help =3D "show QOM composition tree", .cmd =3D hmp_info_qom_tree, + .flags =3D "p", }, =20 STEXI @@ -671,6 +680,7 @@ ETEXI .params =3D "", .help =3D "show memory backends", .cmd =3D hmp_info_memdev, + .flags =3D "p", }, =20 STEXI @@ -699,6 +709,7 @@ ETEXI .params =3D "", .help =3D "show iothreads", .cmd =3D hmp_info_iothreads, + .flags =3D "p", }, =20 STEXI @@ -829,6 +840,7 @@ ETEXI .params =3D "", .help =3D "Show information about hotpluggable CPUs", .cmd =3D hmp_hotpluggable_cpus, + .flags =3D "p", }, =20 STEXI diff --git a/hmp-commands.hx b/hmp-commands.hx index 8bf590ae4b..dc82ed526f 100644 --- a/hmp-commands.hx +++ b/hmp-commands.hx @@ -1856,6 +1856,7 @@ ETEXI .help =3D "show various information about the system state", .cmd =3D hmp_info_help, .sub_table =3D info_cmds, + .flags =3D "p", }, =20 STEXI --=20 2.17.0 From nobody Sun Apr 28 11:09:58 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1528467738291454.842587936776; Fri, 8 Jun 2018 07:22:18 -0700 (PDT) Received: from localhost ([::1]:36025 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fRIHP-00086W-JR for importer@patchew.org; Fri, 08 Jun 2018 10:22:15 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:56729) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fRH8Q-0005VH-W4 for qemu-devel@nongnu.org; Fri, 08 Jun 2018 09:08:55 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fRH8Q-0006i9-6O for qemu-devel@nongnu.org; Fri, 08 Jun 2018 09:08:54 -0400 Received: from mx3-rdu2.redhat.com ([66.187.233.73]:41578 helo=mx1.redhat.com) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1fRH8Q-0006hy-1O for qemu-devel@nongnu.org; Fri, 08 Jun 2018 09:08:54 -0400 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id AD444400E9BA for ; Fri, 8 Jun 2018 13:08:53 +0000 (UTC) Received: from dgilbert-t530.redhat.com (ovpn-117-244.ams2.redhat.com [10.36.117.244]) by smtp.corp.redhat.com (Postfix) with ESMTP id 041222157F44; Fri, 8 Jun 2018 13:08:52 +0000 (UTC) From: "Dr. David Alan Gilbert (git)" To: qemu-devel@nongnu.org, armbru@redhat.com, imammedo@redhat.com Date: Fri, 8 Jun 2018 14:08:45 +0100 Message-Id: <20180608130846.22234-7-dgilbert@redhat.com> In-Reply-To: <20180608130846.22234-1-dgilbert@redhat.com> References: <20180608130846.22234-1-dgilbert@redhat.com> X-Scanned-By: MIMEDefang 2.78 on 10.11.54.6 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.7]); Fri, 08 Jun 2018 13:08:53 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.7]); Fri, 08 Jun 2018 13:08:53 +0000 (UTC) for IP:'10.11.54.6' DOMAIN:'int-mx06.intmail.prod.int.rdu2.redhat.com' HELO:'smtp.corp.redhat.com' FROM:'dgilbert@redhat.com' RCPT:'' X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 66.187.233.73 Subject: [Qemu-devel] [PATCH v3 6/7] hmp: add exit_preconfig X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" From: "Dr. David Alan Gilbert" Add the exit_preconfig command to return to normality. Signed-off-by: Dr. David Alan Gilbert Reviewed-by: Peter Xu Reviewed-by: Igor Mammedov --- hmp-commands.hx | 15 +++++++++++++++ hmp.c | 7 +++++++ hmp.h | 1 + 3 files changed, 23 insertions(+) diff --git a/hmp-commands.hx b/hmp-commands.hx index dc82ed526f..40e2f6ca08 100644 --- a/hmp-commands.hx +++ b/hmp-commands.hx @@ -55,6 +55,21 @@ STEXI @item q or quit @findex quit Quit the emulator. +ETEXI + + { + .name =3D "exit_preconfig", + .args_type =3D "", + .params =3D "", + .help =3D "exit the preconfig state", + .cmd =3D hmp_exit_preconfig, + .flags =3D "p", + }, + +STEXI +@item exit_preconfig +@findex exit_preconfig +Exit the preconfig state ETEXI =20 { diff --git a/hmp.c b/hmp.c index ef93f4878b..c7be6ed394 100644 --- a/hmp.c +++ b/hmp.c @@ -1065,6 +1065,13 @@ void hmp_system_powerdown(Monitor *mon, const QDict = *qdict) qmp_system_powerdown(NULL); } =20 +void hmp_exit_preconfig(Monitor *mon, const QDict *qdict) +{ + Error *err =3D NULL; + qmp_exit_preconfig(&err); + hmp_handle_error(mon, &err); +} + void hmp_cpu(Monitor *mon, const QDict *qdict) { int64_t cpu_index; diff --git a/hmp.h b/hmp.h index 20f27439d3..33354f1bdd 100644 --- a/hmp.h +++ b/hmp.h @@ -44,6 +44,7 @@ void hmp_quit(Monitor *mon, const QDict *qdict); void hmp_stop(Monitor *mon, const QDict *qdict); void hmp_system_reset(Monitor *mon, const QDict *qdict); void hmp_system_powerdown(Monitor *mon, const QDict *qdict); +void hmp_exit_preconfig(Monitor *mon, const QDict *qdict); void hmp_cpu(Monitor *mon, const QDict *qdict); void hmp_memsave(Monitor *mon, const QDict *qdict); void hmp_pmemsave(Monitor *mon, const QDict *qdict); --=20 2.17.0 From nobody Sun Apr 28 11:09:58 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1528467360127519.4137372379059; Fri, 8 Jun 2018 07:16:00 -0700 (PDT) Received: from localhost ([::1]:35985 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fRIBL-0002ca-Bt for importer@patchew.org; Fri, 08 Jun 2018 10:15:59 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:56767) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fRH8S-0005WW-0N for qemu-devel@nongnu.org; Fri, 08 Jun 2018 09:08:56 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fRH8R-0006k7-41 for qemu-devel@nongnu.org; Fri, 08 Jun 2018 09:08:55 -0400 Received: from mx3-rdu2.redhat.com ([66.187.233.73]:40052 helo=mx1.redhat.com) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1fRH8Q-0006if-VR for qemu-devel@nongnu.org; Fri, 08 Jun 2018 09:08:55 -0400 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 9DCB740200A3 for ; Fri, 8 Jun 2018 13:08:54 +0000 (UTC) Received: from dgilbert-t530.redhat.com (ovpn-117-244.ams2.redhat.com [10.36.117.244]) by smtp.corp.redhat.com (Postfix) with ESMTP id E9BCC2157F42; Fri, 8 Jun 2018 13:08:53 +0000 (UTC) From: "Dr. David Alan Gilbert (git)" To: qemu-devel@nongnu.org, armbru@redhat.com, imammedo@redhat.com Date: Fri, 8 Jun 2018 14:08:46 +0100 Message-Id: <20180608130846.22234-8-dgilbert@redhat.com> In-Reply-To: <20180608130846.22234-1-dgilbert@redhat.com> References: <20180608130846.22234-1-dgilbert@redhat.com> X-Scanned-By: MIMEDefang 2.78 on 10.11.54.6 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.6]); Fri, 08 Jun 2018 13:08:54 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.6]); Fri, 08 Jun 2018 13:08:54 +0000 (UTC) for IP:'10.11.54.6' DOMAIN:'int-mx06.intmail.prod.int.rdu2.redhat.com' HELO:'smtp.corp.redhat.com' FROM:'dgilbert@redhat.com' RCPT:'' X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 66.187.233.73 Subject: [Qemu-devel] [PATCH v3 7/7] hmp: Allow HMP in preconfig state again X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" From: "Dr. David Alan Gilbert" Now we can cope with preconfig in HMP, reenable by reverting commit 71dc578e116599ea73c8a2a4e693134702ec0e83. Signed-off-by: Dr. David Alan Gilbert Reviewed-by: Peter Xu Reviewed-by: Igor Mammedov --- monitor.c | 6 ------ 1 file changed, 6 deletions(-) diff --git a/monitor.c b/monitor.c index c369b392db..cd5525e0ec 100644 --- a/monitor.c +++ b/monitor.c @@ -3395,12 +3395,6 @@ static void handle_hmp_command(Monitor *mon, const c= har *cmdline) =20 trace_handle_hmp_command(mon, cmdline); =20 - if (runstate_check(RUN_STATE_PRECONFIG)) { - monitor_printf(mon, "HMP not available in preconfig state, " - "use QMP instead\n"); - return; - } - cmd =3D monitor_parse_command(mon, cmdline, &cmdline, mon->cmd_table); if (!cmd) { return; --=20 2.17.0