qapi: More rigorous checking for type safety bypass
commit2cbf09925ad45401673a79ab77f67de2f04a826c
authorEric Blake <eblake@redhat.com>
Mon, 4 May 2015 15:05:24 +0000 (4 09:05 -0600)
committerMarkus Armbruster <armbru@redhat.com>
Tue, 5 May 2015 16:39:01 +0000 (5 18:39 +0200)
tree50fb23198c62297cdcc892e6d57301109621cfd4
parent10d4d997f86cf2a4ce89145df5658952d5722e56
qapi: More rigorous checking for type safety bypass

Now that we have a way to validate every type, we can also be
stricter about enforcing that callers that want to bypass
type safety in generated code.  Prior to this patch, it didn't
matter what value was associated with the key 'gen', but it
looked odd that 'gen':'yes' could result in bypassing the
generated code.  These changes also enforce the changes made
earlier in the series for documentation and consolidation of
using '**' as the wildcard type, as well as 'gen':false as the
canonical spelling for requesting type bypass.

Note that 'gen':false is a one-way switch away from the default;
we do not support 'gen':true (similar for 'success-response').
In practice, this doesn't matter.

Signed-off-by: Eric Blake <eblake@redhat.com>
Reviewed-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Markus Armbruster <armbru@redhat.com>
scripts/qapi.py
tests/qapi-schema/type-bypass-bad-gen.err
tests/qapi-schema/type-bypass-bad-gen.exit
tests/qapi-schema/type-bypass-bad-gen.json
tests/qapi-schema/type-bypass-bad-gen.out
tests/qapi-schema/type-bypass-no-gen.err
tests/qapi-schema/type-bypass-no-gen.exit
tests/qapi-schema/type-bypass-no-gen.json
tests/qapi-schema/type-bypass-no-gen.out