Patchwork [1/1] hmp: allow "bool" parameter to be optional

login
register
mail settings
Submitter Pavel Hrdina
Date Aug. 7, 2012, 1:03 p.m.
Message ID <3c770151454e19e279d1ecae8bb4daaf456df9de.1344344200.git.phrdina@redhat.com>
Download mbox | patch
Permalink /patch/175625/
State New
Headers show

Comments

Pavel Hrdina - Aug. 7, 2012, 1:03 p.m.
Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
---
 monitor.c | 3 +++
 1 file changed, 3 insertions(+)
Andreas Färber - Aug. 7, 2012, 1:52 p.m.
Am 07.08.2012 15:03, schrieb Pavel Hrdina:
> Signed-off-by: Pavel Hrdina <phrdina@redhat.com>

This is in need of a more detailed commit message: What exactly is this
fixing? Or is this a preparation for a particular new command?

Andreas

> ---
>  monitor.c | 3 +++
>  1 file changed, 3 insertions(+)
> 
> diff --git a/monitor.c b/monitor.c
> index bbf30e6..2b3583c 100644
> --- a/monitor.c
> +++ b/monitor.c
> @@ -3778,6 +3778,9 @@ static const mon_cmd_t *monitor_parse_command(Monitor *mon,
>                      val = 1;
>                  } else if (p - beg == 3 && !memcmp(beg, "off", p - beg)) {
>                      val = 0;
> +                } else if (*typestr == '?') {
> +                    typestr++;
> +                    break;
>                  } else {
>                      monitor_printf(mon, "Expected 'on' or 'off'\n");
>                      goto fail;
>
Pavel Hrdina - Aug. 7, 2012, 1:58 p.m.
On 08/07/2012 03:52 PM, Andreas Färber wrote:
> Am 07.08.2012 15:03, schrieb Pavel Hrdina:
>> Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
> This is in need of a more detailed commit message: What exactly is this
> fixing? Or is this a preparation for a particular new command?
>
> Andreas
Yes, this is preparation for update of savevm command. I forget to write 
it. And I think that in future this could be useful.

Pavel
>> ---
>>   monitor.c | 3 +++
>>   1 file changed, 3 insertions(+)
>>
>> diff --git a/monitor.c b/monitor.c
>> index bbf30e6..2b3583c 100644
>> --- a/monitor.c
>> +++ b/monitor.c
>> @@ -3778,6 +3778,9 @@ static const mon_cmd_t *monitor_parse_command(Monitor *mon,
>>                       val = 1;
>>                   } else if (p - beg == 3 && !memcmp(beg, "off", p - beg)) {
>>                       val = 0;
>> +                } else if (*typestr == '?') {
>> +                    typestr++;
>> +                    break;
>>                   } else {
>>                       monitor_printf(mon, "Expected 'on' or 'off'\n");
>>                       goto fail;
>>
>
Markus Armbruster - Aug. 7, 2012, 2:36 p.m.
Pavel Hrdina <phrdina@redhat.com> writes:

> On 08/07/2012 03:52 PM, Andreas Färber wrote:
>> Am 07.08.2012 15:03, schrieb Pavel Hrdina:
>>> Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
>> This is in need of a more detailed commit message: What exactly is this
>> fixing? Or is this a preparation for a particular new command?
>>
>> Andreas
> Yes, this is preparation for update of savevm command. I forget to
> write it. And I think that in future this could be useful.

Recommend to resend as part of a series that actually uses it.
Pavel Hrdina - Aug. 7, 2012, 2:37 p.m.
On 08/07/2012 04:36 PM, Markus Armbruster wrote:
> Pavel Hrdina <phrdina@redhat.com> writes:
>
>> On 08/07/2012 03:52 PM, Andreas Färber wrote:
>>> Am 07.08.2012 15:03, schrieb Pavel Hrdina:
>>>> Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
>>> This is in need of a more detailed commit message: What exactly is this
>>> fixing? Or is this a preparation for a particular new command?
>>>
>>> Andreas
>> Yes, this is preparation for update of savevm command. I forget to
>> write it. And I think that in future this could be useful.
> Recommend to resend as part of a series that actually uses it.
Ok, that was also my first thought, but the I told myself that it could 
be better send it first alone.

Patch

diff --git a/monitor.c b/monitor.c
index bbf30e6..2b3583c 100644
--- a/monitor.c
+++ b/monitor.c
@@ -3778,6 +3778,9 @@  static const mon_cmd_t *monitor_parse_command(Monitor *mon,
                     val = 1;
                 } else if (p - beg == 3 && !memcmp(beg, "off", p - beg)) {
                     val = 0;
+                } else if (*typestr == '?') {
+                    typestr++;
+                    break;
                 } else {
                     monitor_printf(mon, "Expected 'on' or 'off'\n");
                     goto fail;