diff options
author | Marc-André Lureau <marcandre.lureau@redhat.com> | 2018-07-03 17:56:35 +0200 |
---|---|---|
committer | Markus Armbruster <armbru@redhat.com> | 2018-07-03 18:21:24 +0200 |
commit | 967c885108f18e5065744719f7959ba5ea0a5b0d (patch) | |
tree | b2138075fca0ddc4ca19454502ed0c376b8bc190 /tests/qapi-schema/qapi-schema-test.out | |
parent | b07cd3e748b3f27a17c27afeee578dc4eedb8dd5 (diff) | |
download | qemu-967c885108f18e5065744719f7959ba5ea0a5b0d.zip qemu-967c885108f18e5065744719f7959ba5ea0a5b0d.tar.gz qemu-967c885108f18e5065744719f7959ba5ea0a5b0d.tar.bz2 |
qapi: add 'if' to top-level expressions
Accept 'if' key in top-level elements, accepted as string or list of
string type. The following patches will modify the test visitor to
check the value is correctly saved, and generate #if/#endif code (as a
single #if/endif line or a series for a list).
Example of 'if' key:
{ 'struct': 'TestIfStruct', 'data': { 'foo': 'int' },
'if': 'defined(TEST_IF_STRUCT)' }
The generated code is for now *unconditional*. Later patches generate
the conditionals.
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Reviewed-by: Markus Armbruster <armbru@redhat.com>
Message-Id: <20180703155648.11933-2-marcandre.lureau@redhat.com>
[Commit message and Documentation improved]
Signed-off-by: Markus Armbruster <armbru@redhat.com>
Diffstat (limited to 'tests/qapi-schema/qapi-schema-test.out')
-rw-r--r-- | tests/qapi-schema/qapi-schema-test.out | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/tests/qapi-schema/qapi-schema-test.out b/tests/qapi-schema/qapi-schema-test.out index 0dbcdaf..ed25e5b 100644 --- a/tests/qapi-schema/qapi-schema-test.out +++ b/tests/qapi-schema/qapi-schema-test.out @@ -36,6 +36,8 @@ object UserDefTwoDict object UserDefTwo member string0: str optional=False member dict1: UserDefTwoDict optional=False +object UserDefThree + member string0: str optional=False object ForceArrays member unused1: UserDefOneList optional=False member unused2: UserDefTwoList optional=False @@ -233,3 +235,27 @@ object q_obj___org.qemu_x-command-arg member d: __org.qemu_x-Alt optional=False command __org.qemu_x-command q_obj___org.qemu_x-command-arg -> __org.qemu_x-Union1 gen=True success_response=True boxed=False oob=False preconfig=False +object TestIfStruct + member foo: int optional=False +enum TestIfEnum ['foo', 'bar'] +object q_obj_TestStruct-wrapper + member data: TestStruct optional=False +enum TestIfUnionKind ['foo'] +object TestIfUnion + member type: TestIfUnionKind optional=False + tag type + case foo: q_obj_TestStruct-wrapper +alternate TestIfAlternate + tag type + case foo: int + case bar: TestStruct +object q_obj_TestIfCmd-arg + member foo: TestIfStruct optional=False +command TestIfCmd q_obj_TestIfCmd-arg -> UserDefThree + gen=True success_response=True boxed=False oob=False preconfig=False +command TestCmdReturnDefThree None -> UserDefThree + gen=True success_response=True boxed=False oob=False preconfig=False +object q_obj_TestIfEvent-arg + member foo: TestIfStruct optional=False +event TestIfEvent q_obj_TestIfEvent-arg + boxed=False |