]> git.proxmox.com Git - mirror_qemu.git/commit - qga/qapi-schema.json
qapi: Unify type bypass and add tests
authorEric Blake <eblake@redhat.com>
Mon, 4 May 2015 15:05:19 +0000 (09:05 -0600)
committerMarkus Armbruster <armbru@redhat.com>
Tue, 5 May 2015 16:39:01 +0000 (18:39 +0200)
commitd708cdbe8792a55f53e90c1c787e871d527e8d4b
tree9728fa21413b9a9ec3360db47593e920d2aa6bec
parente53188ada516c814a729551be2448684d6d8ce08
qapi: Unify type bypass and add tests

For a few QMP commands, we are forced to pass an arbitrary type
without tracking it properly in QAPI.  Among the existing clients,
this unnamed type was spelled 'dict', 'visitor', and '**'; this
patch standardizes on '**', matching the documentation changes
earlier in the series.

Meanwhile, for the 'gen' key, we have been ignoring the value,
although the schema consistently used "'no'" ('success-response'
was hard-coded to checking for 'no').  But now that we can support
a literal "false" in the schema, we might as well use that rather
than ignoring the value or special-casing a random string.  Note
that these are one-way switches (use of 'gen':true is not the same
as omitting 'gen'). Also, the use of '**' requires 'gen':false,
but the use of 'gen':false does not mandate the use of '**'.

There is no difference to the generated code.  Add some tests on
what we'd like to guarantee, although it will take later patches
to clean up test results and actually enforce the use of a bool
parameter.

Signed-off-by: Eric Blake <eblake@redhat.com>
Reviewed-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Markus Armbruster <armbru@redhat.com>
16 files changed:
qapi-schema.json
qga/qapi-schema.json
scripts/qapi-commands.py
tests/Makefile
tests/qapi-schema/type-bypass-bad-gen.err [new file with mode: 0644]
tests/qapi-schema/type-bypass-bad-gen.exit [new file with mode: 0644]
tests/qapi-schema/type-bypass-bad-gen.json [new file with mode: 0644]
tests/qapi-schema/type-bypass-bad-gen.out [new file with mode: 0644]
tests/qapi-schema/type-bypass-no-gen.err [new file with mode: 0644]
tests/qapi-schema/type-bypass-no-gen.exit [new file with mode: 0644]
tests/qapi-schema/type-bypass-no-gen.json [new file with mode: 0644]
tests/qapi-schema/type-bypass-no-gen.out [new file with mode: 0644]
tests/qapi-schema/type-bypass.err [new file with mode: 0644]
tests/qapi-schema/type-bypass.exit [new file with mode: 0644]
tests/qapi-schema/type-bypass.json [new file with mode: 0644]
tests/qapi-schema/type-bypass.out [new file with mode: 0644]