target/mips: Simplify decode_opc_mxu() ifdef'ry
[qemu/ar7.git] / qapi / qom.json
blob0b0b92944ba0376a79adce0a17b5b761df80c3db
1 # -*- Mode: Python -*-
2 # vim: filetype=python
4 # This work is licensed under the terms of the GNU GPL, version 2 or later.
5 # See the COPYING file in the top-level directory.
7 ##
8 # = QEMU Object Model (QOM)
9 ##
12 # @ObjectPropertyInfo:
14 # @name: the name of the property
16 # @type: the type of the property.  This will typically come in one of four
17 #        forms:
19 #        1) A primitive type such as 'u8', 'u16', 'bool', 'str', or 'double'.
20 #           These types are mapped to the appropriate JSON type.
22 #        2) A child type in the form 'child<subtype>' where subtype is a qdev
23 #           device type name.  Child properties create the composition tree.
25 #        3) A link type in the form 'link<subtype>' where subtype is a qdev
26 #           device type name.  Link properties form the device model graph.
28 # @description: if specified, the description of the property.
30 # @default-value: the default value, if any (since 5.0)
32 # Since: 1.2
34 { 'struct': 'ObjectPropertyInfo',
35   'data': { 'name': 'str',
36             'type': 'str',
37             '*description': 'str',
38             '*default-value': 'any' } }
41 # @qom-list:
43 # This command will list any properties of a object given a path in the object
44 # model.
46 # @path: the path within the object model.  See @qom-get for a description of
47 #        this parameter.
49 # Returns: a list of @ObjectPropertyInfo that describe the properties of the
50 #          object.
52 # Since: 1.2
54 # Example:
56 # -> { "execute": "qom-list",
57 #      "arguments": { "path": "/chardevs" } }
58 # <- { "return": [ { "name": "type", "type": "string" },
59 #                  { "name": "parallel0", "type": "child<chardev-vc>" },
60 #                  { "name": "serial0", "type": "child<chardev-vc>" },
61 #                  { "name": "mon0", "type": "child<chardev-stdio>" } ] }
64 { 'command': 'qom-list',
65   'data': { 'path': 'str' },
66   'returns': [ 'ObjectPropertyInfo' ],
67   'allow-preconfig': true }
70 # @qom-get:
72 # This command will get a property from a object model path and return the
73 # value.
75 # @path: The path within the object model.  There are two forms of supported
76 #        paths--absolute and partial paths.
78 #        Absolute paths are derived from the root object and can follow child<>
79 #        or link<> properties.  Since they can follow link<> properties, they
80 #        can be arbitrarily long.  Absolute paths look like absolute filenames
81 #        and are prefixed  with a leading slash.
83 #        Partial paths look like relative filenames.  They do not begin
84 #        with a prefix.  The matching rules for partial paths are subtle but
85 #        designed to make specifying objects easy.  At each level of the
86 #        composition tree, the partial path is matched as an absolute path.
87 #        The first match is not returned.  At least two matches are searched
88 #        for.  A successful result is only returned if only one match is
89 #        found.  If more than one match is found, a flag is return to
90 #        indicate that the match was ambiguous.
92 # @property: The property name to read
94 # Returns: The property value.  The type depends on the property
95 #          type. child<> and link<> properties are returned as #str
96 #          pathnames.  All integer property types (u8, u16, etc) are
97 #          returned as #int.
99 # Since: 1.2
101 # Example:
103 # 1. Use absolute path
105 # -> { "execute": "qom-get",
106 #      "arguments": { "path": "/machine/unattached/device[0]",
107 #                     "property": "hotplugged" } }
108 # <- { "return": false }
110 # 2. Use partial path
112 # -> { "execute": "qom-get",
113 #      "arguments": { "path": "unattached/sysbus",
114 #                     "property": "type" } }
115 # <- { "return": "System" }
118 { 'command': 'qom-get',
119   'data': { 'path': 'str', 'property': 'str' },
120   'returns': 'any',
121   'allow-preconfig': true }
124 # @qom-set:
126 # This command will set a property from a object model path.
128 # @path: see @qom-get for a description of this parameter
130 # @property: the property name to set
132 # @value: a value who's type is appropriate for the property type.  See @qom-get
133 #         for a description of type mapping.
135 # Since: 1.2
137 # Example:
139 # -> { "execute": "qom-set",
140 #      "arguments": { "path": "/machine",
141 #                     "property": "graphics",
142 #                     "value": false } }
143 # <- { "return": {} }
146 { 'command': 'qom-set',
147   'data': { 'path': 'str', 'property': 'str', 'value': 'any' },
148   'allow-preconfig': true }
151 # @ObjectTypeInfo:
153 # This structure describes a search result from @qom-list-types
155 # @name: the type name found in the search
157 # @abstract: the type is abstract and can't be directly instantiated.
158 #            Omitted if false. (since 2.10)
160 # @parent: Name of parent type, if any (since 2.10)
162 # Since: 1.1
164 { 'struct': 'ObjectTypeInfo',
165   'data': { 'name': 'str', '*abstract': 'bool', '*parent': 'str' } }
168 # @qom-list-types:
170 # This command will return a list of types given search parameters
172 # @implements: if specified, only return types that implement this type name
174 # @abstract: if true, include abstract types in the results
176 # Returns: a list of @ObjectTypeInfo or an empty list if no results are found
178 # Since: 1.1
180 { 'command': 'qom-list-types',
181   'data': { '*implements': 'str', '*abstract': 'bool' },
182   'returns': [ 'ObjectTypeInfo' ],
183   'allow-preconfig': true }
186 # @qom-list-properties:
188 # List properties associated with a QOM object.
190 # @typename: the type name of an object
192 # Note: objects can create properties at runtime, for example to describe
193 #       links between different devices and/or objects. These properties
194 #       are not included in the output of this command.
196 # Returns: a list of ObjectPropertyInfo describing object properties
198 # Since: 2.12
200 { 'command': 'qom-list-properties',
201   'data': { 'typename': 'str'},
202   'returns': [ 'ObjectPropertyInfo' ],
203   'allow-preconfig': true }
206 # @object-add:
208 # Create a QOM object.
210 # @qom-type: the class name for the object to be created
212 # @id: the name of the new object
214 # @props: a dictionary of properties to be passed to the backend. Deprecated
215 #         since 5.0, specify the properties on the top level instead. It is an
216 #         error to specify the same option both on the top level and in @props.
218 # Additional arguments depend on qom-type and are passed to the backend
219 # unchanged.
221 # Returns: Nothing on success
222 #          Error if @qom-type is not a valid class name
224 # Since: 2.0
226 # Example:
228 # -> { "execute": "object-add",
229 #      "arguments": { "qom-type": "rng-random", "id": "rng1",
230 #                     "filename": "/dev/hwrng" } }
231 # <- { "return": {} }
234 { 'command': 'object-add',
235   'data': {'qom-type': 'str', 'id': 'str', '*props': 'any'},
236   'gen': false } # so we can get the additional arguments
239 # @object-del:
241 # Remove a QOM object.
243 # @id: the name of the QOM object to remove
245 # Returns: Nothing on success
246 #          Error if @id is not a valid id for a QOM object
248 # Since: 2.0
250 # Example:
252 # -> { "execute": "object-del", "arguments": { "id": "rng1" } }
253 # <- { "return": {} }
256 { 'command': 'object-del', 'data': {'id': 'str'} }