[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH 20/26] qapi: Fix to reject union command and eve
From: |
Eric Blake |
Subject: |
Re: [Qemu-devel] [PATCH 20/26] qapi: Fix to reject union command and event arguments |
Date: |
Mon, 17 Aug 2015 12:14:51 -0700 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.1.0 |
On 08/04/2015 02:18 AM, Markus Armbruster wrote:
> A command's or event's 'data' must be a struct type, given either as a
> dictionary, or as struct type name.
>
> Commit dd883c6 tightened the checking there, but not enough: we still
> accept 'union'. Fix to reject it.
>
> We may want to support union types there, but we'll have to extend
> qapi-commands.py and qapi-events.py for it.
>
> Signed-off-by: Markus Armbruster <address@hidden>
> ---
> scripts/qapi.py | 4 ++--
> tests/qapi-schema/args-union.err | 1 +
> tests/qapi-schema/args-union.exit | 2 +-
> tests/qapi-schema/args-union.json | 2 +-
> tests/qapi-schema/args-union.out | 4 ----
> 5 files changed, 5 insertions(+), 8 deletions(-)
Our documentation is also wrong; you may want to squash this in:
diff --git i/docs/qapi-code-gen.txt w/docs/qapi-code-gen.txt
index 688a60c..4652a75 100644
--- i/docs/qapi-code-gen.txt
+++ w/docs/qapi-code-gen.txt
@@ -408,10 +408,9 @@ Client JSON Protocol command exchange.
The 'data' argument maps to the "arguments" dictionary passed in as
part of a Client JSON Protocol command. The 'data' member is optional
and defaults to {} (an empty dictionary). If present, it must be the
-string name of a complex type, a one-element array containing the name
-of a complex type, or a dictionary that declares an anonymous type
-with the same semantics as a 'struct' expression, with one exception
-noted below when 'gen' is used.
+string name of a complex type, or a dictionary that declares an
+anonymous type with the same semantics as a 'struct' expression, with
+one exception noted below when 'gen' is used.
The 'returns' member describes what will appear in the "return" field
of a Client JSON Protocol reply on successful completion of a command.
--
Eric Blake eblake redhat com +1-919-301-3266
Libvirt virtualization library http://libvirt.org
signature.asc
Description: OpenPGP digital signature
- [Qemu-devel] [PATCH 10/26] qapi-visit: Replace list implicit_structs by set, (continued)
- [Qemu-devel] [PATCH 10/26] qapi-visit: Replace list implicit_structs by set, Markus Armbruster, 2015/08/04
- [Qemu-devel] [PATCH 15/26] qapi: Document shortcoming with union 'data' branch, Markus Armbruster, 2015/08/04
- [Qemu-devel] [PATCH 02/26] qapi: Clean up cgen() and mcgen(), Markus Armbruster, 2015/08/04
- [Qemu-devel] [PATCH 07/26] qapi: Fix generated code when flat union has member 'kind', Markus Armbruster, 2015/08/04
- [Qemu-devel] [PATCH 20/26] qapi: Fix to reject union command and event arguments, Markus Armbruster, 2015/08/04
- [Qemu-devel] [PATCH 25/26] qapi-commands: Drop useless initialization, Markus Armbruster, 2015/08/04
- [Qemu-devel] [PATCH 16/26] qapi: Document flaws in checking of names, Markus Armbruster, 2015/08/04
- [Qemu-devel] [PATCH 17/26] tests/qapi-schema: Restore test case for flat union base bug, Markus Armbruster, 2015/08/04
- [Qemu-devel] [PATCH 14/26] qapi: Document that input visitor semantics are prone to leaks, Markus Armbruster, 2015/08/04
- [Qemu-devel] [PATCH 19/26] qapi-tests: New tests for union, alternate command arguments, Markus Armbruster, 2015/08/04
- [Qemu-devel] [PATCH 03/26] qapi: Simplify guardname(), Markus Armbruster, 2015/08/04
- [Qemu-devel] [PATCH 13/26] tests/qapi-schema: Document events with base don't work, Markus Armbruster, 2015/08/04