Change xen_host_pci_sysfs_path() to return void
[qemu/ar7.git] / qapi / introspect.json
blob9e9369e160a55b021176cf11c438f39ea8e9dd45
1 # -*- Mode: Python -*-
3 # QAPI/QMP introspection
5 # Copyright (C) 2015 Red Hat, Inc.
7 # Authors:
8 #  Markus Armbruster <armbru@redhat.com>
10 # This work is licensed under the terms of the GNU GPL, version 2 or later.
11 # See the COPYING file in the top-level directory.
14 # @query-qmp-schema
16 # Command query-qmp-schema exposes the QMP wire ABI as an array of
17 # SchemaInfo.  This lets QMP clients figure out what commands and
18 # events are available in this QEMU, and their parameters and results.
20 # However, the SchemaInfo can't reflect all the rules and restrictions
21 # that apply to QMP.  It's interface introspection (figuring out
22 # what's there), not interface specification.  The specification is in
23 # the QAPI schema.
25 # Furthermore, while we strive to keep the QMP wire format
26 # backwards-compatible across qemu versions, the introspection output
27 # is not guaranteed to have the same stability.  For example, one
28 # version of qemu may list an object member as an optional
29 # non-variant, while another lists the same member only through the
30 # object's variants; or the type of a member may change from a generic
31 # string into a specific enum or from one specific type into an
32 # alternate that includes the original type alongside something else.
34 # Returns: array of @SchemaInfo, where each element describes an
35 # entity in the ABI: command, event, type, ...
37 # The order of the various SchemaInfo is unspecified; however, all
38 # names are guaranteed to be unique (no name will be duplicated with
39 # different meta-types).
41 # Note: the QAPI schema is also used to help define *internal*
42 # interfaces, by defining QAPI types.  These are not part of the QMP
43 # wire ABI, and therefore not returned by this command.
45 # Since: 2.5
47 { 'command': 'query-qmp-schema',
48   'returns': [ 'SchemaInfo' ],
49   'gen': false }                # just to simplify qmp_query_json()
52 # @SchemaMetaType
54 # This is a @SchemaInfo's meta type, i.e. the kind of entity it
55 # describes.
57 # @builtin: a predefined type such as 'int' or 'bool'.
59 # @enum: an enumeration type
61 # @array: an array type
63 # @object: an object type (struct or union)
65 # @alternate: an alternate type
67 # @command: a QMP command
69 # @event: a QMP event
71 # Since: 2.5
73 { 'enum': 'SchemaMetaType',
74   'data': [ 'builtin', 'enum', 'array', 'object', 'alternate',
75             'command', 'event' ] }
78 # @SchemaInfoBase
80 # Members common to any @SchemaInfo.
82 # Since: 2.5
84 { 'struct': 'SchemaInfoBase',
85   'data': { 'name': 'str', 'meta-type': 'SchemaMetaType' } }
88 # @SchemaInfo
90 # @name: the entity's name, inherited from @base.
91 #        Commands and events have the name defined in the QAPI schema.
92 #        Unlike command and event names, type names are not part of
93 #        the wire ABI.  Consequently, type names are meaningless
94 #        strings here, although they are still guaranteed unique
95 #        regardless of @meta-type.
97 # All references to other SchemaInfo are by name.
99 # @meta-type: the entity's meta type, inherited from @base.
101 # Additional members depend on the value of @meta-type.
103 # Since: 2.5
105 { 'union': 'SchemaInfo',
106   'base': 'SchemaInfoBase',
107   'discriminator': 'meta-type',
108   'data': {
109       'builtin': 'SchemaInfoBuiltin',
110       'enum': 'SchemaInfoEnum',
111       'array': 'SchemaInfoArray',
112       'object': 'SchemaInfoObject',
113       'alternate': 'SchemaInfoAlternate',
114       'command': 'SchemaInfoCommand',
115       'event': 'SchemaInfoEvent' } }
118 # @SchemaInfoBuiltin
120 # Additional SchemaInfo members for meta-type 'builtin'.
122 # @json-type: the JSON type used for this type on the wire.
124 # Since: 2.5
126 { 'struct': 'SchemaInfoBuiltin',
127   'data': { 'json-type': 'JSONType' } }
130 # @JSONType
132 # The four primitive and two structured types according to RFC 7159
133 # section 1, plus 'int' (split off 'number'), plus the obvious top
134 # type 'value'.
136 # Since: 2.5
138 { 'enum': 'JSONType',
139   'data': [ 'string', 'number', 'int', 'boolean', 'null',
140             'object', 'array', 'value' ] }
143 # @SchemaInfoEnum
145 # Additional SchemaInfo members for meta-type 'enum'.
147 # @values: the enumeration type's values, in no particular order.
149 # Values of this type are JSON string on the wire.
151 # Since: 2.5
153 { 'struct': 'SchemaInfoEnum',
154   'data': { 'values': ['str'] } }
157 # @SchemaInfoArray
159 # Additional SchemaInfo members for meta-type 'array'.
161 # @element-type: the array type's element type.
163 # Values of this type are JSON array on the wire.
165 # Since: 2.5
167 { 'struct': 'SchemaInfoArray',
168   'data': { 'element-type': 'str' } }
171 # @SchemaInfoObject
173 # Additional SchemaInfo members for meta-type 'object'.
175 # @members: the object type's (non-variant) members, in no particular order.
177 # @tag: #optional the name of the member serving as type tag.
178 #       An element of @members with this name must exist.
180 # @variants: #optional variant members, i.e. additional members that
181 #            depend on the type tag's value.  Present exactly when
182 #            @tag is present.  The variants are in no particular order,
183 #            and may even differ from the order of the values of the
184 #            enum type of the @tag.
186 # Values of this type are JSON object on the wire.
188 # Since: 2.5
190 { 'struct': 'SchemaInfoObject',
191   'data': { 'members': [ 'SchemaInfoObjectMember' ],
192             '*tag': 'str',
193             '*variants': [ 'SchemaInfoObjectVariant' ] } }
196 # @SchemaInfoObjectMember
198 # An object member.
200 # @name: the member's name, as defined in the QAPI schema.
202 # @type: the name of the member's type.
204 # @default: #optional default when used as command parameter.
205 #           If absent, the parameter is mandatory.
206 #           If present, the value must be null.  The parameter is
207 #           optional, and behavior when it's missing is not specified
208 #           here.
209 #           Future extension: if present and non-null, the parameter
210 #           is optional, and defaults to this value.
212 # Since: 2.5
214 { 'struct': 'SchemaInfoObjectMember',
215   'data': { 'name': 'str', 'type': 'str', '*default': 'any' } }
216 # @default's type must be null or match @type
219 # @SchemaInfoObjectVariant
221 # The variant members for a value of the type tag.
223 # @case: a value of the type tag.
225 # @type: the name of the object type that provides the variant members
226 #        when the type tag has value @case.
228 # Since: 2.5
230 { 'struct': 'SchemaInfoObjectVariant',
231   'data': { 'case': 'str', 'type': 'str' } }
234 # @SchemaInfoAlternate
236 # Additional SchemaInfo members for meta-type 'alternate'.
238 # @members: the alternate type's members, in no particular order.
239 #           The members' wire encoding is distinct, see
240 #           docs/qapi-code-gen.txt section Alternate types.
242 # On the wire, this can be any of the members.
244 # Since: 2.5
246 { 'struct': 'SchemaInfoAlternate',
247   'data': { 'members': [ 'SchemaInfoAlternateMember' ] } }
250 # @SchemaInfoAlternateMember
252 # An alternate member.
254 # @type: the name of the member's type.
256 # Since: 2.5
258 { 'struct': 'SchemaInfoAlternateMember',
259   'data': { 'type': 'str' } }
262 # @SchemaInfoCommand
264 # Additional SchemaInfo members for meta-type 'command'.
266 # @arg-type: the name of the object type that provides the command's
267 #            parameters.
269 # @ret-type: the name of the command's result type.
271 # TODO @success-response (currently irrelevant, because it's QGA, not QMP)
273 # Since: 2.5
275 { 'struct': 'SchemaInfoCommand',
276   'data': { 'arg-type': 'str', 'ret-type': 'str' } }
279 # @SchemaInfoEvent
281 # Additional SchemaInfo members for meta-type 'event'.
283 # @arg-type: the name of the object type that provides the event's
284 #            parameters.
286 # Since: 2.5
288 { 'struct': 'SchemaInfoEvent',
289   'data': { 'arg-type': 'str' } }