xref: /openbmc/qemu/qapi/qom.json (revision 29318db1)
1# -*- Mode: Python -*-
2# vim: filetype=python
3#
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.
6
7{ 'include': 'authz.json' }
8{ 'include': 'block-core.json' }
9{ 'include': 'common.json' }
10{ 'include': 'crypto.json' }
11
12##
13# = QEMU Object Model (QOM)
14##
15
16##
17# @ObjectPropertyInfo:
18#
19# @name: the name of the property
20#
21# @type: the type of the property.  This will typically come in one of
22#     four forms:
23#
24#     1) A primitive type such as 'u8', 'u16', 'bool', 'str', or
25#        'double'.  These types are mapped to the appropriate JSON
26#        type.
27#
28#     2) A child type in the form 'child<subtype>' where subtype is a
29#        qdev device type name.  Child properties create the
30#        composition tree.
31#
32#     3) A link type in the form 'link<subtype>' where subtype is a
33#        qdev device type name.  Link properties form the device model
34#        graph.
35#
36# @description: if specified, the description of the property.
37#
38# @default-value: the default value, if any (since 5.0)
39#
40# Since: 1.2
41##
42{ 'struct': 'ObjectPropertyInfo',
43  'data': { 'name': 'str',
44            'type': 'str',
45            '*description': 'str',
46            '*default-value': 'any' } }
47
48##
49# @qom-list:
50#
51# This command will list any properties of a object given a path in
52# the object model.
53#
54# @path: the path within the object model.  See @qom-get for a
55#     description of this parameter.
56#
57# Returns: a list of @ObjectPropertyInfo that describe the properties
58#     of the object.
59#
60# Since: 1.2
61#
62# .. qmp-example::
63#
64#     -> { "execute": "qom-list",
65#          "arguments": { "path": "/chardevs" } }
66#     <- { "return": [ { "name": "type", "type": "string" },
67#                      { "name": "parallel0", "type": "child<chardev-vc>" },
68#                      { "name": "serial0", "type": "child<chardev-vc>" },
69#                      { "name": "mon0", "type": "child<chardev-stdio>" } ] }
70##
71{ 'command': 'qom-list',
72  'data': { 'path': 'str' },
73  'returns': [ 'ObjectPropertyInfo' ],
74  'allow-preconfig': true }
75
76##
77# @qom-get:
78#
79# This command will get a property from a object model path and return
80# the value.
81#
82# @path: The path within the object model.  There are two forms of
83#     supported paths--absolute and partial paths.
84#
85#     Absolute paths are derived from the root object and can follow
86#     child<> or link<> properties.  Since they can follow link<>
87#     properties, they can be arbitrarily long.  Absolute paths look
88#     like absolute filenames and are prefixed  with a leading slash.
89#
90#     Partial paths look like relative filenames.  They do not begin
91#     with a prefix.  The matching rules for partial paths are subtle
92#     but designed to make specifying objects easy.  At each level of
93#     the composition tree, the partial path is matched as an absolute
94#     path.  The first match is not returned.  At least two matches
95#     are searched for.  A successful result is only returned if only
96#     one match is found.  If more than one match is found, a flag is
97#     return to indicate that the match was ambiguous.
98#
99# @property: The property name to read
100#
101# Returns: The property value.  The type depends on the property type.
102#     child<> and link<> properties are returned as #str pathnames.
103#     All integer property types (u8, u16, etc) are returned as #int.
104#
105# Since: 1.2
106#
107# .. qmp-example::
108#    :title: Use absolute path
109#
110#     -> { "execute": "qom-get",
111#          "arguments": { "path": "/machine/unattached/device[0]",
112#                         "property": "hotplugged" } }
113#     <- { "return": false }
114#
115# .. qmp-example::
116#    :title: Use partial path
117#
118#     -> { "execute": "qom-get",
119#          "arguments": { "path": "unattached/sysbus",
120#                         "property": "type" } }
121#     <- { "return": "System" }
122##
123{ 'command': 'qom-get',
124  'data': { 'path': 'str', 'property': 'str' },
125  'returns': 'any',
126  'allow-preconfig': true }
127
128##
129# @qom-set:
130#
131# This command will set a property from a object model path.
132#
133# @path: see @qom-get for a description of this parameter
134#
135# @property: the property name to set
136#
137# @value: a value who's type is appropriate for the property type.
138#     See @qom-get for a description of type mapping.
139#
140# Since: 1.2
141#
142# .. qmp-example::
143#
144#     -> { "execute": "qom-set",
145#          "arguments": { "path": "/machine",
146#                         "property": "graphics",
147#                         "value": false } }
148#     <- { "return": {} }
149##
150{ 'command': 'qom-set',
151  'data': { 'path': 'str', 'property': 'str', 'value': 'any' },
152  'allow-preconfig': true }
153
154##
155# @ObjectTypeInfo:
156#
157# This structure describes a search result from @qom-list-types
158#
159# @name: the type name found in the search
160#
161# @abstract: the type is abstract and can't be directly instantiated.
162#     Omitted if false.  (since 2.10)
163#
164# @parent: Name of parent type, if any (since 2.10)
165#
166# Since: 1.1
167##
168{ 'struct': 'ObjectTypeInfo',
169  'data': { 'name': 'str', '*abstract': 'bool', '*parent': 'str' } }
170
171##
172# @qom-list-types:
173#
174# This command will return a list of types given search parameters
175#
176# @implements: if specified, only return types that implement this
177#     type name
178#
179# @abstract: if true, include abstract types in the results
180#
181# Returns: a list of @ObjectTypeInfo or an empty list if no results
182#     are found
183#
184# Since: 1.1
185##
186{ 'command': 'qom-list-types',
187  'data': { '*implements': 'str', '*abstract': 'bool' },
188  'returns': [ 'ObjectTypeInfo' ],
189  'allow-preconfig': true }
190
191##
192# @qom-list-properties:
193#
194# List properties associated with a QOM object.
195#
196# @typename: the type name of an object
197#
198# .. note:: Objects can create properties at runtime, for example to
199#    describe links between different devices and/or objects.  These
200#    properties are not included in the output of this command.
201#
202# Returns: a list of ObjectPropertyInfo describing object properties
203#
204# Since: 2.12
205##
206{ 'command': 'qom-list-properties',
207  'data': { 'typename': 'str'},
208  'returns': [ 'ObjectPropertyInfo' ],
209  'allow-preconfig': true }
210
211##
212# @CanHostSocketcanProperties:
213#
214# Properties for can-host-socketcan objects.
215#
216# @if: interface name of the host system CAN bus to connect to
217#
218# @canbus: object ID of the can-bus object to connect to the host
219#     interface
220#
221# Since: 2.12
222##
223{ 'struct': 'CanHostSocketcanProperties',
224  'data': { 'if': 'str',
225            'canbus': 'str' } }
226
227##
228# @ColoCompareProperties:
229#
230# Properties for colo-compare objects.
231#
232# @primary_in: name of the character device backend to use for the
233#     primary input (incoming packets are redirected to @outdev)
234#
235# @secondary_in: name of the character device backend to use for
236#     secondary input (incoming packets are only compared to the input
237#     on @primary_in and then dropped)
238#
239# @outdev: name of the character device backend to use for output
240#
241# @iothread: name of the iothread to run in
242#
243# @notify_dev: name of the character device backend to be used to
244#     communicate with the remote colo-frame (only for Xen COLO)
245#
246# @compare_timeout: the maximum time to hold a packet from @primary_in
247#     for comparison with an incoming packet on @secondary_in in
248#     milliseconds (default: 3000)
249#
250# @expired_scan_cycle: the interval at which colo-compare checks
251#     whether packets from @primary have timed out, in milliseconds
252#     (default: 3000)
253#
254# @max_queue_size: the maximum number of packets to keep in the queue
255#     for comparing with incoming packets from @secondary_in.  If the
256#     queue is full and additional packets are received, the
257#     additional packets are dropped.  (default: 1024)
258#
259# @vnet_hdr_support: if true, vnet header support is enabled
260#     (default: false)
261#
262# Since: 2.8
263##
264{ 'struct': 'ColoCompareProperties',
265  'data': { 'primary_in': 'str',
266            'secondary_in': 'str',
267            'outdev': 'str',
268            'iothread': 'str',
269            '*notify_dev': 'str',
270            '*compare_timeout': 'uint64',
271            '*expired_scan_cycle': 'uint32',
272            '*max_queue_size': 'uint32',
273            '*vnet_hdr_support': 'bool' } }
274
275##
276# @CryptodevBackendProperties:
277#
278# Properties for cryptodev-backend and cryptodev-backend-builtin
279# objects.
280#
281# @queues: the number of queues for the cryptodev backend.  Ignored
282#     for cryptodev-backend and must be 1 for
283#     cryptodev-backend-builtin.  (default: 1)
284#
285# @throttle-bps: limit total bytes per second (Since 8.0)
286#
287# @throttle-ops: limit total operations per second (Since 8.0)
288#
289# Since: 2.8
290##
291{ 'struct': 'CryptodevBackendProperties',
292  'data': { '*queues': 'uint32',
293            '*throttle-bps': 'uint64',
294            '*throttle-ops': 'uint64' } }
295
296##
297# @CryptodevVhostUserProperties:
298#
299# Properties for cryptodev-vhost-user objects.
300#
301# @chardev: the name of a Unix domain socket character device that
302#     connects to the vhost-user server
303#
304# Since: 2.12
305##
306{ 'struct': 'CryptodevVhostUserProperties',
307  'base': 'CryptodevBackendProperties',
308  'data': { 'chardev': 'str' } }
309
310##
311# @DBusVMStateProperties:
312#
313# Properties for dbus-vmstate objects.
314#
315# @addr: the name of the DBus bus to connect to
316#
317# @id-list: a comma separated list of DBus IDs of helpers whose data
318#     should be included in the VM state on migration
319#
320# Since: 5.0
321##
322{ 'struct': 'DBusVMStateProperties',
323  'data': { 'addr': 'str' ,
324            '*id-list': 'str' } }
325
326##
327# @NetfilterInsert:
328#
329# Indicates where to insert a netfilter relative to a given other
330# filter.
331#
332# @before: insert before the specified filter
333#
334# @behind: insert behind the specified filter
335#
336# Since: 5.0
337##
338{ 'enum': 'NetfilterInsert',
339  'data': [ 'before', 'behind' ] }
340
341##
342# @NetfilterProperties:
343#
344# Properties for objects of classes derived from netfilter.
345#
346# @netdev: id of the network device backend to filter
347#
348# @queue: indicates which queue(s) to filter (default: all)
349#
350# @status: indicates whether the filter is enabled ("on") or disabled
351#     ("off") (default: "on")
352#
353# @position: specifies where the filter should be inserted in the
354#     filter list.  "head" means the filter is inserted at the head of
355#     the filter list, before any existing filters.  "tail" means the
356#     filter is inserted at the tail of the filter list, behind any
357#     existing filters (default). "id=<id>" means the filter is
358#     inserted before or behind the filter specified by <id>,
359#     depending on the @insert property.  (default: "tail")
360#
361# @insert: where to insert the filter relative to the filter given in
362#     @position.  Ignored if @position is "head" or "tail".
363#     (default: behind)
364#
365# Since: 2.5
366##
367{ 'struct': 'NetfilterProperties',
368  'data': { 'netdev': 'str',
369            '*queue': 'NetFilterDirection',
370            '*status': 'str',
371            '*position': 'str',
372            '*insert': 'NetfilterInsert' } }
373
374##
375# @FilterBufferProperties:
376#
377# Properties for filter-buffer objects.
378#
379# @interval: a non-zero interval in microseconds.  All packets
380#     arriving in the given interval are delayed until the end of the
381#     interval.
382#
383# Since: 2.5
384##
385{ 'struct': 'FilterBufferProperties',
386  'base': 'NetfilterProperties',
387  'data': { 'interval': 'uint32' } }
388
389##
390# @FilterDumpProperties:
391#
392# Properties for filter-dump objects.
393#
394# @file: the filename where the dumped packets should be stored
395#
396# @maxlen: maximum number of bytes in a packet that are stored
397#     (default: 65536)
398#
399# Since: 2.5
400##
401{ 'struct': 'FilterDumpProperties',
402  'base': 'NetfilterProperties',
403  'data': { 'file': 'str',
404            '*maxlen': 'uint32' } }
405
406##
407# @FilterMirrorProperties:
408#
409# Properties for filter-mirror objects.
410#
411# @outdev: the name of a character device backend to which all
412#     incoming packets are mirrored
413#
414# @vnet_hdr_support: if true, vnet header support is enabled
415#     (default: false)
416#
417# Since: 2.6
418##
419{ 'struct': 'FilterMirrorProperties',
420  'base': 'NetfilterProperties',
421  'data': { 'outdev': 'str',
422            '*vnet_hdr_support': 'bool' } }
423
424##
425# @FilterRedirectorProperties:
426#
427# Properties for filter-redirector objects.
428#
429# At least one of @indev or @outdev must be present.  If both are
430# present, they must not refer to the same character device backend.
431#
432# @indev: the name of a character device backend from which packets
433#     are received and redirected to the filtered network device
434#
435# @outdev: the name of a character device backend to which all
436#     incoming packets are redirected
437#
438# @vnet_hdr_support: if true, vnet header support is enabled
439#     (default: false)
440#
441# Since: 2.6
442##
443{ 'struct': 'FilterRedirectorProperties',
444  'base': 'NetfilterProperties',
445  'data': { '*indev': 'str',
446            '*outdev': 'str',
447            '*vnet_hdr_support': 'bool' } }
448
449##
450# @FilterRewriterProperties:
451#
452# Properties for filter-rewriter objects.
453#
454# @vnet_hdr_support: if true, vnet header support is enabled
455#     (default: false)
456#
457# Since: 2.8
458##
459{ 'struct': 'FilterRewriterProperties',
460  'base': 'NetfilterProperties',
461  'data': { '*vnet_hdr_support': 'bool' } }
462
463##
464# @InputBarrierProperties:
465#
466# Properties for input-barrier objects.
467#
468# @name: the screen name as declared in the screens section of
469#     barrier.conf
470#
471# @server: hostname of the Barrier server (default: "localhost")
472#
473# @port: TCP port of the Barrier server (default: "24800")
474#
475# @x-origin: x coordinate of the leftmost pixel on the guest screen
476#     (default: "0")
477#
478# @y-origin: y coordinate of the topmost pixel on the guest screen
479#     (default: "0")
480#
481# @width: the width of secondary screen in pixels (default: "1920")
482#
483# @height: the height of secondary screen in pixels (default: "1080")
484#
485# Since: 4.2
486##
487{ 'struct': 'InputBarrierProperties',
488  'data': { 'name': 'str',
489            '*server': 'str',
490            '*port': 'str',
491            '*x-origin': 'str',
492            '*y-origin': 'str',
493            '*width': 'str',
494            '*height': 'str' } }
495
496##
497# @InputLinuxProperties:
498#
499# Properties for input-linux objects.
500#
501# @evdev: the path of the host evdev device to use
502#
503# @grab_all: if true, grab is toggled for all devices (e.g. both
504#     keyboard and mouse) instead of just one device (default: false)
505#
506# @repeat: enables auto-repeat events (default: false)
507#
508# @grab-toggle: the key or key combination that toggles device grab
509#     (default: ctrl-ctrl)
510#
511# Since: 2.6
512##
513{ 'struct': 'InputLinuxProperties',
514  'data': { 'evdev': 'str',
515            '*grab_all': 'bool',
516            '*repeat': 'bool',
517            '*grab-toggle': 'GrabToggleKeys' } }
518
519##
520# @EventLoopBaseProperties:
521#
522# Common properties for event loops
523#
524# @aio-max-batch: maximum number of requests in a batch for the AIO
525#     engine, 0 means that the engine will use its default.
526#     (default: 0)
527#
528# @thread-pool-min: minimum number of threads reserved in the thread
529#     pool (default:0)
530#
531# @thread-pool-max: maximum number of threads the thread pool can
532#     contain (default:64)
533#
534# Since: 7.1
535##
536{ 'struct': 'EventLoopBaseProperties',
537  'data': { '*aio-max-batch': 'int',
538            '*thread-pool-min': 'int',
539            '*thread-pool-max': 'int' } }
540
541##
542# @IothreadProperties:
543#
544# Properties for iothread objects.
545#
546# @poll-max-ns: the maximum number of nanoseconds to busy wait for
547#     events.  0 means polling is disabled (default: 32768 on POSIX
548#     hosts, 0 otherwise)
549#
550# @poll-grow: the multiplier used to increase the polling time when
551#     the algorithm detects it is missing events due to not polling
552#     long enough.  0 selects a default behaviour (default: 0)
553#
554# @poll-shrink: the divisor used to decrease the polling time when the
555#     algorithm detects it is spending too long polling without
556#     encountering events.  0 selects a default behaviour (default: 0)
557#
558# The @aio-max-batch option is available since 6.1.
559#
560# Since: 2.0
561##
562{ 'struct': 'IothreadProperties',
563  'base': 'EventLoopBaseProperties',
564  'data': { '*poll-max-ns': 'int',
565            '*poll-grow': 'int',
566            '*poll-shrink': 'int' } }
567
568##
569# @MainLoopProperties:
570#
571# Properties for the main-loop object.
572#
573# Since: 7.1
574##
575{ 'struct': 'MainLoopProperties',
576  'base': 'EventLoopBaseProperties',
577  'data': {} }
578
579##
580# @MemoryBackendProperties:
581#
582# Properties for objects of classes derived from memory-backend.
583#
584# @merge: if true, mark the memory as mergeable (default depends on
585#     the machine type)
586#
587# @dump: if true, include the memory in core dumps (default depends on
588#     the machine type)
589#
590# @host-nodes: the list of NUMA host nodes to bind the memory to
591#
592# @policy: the NUMA policy (default: 'default')
593#
594# @prealloc: if true, preallocate memory (default: false)
595#
596# @prealloc-threads: number of CPU threads to use for prealloc
597#     (default: 1)
598#
599# @prealloc-context: thread context to use for creation of
600#     preallocation threads (default: none) (since 7.2)
601#
602# @share: if false, the memory is private to QEMU; if true, it is
603#     shared (default false for backends memory-backend-file and
604#     memory-backend-ram, true for backends memory-backend-epc,
605#     memory-backend-memfd, and memory-backend-shm)
606#
607# @reserve: if true, reserve swap space (or huge pages) if applicable
608#     (default: true) (since 6.1)
609#
610# @size: size of the memory region in bytes
611#
612# @x-use-canonical-path-for-ramblock-id: if true, the canonical path
613#     is used for ramblock-id.  Disable this for 4.0 machine types or
614#     older to allow migration with newer QEMU versions.
615#     (default: false generally, but true for machine types <= 4.0)
616#
617# .. note:: prealloc=true and reserve=false cannot be set at the same
618#    time.  With reserve=true, the behavior depends on the operating
619#    system: for example, Linux will not reserve swap space for shared
620#    file mappings -- "not applicable". In contrast, reserve=false will
621#    bail out if it cannot be configured accordingly.
622#
623# Since: 2.1
624##
625{ 'struct': 'MemoryBackendProperties',
626  'data': { '*dump': 'bool',
627            '*host-nodes': ['uint16'],
628            '*merge': 'bool',
629            '*policy': 'HostMemPolicy',
630            '*prealloc': 'bool',
631            '*prealloc-threads': 'uint32',
632            '*prealloc-context': 'str',
633            '*share': 'bool',
634            '*reserve': 'bool',
635            'size': 'size',
636            '*x-use-canonical-path-for-ramblock-id': 'bool' } }
637
638##
639# @MemoryBackendFileProperties:
640#
641# Properties for memory-backend-file objects.
642#
643# @align: the base address alignment when QEMU mmap(2)s @mem-path.
644#     Some backend stores specified by @mem-path require an alignment
645#     different than the default one used by QEMU, e.g. the device DAX
646#     /dev/dax0.0 requires 2M alignment rather than 4K. In such cases,
647#     users can specify the required alignment via this option.  0
648#     selects a default alignment (currently the page size).
649#     (default: 0)
650#
651# @offset: the offset into the target file that the region starts at.
652#     You can use this option to back multiple regions with a single
653#     file.  Must be a multiple of the page size.
654#     (default: 0) (since 8.1)
655#
656# @discard-data: if true, the file contents can be destroyed when QEMU
657#     exits, to avoid unnecessarily flushing data to the backing file.
658#     Note that @discard-data is only an optimization, and QEMU might
659#     not discard file contents if it aborts unexpectedly or is
660#     terminated using SIGKILL.  (default: false)
661#
662# @mem-path: the path to either a shared memory or huge page
663#     filesystem mount
664#
665# @pmem: specifies whether the backing file specified by @mem-path is
666#     in host persistent memory that can be accessed using the SNIA
667#     NVM programming model (e.g. Intel NVDIMM).
668#
669# @readonly: if true, the backing file is opened read-only; if false,
670#     it is opened read-write.  (default: false)
671#
672# @rom: whether to create Read Only Memory (ROM) that cannot be
673#     modified by the VM.  Any write attempts to such ROM will be
674#     denied.  Most use cases want writable RAM instead of ROM.
675#     However, selected use cases, like R/O NVDIMMs, can benefit from
676#     ROM.  If set to 'on', create ROM; if set to 'off', create
677#     writable RAM; if set to 'auto', the value of the @readonly
678#     property is used.  This property is primarily helpful when we
679#     want to have proper RAM in configurations that would
680#     traditionally create ROM before this property was introduced: VM
681#     templating, where we want to open a file readonly (@readonly set
682#     to true) and mark the memory to be private for QEMU (@share set
683#     to false).  For this use case, we need writable RAM instead of
684#     ROM, and want to set this property to 'off'.  (default: auto,
685#     since 8.2)
686#
687# Since: 2.1
688##
689{ 'struct': 'MemoryBackendFileProperties',
690  'base': 'MemoryBackendProperties',
691  'data': { '*align': 'size',
692            '*offset': 'size',
693            '*discard-data': 'bool',
694            'mem-path': 'str',
695            '*pmem': { 'type': 'bool', 'if': 'CONFIG_LIBPMEM' },
696            '*readonly': 'bool',
697            '*rom': 'OnOffAuto' } }
698
699##
700# @MemoryBackendMemfdProperties:
701#
702# Properties for memory-backend-memfd objects.
703#
704# @hugetlb: if true, the file to be created resides in the hugetlbfs
705#     filesystem (default: false)
706#
707# @hugetlbsize: the hugetlb page size on systems that support multiple
708#     hugetlb page sizes (it must be a power of 2 value supported by
709#     the system). 0 selects a default page size.  This option is
710#     ignored if @hugetlb is false.  (default: 0)
711#
712# @seal: if true, create a sealed-file, which will block further
713#     resizing of the memory (default: true)
714#
715# Since: 2.12
716##
717{ 'struct': 'MemoryBackendMemfdProperties',
718  'base': 'MemoryBackendProperties',
719  'data': { '*hugetlb': 'bool',
720            '*hugetlbsize': 'size',
721            '*seal': 'bool' } }
722
723##
724# @MemoryBackendShmProperties:
725#
726# Properties for memory-backend-shm objects.
727#
728# This memory backend supports only shared memory, which is the
729# default.
730#
731# Since: 9.1
732##
733{ 'struct': 'MemoryBackendShmProperties',
734  'base': 'MemoryBackendProperties',
735  'data': { },
736  'if': 'CONFIG_POSIX' }
737
738##
739# @MemoryBackendEpcProperties:
740#
741# Properties for memory-backend-epc objects.
742#
743# The @merge boolean option is false by default with epc
744#
745# The @dump boolean option is false by default with epc
746#
747# Since: 6.2
748##
749{ 'struct': 'MemoryBackendEpcProperties',
750  'base': 'MemoryBackendProperties',
751  'data': {} }
752
753##
754# @PrManagerHelperProperties:
755#
756# Properties for pr-manager-helper objects.
757#
758# @path: the path to a Unix domain socket for connecting to the
759#     external helper
760#
761# Since: 2.11
762##
763{ 'struct': 'PrManagerHelperProperties',
764  'data': { 'path': 'str' } }
765
766##
767# @QtestProperties:
768#
769# Properties for qtest objects.
770#
771# @chardev: the chardev to be used to receive qtest commands on.
772#
773# @log: the path to a log file
774#
775# Since: 6.0
776##
777{ 'struct': 'QtestProperties',
778        'data': { 'chardev': 'str',
779                  '*log': 'str' } }
780
781##
782# @RemoteObjectProperties:
783#
784# Properties for x-remote-object objects.
785#
786# @fd: file descriptor name previously passed via 'getfd' command
787#
788# @devid: the id of the device to be associated with the file
789#     descriptor
790#
791# Since: 6.0
792##
793{ 'struct': 'RemoteObjectProperties',
794  'data': { 'fd': 'str', 'devid': 'str' } }
795
796##
797# @VfioUserServerProperties:
798#
799# Properties for x-vfio-user-server objects.
800#
801# @socket: socket to be used by the libvfio-user library
802#
803# @device: the ID of the device to be emulated at the server
804#
805# Since: 7.1
806##
807{ 'struct': 'VfioUserServerProperties',
808  'data': { 'socket': 'SocketAddress', 'device': 'str' } }
809
810##
811# @IOMMUFDProperties:
812#
813# Properties for iommufd objects.
814#
815# @fd: file descriptor name previously passed via 'getfd' command,
816#     which represents a pre-opened /dev/iommu.  This allows the
817#     iommufd object to be shared across several subsystems (VFIO,
818#     VDPA, ...), and the file descriptor to be shared with other
819#     process, e.g. DPDK.  (default: QEMU opens /dev/iommu by itself)
820#
821# Since: 9.0
822##
823{ 'struct': 'IOMMUFDProperties',
824  'data': { '*fd': 'str' } }
825
826##
827# @AcpiGenericInitiatorProperties:
828#
829# Properties for acpi-generic-initiator objects.
830#
831# @pci-dev: PCI device ID to be associated with the node
832#
833# @node: NUMA node associated with the PCI device
834#
835# Since: 9.0
836##
837{ 'struct': 'AcpiGenericInitiatorProperties',
838  'data': { 'pci-dev': 'str',
839            'node': 'uint32' } }
840
841##
842# @RngProperties:
843#
844# Properties for objects of classes derived from rng.
845#
846# @opened: if true, the device is opened immediately when applying
847#     this option and will probably fail when processing the next
848#     option.  Don't use; only provided for compatibility.
849#     (default: false)
850#
851# Features:
852#
853# @deprecated: Member @opened is deprecated.  Setting true doesn't
854#     make sense, and false is already the default.
855#
856# Since: 1.3
857##
858{ 'struct': 'RngProperties',
859  'data': { '*opened': { 'type': 'bool', 'features': ['deprecated'] } } }
860
861##
862# @RngEgdProperties:
863#
864# Properties for rng-egd objects.
865#
866# @chardev: the name of a character device backend that provides the
867#     connection to the RNG daemon
868#
869# Since: 1.3
870##
871{ 'struct': 'RngEgdProperties',
872  'base': 'RngProperties',
873  'data': { 'chardev': 'str' } }
874
875##
876# @RngRandomProperties:
877#
878# Properties for rng-random objects.
879#
880# @filename: the filename of the device on the host to obtain entropy
881#     from (default: "/dev/urandom")
882#
883# Since: 1.3
884##
885{ 'struct': 'RngRandomProperties',
886  'base': 'RngProperties',
887  'data': { '*filename': 'str' } }
888
889##
890# @SevCommonProperties:
891#
892# Properties common to objects that are derivatives of sev-common.
893#
894# @sev-device: SEV device to use (default: "/dev/sev")
895#
896# @cbitpos: C-bit location in page table entry (default: 0)
897#
898# @reduced-phys-bits: number of bits in physical addresses that become
899#     unavailable when SEV is enabled
900#
901# @kernel-hashes: if true, add hashes of kernel/initrd/cmdline to a
902#     designated guest firmware page for measured boot with -kernel
903#     (default: false) (since 6.2)
904#
905# Since: 9.1
906##
907{ 'struct': 'SevCommonProperties',
908  'data': { '*sev-device': 'str',
909            '*cbitpos': 'uint32',
910            'reduced-phys-bits': 'uint32',
911            '*kernel-hashes': 'bool' } }
912
913##
914# @SevGuestProperties:
915#
916# Properties for sev-guest objects.
917#
918# @dh-cert-file: guest owners DH certificate (encoded with base64)
919#
920# @session-file: guest owners session parameters (encoded with base64)
921#
922# @policy: SEV policy value (default: 0x1)
923#
924# @handle: SEV firmware handle (default: 0)
925#
926# @legacy-vm-type: Use legacy KVM_SEV_INIT KVM interface for creating the VM.
927#                  The newer KVM_SEV_INIT2 interface, from Linux >= 6.10, syncs
928#                  additional vCPU state when initializing the VMSA structures,
929#                  which will result in a different guest measurement. Set
930#                  this to 'on' to force compatibility with older QEMU or kernel
931#                  versions that rely on legacy KVM_SEV_INIT behavior. 'auto'
932#                  will behave identically to 'on', but will automatically
933#                  switch to using KVM_SEV_INIT2 if the user specifies any
934#                  additional options that require it. If set to 'off', QEMU
935#                  will require KVM_SEV_INIT2 unconditionally.
936#                  (default: off) (since 9.1)
937#
938# Since: 2.12
939##
940{ 'struct': 'SevGuestProperties',
941  'base': 'SevCommonProperties',
942  'data': { '*dh-cert-file': 'str',
943            '*session-file': 'str',
944            '*policy': 'uint32',
945            '*handle': 'uint32',
946            '*legacy-vm-type': 'OnOffAuto' } }
947
948##
949# @SevSnpGuestProperties:
950#
951# Properties for sev-snp-guest objects.  Most of these are direct
952# arguments for the KVM_SNP_* interfaces documented in the Linux
953# kernel source under
954# Documentation/arch/x86/amd-memory-encryption.rst, which are in turn
955# closely coupled with the SNP_INIT/SNP_LAUNCH_* firmware commands
956# documented in the SEV-SNP Firmware ABI Specification (Rev 0.9).
957#
958# More usage information is also available in the QEMU source tree
959# under docs/amd-memory-encryption.
960#
961# @policy: the 'POLICY' parameter to the SNP_LAUNCH_START command, as
962#     defined in the SEV-SNP firmware ABI (default: 0x30000)
963#
964# @guest-visible-workarounds: 16-byte, base64-encoded blob to report
965#     hypervisor-defined workarounds, corresponding to the 'GOSVW'
966#     parameter of the SNP_LAUNCH_START command defined in the SEV-SNP
967#     firmware ABI (default: all-zero)
968#
969# @id-block: 96-byte, base64-encoded blob to provide the 'ID Block'
970#     structure for the SNP_LAUNCH_FINISH command defined in the
971#     SEV-SNP firmware ABI (default: all-zero)
972#
973# @id-auth: 4096-byte, base64-encoded blob to provide the 'ID
974#     Authentication Information Structure' for the SNP_LAUNCH_FINISH
975#     command defined in the SEV-SNP firmware ABI (default: all-zero)
976#
977# @author-key-enabled: true if 'id-auth' blob contains the 'AUTHOR_KEY'
978#     field defined SEV-SNP firmware ABI (default: false)
979#
980# @host-data: 32-byte, base64-encoded, user-defined blob to provide to
981#     the guest, as documented for the 'HOST_DATA' parameter of the
982#     SNP_LAUNCH_FINISH command in the SEV-SNP firmware ABI (default:
983#     all-zero)
984#
985# @vcek-disabled: Guests are by default allowed to choose between VLEK
986#     (Versioned Loaded Endorsement Key) or VCEK (Versioned Chip
987#     Endorsement Key) when requesting attestation reports from
988#     firmware. Set this to true to disable the use of VCEK.
989#     (default: false) (since: 9.1)
990#
991# Since: 9.1
992##
993{ 'struct': 'SevSnpGuestProperties',
994  'base': 'SevCommonProperties',
995  'data': {
996            '*policy': 'uint64',
997            '*guest-visible-workarounds': 'str',
998            '*id-block': 'str',
999            '*id-auth': 'str',
1000            '*author-key-enabled': 'bool',
1001            '*host-data': 'str',
1002            '*vcek-disabled': 'bool' } }
1003
1004##
1005# @ThreadContextProperties:
1006#
1007# Properties for thread context objects.
1008#
1009# @cpu-affinity: the list of host CPU numbers used as CPU affinity for
1010#     all threads created in the thread context (default: QEMU main
1011#     thread CPU affinity)
1012#
1013# @node-affinity: the list of host node numbers that will be resolved
1014#     to a list of host CPU numbers used as CPU affinity.  This is a
1015#     shortcut for specifying the list of host CPU numbers belonging
1016#     to the host nodes manually by setting @cpu-affinity.
1017#     (default: QEMU main thread affinity)
1018#
1019# Since: 7.2
1020##
1021{ 'struct': 'ThreadContextProperties',
1022  'data': { '*cpu-affinity': ['uint16'],
1023            '*node-affinity': ['uint16'] } }
1024
1025
1026##
1027# @ObjectType:
1028#
1029# Features:
1030#
1031# @unstable: Members @x-remote-object and @x-vfio-user-server are
1032#     experimental.
1033#
1034# Since: 6.0
1035##
1036{ 'enum': 'ObjectType',
1037  'data': [
1038    'acpi-generic-initiator',
1039    'authz-list',
1040    'authz-listfile',
1041    'authz-pam',
1042    'authz-simple',
1043    'can-bus',
1044    { 'name': 'can-host-socketcan',
1045      'if': 'CONFIG_LINUX' },
1046    'colo-compare',
1047    'cryptodev-backend',
1048    'cryptodev-backend-builtin',
1049    'cryptodev-backend-lkcf',
1050    { 'name': 'cryptodev-vhost-user',
1051      'if': 'CONFIG_VHOST_CRYPTO' },
1052    'dbus-vmstate',
1053    'filter-buffer',
1054    'filter-dump',
1055    'filter-mirror',
1056    'filter-redirector',
1057    'filter-replay',
1058    'filter-rewriter',
1059    'input-barrier',
1060    { 'name': 'input-linux',
1061      'if': 'CONFIG_LINUX' },
1062    'iommufd',
1063    'iothread',
1064    'main-loop',
1065    { 'name': 'memory-backend-epc',
1066      'if': 'CONFIG_LINUX' },
1067    'memory-backend-file',
1068    { 'name': 'memory-backend-memfd',
1069      'if': 'CONFIG_LINUX' },
1070    'memory-backend-ram',
1071    { 'name': 'memory-backend-shm',
1072      'if': 'CONFIG_POSIX' },
1073    'pef-guest',
1074    { 'name': 'pr-manager-helper',
1075      'if': 'CONFIG_LINUX' },
1076    'qtest',
1077    'rng-builtin',
1078    'rng-egd',
1079    { 'name': 'rng-random',
1080      'if': 'CONFIG_POSIX' },
1081    'secret',
1082    { 'name': 'secret_keyring',
1083      'if': 'CONFIG_SECRET_KEYRING' },
1084    'sev-guest',
1085    'sev-snp-guest',
1086    'thread-context',
1087    's390-pv-guest',
1088    'throttle-group',
1089    'tls-creds-anon',
1090    'tls-creds-psk',
1091    'tls-creds-x509',
1092    'tls-cipher-suites',
1093    { 'name': 'x-remote-object', 'features': [ 'unstable' ] },
1094    { 'name': 'x-vfio-user-server', 'features': [ 'unstable' ] }
1095  ] }
1096
1097##
1098# @ObjectOptions:
1099#
1100# Describes the options of a user creatable QOM object.
1101#
1102# @qom-type: the class name for the object to be created
1103#
1104# @id: the name of the new object
1105#
1106# Since: 6.0
1107##
1108{ 'union': 'ObjectOptions',
1109  'base': { 'qom-type': 'ObjectType',
1110            'id': 'str' },
1111  'discriminator': 'qom-type',
1112  'data': {
1113      'acpi-generic-initiator':     'AcpiGenericInitiatorProperties',
1114      'authz-list':                 'AuthZListProperties',
1115      'authz-listfile':             'AuthZListFileProperties',
1116      'authz-pam':                  'AuthZPAMProperties',
1117      'authz-simple':               'AuthZSimpleProperties',
1118      'can-host-socketcan':         { 'type': 'CanHostSocketcanProperties',
1119                                      'if': 'CONFIG_LINUX' },
1120      'colo-compare':               'ColoCompareProperties',
1121      'cryptodev-backend':          'CryptodevBackendProperties',
1122      'cryptodev-backend-builtin':  'CryptodevBackendProperties',
1123      'cryptodev-backend-lkcf':     'CryptodevBackendProperties',
1124      'cryptodev-vhost-user':       { 'type': 'CryptodevVhostUserProperties',
1125                                      'if': 'CONFIG_VHOST_CRYPTO' },
1126      'dbus-vmstate':               'DBusVMStateProperties',
1127      'filter-buffer':              'FilterBufferProperties',
1128      'filter-dump':                'FilterDumpProperties',
1129      'filter-mirror':              'FilterMirrorProperties',
1130      'filter-redirector':          'FilterRedirectorProperties',
1131      'filter-replay':              'NetfilterProperties',
1132      'filter-rewriter':            'FilterRewriterProperties',
1133      'input-barrier':              'InputBarrierProperties',
1134      'input-linux':                { 'type': 'InputLinuxProperties',
1135                                      'if': 'CONFIG_LINUX' },
1136      'iommufd':                    'IOMMUFDProperties',
1137      'iothread':                   'IothreadProperties',
1138      'main-loop':                  'MainLoopProperties',
1139      'memory-backend-epc':         { 'type': 'MemoryBackendEpcProperties',
1140                                      'if': 'CONFIG_LINUX' },
1141      'memory-backend-file':        'MemoryBackendFileProperties',
1142      'memory-backend-memfd':       { 'type': 'MemoryBackendMemfdProperties',
1143                                      'if': 'CONFIG_LINUX' },
1144      'memory-backend-ram':         'MemoryBackendProperties',
1145      'memory-backend-shm':         { 'type': 'MemoryBackendShmProperties',
1146                                      'if': 'CONFIG_POSIX' },
1147      'pr-manager-helper':          { 'type': 'PrManagerHelperProperties',
1148                                      'if': 'CONFIG_LINUX' },
1149      'qtest':                      'QtestProperties',
1150      'rng-builtin':                'RngProperties',
1151      'rng-egd':                    'RngEgdProperties',
1152      'rng-random':                 { 'type': 'RngRandomProperties',
1153                                      'if': 'CONFIG_POSIX' },
1154      'secret':                     'SecretProperties',
1155      'secret_keyring':             { 'type': 'SecretKeyringProperties',
1156                                      'if': 'CONFIG_SECRET_KEYRING' },
1157      'sev-guest':                  'SevGuestProperties',
1158      'sev-snp-guest':              'SevSnpGuestProperties',
1159      'thread-context':             'ThreadContextProperties',
1160      'throttle-group':             'ThrottleGroupProperties',
1161      'tls-creds-anon':             'TlsCredsAnonProperties',
1162      'tls-creds-psk':              'TlsCredsPskProperties',
1163      'tls-creds-x509':             'TlsCredsX509Properties',
1164      'tls-cipher-suites':          'TlsCredsProperties',
1165      'x-remote-object':            'RemoteObjectProperties',
1166      'x-vfio-user-server':         'VfioUserServerProperties'
1167  } }
1168
1169##
1170# @object-add:
1171#
1172# Create a QOM object.
1173#
1174# Errors:
1175#     - Error if @qom-type is not a valid class name
1176#
1177# Since: 2.0
1178#
1179# .. qmp-example::
1180#
1181#     -> { "execute": "object-add",
1182#          "arguments": { "qom-type": "rng-random", "id": "rng1",
1183#                         "filename": "/dev/hwrng" } }
1184#     <- { "return": {} }
1185##
1186{ 'command': 'object-add', 'data': 'ObjectOptions', 'boxed': true,
1187  'allow-preconfig': true }
1188
1189##
1190# @object-del:
1191#
1192# Remove a QOM object.
1193#
1194# @id: the name of the QOM object to remove
1195#
1196# Errors:
1197#     - Error if @id is not a valid id for a QOM object
1198#
1199# Since: 2.0
1200#
1201# .. qmp-example::
1202#
1203#     -> { "execute": "object-del", "arguments": { "id": "rng1" } }
1204#     <- { "return": {} }
1205##
1206{ 'command': 'object-del', 'data': {'id': 'str'},
1207  'allow-preconfig': true }
1208