[Top][All Lists]

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

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

From: Kevin Wolf
Subject: Re: [Qemu-block] [PATCH 19/24] qapi: Improve how keyval input visitor reports unexpected dicts
Date: Tue, 28 Feb 2017 18:51:42 +0100
User-agent: Mutt/1.5.21 (2010-09-15)

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.

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>

reply via email to

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