From nobody Mon Apr 29 13:04:36 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 1529509501208690.4966837697182; Wed, 20 Jun 2018 08:45:01 -0700 (PDT) Received: from localhost ([::1]:50392 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fVfI4-0002Kg-DL for importer@patchew.org; Wed, 20 Jun 2018 11:45:00 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:33532) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fVfD9-0006y4-Fe for qemu-devel@nongnu.org; Wed, 20 Jun 2018 11:39:56 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fVfD6-0003jJ-6u for qemu-devel@nongnu.org; Wed, 20 Jun 2018 11:39:55 -0400 Received: from mx3-rdu2.redhat.com ([66.187.233.73]:41918 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 1fVfD6-0003jE-1c for qemu-devel@nongnu.org; Wed, 20 Jun 2018 11:39:52 -0400 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 9BC5277154 for ; Wed, 20 Jun 2018 15:39:51 +0000 (UTC) Received: from dgilbert-t530.redhat.com (ovpn-117-189.ams2.redhat.com [10.36.117.189]) by smtp.corp.redhat.com (Postfix) with ESMTP id C933F111E40F; Wed, 20 Jun 2018 15:39:50 +0000 (UTC) From: "Dr. David Alan Gilbert (git)" To: qemu-devel@nongnu.org, armbru@redhat.com, imammedo@redhat.com, peterx@redhat.com Date: Wed, 20 Jun 2018 16:39:41 +0100 Message-Id: <20180620153947.30834-2-dgilbert@redhat.com> In-Reply-To: <20180620153947.30834-1-dgilbert@redhat.com> References: <20180620153947.30834-1-dgilbert@redhat.com> X-Scanned-By: MIMEDefang 2.78 on 10.11.54.3 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.1]); Wed, 20 Jun 2018 15:39:51 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.1]); Wed, 20 Jun 2018 15:39:51 +0000 (UTC) for IP:'10.11.54.3' DOMAIN:'int-mx03.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 v5 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 Reviewed-by: Igor Mammedov --- monitor.c | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/monitor.c b/monitor.c index 885e000f9b..8dc86c0c3c 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 @@ -958,6 +959,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, @@ -3041,6 +3055,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 Mon Apr 29 13:04:36 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 1529509325013731.4217081096768; Wed, 20 Jun 2018 08:42:05 -0700 (PDT) Received: from localhost ([::1]:50377 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fVfF9-0008EU-3T for importer@patchew.org; Wed, 20 Jun 2018 11:41:59 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:33531) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fVfD9-0006y2-FO for qemu-devel@nongnu.org; Wed, 20 Jun 2018 11:39:56 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fVfD7-0003k6-9I for qemu-devel@nongnu.org; Wed, 20 Jun 2018 11:39:55 -0400 Received: from mx3-rdu2.redhat.com ([66.187.233.73]:56190 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 1fVfD7-0003jf-4H for qemu-devel@nongnu.org; Wed, 20 Jun 2018 11:39:53 -0400 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id AAB7D407A6E4 for ; Wed, 20 Jun 2018 15:39:52 +0000 (UTC) Received: from dgilbert-t530.redhat.com (ovpn-117-189.ams2.redhat.com [10.36.117.189]) by smtp.corp.redhat.com (Postfix) with ESMTP id D7AAE111E40F; Wed, 20 Jun 2018 15:39:51 +0000 (UTC) From: "Dr. David Alan Gilbert (git)" To: qemu-devel@nongnu.org, armbru@redhat.com, imammedo@redhat.com, peterx@redhat.com Date: Wed, 20 Jun 2018 16:39:42 +0100 Message-Id: <20180620153947.30834-3-dgilbert@redhat.com> In-Reply-To: <20180620153947.30834-1-dgilbert@redhat.com> References: <20180620153947.30834-1-dgilbert@redhat.com> X-Scanned-By: MIMEDefang 2.78 on 10.11.54.3 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.7]); Wed, 20 Jun 2018 15:39:52 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.7]); Wed, 20 Jun 2018 15:39:52 +0000 (UTC) for IP:'10.11.54.3' DOMAIN:'int-mx03.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 v5 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 0de7c4c29e..3094294e5b 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 8dc86c0c3c..6fc20c4889 100644 --- a/monitor.c +++ b/monitor.c @@ -979,6 +979,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]); } @@ -1001,7 +1005,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 Mon Apr 29 13:04:36 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 15295094923502.680171356669007; Wed, 20 Jun 2018 08:44:52 -0700 (PDT) Received: from localhost ([::1]:50389 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fVfHv-0002CW-JX for importer@patchew.org; Wed, 20 Jun 2018 11:44:51 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:33529) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fVfD9-0006y0-FS for qemu-devel@nongnu.org; Wed, 20 Jun 2018 11:39:56 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fVfD8-0003kX-AJ for qemu-devel@nongnu.org; Wed, 20 Jun 2018 11:39:55 -0400 Received: from mx3-rdu2.redhat.com ([66.187.233.73]:41922 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 1fVfD8-0003kM-5v for qemu-devel@nongnu.org; Wed, 20 Jun 2018 11:39:54 -0400 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id BAE5177154 for ; Wed, 20 Jun 2018 15:39:53 +0000 (UTC) Received: from dgilbert-t530.redhat.com (ovpn-117-189.ams2.redhat.com [10.36.117.189]) by smtp.corp.redhat.com (Postfix) with ESMTP id E6B78111E40F; Wed, 20 Jun 2018 15:39:52 +0000 (UTC) From: "Dr. David Alan Gilbert (git)" To: qemu-devel@nongnu.org, armbru@redhat.com, imammedo@redhat.com, peterx@redhat.com Date: Wed, 20 Jun 2018 16:39:43 +0100 Message-Id: <20180620153947.30834-4-dgilbert@redhat.com> In-Reply-To: <20180620153947.30834-1-dgilbert@redhat.com> References: <20180620153947.30834-1-dgilbert@redhat.com> X-Scanned-By: MIMEDefang 2.78 on 10.11.54.3 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.1]); Wed, 20 Jun 2018 15:39:53 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.1]); Wed, 20 Jun 2018 15:39:53 +0000 (UTC) for IP:'10.11.54.3' DOMAIN:'int-mx03.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 v5 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 6fc20c4889..0c32308fb2 100644 --- a/monitor.c +++ b/monitor.c @@ -4016,12 +4016,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 Mon Apr 29 13:04:36 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 15295093253695.103099851323236; Wed, 20 Jun 2018 08:42:05 -0700 (PDT) Received: from localhost ([::1]:50378 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fVfF9-0008Et-Ja for importer@patchew.org; Wed, 20 Jun 2018 11:41:59 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:33557) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fVfDA-0006yw-IC for qemu-devel@nongnu.org; Wed, 20 Jun 2018 11:39:57 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fVfD9-0003lp-EW for qemu-devel@nongnu.org; Wed, 20 Jun 2018 11:39:56 -0400 Received: from mx3-rdu2.redhat.com ([66.187.233.73]:41924 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 1fVfD9-0003l5-8G for qemu-devel@nongnu.org; Wed, 20 Jun 2018 11:39:55 -0400 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id C96A877154 for ; Wed, 20 Jun 2018 15:39:54 +0000 (UTC) Received: from dgilbert-t530.redhat.com (ovpn-117-189.ams2.redhat.com [10.36.117.189]) by smtp.corp.redhat.com (Postfix) with ESMTP id 01DF8111E40F; Wed, 20 Jun 2018 15:39:53 +0000 (UTC) From: "Dr. David Alan Gilbert (git)" To: qemu-devel@nongnu.org, armbru@redhat.com, imammedo@redhat.com, peterx@redhat.com Date: Wed, 20 Jun 2018 16:39:44 +0100 Message-Id: <20180620153947.30834-5-dgilbert@redhat.com> In-Reply-To: <20180620153947.30834-1-dgilbert@redhat.com> References: <20180620153947.30834-1-dgilbert@redhat.com> X-Scanned-By: MIMEDefang 2.78 on 10.11.54.3 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.1]); Wed, 20 Jun 2018 15:39:54 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.1]); Wed, 20 Jun 2018 15:39:54 +0000 (UTC) for IP:'10.11.54.3' DOMAIN:'int-mx03.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 v5 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 Reviewed-by: Eric Blake --- 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 Mon Apr 29 13:04:36 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 1529509390696441.36513277043696; Wed, 20 Jun 2018 08:43:10 -0700 (PDT) Received: from localhost ([::1]:50380 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fVfGH-0000jJ-Qi for importer@patchew.org; Wed, 20 Jun 2018 11:43:09 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:33569) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fVfDB-0006zg-EW for qemu-devel@nongnu.org; Wed, 20 Jun 2018 11:39:58 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fVfDA-0003o3-FI for qemu-devel@nongnu.org; Wed, 20 Jun 2018 11:39:57 -0400 Received: from mx3-rdu2.redhat.com ([66.187.233.73]:41926 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 1fVfDA-0003nE-9e for qemu-devel@nongnu.org; Wed, 20 Jun 2018 11:39:56 -0400 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id D9FD777154 for ; Wed, 20 Jun 2018 15:39:55 +0000 (UTC) Received: from dgilbert-t530.redhat.com (ovpn-117-189.ams2.redhat.com [10.36.117.189]) by smtp.corp.redhat.com (Postfix) with ESMTP id 112D2111E40F; Wed, 20 Jun 2018 15:39:54 +0000 (UTC) From: "Dr. David Alan Gilbert (git)" To: qemu-devel@nongnu.org, armbru@redhat.com, imammedo@redhat.com, peterx@redhat.com Date: Wed, 20 Jun 2018 16:39:45 +0100 Message-Id: <20180620153947.30834-6-dgilbert@redhat.com> In-Reply-To: <20180620153947.30834-1-dgilbert@redhat.com> References: <20180620153947.30834-1-dgilbert@redhat.com> X-Scanned-By: MIMEDefang 2.78 on 10.11.54.3 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.1]); Wed, 20 Jun 2018 15:39:55 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.1]); Wed, 20 Jun 2018 15:39:55 +0000 (UTC) for IP:'10.11.54.3' DOMAIN:'int-mx03.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 v5 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 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 Reviewed-by: Igor Mammedov --- hmp-commands-info.hx | 11 +++++++++++ hmp-commands.hx | 3 +++ 2 files changed, 14 insertions(+) diff --git a/hmp-commands-info.hx b/hmp-commands-info.hx index ddfcd5adcc..874ff07583 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 @@ -399,6 +403,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 +462,7 @@ ETEXI .params =3D "", .help =3D "show the current VM name", .cmd =3D hmp_info_name, + .flags =3D "p", }, =20 STEXI @@ -471,6 +477,7 @@ ETEXI .params =3D "", .help =3D "show the current VM UUID", .cmd =3D hmp_info_uuid, + .flags =3D "p", }, =20 STEXI @@ -613,6 +620,7 @@ ETEXI .params =3D "[path]", .help =3D "show QOM composition tree", .cmd =3D hmp_info_qom_tree, + .flags =3D "p", }, =20 STEXI @@ -671,6 +679,7 @@ ETEXI .params =3D "", .help =3D "show memory backends", .cmd =3D hmp_info_memdev, + .flags =3D "p", }, =20 STEXI @@ -699,6 +708,7 @@ ETEXI .params =3D "", .help =3D "show iothreads", .cmd =3D hmp_info_iothreads, + .flags =3D "p", }, =20 STEXI @@ -829,6 +839,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 3094294e5b..4bdf8e2090 100644 --- a/hmp-commands.hx +++ b/hmp-commands.hx @@ -1828,6 +1828,7 @@ ETEXI .params =3D "path", .help =3D "list QOM properties", .cmd =3D hmp_qom_list, + .flags =3D "p", }, =20 STEXI @@ -1841,6 +1842,7 @@ ETEXI .params =3D "path property value", .help =3D "set QOM property", .cmd =3D hmp_qom_set, + .flags =3D "p", }, =20 STEXI @@ -1855,6 +1857,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 Mon Apr 29 13:04:36 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 1529509677844508.84599343942307; Wed, 20 Jun 2018 08:47:57 -0700 (PDT) Received: from localhost ([::1]:50415 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fVfKl-0004bQ-QZ for importer@patchew.org; Wed, 20 Jun 2018 11:47:47 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:33579) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fVfDC-00070f-9d for qemu-devel@nongnu.org; Wed, 20 Jun 2018 11:39:59 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fVfDB-0003pW-FC for qemu-devel@nongnu.org; Wed, 20 Jun 2018 11:39:58 -0400 Received: from mx3-rdu2.redhat.com ([66.187.233.73]:40038 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 1fVfDB-0003oq-BL for qemu-devel@nongnu.org; Wed, 20 Jun 2018 11:39:57 -0400 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id EC26181663D5 for ; Wed, 20 Jun 2018 15:39:56 +0000 (UTC) Received: from dgilbert-t530.redhat.com (ovpn-117-189.ams2.redhat.com [10.36.117.189]) by smtp.corp.redhat.com (Postfix) with ESMTP id 21DAA111E40F; Wed, 20 Jun 2018 15:39:56 +0000 (UTC) From: "Dr. David Alan Gilbert (git)" To: qemu-devel@nongnu.org, armbru@redhat.com, imammedo@redhat.com, peterx@redhat.com Date: Wed, 20 Jun 2018 16:39:46 +0100 Message-Id: <20180620153947.30834-7-dgilbert@redhat.com> In-Reply-To: <20180620153947.30834-1-dgilbert@redhat.com> References: <20180620153947.30834-1-dgilbert@redhat.com> X-Scanned-By: MIMEDefang 2.78 on 10.11.54.3 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.8]); Wed, 20 Jun 2018 15:39:56 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.8]); Wed, 20 Jun 2018 15:39:56 +0000 (UTC) for IP:'10.11.54.3' DOMAIN:'int-mx03.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 v5 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 4bdf8e2090..b297fe2826 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 f40d8279cf..f601099f90 100644 --- a/hmp.c +++ b/hmp.c @@ -1068,6 +1068,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 Mon Apr 29 13:04:36 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 1529509558984388.1054493750214; Wed, 20 Jun 2018 08:45:58 -0700 (PDT) Received: from localhost ([::1]:50395 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fVfJ0-00037D-87 for importer@patchew.org; Wed, 20 Jun 2018 11:45:58 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:33590) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fVfDD-00071j-BQ for qemu-devel@nongnu.org; Wed, 20 Jun 2018 11:40:00 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fVfDC-0003rp-Ir for qemu-devel@nongnu.org; Wed, 20 Jun 2018 11:39:59 -0400 Received: from mx3-rdu2.redhat.com ([66.187.233.73]:41940 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 1fVfDC-0003qg-Dx for qemu-devel@nongnu.org; Wed, 20 Jun 2018 11:39:58 -0400 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 06DD5738E6 for ; Wed, 20 Jun 2018 15:39:58 +0000 (UTC) Received: from dgilbert-t530.redhat.com (ovpn-117-189.ams2.redhat.com [10.36.117.189]) by smtp.corp.redhat.com (Postfix) with ESMTP id 332DB111E40F; Wed, 20 Jun 2018 15:39:57 +0000 (UTC) From: "Dr. David Alan Gilbert (git)" To: qemu-devel@nongnu.org, armbru@redhat.com, imammedo@redhat.com, peterx@redhat.com Date: Wed, 20 Jun 2018 16:39:47 +0100 Message-Id: <20180620153947.30834-8-dgilbert@redhat.com> In-Reply-To: <20180620153947.30834-1-dgilbert@redhat.com> References: <20180620153947.30834-1-dgilbert@redhat.com> X-Scanned-By: MIMEDefang 2.78 on 10.11.54.3 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.1]); Wed, 20 Jun 2018 15:39:58 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.1]); Wed, 20 Jun 2018 15:39:58 +0000 (UTC) for IP:'10.11.54.3' DOMAIN:'int-mx03.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 v5 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 0c32308fb2..edf342ac95 100644 --- a/monitor.c +++ b/monitor.c @@ -3460,12 +3460,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