qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: wenchao xia <xiaxia347os@163.com>
To: Wenchao Xia <xiawenc@linux.vnet.ibm.com>
Cc: aliguori@us.ibm.com, chenwj@iis.sinica.edu.tw, armbru@redhat.com,
	qemu-devel@nongnu.org, pbonzini@redhat.com,
	Luiz Capitulino <lcapitulino@redhat.com>
Subject: Re: [Qemu-devel] [PATCH V3 2/4] HMP: add infrastructure for sub command
Date: Thu, 10 Jan 2013 15:07:51 +0800	[thread overview]
Message-ID: <50EE68C7.9060606@163.com> (raw)
In-Reply-To: <50EE35C9.8010904@linux.vnet.ibm.com>

于 2013-1-10 11:30, Wenchao Xia 写道:
>>> -static const mon_cmd_t *qmp_find_cmd(const char *cmdname)
>>> -{
>>> -    return search_dispatch_table(qmp_cmds, cmdname);
>>> -}
>>
>> Touching qmp_find_cmd() is unrelated to this series.
>>
>    OK.
>
>>> -
>>> -static const mon_cmd_t *monitor_parse_command(Monitor *mon,
>>> -                                              const char *cmdline,
>>> -                                              QDict *qdict)
>>> +/*
>>> + * Try find the target mon_cmd_t instance, if it have sub_table and
>>> have string
>>> + * for it, this function will try search it with remain string, and
>>> if not
>>> + * found it return NULL.
>>> + */
>>> +static const mon_cmd_t *hmp_parse_command(Monitor *mon,
>>> +                                          const char *cmdline,
>>> +                                          mon_cmd_t *table,
>>> +                                          QDict *qdict)
>>
>> Renaming is also not necessary, but if you do it please do in a different
>> patch.
>>
>    OK.
>
>>>   {
>>> +        }
>>> +        return hmp_parse_command(mon, p, cmd->sub_table, qdict);
>>
>> This works, and seems less hack then the previous attempt.
>>
>> Except for a small detail. This:
>>
>>    (qemu) info bla
>>
>> Currently returns a list of info commands, but with this series it
>> returns
>> an error.
>>
>    Yep, I think command completion is another topic, but I am pretty
> sure it can be solved in this framework, for that it is not hack and
> what need to do is, let command completion function knows there may be
> another sub layer too.
>
   Sorry I missed your point. Returning an error instead of info
commands, is made on purpose. IMHO always print the commands
make user confused, message tipping what is wrong is better.

>> I'd like to get a reviewed-by from Markus before applying this as,
>> besides
>> this being his idea, I honestly have a very hard time knowing how to
>> move old
>> hmp hackery forward.
>>

  reply	other threads:[~2013-01-10  7:08 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-12-27  9:40 [Qemu-devel] [PATCH V3 0/4] HMP: allow parsing for sub command Wenchao Xia
2012-12-27  9:40 ` [Qemu-devel] [PATCH V3 1/4] HMP: add QDict to info callback handler Wenchao Xia
2012-12-27  9:40 ` [Qemu-devel] [PATCH V3 2/4] HMP: add infrastructure for sub command Wenchao Xia
2013-01-09 12:57   ` Luiz Capitulino
2013-01-10  3:30     ` Wenchao Xia
2013-01-10  7:07       ` wenchao xia [this message]
2013-01-10  9:23         ` Markus Armbruster
2012-12-27  9:40 ` [Qemu-devel] [PATCH V3 3/4] HMP: move define of mon_cmds Wenchao Xia
2012-12-27  9:40 ` [Qemu-devel] [PATCH V3 4/4] HMP: add sub command table to info Wenchao Xia
2013-01-04  3:00 ` [Qemu-devel] [PATCH V3 0/4] HMP: allow parsing for sub command Wenchao Xia

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=50EE68C7.9060606@163.com \
    --to=xiaxia347os@163.com \
    --cc=aliguori@us.ibm.com \
    --cc=armbru@redhat.com \
    --cc=chenwj@iis.sinica.edu.tw \
    --cc=lcapitulino@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=xiawenc@linux.vnet.ibm.com \
    /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).