[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH v4 12/19] qapi: Add some type check tests
From: |
Markus Armbruster |
Subject: |
Re: [Qemu-devel] [PATCH v4 12/19] qapi: Add some type check tests |
Date: |
Thu, 25 Sep 2014 10:06:07 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux) |
Markus Armbruster <address@hidden> writes:
> Eric Blake <address@hidden> writes:
>
>> Demonstrate that the qapi generator silently parses confusing
>> types, which may cause other errors later on. Later patches
>> will update the expected results as the generator is made stricter.
[...]
>> diff --git a/tests/qapi-schema/returns-array-bad.json
>> b/tests/qapi-schema/returns-array-bad.json
>> new file mode 100644
>> index 0000000..14882c1
>> --- /dev/null
>> +++ b/tests/qapi-schema/returns-array-bad.json
>> @@ -0,0 +1,2 @@
>> +# FIXME: we should reject an array return that is not a single type
>> +{ 'command': 'oops', 'returns': [ 'str', 'str' ] }
Yes, we want this test, and your remaining tests of 'returns' are fine,
too.
> Do we want to permit anything but a complex type for 'returns'?
>
> For what it's worth, docs/qmp/qmp-spec.txt specifies:
>
> 2.4.1 success
> -------------
>
> The format of a success response is:
>
> { "return": json-object, "id": json-value }
>
> Where,
>
> - The "return" member contains the command returned data, which is defined
> in a per-command basis or an empty json-object if the command does not
> return data
> - The "id" member contains the transaction identification associated
> with the command execution if issued by the Client
>
> The QAPI schema's 'returns' becomes "return" on the wire. We suck.
>
> qmp-spec.txt is *wrong*! We actually use json-array in addition to
> json-object.
Actually, we use json-int and json-str as well:
query-migrate-cache-size, ringbuf-read, human-monitor-command.
> Similar argument on types wanted as for 'data' / "arguments" above. I
> think we should permit exactly the same QAPI types, plus lists.
The similarity to 'data' just isn't there. Separate analysis needed.
Any QAPI types that don't make sense, other than list with length != 1?
[...]
- Re: [Qemu-devel] [PATCH v4 11/19] qapi: Add tests of type bypass, (continued)
- [Qemu-devel] [PATCH v4 13/19] qapi: More rigourous checking of types, Eric Blake, 2014/09/19
- [Qemu-devel] [PATCH v4 07/19] qapi: Add some expr tests, Eric Blake, 2014/09/19
- [Qemu-devel] [PATCH v4 12/19] qapi: Add some type check tests, Eric Blake, 2014/09/19
- Re: [Qemu-devel] [PATCH v4 12/19] qapi: Add some type check tests, Markus Armbruster, 2014/09/25
- Re: [Qemu-devel] [PATCH v4 12/19] qapi: Add some type check tests,
Markus Armbruster <=
- Re: [Qemu-devel] [PATCH v4 12/19] qapi: Add some type check tests, Eric Blake, 2014/09/25
- Re: [Qemu-devel] [PATCH v4 12/19] qapi: Add some type check tests, Markus Armbruster, 2014/09/25
- Re: [Qemu-devel] [PATCH v4 12/19] qapi: Add some type check tests, Eric Blake, 2014/09/25
- Re: [Qemu-devel] [PATCH v4 12/19] qapi: Add some type check tests, Markus Armbruster, 2014/09/25
- Re: [Qemu-devel] [PATCH v4 12/19] qapi: Add some type check tests, Eric Blake, 2014/09/25
- [Qemu-devel] [PATCH v4 19/19] qapi: Drop support for inline subtypes, Eric Blake, 2014/09/19
- [Qemu-devel] [PATCH v4 06/19] qapi: Better error messages for bad enums, Eric Blake, 2014/09/19