qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH 19/24] qapi: Improve how keyval input visitor re


From: Markus Armbruster
Subject: Re: [Qemu-devel] [PATCH 19/24] qapi: Improve how keyval input visitor reports unexpected dicts
Date: Tue, 28 Feb 2017 19:52:05 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1 (gnu/linux)

Kevin Wolf <address@hidden> writes:

> Am 27.02.2017 um 12:20 hat Markus Armbruster geschrieben:
>> Incorrect option
>> 
>>     -blockdev node-name=foo,driver=file,filename=foo.img,aio.unmap
>> 
>> is rejected with "Invalid parameter type for 'aio', expected: string".
>> To make sense of this, you almost have to translate it into the
>> equivalent QMP command
>> 
>>     { "execute": "blockdev-add", "arguments": { "node-name": "foo", 
>> "driver": "file", "filename": "foo.img", "aio": { "unmap": true } } }
>> 
>> Improve the error message to "Parameters 'aio.*' are unexpected".
>
> In fact, what I get (after fixing the previous review comments that
> would make it crash) is "Expected '=' after parameter 'aio.unmap'". Only
> if I add a value, I get the newly added message.

Fallout from ditching implied value sugar some time after this commit
message was written.  Will fix.

> Doesn't make the patch less correct, though.
>
>> Take care not to confuse the case "unexpected nested parameters"
>> (i.e. the object is a QDict or QList) with the case "non-string scalar
>> parameter".  The latter is a misuse of the visitor, and should perhaps
>> be an assertion.  Note that test-qobject-input-visitor exercises this
>> misuse in test_visitor_in_int_keyval(), test_visitor_in_bool_keyval()
>> and test_visitor_in_number_keyval().
>> 
>> Signed-off-by: Markus Armbruster <address@hidden>
>
> Reviewed-by: Kevin Wolf <address@hidden>

Thanks!



reply via email to

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