[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-block] [Qemu-devel] [PATCH 19/24] qapi: Improve how keyval inp
From: |
Markus Armbruster |
Subject: |
Re: [Qemu-block] [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!
- [Qemu-block] [PATCH 06/24] qapi: Factor out common part of qobject input visitor creation, (continued)
- [Qemu-block] [PATCH 06/24] qapi: Factor out common part of qobject input visitor creation, Markus Armbruster, 2017/02/27
- [Qemu-block] [PATCH 11/24] test-qobject-input-visitor: Abort earlier on bad test input, Markus Armbruster, 2017/02/27
- [Qemu-block] [PATCH 02/24] tests: Fix gcov-files-test-qemu-opts-y, gcov-files-test-logging-y, Markus Armbruster, 2017/02/27
- [Qemu-block] [PATCH 08/24] qobject: Propagate parse errors through qobject_from_jsonv(), Markus Armbruster, 2017/02/27
- [Qemu-block] [PATCH 19/24] qapi: Improve how keyval input visitor reports unexpected dicts, Markus Armbruster, 2017/02/27
- [Qemu-block] [PATCH 12/24] qobject: Propagate parse errors through qobject_from_json(), Markus Armbruster, 2017/02/27
- [Qemu-block] [PATCH 22/24] qapi: New parse_qapi_name(), Markus Armbruster, 2017/02/27
- [Qemu-block] [PATCH 07/24] qapi: Factor out common qobject_input_get_keyval(), Markus Armbruster, 2017/02/27
- [Qemu-block] [PATCH 15/24] test-visitor-serialization: Pass &error_abort to qobject_from_json(), Markus Armbruster, 2017/02/27