blob: 218ac7d55694b611a436b52920c855ce0717cee7 [file] [log] [blame]
Markus Armbruster8a847672018-02-11 10:35:54 +01001object q_empty
2enum QType ['none', 'qnull', 'qnum', 'qstring', 'qdict', 'qlist', 'qbool']
3 prefix QTYPE
Markus Armbrustercf40a0a2018-02-11 10:35:55 +01004module qapi-schema-test.json
Markus Armbruster8a847672018-02-11 10:35:54 +01005object TestStruct
6 member integer: int optional=False
7 member boolean: bool optional=False
8 member string: str optional=False
9object NestedEnumsOne
10 member enum1: EnumOne optional=False
11 member enum2: EnumOne optional=True
12 member enum3: EnumOne optional=False
13 member enum4: EnumOne optional=True
14enum MyEnum []
15object Empty1
16object Empty2
17 base Empty1
18command user_def_cmd0 Empty2 -> Empty2
Igor Mammedov7b13f2c2018-05-11 19:15:59 +020019 gen=True success_response=True boxed=False oob=False preconfig=False
Markus Armbruster8a847672018-02-11 10:35:54 +010020enum QEnumTwo ['value1', 'value2']
21 prefix QENUM_TWO
22object UserDefOne
23 base UserDefZero
24 member string: str optional=False
25 member enum1: EnumOne optional=True
Anton Nefedov800877b2018-06-18 11:40:05 +030026enum EnumOne ['value1', 'value2', 'value3', 'value4']
Markus Armbruster8a847672018-02-11 10:35:54 +010027object UserDefZero
28 member integer: int optional=False
29object UserDefTwoDictDict
30 member userdef: UserDefOne optional=False
31 member string: str optional=False
32object UserDefTwoDict
33 member string1: str optional=False
34 member dict2: UserDefTwoDictDict optional=False
35 member dict3: UserDefTwoDictDict optional=True
36object UserDefTwo
37 member string0: str optional=False
38 member dict1: UserDefTwoDict optional=False
Marc-André Lureau967c8852018-07-03 17:56:35 +020039object UserDefThree
40 member string0: str optional=False
Markus Armbruster8a847672018-02-11 10:35:54 +010041object ForceArrays
42 member unused1: UserDefOneList optional=False
43 member unused2: UserDefTwoList optional=False
44 member unused3: TestStructList optional=False
45object UserDefA
46 member boolean: bool optional=False
47 member a_b: int optional=True
48object UserDefB
49 member intb: int optional=False
50 member a-b: bool optional=True
51object UserDefFlatUnion
52 base UserDefUnionBase
53 tag enum1
54 case value1: UserDefA
55 case value2: UserDefB
56 case value3: UserDefB
Anton Nefedov800877b2018-06-18 11:40:05 +030057 case value4: q_empty
Markus Armbruster8a847672018-02-11 10:35:54 +010058object UserDefUnionBase
59 base UserDefZero
60 member string: str optional=False
61 member enum1: EnumOne optional=False
62object q_obj_UserDefFlatUnion2-base
63 member integer: int optional=True
64 member string: str optional=False
65 member enum1: QEnumTwo optional=False
66object UserDefFlatUnion2
67 base q_obj_UserDefFlatUnion2-base
68 tag enum1
69 case value1: UserDefC
70 case value2: UserDefB
71object WrapAlternate
72 member alt: UserDefAlternate optional=False
73alternate UserDefAlternate
74 tag type
75 case udfu: UserDefFlatUnion
76 case e: EnumOne
77 case i: int
78 case n: null
79object UserDefC
80 member string1: str optional=False
81 member string2: str optional=False
Markus Armbruster8168ca82017-05-22 18:42:14 +020082alternate AltEnumBool
83 tag type
84 case e: EnumOne
85 case b: bool
Markus Armbruster8168ca82017-05-22 18:42:14 +020086alternate AltEnumNum
87 tag type
88 case e: EnumOne
89 case n: number
Markus Armbruster8168ca82017-05-22 18:42:14 +020090alternate AltNumEnum
91 tag type
92 case n: number
93 case e: EnumOne
Markus Armbruster8a847672018-02-11 10:35:54 +010094alternate AltEnumInt
95 tag type
96 case e: EnumOne
97 case i: int
Markus Armbrusterc0644772017-05-22 18:42:15 +020098alternate AltStrObj
Eric Blakeda9cb192016-07-13 21:50:15 -060099 tag type
Eric Blake9c51b442015-09-29 16:21:06 -0600100 case s: str
Markus Armbrusterc0644772017-05-22 18:42:15 +0200101 case o: TestStruct
Markus Armbruster8a847672018-02-11 10:35:54 +0100102object q_obj_intList-wrapper
103 member data: intList optional=False
104object q_obj_int8List-wrapper
105 member data: int8List optional=False
106object q_obj_int16List-wrapper
107 member data: int16List optional=False
108object q_obj_int32List-wrapper
109 member data: int32List optional=False
110object q_obj_int64List-wrapper
111 member data: int64List optional=False
112object q_obj_uint8List-wrapper
113 member data: uint8List optional=False
114object q_obj_uint16List-wrapper
115 member data: uint16List optional=False
116object q_obj_uint32List-wrapper
117 member data: uint32List optional=False
118object q_obj_uint64List-wrapper
119 member data: uint64List optional=False
120object q_obj_numberList-wrapper
121 member data: numberList optional=False
122object q_obj_boolList-wrapper
123 member data: boolList optional=False
124object q_obj_strList-wrapper
125 member data: strList optional=False
126object q_obj_sizeList-wrapper
127 member data: sizeList optional=False
128object q_obj_anyList-wrapper
129 member data: anyList optional=False
130enum UserDefNativeListUnionKind ['integer', 's8', 's16', 's32', 's64', 'u8', 'u16', 'u32', 'u64', 'number', 'boolean', 'string', 'sizes', 'any']
Markus Armbruster156402e2015-09-16 13:06:08 +0200131object UserDefNativeListUnion
Eric Blakeda34a9b2015-11-18 01:52:36 -0700132 member type: UserDefNativeListUnionKind optional=False
Eric Blakeda9cb192016-07-13 21:50:15 -0600133 tag type
Eric Blake75996972016-03-17 16:48:29 -0600134 case integer: q_obj_intList-wrapper
135 case s8: q_obj_int8List-wrapper
136 case s16: q_obj_int16List-wrapper
137 case s32: q_obj_int32List-wrapper
138 case s64: q_obj_int64List-wrapper
139 case u8: q_obj_uint8List-wrapper
140 case u16: q_obj_uint16List-wrapper
141 case u32: q_obj_uint32List-wrapper
142 case u64: q_obj_uint64List-wrapper
143 case number: q_obj_numberList-wrapper
144 case boolean: q_obj_boolList-wrapper
145 case string: q_obj_strList-wrapper
146 case sizes: q_obj_sizeList-wrapper
147 case any: q_obj_anyList-wrapper
Markus Armbruster8a847672018-02-11 10:35:54 +0100148command user_def_cmd None -> None
Igor Mammedov7b13f2c2018-05-11 19:15:59 +0200149 gen=True success_response=True boxed=False oob=False preconfig=False
Markus Armbruster8a847672018-02-11 10:35:54 +0100150object q_obj_user_def_cmd1-arg
151 member ud1a: UserDefOne optional=False
152command user_def_cmd1 q_obj_user_def_cmd1-arg -> None
Igor Mammedov7b13f2c2018-05-11 19:15:59 +0200153 gen=True success_response=True boxed=False oob=False preconfig=False
Markus Armbruster8a847672018-02-11 10:35:54 +0100154object q_obj_user_def_cmd2-arg
155 member ud1a: UserDefOne optional=False
156 member ud1b: UserDefOne optional=True
157command user_def_cmd2 q_obj_user_def_cmd2-arg -> UserDefTwo
Igor Mammedov7b13f2c2018-05-11 19:15:59 +0200158 gen=True success_response=True boxed=False oob=False preconfig=False
Marc-André Lureauae6bf762018-08-30 17:58:10 +0200159command cmd-success-response None -> None
160 gen=True success_response=False boxed=False oob=False preconfig=False
Markus Armbruster8a847672018-02-11 10:35:54 +0100161object q_obj_guest-get-time-arg
162 member a: int optional=False
163 member b: int optional=True
164command guest-get-time q_obj_guest-get-time-arg -> int
Igor Mammedov7b13f2c2018-05-11 19:15:59 +0200165 gen=True success_response=True boxed=False oob=False preconfig=False
Markus Armbruster8a847672018-02-11 10:35:54 +0100166object q_obj_guest-sync-arg
167 member arg: any optional=False
168command guest-sync q_obj_guest-sync-arg -> any
Igor Mammedov7b13f2c2018-05-11 19:15:59 +0200169 gen=True success_response=True boxed=False oob=False preconfig=False
Markus Armbruster8a847672018-02-11 10:35:54 +0100170command boxed-struct UserDefZero -> None
Igor Mammedov7b13f2c2018-05-11 19:15:59 +0200171 gen=True success_response=True boxed=True oob=False preconfig=False
Markus Armbruster8a847672018-02-11 10:35:54 +0100172command boxed-union UserDefNativeListUnion -> None
Igor Mammedov7b13f2c2018-05-11 19:15:59 +0200173 gen=True success_response=True boxed=True oob=False preconfig=False
174command test-flags-command None -> None
175 gen=True success_response=True boxed=False oob=True preconfig=True
Markus Armbruster156402e2015-09-16 13:06:08 +0200176object UserDefOptions
177 member i64: intList optional=True
178 member u64: uint64List optional=True
179 member u16: uint16List optional=True
180 member i64x: int optional=True
181 member u64x: uint64 optional=True
Markus Armbruster8a847672018-02-11 10:35:54 +0100182object EventStructOne
183 member struct1: UserDefOne optional=False
Markus Armbruster156402e2015-09-16 13:06:08 +0200184 member string: str optional=False
Markus Armbruster8a847672018-02-11 10:35:54 +0100185 member enum2: EnumOne optional=True
186event EVENT_A None
Eric Blake48825ca2016-07-13 21:50:19 -0600187 boxed=False
Markus Armbruster8a847672018-02-11 10:35:54 +0100188event EVENT_B None
189 boxed=False
Eric Blake75996972016-03-17 16:48:29 -0600190object q_obj_EVENT_C-arg
191 member a: int optional=True
192 member b: UserDefOne optional=True
193 member c: str optional=False
Markus Armbruster8a847672018-02-11 10:35:54 +0100194event EVENT_C q_obj_EVENT_C-arg
195 boxed=False
Eric Blake75996972016-03-17 16:48:29 -0600196object q_obj_EVENT_D-arg
197 member a: EventStructOne optional=False
198 member b: str optional=False
199 member c: str optional=True
200 member enum3: EnumOne optional=True
Markus Armbruster8a847672018-02-11 10:35:54 +0100201event EVENT_D q_obj_EVENT_D-arg
202 boxed=False
203event EVENT_E UserDefZero
204 boxed=True
205event EVENT_F UserDefAlternate
206 boxed=True
207enum __org.qemu_x-Enum ['__org.qemu_x-value']
208object __org.qemu_x-Base
209 member __org.qemu_x-member1: __org.qemu_x-Enum optional=False
210object __org.qemu_x-Struct
211 base __org.qemu_x-Base
212 member __org.qemu_x-member2: str optional=False
213 member wchar-t: int optional=True
214object q_obj_str-wrapper
215 member data: str optional=False
216enum __org.qemu_x-Union1Kind ['__org.qemu_x-branch']
217object __org.qemu_x-Union1
218 member type: __org.qemu_x-Union1Kind optional=False
219 tag type
220 case __org.qemu_x-branch: q_obj_str-wrapper
221object __org.qemu_x-Struct2
222 member array: __org.qemu_x-Union1List optional=False
223object __org.qemu_x-Union2
224 base __org.qemu_x-Base
225 tag __org.qemu_x-member1
226 case __org.qemu_x-value: __org.qemu_x-Struct2
227alternate __org.qemu_x-Alt
228 tag type
229 case __org.qemu_x-branch: str
230 case b: __org.qemu_x-Base
231event __ORG.QEMU_X-EVENT __org.qemu_x-Struct
232 boxed=False
Eric Blake75996972016-03-17 16:48:29 -0600233object q_obj___org.qemu_x-command-arg
234 member a: __org.qemu_x-EnumList optional=False
235 member b: __org.qemu_x-StructList optional=False
236 member c: __org.qemu_x-Union2 optional=False
237 member d: __org.qemu_x-Alt optional=False
Markus Armbruster8a847672018-02-11 10:35:54 +0100238command __org.qemu_x-command q_obj___org.qemu_x-command-arg -> __org.qemu_x-Union1
Igor Mammedov7b13f2c2018-05-11 19:15:59 +0200239 gen=True success_response=True boxed=False oob=False preconfig=False
Marc-André Lureau967c8852018-07-03 17:56:35 +0200240object TestIfStruct
241 member foo: int optional=False
Marc-André Lureaufbf09a22018-07-03 17:56:38 +0200242 if ['defined(TEST_IF_STRUCT)']
Marc-André Lureau967c8852018-07-03 17:56:35 +0200243enum TestIfEnum ['foo', 'bar']
Marc-André Lureaufbf09a22018-07-03 17:56:38 +0200244 if ['defined(TEST_IF_ENUM)']
Marc-André Lureau967c8852018-07-03 17:56:35 +0200245object q_obj_TestStruct-wrapper
246 member data: TestStruct optional=False
247enum TestIfUnionKind ['foo']
Marc-André Lureaufbf09a22018-07-03 17:56:38 +0200248 if ['defined(TEST_IF_UNION) && defined(TEST_IF_STRUCT)']
Marc-André Lureau967c8852018-07-03 17:56:35 +0200249object TestIfUnion
250 member type: TestIfUnionKind optional=False
251 tag type
252 case foo: q_obj_TestStruct-wrapper
Marc-André Lureaufbf09a22018-07-03 17:56:38 +0200253 if ['defined(TEST_IF_UNION) && defined(TEST_IF_STRUCT)']
Marc-André Lureau967c8852018-07-03 17:56:35 +0200254alternate TestIfAlternate
255 tag type
256 case foo: int
257 case bar: TestStruct
Marc-André Lureaufbf09a22018-07-03 17:56:38 +0200258 if ['defined(TEST_IF_ALT) && defined(TEST_IF_STRUCT)']
Marc-André Lureau967c8852018-07-03 17:56:35 +0200259object q_obj_TestIfCmd-arg
260 member foo: TestIfStruct optional=False
Marc-André Lureaufbf09a22018-07-03 17:56:38 +0200261 if ['defined(TEST_IF_CMD)', 'defined(TEST_IF_STRUCT)']
Marc-André Lureau967c8852018-07-03 17:56:35 +0200262command TestIfCmd q_obj_TestIfCmd-arg -> UserDefThree
263 gen=True success_response=True boxed=False oob=False preconfig=False
Marc-André Lureaufbf09a22018-07-03 17:56:38 +0200264 if ['defined(TEST_IF_CMD)', 'defined(TEST_IF_STRUCT)']
Marc-André Lureau967c8852018-07-03 17:56:35 +0200265command TestCmdReturnDefThree None -> UserDefThree
266 gen=True success_response=True boxed=False oob=False preconfig=False
267object q_obj_TestIfEvent-arg
268 member foo: TestIfStruct optional=False
Marc-André Lureaufbf09a22018-07-03 17:56:38 +0200269 if ['defined(TEST_IF_EVT) && defined(TEST_IF_STRUCT)']
Marc-André Lureau967c8852018-07-03 17:56:35 +0200270event TestIfEvent q_obj_TestIfEvent-arg
271 boxed=False
Marc-André Lureaufbf09a22018-07-03 17:56:38 +0200272 if ['defined(TEST_IF_EVT) && defined(TEST_IF_STRUCT)']