qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Dr. David Alan Gilbert (git)" <dgilbert@redhat.com>
To: qemu-devel@nongnu.org
Cc: armbru@redhat.com
Subject: [Qemu-devel] [PULL 2/5] hmp: Fix unknown command for subtable
Date: Thu,  5 Oct 2017 11:51:54 +0100	[thread overview]
Message-ID: <20171005105157.10831-3-dgilbert@redhat.com> (raw)
In-Reply-To: <20171005105157.10831-1-dgilbert@redhat.com>

From: "Dr. David Alan Gilbert" <dgilbert@redhat.com>

(qemu) info foo
unknown command: 'foo'

fix this to:
(qemu) info foo
unknown command: 'info foo'

Reported-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
Message-Id: <20170817104216.29150-3-dgilbert@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
---
 monitor.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/monitor.c b/monitor.c
index 94fb197c0d..fe0d1bdbb4 100644
--- a/monitor.c
+++ b/monitor.c
@@ -2697,6 +2697,7 @@ static const mon_cmd_t *search_dispatch_table(const mon_cmd_t *disp_table,
  * the command is found in a sub-command table.
  */
 static const mon_cmd_t *monitor_parse_command(Monitor *mon,
+                                              const char *cmdp_start,
                                               const char **cmdp,
                                               mon_cmd_t *table)
 {
@@ -2712,7 +2713,7 @@ static const mon_cmd_t *monitor_parse_command(Monitor *mon,
     cmd = search_dispatch_table(table, cmdname);
     if (!cmd) {
         monitor_printf(mon, "unknown command: '%.*s'\n",
-                       (int)(p - *cmdp), *cmdp);
+                       (int)(p - cmdp_start), cmdp_start);
         return NULL;
     }
 
@@ -2724,7 +2725,7 @@ static const mon_cmd_t *monitor_parse_command(Monitor *mon,
     *cmdp = p;
     /* search sub command */
     if (cmd->sub_table != NULL && *p != '\0') {
-        return monitor_parse_command(mon, cmdp, cmd->sub_table);
+        return monitor_parse_command(mon, cmdp_start, cmdp, cmd->sub_table);
     }
 
     return cmd;
@@ -3108,7 +3109,7 @@ static void handle_hmp_command(Monitor *mon, const char *cmdline)
 
     trace_handle_hmp_command(mon, cmdline);
 
-    cmd = monitor_parse_command(mon, &cmdline, mon->cmd_table);
+    cmd = monitor_parse_command(mon, cmdline, &cmdline, mon->cmd_table);
     if (!cmd) {
         return;
     }
-- 
2.13.6

  parent reply	other threads:[~2017-10-05 10:52 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-10-05 10:51 [Qemu-devel] [PULL 0/5] hmp queue Dr. David Alan Gilbert (git)
2017-10-05 10:51 ` [Qemu-devel] [PULL 1/5] hmp: Missing handle_errors Dr. David Alan Gilbert (git)
2017-10-05 10:51 ` Dr. David Alan Gilbert (git) [this message]
2017-10-05 10:51 ` [Qemu-devel] [PULL 3/5] hmp-commands-info: Fix "info rocker-FOO" misspellings Dr. David Alan Gilbert (git)
2017-10-05 12:47   ` Paolo Bonzini
2017-10-05 14:21     ` Dr. David Alan Gilbert
2017-10-06  5:46     ` Markus Armbruster
2017-10-05 10:51 ` [Qemu-devel] [PULL 4/5] hmp-commands-info: Move Texinfo stanzas to conventional place Dr. David Alan Gilbert (git)
2017-10-05 10:51 ` [Qemu-devel] [PULL 5/5] hmp-commands-info: Change "@findex FOO" to "@findex info FOO" Dr. David Alan Gilbert (git)
2017-10-05 15:53 ` [Qemu-devel] [PULL 0/5] hmp queue Peter Maydell

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20171005105157.10831-3-dgilbert@redhat.com \
    --to=dgilbert@redhat.com \
    --cc=armbru@redhat.com \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).