From nobody Sat Apr 20 07:50:27 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 (208.118.235.17 [208.118.235.17]) by mx.zohomail.com with SMTPS id 1528795332015959.617795243999; Tue, 12 Jun 2018 02:22:12 -0700 (PDT) Received: from localhost ([::1]:54027 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fSfV6-0000rx-0h for importer@patchew.org; Tue, 12 Jun 2018 05:22:04 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:60062) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fSfSz-00080H-Dv for qemu-devel@nongnu.org; Tue, 12 Jun 2018 05:19:54 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fSfSx-000124-2g for qemu-devel@nongnu.org; Tue, 12 Jun 2018 05:19:53 -0400 Received: from mx3-rdu2.redhat.com ([66.187.233.73]:55048 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 1fSfSw-00011y-TF for qemu-devel@nongnu.org; Tue, 12 Jun 2018 05:19: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 93D524005F82 for ; Tue, 12 Jun 2018 09:19:50 +0000 (UTC) Received: from dgilbert-t530.redhat.com (ovpn-117-246.ams2.redhat.com [10.36.117.246]) by smtp.corp.redhat.com (Postfix) with ESMTP id E34E42035721; Tue, 12 Jun 2018 09:19:49 +0000 (UTC) From: "Dr. David Alan Gilbert (git)" To: qemu-devel@nongnu.org, armbru@redhat.com, imammedo@redhat.com Date: Tue, 12 Jun 2018 10:19:42 +0100 Message-Id: <20180612091948.14367-2-dgilbert@redhat.com> In-Reply-To: <20180612091948.14367-1-dgilbert@redhat.com> References: <20180612091948.14367-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]); Tue, 12 Jun 2018 09:19:50 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.6]); Tue, 12 Jun 2018 09:19: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 v4 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..2d7bfb8a2c 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 " + "until after exit_preconfig.\n", + (int)(p - cmdp_start), cmdp_start); + return NULL; + } =20 /* filter out following useless space */ while (qemu_isspace(*p)) { --=20 2.17.1 From nobody Sat Apr 20 07:50:27 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 1528795482292268.26520023164244; Tue, 12 Jun 2018 02:24:42 -0700 (PDT) Received: from localhost ([::1]:54040 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fSfXa-00031T-EE for importer@patchew.org; Tue, 12 Jun 2018 05:24:38 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:60064) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fSfSz-00080I-FA for qemu-devel@nongnu.org; Tue, 12 Jun 2018 05:19:54 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fSfSy-000138-0S for qemu-devel@nongnu.org; Tue, 12 Jun 2018 05:19:53 -0400 Received: from mx3-rdu2.redhat.com ([66.187.233.73]:55050 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 1fSfSx-00012U-Rp for qemu-devel@nongnu.org; Tue, 12 Jun 2018 05:19: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 7FE9E4005F82 for ; Tue, 12 Jun 2018 09:19:51 +0000 (UTC) Received: from dgilbert-t530.redhat.com (ovpn-117-246.ams2.redhat.com [10.36.117.246]) by smtp.corp.redhat.com (Postfix) with ESMTP id CF3CC2035721; Tue, 12 Jun 2018 09:19:50 +0000 (UTC) From: "Dr. David Alan Gilbert (git)" To: qemu-devel@nongnu.org, armbru@redhat.com, imammedo@redhat.com Date: Tue, 12 Jun 2018 10:19:43 +0100 Message-Id: <20180612091948.14367-3-dgilbert@redhat.com> In-Reply-To: <20180612091948.14367-1-dgilbert@redhat.com> References: <20180612091948.14367-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]); Tue, 12 Jun 2018 09:19:51 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.6]); Tue, 12 Jun 2018 09:19: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 v4 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 2d7bfb8a2c..8ff0e2fcc7 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.1 From nobody Sat Apr 20 07:50:27 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 (208.118.235.17 [208.118.235.17]) by mx.zohomail.com with SMTPS id 152879533106916.949784707841104; Tue, 12 Jun 2018 02:22:11 -0700 (PDT) Received: from localhost ([::1]:54028 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fSfV7-0000st-Hg for importer@patchew.org; Tue, 12 Jun 2018 05:22:05 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:60072) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fSfSz-00080K-QG for qemu-devel@nongnu.org; Tue, 12 Jun 2018 05:19:54 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fSfSy-000148-Ub for qemu-devel@nongnu.org; Tue, 12 Jun 2018 05:19:53 -0400 Received: from mx3-rdu2.redhat.com ([66.187.233.73]:43772 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 1fSfSy-00013y-PI for qemu-devel@nongnu.org; Tue, 12 Jun 2018 05:19: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 6B9727D84D for ; Tue, 12 Jun 2018 09:19:52 +0000 (UTC) Received: from dgilbert-t530.redhat.com (ovpn-117-246.ams2.redhat.com [10.36.117.246]) by smtp.corp.redhat.com (Postfix) with ESMTP id BB6F02035721; Tue, 12 Jun 2018 09:19:51 +0000 (UTC) From: "Dr. David Alan Gilbert (git)" To: qemu-devel@nongnu.org, armbru@redhat.com, imammedo@redhat.com Date: Tue, 12 Jun 2018 10:19:44 +0100 Message-Id: <20180612091948.14367-4-dgilbert@redhat.com> In-Reply-To: <20180612091948.14367-1-dgilbert@redhat.com> References: <20180612091948.14367-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.2]); Tue, 12 Jun 2018 09:19:52 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.2]); Tue, 12 Jun 2018 09:19: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 v4 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 8ff0e2fcc7..9ea23828ef 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.1 From nobody Sat Apr 20 07:50:27 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 1528795482339617.4478924102441; Tue, 12 Jun 2018 02:24:42 -0700 (PDT) Received: from localhost ([::1]:54041 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fSfXa-000343-Tt for importer@patchew.org; Tue, 12 Jun 2018 05:24:38 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:60107) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fSfT1-00080l-Fh for qemu-devel@nongnu.org; Tue, 12 Jun 2018 05:19:58 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fSfT0-00015A-AQ for qemu-devel@nongnu.org; Tue, 12 Jun 2018 05:19:55 -0400 Received: from mx3-rdu2.redhat.com ([66.187.233.73]:35574 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 1fSfT0-00014l-53 for qemu-devel@nongnu.org; Tue, 12 Jun 2018 05:19: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 C449B818BAF6 for ; Tue, 12 Jun 2018 09:19:53 +0000 (UTC) Received: from dgilbert-t530.redhat.com (ovpn-117-246.ams2.redhat.com [10.36.117.246]) by smtp.corp.redhat.com (Postfix) with ESMTP id 1F43A2035721; Tue, 12 Jun 2018 09:19:52 +0000 (UTC) From: "Dr. David Alan Gilbert (git)" To: qemu-devel@nongnu.org, armbru@redhat.com, imammedo@redhat.com Date: Tue, 12 Jun 2018 10:19:45 +0100 Message-Id: <20180612091948.14367-5-dgilbert@redhat.com> In-Reply-To: <20180612091948.14367-1-dgilbert@redhat.com> References: <20180612091948.14367-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]); Tue, 12 Jun 2018 09:19:53 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.8]); Tue, 12 Jun 2018 09:19: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 v4 4/7] qmp: Enable a few 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 Commands query-chardev, query-version, query-name, query-uuid, query-iothreads, query-memdev are informational and do not depend on the machine being initialized. Make them available in preconfig runstate to make the latter a little bit more useful. The generic qom commands don't depend on the machine being initialized either; so enabled qom-list, qom-get, qom-set, qom-list-types, qom-list-properties. Signed-off-by: Igor Mammedov Signed-off-by: Dr. David Alan Gilbert --- qapi/char.json | 3 ++- qapi/misc.json | 27 +++++++++++++++++---------- 2 files changed, 19 insertions(+), 11 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..fa86831ec3 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: @@ -1408,7 +1410,8 @@ ## { 'command': 'qom-list', 'data': { 'path': 'str' }, - 'returns': [ 'ObjectPropertyInfo' ] } + 'returns': [ 'ObjectPropertyInfo' ], + 'allow-preconfig': true } =20 ## # @qom-get: @@ -1444,7 +1447,8 @@ ## { 'command': 'qom-get', 'data': { 'path': 'str', 'property': 'str' }, - 'returns': 'any' } + 'returns': 'any', + 'allow-preconfig': true } =20 ## # @qom-set: @@ -1461,7 +1465,8 @@ # Since: 1.2 ## { 'command': 'qom-set', - 'data': { 'path': 'str', 'property': 'str', 'value': 'any' } } + 'data': { 'path': 'str', 'property': 'str', 'value': 'any' }, + 'allow-preconfig': true } =20 ## # @change: @@ -1543,7 +1548,8 @@ ## { 'command': 'qom-list-types', 'data': { '*implements': 'str', '*abstract': 'bool' }, - 'returns': [ 'ObjectTypeInfo' ] } + 'returns': [ 'ObjectTypeInfo' ], + 'allow-preconfig': true } =20 ## # @device-list-properties: @@ -1581,7 +1587,8 @@ ## { 'command': 'qom-list-properties', 'data': { 'typename': 'str'}, - 'returns': [ 'ObjectPropertyInfo' ] } + 'returns': [ 'ObjectPropertyInfo' ], + 'allow-preconfig': true } =20 ## # @xen-set-global-dirty-log: @@ -2902,7 +2909,7 @@ # } # ## -{ 'command': 'query-memdev', 'returns': ['Memdev'] } +{ 'command': 'query-memdev', 'returns': ['Memdev'], 'allow-preconfig': tru= e } =20 ## # @PCDIMMDeviceInfo: --=20 2.17.1 From nobody Sat Apr 20 07:50:27 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 1528795600127422.8650663270829; Tue, 12 Jun 2018 02:26:40 -0700 (PDT) Received: from localhost ([::1]:54055 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fSfZX-0004iQ-Cq for importer@patchew.org; Tue, 12 Jun 2018 05:26:39 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:60127) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fSfT2-00081V-JB for qemu-devel@nongnu.org; Tue, 12 Jun 2018 05:19:59 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fSfT1-00015o-85 for qemu-devel@nongnu.org; Tue, 12 Jun 2018 05:19:56 -0400 Received: from mx3-rdu2.redhat.com ([66.187.233.73]:46186 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 1fSfT1-00015W-2t for qemu-devel@nongnu.org; Tue, 12 Jun 2018 05:19: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 B43F77B2B1 for ; Tue, 12 Jun 2018 09:19:54 +0000 (UTC) Received: from dgilbert-t530.redhat.com (ovpn-117-246.ams2.redhat.com [10.36.117.246]) by smtp.corp.redhat.com (Postfix) with ESMTP id 0C0C82035721; Tue, 12 Jun 2018 09:19:53 +0000 (UTC) From: "Dr. David Alan Gilbert (git)" To: qemu-devel@nongnu.org, armbru@redhat.com, imammedo@redhat.com Date: Tue, 12 Jun 2018 10:19:46 +0100 Message-Id: <20180612091948.14367-6-dgilbert@redhat.com> In-Reply-To: <20180612091948.14367-1-dgilbert@redhat.com> References: <20180612091948.14367-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]); Tue, 12 Jun 2018 09:19:54 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.1]); Tue, 12 Jun 2018 09:19: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 v4 5/7] hmp: Add 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 Also enable the qom commands qom-list and qom-set. Signed-off-by: Dr. David Alan Gilbert --- hmp-commands-info.hx | 12 ++++++++++++ hmp-commands.hx | 3 +++ 2 files changed, 15 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..bd87569229 100644 --- a/hmp-commands.hx +++ b/hmp-commands.hx @@ -1829,6 +1829,7 @@ ETEXI .params =3D "path", .help =3D "list QOM properties", .cmd =3D hmp_qom_list, + .flags =3D "p", }, =20 STEXI @@ -1842,6 +1843,7 @@ ETEXI .params =3D "path property value", .help =3D "set QOM property", .cmd =3D hmp_qom_set, + .flags =3D "p", }, =20 STEXI @@ -1856,6 +1858,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.1 From nobody Sat Apr 20 07:50:27 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 (208.118.235.17 [208.118.235.17]) by mx.zohomail.com with SMTPS id 1528795331051777.5575809620759; Tue, 12 Jun 2018 02:22:11 -0700 (PDT) Received: from localhost ([::1]:54030 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fSfV9-0000vo-UW for importer@patchew.org; Tue, 12 Jun 2018 05:22:07 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:60133) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fSfT3-00081X-0F for qemu-devel@nongnu.org; Tue, 12 Jun 2018 05:19:58 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fSfT2-00016C-4d for qemu-devel@nongnu.org; Tue, 12 Jun 2018 05:19:56 -0400 Received: from mx3-rdu2.redhat.com ([66.187.233.73]:55054 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 1fSfT1-00015z-Vx for qemu-devel@nongnu.org; Tue, 12 Jun 2018 05:19:56 -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 9FB4C4005F82 for ; Tue, 12 Jun 2018 09:19:55 +0000 (UTC) Received: from dgilbert-t530.redhat.com (ovpn-117-246.ams2.redhat.com [10.36.117.246]) by smtp.corp.redhat.com (Postfix) with ESMTP id EF5A82035721; Tue, 12 Jun 2018 09:19:54 +0000 (UTC) From: "Dr. David Alan Gilbert (git)" To: qemu-devel@nongnu.org, armbru@redhat.com, imammedo@redhat.com Date: Tue, 12 Jun 2018 10:19:47 +0100 Message-Id: <20180612091948.14367-7-dgilbert@redhat.com> In-Reply-To: <20180612091948.14367-1-dgilbert@redhat.com> References: <20180612091948.14367-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]); Tue, 12 Jun 2018 09:19:55 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.6]); Tue, 12 Jun 2018 09:19:55 +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 v4 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 | 19 +++++++++++++++++++ hmp.c | 8 ++++++++ hmp.h | 1 + 3 files changed, 28 insertions(+) diff --git a/hmp-commands.hx b/hmp-commands.hx index bd87569229..a06d0bc5f1 100644 --- a/hmp-commands.hx +++ b/hmp-commands.hx @@ -55,6 +55,25 @@ 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 +This command makes QEMU exit the preconfig state and proceed with +VM initialization using configuration data provided on the command line +and via the QMP monitor during the preconfig state. The command is only +available during the preconfig state (i.e. when the --preconfig command +line option was in use). ETEXI =20 { diff --git a/hmp.c b/hmp.c index ef93f4878b..983e3be1a1 100644 --- a/hmp.c +++ b/hmp.c @@ -1065,6 +1065,14 @@ 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.1 From nobody Sat Apr 20 07:50:27 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 1528795713957742.6106368419075; Tue, 12 Jun 2018 02:28:33 -0700 (PDT) Received: from localhost ([::1]:54068 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fSfbN-0006GN-AV for importer@patchew.org; Tue, 12 Jun 2018 05:28:33 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:60147) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fSfT3-00081Z-QT for qemu-devel@nongnu.org; Tue, 12 Jun 2018 05:19:58 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fSfT3-00016l-1L for qemu-devel@nongnu.org; Tue, 12 Jun 2018 05:19:57 -0400 Received: from mx3-rdu2.redhat.com ([66.187.233.73]:43774 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 1fSfT2-00016O-Tf for qemu-devel@nongnu.org; Tue, 12 Jun 2018 05:19:56 -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 8C0387D84D for ; Tue, 12 Jun 2018 09:19:56 +0000 (UTC) Received: from dgilbert-t530.redhat.com (ovpn-117-246.ams2.redhat.com [10.36.117.246]) by smtp.corp.redhat.com (Postfix) with ESMTP id DACC72035721; Tue, 12 Jun 2018 09:19:55 +0000 (UTC) From: "Dr. David Alan Gilbert (git)" To: qemu-devel@nongnu.org, armbru@redhat.com, imammedo@redhat.com Date: Tue, 12 Jun 2018 10:19:48 +0100 Message-Id: <20180612091948.14367-8-dgilbert@redhat.com> In-Reply-To: <20180612091948.14367-1-dgilbert@redhat.com> References: <20180612091948.14367-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.2]); Tue, 12 Jun 2018 09:19:56 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.2]); Tue, 12 Jun 2018 09:19:56 +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 v4 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 9ea23828ef..66fc5fe3b3 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.1