From nobody Sun May 5 23:58:41 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 152959985260368.7225405272709; Thu, 21 Jun 2018 09:50:52 -0700 (PDT) Received: from localhost ([::1]:56636 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fW2nL-000633-Sw for importer@patchew.org; Thu, 21 Jun 2018 12:50:51 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:44945) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fW2k8-0003yJ-Sc for qemu-devel@nongnu.org; Thu, 21 Jun 2018 12:47:33 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fW2k6-0003di-Pe for qemu-devel@nongnu.org; Thu, 21 Jun 2018 12:47:32 -0400 Received: from mx3-rdu2.redhat.com ([66.187.233.73]:33926 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 1fW2k6-0003dR-Kk for qemu-devel@nongnu.org; Thu, 21 Jun 2018 12:47:30 -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 26F8F401EF32; Thu, 21 Jun 2018 16:47:30 +0000 (UTC) Received: from dgilbert-t530.redhat.com (ovpn-117-193.ams2.redhat.com [10.36.117.193]) by smtp.corp.redhat.com (Postfix) with ESMTP id 339482156880; Thu, 21 Jun 2018 16:47:29 +0000 (UTC) From: "Dr. David Alan Gilbert (git)" To: qemu-devel@nongnu.org, imammedo@redhat.com, sjitindarsingh@gmail.com, walling@linux.ibm.com Date: Thu, 21 Jun 2018 17:47:19 +0100 Message-Id: <20180621164727.36626-2-dgilbert@redhat.com> In-Reply-To: <20180621164727.36626-1-dgilbert@redhat.com> References: <20180621164727.36626-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.5]); Thu, 21 Jun 2018 16:47:30 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.5]); Thu, 21 Jun 2018 16:47:30 +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] [PULL 1/9] monitor: report entirety of hmp command on error 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: , Cc: armbru@redhat.com 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: Collin Walling When a user incorrectly provides an hmp command, an error response will be printed that prompts the user to try "help ". However, when the command contains multiple parts e.g. "info uuid xyz", only the last whitespace delimited string will be reported (in this example "info" will be dropped and the message will read "Try "help uuid" for more information", which is incorrect). Let's correct this by capturing the entirety of the command from the command line -- excluding any extraneous characters. Reported-by: Mikhail Fokin Signed-off-by: Collin Walling Message-Id: Reviewed-by: Eric Blake Signed-off-by: Dr. David Alan Gilbert --- monitor.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/monitor.c b/monitor.c index 885e000f9b..2a8187f5d7 100644 --- a/monitor.c +++ b/monitor.c @@ -3431,6 +3431,7 @@ static void handle_hmp_command(Monitor *mon, const ch= ar *cmdline) { QDict *qdict; const mon_cmd_t *cmd; + const char *cmd_start =3D cmdline; =20 trace_handle_hmp_command(mon, cmdline); =20 @@ -3447,8 +3448,11 @@ static void handle_hmp_command(Monitor *mon, const c= har *cmdline) =20 qdict =3D monitor_parse_arguments(mon, &cmdline, cmd); if (!qdict) { - monitor_printf(mon, "Try \"help %s\" for more information\n", - cmd->name); + while (cmdline > cmd_start && qemu_isspace(cmdline[-1])) { + cmdline--; + } + monitor_printf(mon, "Try \"help %.*s\" for more information\n", + (int)(cmdline - cmd_start), cmd_start); return; } =20 --=20 2.17.1 From nobody Sun May 5 23:58:41 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 152959999980630.14708027220695; Thu, 21 Jun 2018 09:53:19 -0700 (PDT) Received: from localhost ([::1]:56648 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fW2pj-0007zA-4F for importer@patchew.org; Thu, 21 Jun 2018 12:53:19 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:44944) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fW2k8-0003yI-Sb for qemu-devel@nongnu.org; Thu, 21 Jun 2018 12:47:33 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fW2k8-0003e9-03 for qemu-devel@nongnu.org; Thu, 21 Jun 2018 12:47:32 -0400 Received: from mx3-rdu2.redhat.com ([66.187.233.73]:46278 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 1fW2k7-0003dz-Ry for qemu-devel@nongnu.org; Thu, 21 Jun 2018 12:47:31 -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 543E4400E978; Thu, 21 Jun 2018 16:47:31 +0000 (UTC) Received: from dgilbert-t530.redhat.com (ovpn-117-193.ams2.redhat.com [10.36.117.193]) by smtp.corp.redhat.com (Postfix) with ESMTP id 618B92156880; Thu, 21 Jun 2018 16:47:30 +0000 (UTC) From: "Dr. David Alan Gilbert (git)" To: qemu-devel@nongnu.org, imammedo@redhat.com, sjitindarsingh@gmail.com, walling@linux.ibm.com Date: Thu, 21 Jun 2018 17:47:20 +0100 Message-Id: <20180621164727.36626-3-dgilbert@redhat.com> In-Reply-To: <20180621164727.36626-1-dgilbert@redhat.com> References: <20180621164727.36626-1-dgilbert@redhat.com> X-Scanned-By: MIMEDefang 2.78 on 10.11.54.6 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.7]); Thu, 21 Jun 2018 16:47:31 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.7]); Thu, 21 Jun 2018 16:47:31 +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] [PULL 2/9] hmp-commands: use long for begin and length in dump-guest-memory 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: , Cc: armbru@redhat.com 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: Suraj Jitindar Singh The dump-guest-memory command is used to dump an area of guest memory to a file, the piece of memory is specified by a begin address and a length. These parameters are specified as ints and thus have a maximum value of 4GB. This means you can't dump the guest memory past the first 4GB and instead get: (qemu) dump-guest-memory tmp 0x100000000 0x100000000 'dump-guest-memory' has failed: integer is for 32-bit values Try "help dump-guest-memory" for more information This limitation is imposed in monitor_parse_arguments() since they are both ints. hmp_dump_guest_memory() uses 64 bit quantities to store both the begin and length values. Thus specify begin and length as long so that the entire guest memory space can be dumped. Signed-off-by: Suraj Jitindar Singh Message-Id: <20180620003202.10546-1-sjitindarsingh@gmail.com> Reviewed-by: Dr. David Alan Gilbert Signed-off-by: Dr. David Alan Gilbert --- hmp-commands.hx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hmp-commands.hx b/hmp-commands.hx index 0de7c4c29e..754620e411 100644 --- a/hmp-commands.hx +++ b/hmp-commands.hx @@ -1116,7 +1116,7 @@ ETEXI =20 { .name =3D "dump-guest-memory", - .args_type =3D "paging:-p,detach:-d,zlib:-z,lzo:-l,snappy:-s,file= name:F,begin:i?,length:i?", + .args_type =3D "paging:-p,detach:-d,zlib:-z,lzo:-l,snappy:-s,file= name:F,begin:l?,length:l?", .params =3D "[-p] [-d] [-z|-l|-s] filename [begin length]", .help =3D "dump guest memory into file 'filename'.\n\t\t\t" "-p: do paging to get guest's memory mapping.\n\t\t\= t" --=20 2.17.1 From nobody Sun May 5 23:58:41 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 1529599950433733.6830731186162; Thu, 21 Jun 2018 09:52:30 -0700 (PDT) Received: from localhost ([::1]:56646 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fW2ov-0007QB-O9 for importer@patchew.org; Thu, 21 Jun 2018 12:52:29 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:44978) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fW2k9-0003yz-Uu for qemu-devel@nongnu.org; Thu, 21 Jun 2018 12:47:34 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fW2k9-0003fm-3l for qemu-devel@nongnu.org; Thu, 21 Jun 2018 12:47:33 -0400 Received: from mx3-rdu2.redhat.com ([66.187.233.73]:44314 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 1fW2k8-0003ek-Vt for qemu-devel@nongnu.org; Thu, 21 Jun 2018 12:47:33 -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 849A0F68AA; Thu, 21 Jun 2018 16:47:32 +0000 (UTC) Received: from dgilbert-t530.redhat.com (ovpn-117-193.ams2.redhat.com [10.36.117.193]) by smtp.corp.redhat.com (Postfix) with ESMTP id 8FBAD2156880; Thu, 21 Jun 2018 16:47:31 +0000 (UTC) From: "Dr. David Alan Gilbert (git)" To: qemu-devel@nongnu.org, imammedo@redhat.com, sjitindarsingh@gmail.com, walling@linux.ibm.com Date: Thu, 21 Jun 2018 17:47:21 +0100 Message-Id: <20180621164727.36626-4-dgilbert@redhat.com> In-Reply-To: <20180621164727.36626-1-dgilbert@redhat.com> References: <20180621164727.36626-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]); Thu, 21 Jun 2018 16:47:32 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.1]); Thu, 21 Jun 2018 16:47:32 +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] [PULL 3/9] 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: , Cc: armbru@redhat.com 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 Message-Id: <20180620153947.30834-2-dgilbert@redhat.com> Signed-off-by: Dr. David Alan Gilbert --- monitor.c | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/monitor.c b/monitor.c index 2a8187f5d7..ff26d863db 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 Sun May 5 23:58:41 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 152959995221546.93172641387878; Thu, 21 Jun 2018 09:52:32 -0700 (PDT) Received: from localhost ([::1]:56647 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fW2ox-0007RO-Dt for importer@patchew.org; Thu, 21 Jun 2018 12:52:31 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:44996) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fW2kB-0003zz-5B for qemu-devel@nongnu.org; Thu, 21 Jun 2018 12:47:36 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fW2kA-0003gd-At for qemu-devel@nongnu.org; Thu, 21 Jun 2018 12:47:35 -0400 Received: from mx3-rdu2.redhat.com ([66.187.233.73]:33930 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 1fW2kA-0003gI-73 for qemu-devel@nongnu.org; Thu, 21 Jun 2018 12:47:34 -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 B43B7401EF28; Thu, 21 Jun 2018 16:47:33 +0000 (UTC) Received: from dgilbert-t530.redhat.com (ovpn-117-193.ams2.redhat.com [10.36.117.193]) by smtp.corp.redhat.com (Postfix) with ESMTP id BD74E2156880; Thu, 21 Jun 2018 16:47:32 +0000 (UTC) From: "Dr. David Alan Gilbert (git)" To: qemu-devel@nongnu.org, imammedo@redhat.com, sjitindarsingh@gmail.com, walling@linux.ibm.com Date: Thu, 21 Jun 2018 17:47:22 +0100 Message-Id: <20180621164727.36626-5-dgilbert@redhat.com> In-Reply-To: <20180621164727.36626-1-dgilbert@redhat.com> References: <20180621164727.36626-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.5]); Thu, 21 Jun 2018 16:47:33 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.5]); Thu, 21 Jun 2018 16:47:33 +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] [PULL 4/9] 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: , Cc: armbru@redhat.com 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 Message-Id: <20180620153947.30834-3-dgilbert@redhat.com> Signed-off-by: Dr. David Alan Gilbert --- 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 754620e411..7ce991f4dd 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 ff26d863db..18c2207e6d 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 Sun May 5 23:58:41 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 1529600094745687.5759546448725; Thu, 21 Jun 2018 09:54:54 -0700 (PDT) Received: from localhost ([::1]:56655 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fW2rD-0000jy-Vj for importer@patchew.org; Thu, 21 Jun 2018 12:54:52 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:45007) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fW2kC-00041P-Bc for qemu-devel@nongnu.org; Thu, 21 Jun 2018 12:47:37 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fW2kB-0003hR-HY for qemu-devel@nongnu.org; Thu, 21 Jun 2018 12:47:36 -0400 Received: from mx3-rdu2.redhat.com ([66.187.233.73]:49326 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 1fW2kB-0003h9-DK for qemu-devel@nongnu.org; Thu, 21 Jun 2018 12:47:35 -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 E42F44023344; Thu, 21 Jun 2018 16:47:34 +0000 (UTC) Received: from dgilbert-t530.redhat.com (ovpn-117-193.ams2.redhat.com [10.36.117.193]) by smtp.corp.redhat.com (Postfix) with ESMTP id EDE2F2156880; Thu, 21 Jun 2018 16:47:33 +0000 (UTC) From: "Dr. David Alan Gilbert (git)" To: qemu-devel@nongnu.org, imammedo@redhat.com, sjitindarsingh@gmail.com, walling@linux.ibm.com Date: Thu, 21 Jun 2018 17:47:23 +0100 Message-Id: <20180621164727.36626-6-dgilbert@redhat.com> In-Reply-To: <20180621164727.36626-1-dgilbert@redhat.com> References: <20180621164727.36626-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]); Thu, 21 Jun 2018 16:47:34 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.6]); Thu, 21 Jun 2018 16:47:34 +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] [PULL 5/9] 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: , Cc: armbru@redhat.com 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 Message-Id: <20180620153947.30834-4-dgilbert@redhat.com> Signed-off-by: Dr. David Alan Gilbert --- monitor.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/monitor.c b/monitor.c index 18c2207e6d..068c094a9a 100644 --- a/monitor.c +++ b/monitor.c @@ -4020,12 +4020,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 Sun May 5 23:58:41 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 1529600140949459.2271395861751; Thu, 21 Jun 2018 09:55:40 -0700 (PDT) Received: from localhost ([::1]:56664 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fW2rx-0001Tc-9q for importer@patchew.org; Thu, 21 Jun 2018 12:55:37 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:45020) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fW2kD-000433-RA for qemu-devel@nongnu.org; Thu, 21 Jun 2018 12:47:42 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fW2kC-0003iJ-Rf for qemu-devel@nongnu.org; Thu, 21 Jun 2018 12:47:37 -0400 Received: from mx3-rdu2.redhat.com ([66.187.233.73]:57894 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 1fW2kC-0003hw-M6 for qemu-devel@nongnu.org; Thu, 21 Jun 2018 12:47:36 -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 20DEC81663D8; Thu, 21 Jun 2018 16:47:36 +0000 (UTC) Received: from dgilbert-t530.redhat.com (ovpn-117-193.ams2.redhat.com [10.36.117.193]) by smtp.corp.redhat.com (Postfix) with ESMTP id 2E3892156880; Thu, 21 Jun 2018 16:47:35 +0000 (UTC) From: "Dr. David Alan Gilbert (git)" To: qemu-devel@nongnu.org, imammedo@redhat.com, sjitindarsingh@gmail.com, walling@linux.ibm.com Date: Thu, 21 Jun 2018 17:47:24 +0100 Message-Id: <20180621164727.36626-7-dgilbert@redhat.com> In-Reply-To: <20180621164727.36626-1-dgilbert@redhat.com> References: <20180621164727.36626-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]); Thu, 21 Jun 2018 16:47:36 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.8]); Thu, 21 Jun 2018 16:47:36 +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] [PULL 6/9] 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: , Cc: armbru@redhat.com 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 Message-Id: <20180620153947.30834-5-dgilbert@redhat.com> 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 Sun May 5 23:58:41 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 1529600271040215.34902139647147; Thu, 21 Jun 2018 09:57:51 -0700 (PDT) Received: from localhost ([::1]:56679 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fW2u6-0003J3-BN for importer@patchew.org; Thu, 21 Jun 2018 12:57:50 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:45047) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fW2kH-00045Z-1k for qemu-devel@nongnu.org; Thu, 21 Jun 2018 12:47:42 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fW2kD-0003k6-WA for qemu-devel@nongnu.org; Thu, 21 Jun 2018 12:47:41 -0400 Received: from mx3-rdu2.redhat.com ([66.187.233.73]:35224 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 1fW2kD-0003jT-Px for qemu-devel@nongnu.org; Thu, 21 Jun 2018 12:47:37 -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 4FCBC20E19; Thu, 21 Jun 2018 16:47:37 +0000 (UTC) Received: from dgilbert-t530.redhat.com (ovpn-117-193.ams2.redhat.com [10.36.117.193]) by smtp.corp.redhat.com (Postfix) with ESMTP id 5BDE02156880; Thu, 21 Jun 2018 16:47:36 +0000 (UTC) From: "Dr. David Alan Gilbert (git)" To: qemu-devel@nongnu.org, imammedo@redhat.com, sjitindarsingh@gmail.com, walling@linux.ibm.com Date: Thu, 21 Jun 2018 17:47:25 +0100 Message-Id: <20180621164727.36626-8-dgilbert@redhat.com> In-Reply-To: <20180621164727.36626-1-dgilbert@redhat.com> References: <20180621164727.36626-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]); Thu, 21 Jun 2018 16:47:37 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.2]); Thu, 21 Jun 2018 16:47:37 +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] [PULL 7/9] 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: , Cc: armbru@redhat.com 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 Don't have a QMP equivalent Also enable the qom commands qom-list and qom-set. Signed-off-by: Dr. David Alan Gilbert Message-Id: <20180620153947.30834-6-dgilbert@redhat.com> Reviewed-by: Igor Mammedov Signed-off-by: Dr. David Alan Gilbert Dropped info numa as per Igor's 2018-06-21 review --- hmp-commands-info.hx | 10 ++++++++++ hmp-commands.hx | 3 +++ 2 files changed, 13 insertions(+) diff --git a/hmp-commands-info.hx b/hmp-commands-info.hx index ddfcd5adcc..6db3457a78 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 @@ -399,6 +402,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 +461,7 @@ ETEXI .params =3D "", .help =3D "show the current VM name", .cmd =3D hmp_info_name, + .flags =3D "p", }, =20 STEXI @@ -471,6 +476,7 @@ ETEXI .params =3D "", .help =3D "show the current VM UUID", .cmd =3D hmp_info_uuid, + .flags =3D "p", }, =20 STEXI @@ -613,6 +619,7 @@ ETEXI .params =3D "[path]", .help =3D "show QOM composition tree", .cmd =3D hmp_info_qom_tree, + .flags =3D "p", }, =20 STEXI @@ -671,6 +678,7 @@ ETEXI .params =3D "", .help =3D "show memory backends", .cmd =3D hmp_info_memdev, + .flags =3D "p", }, =20 STEXI @@ -699,6 +707,7 @@ ETEXI .params =3D "", .help =3D "show iothreads", .cmd =3D hmp_info_iothreads, + .flags =3D "p", }, =20 STEXI @@ -829,6 +838,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 7ce991f4dd..4acf6a3222 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 Sun May 5 23:58:41 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 1529600096067720.4453695673508; Thu, 21 Jun 2018 09:54:56 -0700 (PDT) Received: from localhost ([::1]:56657 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fW2rF-0000lK-8b for importer@patchew.org; Thu, 21 Jun 2018 12:54:53 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:45048) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fW2kH-00045a-1r for qemu-devel@nongnu.org; Thu, 21 Jun 2018 12:47:42 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fW2kF-0003kb-4Q for qemu-devel@nongnu.org; Thu, 21 Jun 2018 12:47:41 -0400 Received: from mx3-rdu2.redhat.com ([66.187.233.73]:49336 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 1fW2kE-0003kI-VU for qemu-devel@nongnu.org; Thu, 21 Jun 2018 12:47:39 -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 7C86B4007389; Thu, 21 Jun 2018 16:47:38 +0000 (UTC) Received: from dgilbert-t530.redhat.com (ovpn-117-193.ams2.redhat.com [10.36.117.193]) by smtp.corp.redhat.com (Postfix) with ESMTP id 8A0A52156880; Thu, 21 Jun 2018 16:47:37 +0000 (UTC) From: "Dr. David Alan Gilbert (git)" To: qemu-devel@nongnu.org, imammedo@redhat.com, sjitindarsingh@gmail.com, walling@linux.ibm.com Date: Thu, 21 Jun 2018 17:47:26 +0100 Message-Id: <20180621164727.36626-9-dgilbert@redhat.com> In-Reply-To: <20180621164727.36626-1-dgilbert@redhat.com> References: <20180621164727.36626-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]); Thu, 21 Jun 2018 16:47:38 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.6]); Thu, 21 Jun 2018 16:47:38 +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] [PULL 8/9] 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: , Cc: armbru@redhat.com 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 Message-Id: <20180620153947.30834-7-dgilbert@redhat.com> Signed-off-by: Dr. David Alan Gilbert --- 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 4acf6a3222..ba9cdb8800 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 Sun May 5 23:58:41 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 1529599814910838.540845547784; Thu, 21 Jun 2018 09:50:14 -0700 (PDT) Received: from localhost ([::1]:56630 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fW2mb-0005HI-Qb for importer@patchew.org; Thu, 21 Jun 2018 12:50:05 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:45051) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fW2kH-00045b-9D for qemu-devel@nongnu.org; Thu, 21 Jun 2018 12:47:42 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fW2kG-0003l4-Ar for qemu-devel@nongnu.org; Thu, 21 Jun 2018 12:47:41 -0400 Received: from mx3-rdu2.redhat.com ([66.187.233.73]:49348 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 1fW2kG-0003ku-67 for qemu-devel@nongnu.org; Thu, 21 Jun 2018 12:47:40 -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 AA225400B45C; Thu, 21 Jun 2018 16:47:39 +0000 (UTC) Received: from dgilbert-t530.redhat.com (ovpn-117-193.ams2.redhat.com [10.36.117.193]) by smtp.corp.redhat.com (Postfix) with ESMTP id B83222156880; Thu, 21 Jun 2018 16:47:38 +0000 (UTC) From: "Dr. David Alan Gilbert (git)" To: qemu-devel@nongnu.org, imammedo@redhat.com, sjitindarsingh@gmail.com, walling@linux.ibm.com Date: Thu, 21 Jun 2018 17:47:27 +0100 Message-Id: <20180621164727.36626-10-dgilbert@redhat.com> In-Reply-To: <20180621164727.36626-1-dgilbert@redhat.com> References: <20180621164727.36626-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]); Thu, 21 Jun 2018 16:47:39 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.6]); Thu, 21 Jun 2018 16:47:39 +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] [PULL 9/9] 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: , Cc: armbru@redhat.com 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 Message-Id: <20180620153947.30834-8-dgilbert@redhat.com> Signed-off-by: Dr. David Alan Gilbert --- monitor.c | 6 ------ 1 file changed, 6 deletions(-) diff --git a/monitor.c b/monitor.c index 068c094a9a..0730a27172 100644 --- a/monitor.c +++ b/monitor.c @@ -3461,12 +3461,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