qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH v8 1/3] monitor/hmp: add support for flag argument with value


From: Fabian Ebner
Subject: Re: [PATCH v8 1/3] monitor/hmp: add support for flag argument with value
Date: Thu, 24 Feb 2022 10:17:21 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.6.0

Am 09.02.22 um 15:12 schrieb Markus Armbruster:
> Fabian Ebner <f.ebner@proxmox.com> writes:

----8<----

>> diff --git a/monitor/monitor-internal.h b/monitor/monitor-internal.h
>> index 3da3f86c6a..a4cb307c8a 100644
>> --- a/monitor/monitor-internal.h
>> +++ b/monitor/monitor-internal.h
>> @@ -63,7 +63,8 @@
>>   * '.'          other form of optional type (for 'i' and 'l')
>>   * 'b'          boolean
>>   *              user mode accepts "on" or "off"
>> - * '-'          optional parameter (eg. '-f')
>> + * '-'          optional parameter (eg. '-f'); if followed by a 'V', it
>> + *              specifies an optional string param (e.g. '-fV' allows '-f 
>> foo')
>>   *
>>   */
> 
> For what it's worth, getopt() uses ':' after the option character for
> "takes an argument".
> 

Doing that leads to e.g.
    .args_type  = "protocol:s,password:s,display:-d:,connected:s?",
so there's two different kinds of colons now. It's not a problem
functionality-wise AFAICT, but it might not be ideal. Should I still go
for it?

Also, wouldn't future non-string flag parameters need their own letter
too? What about re-using 's' here instead?

> Happy to make that tweak in my tree.  But see my review of PATCH 3
> first.
> 
> 




reply via email to

[Prev in Thread] Current Thread [Next in Thread]