qemu-devel
[Top][All Lists]
Advanced

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

Re: [PATCH v4 4/7] keyval: Parse help options


From: Markus Armbruster
Subject: Re: [PATCH v4 4/7] keyval: Parse help options
Date: Mon, 19 Oct 2020 11:04:22 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/27.1 (gnu/linux)

Kevin Wolf <kwolf@redhat.com> writes:

> Am 11.10.2020 um 09:35 hat Markus Armbruster geschrieben:
>> From: Kevin Wolf <kwolf@redhat.com>
>> 
>> This adds a special meaning for 'help' and '?' as options to the keyval
>> parser. Instead of being an error (because of a missing value) or a
>> value for an implied key, they now request help, which is a new boolean
>> output of the parser in addition to the QDict.
>> 
>> A new parameter 'p_help' is added to keyval_parse() that contains on
>> return whether help was requested. If NULL is passed, requesting help
>> results in an error and all other cases work like before.
>> 
>> Turning previous error cases into help is a compatible extension. The
>> behaviour potentially changes for implied keys: They could previously
>> get 'help' as their value, which is now interpreted as requesting help.
>> 
>> This is not a problem in practice because 'help' and '?' are not a valid
>> values for the implied key of any option parsed with keyval_parse():
>> 
>> * audiodev: union Audiodev, implied key "driver" is enum AudiodevDriver,
>>   "help" and "?" are not among its values
>> 
>> * display: union DisplayOptions, implied key "type" is enum
>>   DisplayType, "help" and "?" are not among its values
>> 
>> * blockdev: union BlockdevOptions, implied key "driver is enum
>>   BlockdevDriver, "help" and "?" are not among its values
>> 
>> * export: union BlockExport, implied key "type" is enum BlockExportType,
>>   "help" and "?" are not among its values
>> 
>> * monitor: struct MonitorOptions, implied key "mode" is enum MonitorMode,
>>   "help" and "?" are not among its values
>> 
>> * nbd-server: struct NbdServerOptions, no implied key.
>> 
>> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
>> Signed-off-by: Markus Armbruster <armbru@redhat.com>
>
>> diff --git a/tests/test-keyval.c b/tests/test-keyval.c
>> index 04c62cf045..7b459900af 100644
>> --- a/tests/test-keyval.c
>> +++ b/tests/test-keyval.c
>> @@ -1,3 +1,4 @@
>> +
>>  /*
>>   * Unit tests for parsing of KEY=VALUE,... strings
>>   *
>
> This hunk looks unintentional.

It is.  Thanks for fixing it up!




reply via email to

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