OSDN Git Service

qapi: More rigourous checking of types
authorEric Blake <eblake@redhat.com>
Mon, 4 May 2015 15:05:21 +0000 (09:05 -0600)
committerMarkus Armbruster <armbru@redhat.com>
Tue, 5 May 2015 16:39:01 +0000 (18:39 +0200)
commitdd883c6f0547f02ae805d02852ff3691f6d08f85
treecd92a7393c8dcf3ef4a02266e2a6db581b774858
parent0d8b9fb5f296a96723d98a45a6a00bfd4e45e1b9
qapi: More rigourous checking of types

Now that we know every expression is valid with regards to
its keys, we can add further tests that those keys refer to
valid types.  With this patch, all uses of a type (the 'data':
of command, type, union, alternate, and event; the 'returns':
of command; the 'base': of type and union) must resolve to an
appropriate subset of metatypes  declared by the current qapi
parse; this includes recursing into each member of a data
dictionary.  Dealing with '**' and nested anonymous structs
will be done in later patches.

Update the testsuite to match improved output.

Signed-off-by: Eric Blake <eblake@redhat.com>
Reviewed-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Markus Armbruster <armbru@redhat.com>
52 files changed:
scripts/qapi.py
tests/qapi-schema/alternate-array.err
tests/qapi-schema/alternate-nested.err
tests/qapi-schema/alternate-unknown.err
tests/qapi-schema/bad-base.err
tests/qapi-schema/bad-base.exit
tests/qapi-schema/bad-base.json
tests/qapi-schema/bad-base.out
tests/qapi-schema/bad-data.err
tests/qapi-schema/bad-data.exit
tests/qapi-schema/bad-data.json
tests/qapi-schema/bad-data.out
tests/qapi-schema/data-array-empty.err
tests/qapi-schema/data-array-empty.exit
tests/qapi-schema/data-array-empty.json
tests/qapi-schema/data-array-empty.out
tests/qapi-schema/data-array-unknown.err
tests/qapi-schema/data-array-unknown.exit
tests/qapi-schema/data-array-unknown.json
tests/qapi-schema/data-array-unknown.out
tests/qapi-schema/data-int.err
tests/qapi-schema/data-int.exit
tests/qapi-schema/data-int.json
tests/qapi-schema/data-int.out
tests/qapi-schema/data-member-array-bad.err
tests/qapi-schema/data-member-array-bad.exit
tests/qapi-schema/data-member-array-bad.json
tests/qapi-schema/data-member-array-bad.out
tests/qapi-schema/data-member-unknown.err
tests/qapi-schema/data-member-unknown.exit
tests/qapi-schema/data-member-unknown.json
tests/qapi-schema/data-member-unknown.out
tests/qapi-schema/data-unknown.err
tests/qapi-schema/data-unknown.exit
tests/qapi-schema/data-unknown.json
tests/qapi-schema/data-unknown.out
tests/qapi-schema/flat-union-int-branch.err
tests/qapi-schema/flat-union-int-branch.exit
tests/qapi-schema/flat-union-int-branch.json
tests/qapi-schema/flat-union-int-branch.out
tests/qapi-schema/returns-array-bad.err
tests/qapi-schema/returns-array-bad.exit
tests/qapi-schema/returns-array-bad.json
tests/qapi-schema/returns-array-bad.out
tests/qapi-schema/returns-unknown.err
tests/qapi-schema/returns-unknown.exit
tests/qapi-schema/returns-unknown.json
tests/qapi-schema/returns-unknown.out
tests/qapi-schema/union-unknown.err
tests/qapi-schema/union-unknown.exit
tests/qapi-schema/union-unknown.json
tests/qapi-schema/union-unknown.out