From nobody Mon Apr 29 23:44:49 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 1528201726906462.630930603758; Tue, 5 Jun 2018 05:28:46 -0700 (PDT) Received: from localhost ([::1]:46317 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fQB4q-000524-GV for importer@patchew.org; Tue, 05 Jun 2018 08:28:40 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:41984) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fQB31-0003nr-Hg for qemu-devel@nongnu.org; Tue, 05 Jun 2018 08:26:49 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fQB2z-0005E1-Jo for qemu-devel@nongnu.org; Tue, 05 Jun 2018 08:26:47 -0400 Received: from mx3-rdu2.redhat.com ([66.187.233.73]:60122 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 1fQB2z-0005DF-Bz for qemu-devel@nongnu.org; Tue, 05 Jun 2018 08:26:45 -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 505E5BB409 for ; Tue, 5 Jun 2018 12:26:44 +0000 (UTC) Received: from dgilbert-t530.redhat.com (ovpn-117-20.ams2.redhat.com [10.36.117.20]) by smtp.corp.redhat.com (Postfix) with ESMTP id 7F0B5205D521; Tue, 5 Jun 2018 12:26:43 +0000 (UTC) From: "Dr. David Alan Gilbert (git)" To: qemu-devel@nongnu.org, armbru@redhat.com, imammedo@redhat.com Date: Tue, 5 Jun 2018 13:26:31 +0100 Message-Id: <20180605122636.33654-2-dgilbert@redhat.com> In-Reply-To: <20180605122636.33654-1-dgilbert@redhat.com> References: <20180605122636.33654-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, 05 Jun 2018 12:26:44 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.1]); Tue, 05 Jun 2018 12:26:44 +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 1/6] 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. Signed-off-by: Dr. David Alan Gilbert Reviewed-by: Igor Mammedov Reviewed-by: Peter Xu Tested-by: Peter Xu --- monitor.c | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/monitor.c b/monitor.c index 6d0cec552e..50b95f41db 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,11 @@ 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 in preconfig\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 Mon Apr 29 23:44:49 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 1528201728590938.1495802657464; Tue, 5 Jun 2018 05:28:48 -0700 (PDT) Received: from localhost ([::1]:46316 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fQB4p-00050y-4f for importer@patchew.org; Tue, 05 Jun 2018 08:28:39 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:41996) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fQB32-0003ns-Cg for qemu-devel@nongnu.org; Tue, 05 Jun 2018 08:26:49 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fQB30-0005F7-Ho for qemu-devel@nongnu.org; Tue, 05 Jun 2018 08:26:48 -0400 Received: from mx3-rdu2.redhat.com ([66.187.233.73]:34720 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 1fQB30-0005Dx-AI for qemu-devel@nongnu.org; Tue, 05 Jun 2018 08:26:46 -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 5D485402382F for ; Tue, 5 Jun 2018 12:26:45 +0000 (UTC) Received: from dgilbert-t530.redhat.com (ovpn-117-20.ams2.redhat.com [10.36.117.20]) by smtp.corp.redhat.com (Postfix) with ESMTP id 8C008205D521; Tue, 5 Jun 2018 12:26:44 +0000 (UTC) From: "Dr. David Alan Gilbert (git)" To: qemu-devel@nongnu.org, armbru@redhat.com, imammedo@redhat.com Date: Tue, 5 Jun 2018 13:26:32 +0100 Message-Id: <20180605122636.33654-3-dgilbert@redhat.com> In-Reply-To: <20180605122636.33654-1-dgilbert@redhat.com> References: <20180605122636.33654-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, 05 Jun 2018 12:26:45 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.6]); Tue, 05 Jun 2018 12:26:45 +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 2/6] 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: Igor Mammedov Reviewed-by: Peter Xu Tested-by: Peter Xu --- 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 50b95f41db..7d1709c225 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 Mon Apr 29 23:44:49 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 1528201860809956.8782496412334; Tue, 5 Jun 2018 05:31:00 -0700 (PDT) Received: from localhost ([::1]:46332 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fQB76-00086o-00 for importer@patchew.org; Tue, 05 Jun 2018 08:31:00 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:42009) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fQB33-0003nu-5Y for qemu-devel@nongnu.org; Tue, 05 Jun 2018 08:26:50 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fQB31-0005G7-KX for qemu-devel@nongnu.org; Tue, 05 Jun 2018 08:26:49 -0400 Received: from mx3-rdu2.redhat.com ([66.187.233.73]:34722 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 1fQB31-0005FF-DT for qemu-devel@nongnu.org; Tue, 05 Jun 2018 08:26:47 -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 6B9FA4023834 for ; Tue, 5 Jun 2018 12:26:46 +0000 (UTC) Received: from dgilbert-t530.redhat.com (ovpn-117-20.ams2.redhat.com [10.36.117.20]) by smtp.corp.redhat.com (Postfix) with ESMTP id 981B6205D521; Tue, 5 Jun 2018 12:26:45 +0000 (UTC) From: "Dr. David Alan Gilbert (git)" To: qemu-devel@nongnu.org, armbru@redhat.com, imammedo@redhat.com Date: Tue, 5 Jun 2018 13:26:33 +0100 Message-Id: <20180605122636.33654-4-dgilbert@redhat.com> In-Reply-To: <20180605122636.33654-1-dgilbert@redhat.com> References: <20180605122636.33654-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, 05 Jun 2018 12:26:46 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.6]); Tue, 05 Jun 2018 12:26:46 +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 3/6] 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: Igor Mammedov Reviewed-by: Peter Xu Tested-by: Peter Xu --- monitor.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/monitor.c b/monitor.c index 7d1709c225..9b29787a52 100644 --- a/monitor.c +++ b/monitor.c @@ -3950,12 +3950,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 Mon Apr 29 23:44:49 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 1528202001866129.83201411277594; Tue, 5 Jun 2018 05:33:21 -0700 (PDT) Received: from localhost ([::1]:46348 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fQB9N-0001FL-4I for importer@patchew.org; Tue, 05 Jun 2018 08:33:21 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:42031) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fQB34-0003oB-C2 for qemu-devel@nongnu.org; Tue, 05 Jun 2018 08:26:51 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fQB32-0005Ge-KV for qemu-devel@nongnu.org; Tue, 05 Jun 2018 08:26:50 -0400 Received: from mx3-rdu2.redhat.com ([66.187.233.73]:34724 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 1fQB32-0005GC-Cn for qemu-devel@nongnu.org; Tue, 05 Jun 2018 08:26:48 -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 75250402382F for ; Tue, 5 Jun 2018 12:26:47 +0000 (UTC) Received: from dgilbert-t530.redhat.com (ovpn-117-20.ams2.redhat.com [10.36.117.20]) by smtp.corp.redhat.com (Postfix) with ESMTP id A35BF205D521; Tue, 5 Jun 2018 12:26:46 +0000 (UTC) From: "Dr. David Alan Gilbert (git)" To: qemu-devel@nongnu.org, armbru@redhat.com, imammedo@redhat.com Date: Tue, 5 Jun 2018 13:26:34 +0100 Message-Id: <20180605122636.33654-5-dgilbert@redhat.com> In-Reply-To: <20180605122636.33654-1-dgilbert@redhat.com> References: <20180605122636.33654-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, 05 Jun 2018 12:26:47 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.6]); Tue, 05 Jun 2018 12:26:47 +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 4/6] 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. Could probably add most of them. Signed-off-by: Dr. David Alan Gilbert Reviewed-by: Igor Mammedov Reviewed-by: Peter Xu Tested-by: Peter Xu --- hmp-commands-info.hx | 9 +++++++++ hmp-commands.hx | 1 + 2 files changed, 10 insertions(+) diff --git a/hmp-commands-info.hx b/hmp-commands-info.hx index ddfcd5adcc..00735e7d1c 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 @@ -33,6 +34,7 @@ ETEXI .params =3D "", .help =3D "show the network state", .cmd =3D hmp_info_network, + .flags =3D "p", }, =20 STEXI @@ -47,6 +49,7 @@ ETEXI .params =3D "", .help =3D "show the character devices", .cmd =3D hmp_info_chardev, + .flags =3D "p", }, =20 STEXI @@ -62,6 +65,7 @@ ETEXI .help =3D "show info of one block device or all block device= s " "(-n: show named nodes; -v: show details)", .cmd =3D hmp_info_block, + .flags =3D "p", }, =20 STEXI @@ -151,6 +155,7 @@ ETEXI .params =3D "", .help =3D "show infos for each CPU", .cmd =3D hmp_info_cpus, + .flags =3D "p", }, =20 STEXI @@ -165,6 +170,7 @@ ETEXI .params =3D "", .help =3D "show the command line history", .cmd =3D hmp_info_history, + .flags =3D "p", }, =20 STEXI @@ -255,6 +261,7 @@ ETEXI .help =3D "show memory tree (-f: dump flat view for address = spaces;" "-d: dump dispatch tree, valid with -f only)", .cmd =3D hmp_info_mtree, + .flags =3D "p", }, =20 STEXI @@ -399,6 +406,7 @@ ETEXI .params =3D "", .help =3D "show the current VM status (running|paused)", .cmd =3D hmp_info_status, + .flags =3D "p", }, =20 STEXI @@ -829,6 +837,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 Mon Apr 29 23:44:49 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 1528201726885721.4585625521474; Tue, 5 Jun 2018 05:28:46 -0700 (PDT) Received: from localhost ([::1]:46318 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fQB4r-00054A-RV for importer@patchew.org; Tue, 05 Jun 2018 08:28:41 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:42036) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fQB34-0003oT-Ox for qemu-devel@nongnu.org; Tue, 05 Jun 2018 08:26:51 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fQB33-0005HB-F4 for qemu-devel@nongnu.org; Tue, 05 Jun 2018 08:26:50 -0400 Received: from mx3-rdu2.redhat.com ([66.187.233.73]:47808 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 1fQB33-0005Gp-90 for qemu-devel@nongnu.org; Tue, 05 Jun 2018 08:26:49 -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 85DFA859C5 for ; Tue, 5 Jun 2018 12:26:48 +0000 (UTC) Received: from dgilbert-t530.redhat.com (ovpn-117-20.ams2.redhat.com [10.36.117.20]) by smtp.corp.redhat.com (Postfix) with ESMTP id B0C2F205D522; Tue, 5 Jun 2018 12:26:47 +0000 (UTC) From: "Dr. David Alan Gilbert (git)" To: qemu-devel@nongnu.org, armbru@redhat.com, imammedo@redhat.com Date: Tue, 5 Jun 2018 13:26:35 +0100 Message-Id: <20180605122636.33654-6-dgilbert@redhat.com> In-Reply-To: <20180605122636.33654-1-dgilbert@redhat.com> References: <20180605122636.33654-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, 05 Jun 2018 12:26:48 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.2]); Tue, 05 Jun 2018 12:26:48 +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 5/6] 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: Igor Mammedov Reviewed-by: Peter Xu Tested-by: Peter Xu --- 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 Mon Apr 29 23:44:49 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 1528201863357146.1172411661464; Tue, 5 Jun 2018 05:31:03 -0700 (PDT) Received: from localhost ([::1]:46335 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fQB78-000898-KB for importer@patchew.org; Tue, 05 Jun 2018 08:31:02 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:42052) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fQB35-0003pP-Hh for qemu-devel@nongnu.org; Tue, 05 Jun 2018 08:26:52 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fQB34-0005Hx-Fp for qemu-devel@nongnu.org; Tue, 05 Jun 2018 08:26:51 -0400 Received: from mx3-rdu2.redhat.com ([66.187.233.73]:47810 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 1fQB34-0005HU-8V for qemu-devel@nongnu.org; Tue, 05 Jun 2018 08:26: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 9248F859C5 for ; Tue, 5 Jun 2018 12:26:49 +0000 (UTC) Received: from dgilbert-t530.redhat.com (ovpn-117-20.ams2.redhat.com [10.36.117.20]) by smtp.corp.redhat.com (Postfix) with ESMTP id C04B9205D522; Tue, 5 Jun 2018 12:26:48 +0000 (UTC) From: "Dr. David Alan Gilbert (git)" To: qemu-devel@nongnu.org, armbru@redhat.com, imammedo@redhat.com Date: Tue, 5 Jun 2018 13:26:36 +0100 Message-Id: <20180605122636.33654-7-dgilbert@redhat.com> In-Reply-To: <20180605122636.33654-1-dgilbert@redhat.com> References: <20180605122636.33654-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, 05 Jun 2018 12:26:49 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.2]); Tue, 05 Jun 2018 12:26: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 6/6] 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: Igor Mammedov Reviewed-by: Peter Xu Tested-by: Peter Xu --- monitor.c | 6 ------ 1 file changed, 6 deletions(-) diff --git a/monitor.c b/monitor.c index 9b29787a52..50bcba18db 100644 --- a/monitor.c +++ b/monitor.c @@ -3394,12 +3394,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