]> git.proxmox.com Git - mirror_qemu.git/commit
qapi: Fix command with named empty argument type
authorEric Blake <eblake@redhat.com>
Thu, 17 Mar 2016 22:48:27 +0000 (16:48 -0600)
committerMarkus Armbruster <armbru@redhat.com>
Fri, 18 Mar 2016 09:29:25 +0000 (10:29 +0100)
commit972a110162677fe5155f68a718ec6e999cd059a7
treeb261494c40c0493beb52aeb01e0794ac8ec2e5a5
parent29f6bd15eb8a55ed37b2a443f7275b3d134eb2b2
qapi: Fix command with named empty argument type

The generator special-cased

 { 'command':'foo', 'data': {} }

to avoid emitting a visitor variable, but failed to see that

 { 'struct':'NamedEmptyType, 'data': {} }
 { 'command':'foo', 'data':'NamedEmptyType' }

needs the same treatment.  There, the generator happily generates a
visitor to get no arguments, and a visitor to destroy no arguments;
and the compiler isn't happy with that, as demonstrated by the updated
qapi-schema-test.json:

  tests/test-qmp-marshal.c: In function ‘qmp_marshal_user_def_cmd0’:
  tests/test-qmp-marshal.c:264:14: error: variable ‘v’ set but not used [-Werror=unused-but-set-variable]
       Visitor *v;
                ^

No change to generated code except for the testsuite addition.

Signed-off-by: Eric Blake <eblake@redhat.com>
Message-Id: <1458254921-17042-3-git-send-email-eblake@redhat.com>
Signed-off-by: Markus Armbruster <armbru@redhat.com>
scripts/qapi-commands.py
tests/qapi-schema/qapi-schema-test.json
tests/qapi-schema/qapi-schema-test.out
tests/test-qmp-commands.c