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 { 'include': 'authz.json' }
10 # = QEMU Object Model (QOM)
14 # @ObjectPropertyInfo:
16 # @name: the name of the property
18 # @type: the type of the property. This will typically come in one of four
21 # 1) A primitive type such as 'u8', 'u16', 'bool', 'str', or 'double'.
22 # These types are mapped to the appropriate JSON type.
24 # 2) A child type in the form 'child<subtype>' where subtype is a qdev
25 # device type name. Child properties create the composition tree.
27 # 3) A link type in the form 'link<subtype>' where subtype is a qdev
28 # device type name. Link properties form the device model graph.
30 # @description: if specified, the description of the property.
32 # @default-value: the default value, if any (since 5.0)
36 { 'struct': 'ObjectPropertyInfo',
37 'data': { 'name': 'str',
39 '*description': 'str',
40 '*default-value': 'any' } }
45 # This command will list any properties of a object given a path in the object
48 # @path: the path within the object model. See @qom-get for a description of
51 # Returns: a list of @ObjectPropertyInfo that describe the properties of the
58 # -> { "execute": "qom-list",
59 # "arguments": { "path": "/chardevs" } }
60 # <- { "return": [ { "name": "type", "type": "string" },
61 # { "name": "parallel0", "type": "child<chardev-vc>" },
62 # { "name": "serial0", "type": "child<chardev-vc>" },
63 # { "name": "mon0", "type": "child<chardev-stdio>" } ] }
66 { 'command': 'qom-list',
67 'data': { 'path': 'str' },
68 'returns': [ 'ObjectPropertyInfo' ],
69 'allow-preconfig': true }
74 # This command will get a property from a object model path and return the
77 # @path: The path within the object model. There are two forms of supported
78 # paths--absolute and partial paths.
80 # Absolute paths are derived from the root object and can follow child<>
81 # or link<> properties. Since they can follow link<> properties, they
82 # can be arbitrarily long. Absolute paths look like absolute filenames
83 # and are prefixed with a leading slash.
85 # Partial paths look like relative filenames. They do not begin
86 # with a prefix. The matching rules for partial paths are subtle but
87 # designed to make specifying objects easy. At each level of the
88 # composition tree, the partial path is matched as an absolute path.
89 # The first match is not returned. At least two matches are searched
90 # for. A successful result is only returned if only one match is
91 # found. If more than one match is found, a flag is return to
92 # indicate that the match was ambiguous.
94 # @property: The property name to read
96 # Returns: The property value. The type depends on the property
97 # type. child<> and link<> properties are returned as #str
98 # pathnames. All integer property types (u8, u16, etc) are
105 # 1. Use absolute path
107 # -> { "execute": "qom-get",
108 # "arguments": { "path": "/machine/unattached/device[0]",
109 # "property": "hotplugged" } }
110 # <- { "return": false }
112 # 2. Use partial path
114 # -> { "execute": "qom-get",
115 # "arguments": { "path": "unattached/sysbus",
116 # "property": "type" } }
117 # <- { "return": "System" }
120 { 'command': 'qom-get',
121 'data': { 'path': 'str', 'property': 'str' },
123 'allow-preconfig': true }
128 # This command will set a property from a object model path.
130 # @path: see @qom-get for a description of this parameter
132 # @property: the property name to set
134 # @value: a value who's type is appropriate for the property type. See @qom-get
135 # for a description of type mapping.
141 # -> { "execute": "qom-set",
142 # "arguments": { "path": "/machine",
143 # "property": "graphics",
145 # <- { "return": {} }
148 { 'command': 'qom-set',
149 'data': { 'path': 'str', 'property': 'str', 'value': 'any' },
150 'allow-preconfig': true }
155 # This structure describes a search result from @qom-list-types
157 # @name: the type name found in the search
159 # @abstract: the type is abstract and can't be directly instantiated.
160 # Omitted if false. (since 2.10)
162 # @parent: Name of parent type, if any (since 2.10)
166 { 'struct': 'ObjectTypeInfo',
167 'data': { 'name': 'str', '*abstract': 'bool', '*parent': 'str' } }
172 # This command will return a list of types given search parameters
174 # @implements: if specified, only return types that implement this type name
176 # @abstract: if true, include abstract types in the results
178 # Returns: a list of @ObjectTypeInfo or an empty list if no results are found
182 { 'command': 'qom-list-types',
183 'data': { '*implements': 'str', '*abstract': 'bool' },
184 'returns': [ 'ObjectTypeInfo' ],
185 'allow-preconfig': true }
188 # @qom-list-properties:
190 # List properties associated with a QOM object.
192 # @typename: the type name of an object
194 # Note: objects can create properties at runtime, for example to describe
195 # links between different devices and/or objects. These properties
196 # are not included in the output of this command.
198 # Returns: a list of ObjectPropertyInfo describing object properties
202 { 'command': 'qom-list-properties',
203 'data': { 'typename': 'str'},
204 'returns': [ 'ObjectPropertyInfo' ],
205 'allow-preconfig': true }
208 # @IothreadProperties:
210 # Properties for iothread objects.
212 # @poll-max-ns: the maximum number of nanoseconds to busy wait for events.
213 # 0 means polling is disabled (default: 32768 on POSIX hosts,
216 # @poll-grow: the multiplier used to increase the polling time when the
217 # algorithm detects it is missing events due to not polling long
218 # enough. 0 selects a default behaviour (default: 0)
220 # @poll-shrink: the divisor used to decrease the polling time when the
221 # algorithm detects it is spending too long polling without
222 # encountering events. 0 selects a default behaviour (default: 0)
226 { 'struct': 'IothreadProperties',
227 'data': { '*poll-max-ns': 'int',
229 '*poll-shrink': 'int' } }
236 { 'enum': 'ObjectType',
248 # Describes the options of a user creatable QOM object.
250 # @qom-type: the class name for the object to be created
252 # @id: the name of the new object
256 { 'union': 'ObjectOptions',
257 'base': { 'qom-type': 'ObjectType',
259 'discriminator': 'qom-type',
261 'authz-list': 'AuthZListProperties',
262 'authz-listfile': 'AuthZListFileProperties',
263 'authz-pam': 'AuthZPAMProperties',
264 'authz-simple': 'AuthZSimpleProperties',
265 'iothread': 'IothreadProperties'
271 # Create a QOM object.
273 # @qom-type: the class name for the object to be created
275 # @id: the name of the new object
277 # Additional arguments depend on qom-type and are passed to the backend
280 # Returns: Nothing on success
281 # Error if @qom-type is not a valid class name
287 # -> { "execute": "object-add",
288 # "arguments": { "qom-type": "rng-random", "id": "rng1",
289 # "filename": "/dev/hwrng" } }
290 # <- { "return": {} }
293 { 'command': 'object-add',
294 'data': {'qom-type': 'str', 'id': 'str'},
295 'gen': false } # so we can get the additional arguments
300 # Remove a QOM object.
302 # @id: the name of the QOM object to remove
304 # Returns: Nothing on success
305 # Error if @id is not a valid id for a QOM object
311 # -> { "execute": "object-del", "arguments": { "id": "rng1" } }
312 # <- { "return": {} }
315 { 'command': 'object-del', 'data': {'id': 'str'} }