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 <[email protected]>
Reviewed-by: Kevin Wolf <[email protected]>