Merge tag 'pull-loongarch-20240912' of https://gitlab.com/gaosong/qemu into staging
[qemu/kevin.git] / qapi / qom.json
blob321ccd708ad11c0ef20ab7939d36ca301fe656b3
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 { 'include': 'authz.json' }
8 { 'include': 'block-core.json' }
9 { 'include': 'common.json' }
10 { 'include': 'crypto.json' }
13 # = QEMU Object Model (QOM)
17 # @ObjectPropertyInfo:
19 # @name: the name of the property
21 # @type: the type of the property.  This will typically come in one of
22 #     four forms:
24 #     1) A primitive type such as 'u8', 'u16', 'bool', 'str', or
25 #        'double'.  These types are mapped to the appropriate JSON
26 #        type.
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.
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.
36 # @description: if specified, the description of the property.
38 # @default-value: the default value, if any (since 5.0)
40 # Since: 1.2
42 { 'struct': 'ObjectPropertyInfo',
43   'data': { 'name': 'str',
44             'type': 'str',
45             '*description': 'str',
46             '*default-value': 'any' } }
49 # @qom-list:
51 # This command will list any properties of a object given a path in
52 # the object model.
54 # @path: the path within the object model.  See @qom-get for a
55 #     description of this parameter.
57 # Returns: a list of @ObjectPropertyInfo that describe the properties
58 #     of the object.
60 # Since: 1.2
62 # .. qmp-example::
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>" } ] }
71 { 'command': 'qom-list',
72   'data': { 'path': 'str' },
73   'returns': [ 'ObjectPropertyInfo' ],
74   'allow-preconfig': true }
77 # @qom-get:
79 # This command will get a property from a object model path and return
80 # the value.
82 # @path: The path within the object model.  There are two forms of
83 #     supported paths--absolute and partial paths.
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.
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.
99 # @property: The property name to read
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.
105 # Since: 1.2
107 # .. qmp-example::
108 #    :title: Use absolute path
110 #     -> { "execute": "qom-get",
111 #          "arguments": { "path": "/machine/unattached/device[0]",
112 #                         "property": "hotplugged" } }
113 #     <- { "return": false }
115 # .. qmp-example::
116 #    :title: Use partial path
118 #     -> { "execute": "qom-get",
119 #          "arguments": { "path": "unattached/sysbus",
120 #                         "property": "type" } }
121 #     <- { "return": "System" }
123 { 'command': 'qom-get',
124   'data': { 'path': 'str', 'property': 'str' },
125   'returns': 'any',
126   'allow-preconfig': true }
129 # @qom-set:
131 # This command will set a property from a object model path.
133 # @path: see @qom-get for a description of this parameter
135 # @property: the property name to set
137 # @value: a value who's type is appropriate for the property type.
138 #     See @qom-get for a description of type mapping.
140 # Since: 1.2
142 # .. qmp-example::
144 #     -> { "execute": "qom-set",
145 #          "arguments": { "path": "/machine",
146 #                         "property": "graphics",
147 #                         "value": false } }
148 #     <- { "return": {} }
150 { 'command': 'qom-set',
151   'data': { 'path': 'str', 'property': 'str', 'value': 'any' },
152   'allow-preconfig': true }
155 # @ObjectTypeInfo:
157 # This structure describes a search result from @qom-list-types
159 # @name: the type name found in the search
161 # @abstract: the type is abstract and can't be directly instantiated.
162 #     Omitted if false.  (since 2.10)
164 # @parent: Name of parent type, if any (since 2.10)
166 # Since: 1.1
168 { 'struct': 'ObjectTypeInfo',
169   'data': { 'name': 'str', '*abstract': 'bool', '*parent': 'str' } }
172 # @qom-list-types:
174 # This command will return a list of types given search parameters
176 # @implements: if specified, only return types that implement this
177 #     type name
179 # @abstract: if true, include abstract types in the results
181 # Returns: a list of @ObjectTypeInfo or an empty list if no results
182 #     are found
184 # Since: 1.1
186 { 'command': 'qom-list-types',
187   'data': { '*implements': 'str', '*abstract': 'bool' },
188   'returns': [ 'ObjectTypeInfo' ],
189   'allow-preconfig': true }
192 # @qom-list-properties:
194 # List properties associated with a QOM object.
196 # @typename: the type name of an object
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.
202 # Returns: a list of ObjectPropertyInfo describing object properties
204 # Since: 2.12
206 { 'command': 'qom-list-properties',
207   'data': { 'typename': 'str'},
208   'returns': [ 'ObjectPropertyInfo' ],
209   'allow-preconfig': true }
212 # @CanHostSocketcanProperties:
214 # Properties for can-host-socketcan objects.
216 # @if: interface name of the host system CAN bus to connect to
218 # @canbus: object ID of the can-bus object to connect to the host
219 #     interface
221 # Since: 2.12
223 { 'struct': 'CanHostSocketcanProperties',
224   'data': { 'if': 'str',
225             'canbus': 'str' },
226   'if': 'CONFIG_LINUX' }
229 # @ColoCompareProperties:
231 # Properties for colo-compare objects.
233 # @primary_in: name of the character device backend to use for the
234 #     primary input (incoming packets are redirected to @outdev)
236 # @secondary_in: name of the character device backend to use for
237 #     secondary input (incoming packets are only compared to the input
238 #     on @primary_in and then dropped)
240 # @outdev: name of the character device backend to use for output
242 # @iothread: name of the iothread to run in
244 # @notify_dev: name of the character device backend to be used to
245 #     communicate with the remote colo-frame (only for Xen COLO)
247 # @compare_timeout: the maximum time to hold a packet from @primary_in
248 #     for comparison with an incoming packet on @secondary_in in
249 #     milliseconds (default: 3000)
251 # @expired_scan_cycle: the interval at which colo-compare checks
252 #     whether packets from @primary have timed out, in milliseconds
253 #     (default: 3000)
255 # @max_queue_size: the maximum number of packets to keep in the queue
256 #     for comparing with incoming packets from @secondary_in.  If the
257 #     queue is full and additional packets are received, the
258 #     additional packets are dropped.  (default: 1024)
260 # @vnet_hdr_support: if true, vnet header support is enabled
261 #     (default: false)
263 # Since: 2.8
265 { 'struct': 'ColoCompareProperties',
266   'data': { 'primary_in': 'str',
267             'secondary_in': 'str',
268             'outdev': 'str',
269             'iothread': 'str',
270             '*notify_dev': 'str',
271             '*compare_timeout': 'uint64',
272             '*expired_scan_cycle': 'uint32',
273             '*max_queue_size': 'uint32',
274             '*vnet_hdr_support': 'bool' } }
277 # @CryptodevBackendProperties:
279 # Properties for cryptodev-backend and cryptodev-backend-builtin
280 # objects.
282 # @queues: the number of queues for the cryptodev backend.  Ignored
283 #     for cryptodev-backend and must be 1 for
284 #     cryptodev-backend-builtin.  (default: 1)
286 # @throttle-bps: limit total bytes per second (Since 8.0)
288 # @throttle-ops: limit total operations per second (Since 8.0)
290 # Since: 2.8
292 { 'struct': 'CryptodevBackendProperties',
293   'data': { '*queues': 'uint32',
294             '*throttle-bps': 'uint64',
295             '*throttle-ops': 'uint64' } }
298 # @CryptodevVhostUserProperties:
300 # Properties for cryptodev-vhost-user objects.
302 # @chardev: the name of a Unix domain socket character device that
303 #     connects to the vhost-user server
305 # Since: 2.12
307 { 'struct': 'CryptodevVhostUserProperties',
308   'base': 'CryptodevBackendProperties',
309   'data': { 'chardev': 'str' },
310   'if': 'CONFIG_VHOST_CRYPTO' }
313 # @DBusVMStateProperties:
315 # Properties for dbus-vmstate objects.
317 # @addr: the name of the DBus bus to connect to
319 # @id-list: a comma separated list of DBus IDs of helpers whose data
320 #     should be included in the VM state on migration
322 # Since: 5.0
324 { 'struct': 'DBusVMStateProperties',
325   'data': { 'addr': 'str' ,
326             '*id-list': 'str' } }
329 # @NetfilterInsert:
331 # Indicates where to insert a netfilter relative to a given other
332 # filter.
334 # @before: insert before the specified filter
336 # @behind: insert behind the specified filter
338 # Since: 5.0
340 { 'enum': 'NetfilterInsert',
341   'data': [ 'before', 'behind' ] }
344 # @NetfilterProperties:
346 # Properties for objects of classes derived from netfilter.
348 # @netdev: id of the network device backend to filter
350 # @queue: indicates which queue(s) to filter (default: all)
352 # @status: indicates whether the filter is enabled ("on") or disabled
353 #     ("off") (default: "on")
355 # @position: specifies where the filter should be inserted in the
356 #     filter list.  "head" means the filter is inserted at the head of
357 #     the filter list, before any existing filters.  "tail" means the
358 #     filter is inserted at the tail of the filter list, behind any
359 #     existing filters (default).  "id=<id>" means the filter is
360 #     inserted before or behind the filter specified by <id>,
361 #     depending on the @insert property.  (default: "tail")
363 # @insert: where to insert the filter relative to the filter given in
364 #     @position.  Ignored if @position is "head" or "tail".
365 #     (default: behind)
367 # Since: 2.5
369 { 'struct': 'NetfilterProperties',
370   'data': { 'netdev': 'str',
371             '*queue': 'NetFilterDirection',
372             '*status': 'str',
373             '*position': 'str',
374             '*insert': 'NetfilterInsert' } }
377 # @FilterBufferProperties:
379 # Properties for filter-buffer objects.
381 # @interval: a non-zero interval in microseconds.  All packets
382 #     arriving in the given interval are delayed until the end of the
383 #     interval.
385 # Since: 2.5
387 { 'struct': 'FilterBufferProperties',
388   'base': 'NetfilterProperties',
389   'data': { 'interval': 'uint32' } }
392 # @FilterDumpProperties:
394 # Properties for filter-dump objects.
396 # @file: the filename where the dumped packets should be stored
398 # @maxlen: maximum number of bytes in a packet that are stored
399 #     (default: 65536)
401 # Since: 2.5
403 { 'struct': 'FilterDumpProperties',
404   'base': 'NetfilterProperties',
405   'data': { 'file': 'str',
406             '*maxlen': 'uint32' } }
409 # @FilterMirrorProperties:
411 # Properties for filter-mirror objects.
413 # @outdev: the name of a character device backend to which all
414 #     incoming packets are mirrored
416 # @vnet_hdr_support: if true, vnet header support is enabled
417 #     (default: false)
419 # Since: 2.6
421 { 'struct': 'FilterMirrorProperties',
422   'base': 'NetfilterProperties',
423   'data': { 'outdev': 'str',
424             '*vnet_hdr_support': 'bool' } }
427 # @FilterRedirectorProperties:
429 # Properties for filter-redirector objects.
431 # At least one of @indev or @outdev must be present.  If both are
432 # present, they must not refer to the same character device backend.
434 # @indev: the name of a character device backend from which packets
435 #     are received and redirected to the filtered network device
437 # @outdev: the name of a character device backend to which all
438 #     incoming packets are redirected
440 # @vnet_hdr_support: if true, vnet header support is enabled
441 #     (default: false)
443 # Since: 2.6
445 { 'struct': 'FilterRedirectorProperties',
446   'base': 'NetfilterProperties',
447   'data': { '*indev': 'str',
448             '*outdev': 'str',
449             '*vnet_hdr_support': 'bool' } }
452 # @FilterRewriterProperties:
454 # Properties for filter-rewriter objects.
456 # @vnet_hdr_support: if true, vnet header support is enabled
457 #     (default: false)
459 # Since: 2.8
461 { 'struct': 'FilterRewriterProperties',
462   'base': 'NetfilterProperties',
463   'data': { '*vnet_hdr_support': 'bool' } }
466 # @InputBarrierProperties:
468 # Properties for input-barrier objects.
470 # @name: the screen name as declared in the screens section of
471 #     barrier.conf
473 # @server: hostname of the Barrier server (default: "localhost")
475 # @port: TCP port of the Barrier server (default: "24800")
477 # @x-origin: x coordinate of the leftmost pixel on the guest screen
478 #     (default: "0")
480 # @y-origin: y coordinate of the topmost pixel on the guest screen
481 #     (default: "0")
483 # @width: the width of secondary screen in pixels (default: "1920")
485 # @height: the height of secondary screen in pixels (default: "1080")
487 # Since: 4.2
489 { 'struct': 'InputBarrierProperties',
490   'data': { 'name': 'str',
491             '*server': 'str',
492             '*port': 'str',
493             '*x-origin': 'str',
494             '*y-origin': 'str',
495             '*width': 'str',
496             '*height': 'str' } }
499 # @InputLinuxProperties:
501 # Properties for input-linux objects.
503 # @evdev: the path of the host evdev device to use
505 # @grab_all: if true, grab is toggled for all devices (e.g. both
506 #     keyboard and mouse) instead of just one device (default: false)
508 # @repeat: enables auto-repeat events (default: false)
510 # @grab-toggle: the key or key combination that toggles device grab
511 #     (default: ctrl-ctrl)
513 # Since: 2.6
515 { 'struct': 'InputLinuxProperties',
516   'data': { 'evdev': 'str',
517             '*grab_all': 'bool',
518             '*repeat': 'bool',
519             '*grab-toggle': 'GrabToggleKeys' },
520   'if': 'CONFIG_LINUX' }
523 # @EventLoopBaseProperties:
525 # Common properties for event loops
527 # @aio-max-batch: maximum number of requests in a batch for the AIO
528 #     engine, 0 means that the engine will use its default.
529 #     (default: 0)
531 # @thread-pool-min: minimum number of threads reserved in the thread
532 #     pool (default:0)
534 # @thread-pool-max: maximum number of threads the thread pool can
535 #     contain (default:64)
537 # Since: 7.1
539 { 'struct': 'EventLoopBaseProperties',
540   'data': { '*aio-max-batch': 'int',
541             '*thread-pool-min': 'int',
542             '*thread-pool-max': 'int' } }
545 # @IothreadProperties:
547 # Properties for iothread objects.
549 # @poll-max-ns: the maximum number of nanoseconds to busy wait for
550 #     events.  0 means polling is disabled (default: 32768 on POSIX
551 #     hosts, 0 otherwise)
553 # @poll-grow: the multiplier used to increase the polling time when
554 #     the algorithm detects it is missing events due to not polling
555 #     long enough.  0 selects a default behaviour (default: 0)
557 # @poll-shrink: the divisor used to decrease the polling time when the
558 #     algorithm detects it is spending too long polling without
559 #     encountering events.  0 selects a default behaviour (default: 0)
561 # The @aio-max-batch option is available since 6.1.
563 # Since: 2.0
565 { 'struct': 'IothreadProperties',
566   'base': 'EventLoopBaseProperties',
567   'data': { '*poll-max-ns': 'int',
568             '*poll-grow': 'int',
569             '*poll-shrink': 'int' } }
572 # @MainLoopProperties:
574 # Properties for the main-loop object.
576 # Since: 7.1
578 { 'struct': 'MainLoopProperties',
579   'base': 'EventLoopBaseProperties',
580   'data': {} }
583 # @MemoryBackendProperties:
585 # Properties for objects of classes derived from memory-backend.
587 # @merge: if true, mark the memory as mergeable (default depends on
588 #     the machine type)
590 # @dump: if true, include the memory in core dumps (default depends on
591 #     the machine type)
593 # @host-nodes: the list of NUMA host nodes to bind the memory to
595 # @policy: the NUMA policy (default: 'default')
597 # @prealloc: if true, preallocate memory (default: false)
599 # @prealloc-threads: number of CPU threads to use for prealloc
600 #     (default: 1)
602 # @prealloc-context: thread context to use for creation of
603 #     preallocation threads (default: none) (since 7.2)
605 # @share: if false, the memory is private to QEMU; if true, it is
606 #     shared (default false for backends memory-backend-file and
607 #     memory-backend-ram, true for backends memory-backend-epc,
608 #     memory-backend-memfd, and memory-backend-shm)
610 # @reserve: if true, reserve swap space (or huge pages) if applicable
611 #     (default: true) (since 6.1)
613 # @size: size of the memory region in bytes
615 # @x-use-canonical-path-for-ramblock-id: if true, the canonical path
616 #     is used for ramblock-id.  Disable this for 4.0 machine types or
617 #     older to allow migration with newer QEMU versions.
618 #     (default: false generally, but true for machine types <= 4.0)
620 # .. note:: prealloc=true and reserve=false cannot be set at the same
621 #    time.  With reserve=true, the behavior depends on the operating
622 #    system: for example, Linux will not reserve swap space for shared
623 #    file mappings -- "not applicable".  In contrast, reserve=false
624 #    will bail out if it cannot be configured accordingly.
626 # Since: 2.1
628 { 'struct': 'MemoryBackendProperties',
629   'data': { '*dump': 'bool',
630             '*host-nodes': ['uint16'],
631             '*merge': 'bool',
632             '*policy': 'HostMemPolicy',
633             '*prealloc': 'bool',
634             '*prealloc-threads': 'uint32',
635             '*prealloc-context': 'str',
636             '*share': 'bool',
637             '*reserve': 'bool',
638             'size': 'size',
639             '*x-use-canonical-path-for-ramblock-id': 'bool' } }
642 # @MemoryBackendFileProperties:
644 # Properties for memory-backend-file objects.
646 # @align: the base address alignment when QEMU mmap(2)s @mem-path.
647 #     Some backend stores specified by @mem-path require an alignment
648 #     different than the default one used by QEMU, e.g. the device DAX
649 #     /dev/dax0.0 requires 2M alignment rather than 4K.  In such
650 #     cases, users can specify the required alignment via this option.
651 #     0 selects a default alignment (currently the page size).
652 #     (default: 0)
654 # @offset: the offset into the target file that the region starts at.
655 #     You can use this option to back multiple regions with a single
656 #     file.  Must be a multiple of the page size.
657 #     (default: 0) (since 8.1)
659 # @discard-data: if true, the file contents can be destroyed when QEMU
660 #     exits, to avoid unnecessarily flushing data to the backing file.
661 #     Note that @discard-data is only an optimization, and QEMU might
662 #     not discard file contents if it aborts unexpectedly or is
663 #     terminated using SIGKILL.  (default: false)
665 # @mem-path: the path to either a shared memory or huge page
666 #     filesystem mount
668 # @pmem: specifies whether the backing file specified by @mem-path is
669 #     in host persistent memory that can be accessed using the SNIA
670 #     NVM programming model (e.g. Intel NVDIMM).
672 # @readonly: if true, the backing file is opened read-only; if false,
673 #     it is opened read-write.  (default: false)
675 # @rom: whether to create Read Only Memory (ROM) that cannot be
676 #     modified by the VM.  Any write attempts to such ROM will be
677 #     denied.  Most use cases want writable RAM instead of ROM.
678 #     However, selected use cases, like R/O NVDIMMs, can benefit from
679 #     ROM.  If set to 'on', create ROM; if set to 'off', create
680 #     writable RAM; if set to 'auto', the value of the @readonly
681 #     property is used.  This property is primarily helpful when we
682 #     want to have proper RAM in configurations that would
683 #     traditionally create ROM before this property was introduced: VM
684 #     templating, where we want to open a file readonly (@readonly set
685 #     to true) and mark the memory to be private for QEMU (@share set
686 #     to false).  For this use case, we need writable RAM instead of
687 #     ROM, and want to set this property to 'off'.  (default: auto,
688 #     since 8.2)
690 # Since: 2.1
692 { 'struct': 'MemoryBackendFileProperties',
693   'base': 'MemoryBackendProperties',
694   'data': { '*align': 'size',
695             '*offset': 'size',
696             '*discard-data': 'bool',
697             'mem-path': 'str',
698             '*pmem': { 'type': 'bool', 'if': 'CONFIG_LIBPMEM' },
699             '*readonly': 'bool',
700             '*rom': 'OnOffAuto' } }
703 # @MemoryBackendMemfdProperties:
705 # Properties for memory-backend-memfd objects.
707 # @hugetlb: if true, the file to be created resides in the hugetlbfs
708 #     filesystem (default: false)
710 # @hugetlbsize: the hugetlb page size on systems that support multiple
711 #     hugetlb page sizes (it must be a power of 2 value supported by
712 #     the system).  0 selects a default page size.  This option is
713 #     ignored if @hugetlb is false.  (default: 0)
715 # @seal: if true, create a sealed-file, which will block further
716 #     resizing of the memory (default: true)
718 # Since: 2.12
720 { 'struct': 'MemoryBackendMemfdProperties',
721   'base': 'MemoryBackendProperties',
722   'data': { '*hugetlb': 'bool',
723             '*hugetlbsize': 'size',
724             '*seal': 'bool' },
725   'if': 'CONFIG_LINUX' }
728 # @MemoryBackendShmProperties:
730 # Properties for memory-backend-shm objects.
732 # This memory backend supports only shared memory, which is the
733 # default.
735 # Since: 9.1
737 { 'struct': 'MemoryBackendShmProperties',
738   'base': 'MemoryBackendProperties',
739   'data': { },
740   'if': 'CONFIG_POSIX' }
743 # @MemoryBackendEpcProperties:
745 # Properties for memory-backend-epc objects.
747 # The @merge boolean option is false by default with epc
749 # The @dump boolean option is false by default with epc
751 # Since: 6.2
753 { 'struct': 'MemoryBackendEpcProperties',
754   'base': 'MemoryBackendProperties',
755   'data': {},
756   'if': 'CONFIG_LINUX' }
759 # @PrManagerHelperProperties:
761 # Properties for pr-manager-helper objects.
763 # @path: the path to a Unix domain socket for connecting to the
764 #     external helper
766 # Since: 2.11
768 { 'struct': 'PrManagerHelperProperties',
769   'data': { 'path': 'str' },
770   'if': 'CONFIG_LINUX' }
773 # @QtestProperties:
775 # Properties for qtest objects.
777 # @chardev: the chardev to be used to receive qtest commands on.
779 # @log: the path to a log file
781 # Since: 6.0
783 { 'struct': 'QtestProperties',
784         'data': { 'chardev': 'str',
785                   '*log': 'str' } }
788 # @RemoteObjectProperties:
790 # Properties for x-remote-object objects.
792 # @fd: file descriptor name previously passed via 'getfd' command
794 # @devid: the id of the device to be associated with the file
795 #     descriptor
797 # Since: 6.0
799 { 'struct': 'RemoteObjectProperties',
800   'data': { 'fd': 'str', 'devid': 'str' } }
803 # @VfioUserServerProperties:
805 # Properties for x-vfio-user-server objects.
807 # @socket: socket to be used by the libvfio-user library
809 # @device: the ID of the device to be emulated at the server
811 # Since: 7.1
813 { 'struct': 'VfioUserServerProperties',
814   'data': { 'socket': 'SocketAddress', 'device': 'str' } }
817 # @IOMMUFDProperties:
819 # Properties for iommufd objects.
821 # @fd: file descriptor name previously passed via 'getfd' command,
822 #     which represents a pre-opened /dev/iommu.  This allows the
823 #     iommufd object to be shared across several subsystems (VFIO,
824 #     VDPA, ...), and the file descriptor to be shared with other
825 #     process, e.g. DPDK.  (default: QEMU opens /dev/iommu by itself)
827 # Since: 9.0
829 { 'struct': 'IOMMUFDProperties',
830   'data': { '*fd': 'str' } }
833 # @AcpiGenericInitiatorProperties:
835 # Properties for acpi-generic-initiator objects.
837 # @pci-dev: PCI device ID to be associated with the node
839 # @node: NUMA node associated with the PCI device
841 # Since: 9.0
843 { 'struct': 'AcpiGenericInitiatorProperties',
844   'data': { 'pci-dev': 'str',
845             'node': 'uint32' } }
848 # @RngProperties:
850 # Properties for objects of classes derived from rng.
852 # @opened: if true, the device is opened immediately when applying
853 #     this option and will probably fail when processing the next
854 #     option.  Don't use; only provided for compatibility.
855 #     (default: false)
857 # Features:
859 # @deprecated: Member @opened is deprecated.  Setting true doesn't
860 #     make sense, and false is already the default.
862 # Since: 1.3
864 { 'struct': 'RngProperties',
865   'data': { '*opened': { 'type': 'bool', 'features': ['deprecated'] } } }
868 # @RngEgdProperties:
870 # Properties for rng-egd objects.
872 # @chardev: the name of a character device backend that provides the
873 #     connection to the RNG daemon
875 # Since: 1.3
877 { 'struct': 'RngEgdProperties',
878   'base': 'RngProperties',
879   'data': { 'chardev': 'str' } }
882 # @RngRandomProperties:
884 # Properties for rng-random objects.
886 # @filename: the filename of the device on the host to obtain entropy
887 #     from (default: "/dev/urandom")
889 # Since: 1.3
891 { 'struct': 'RngRandomProperties',
892   'base': 'RngProperties',
893   'data': { '*filename': 'str' },
894   'if': 'CONFIG_POSIX' }
897 # @SevCommonProperties:
899 # Properties common to objects that are derivatives of sev-common.
901 # @sev-device: SEV device to use (default: "/dev/sev")
903 # @cbitpos: C-bit location in page table entry (default: 0)
905 # @reduced-phys-bits: number of bits in physical addresses that become
906 #     unavailable when SEV is enabled
908 # @kernel-hashes: if true, add hashes of kernel/initrd/cmdline to a
909 #     designated guest firmware page for measured boot with -kernel
910 #     (default: false) (since 6.2)
912 # Since: 9.1
914 { 'struct': 'SevCommonProperties',
915   'data': { '*sev-device': 'str',
916             '*cbitpos': 'uint32',
917             'reduced-phys-bits': 'uint32',
918             '*kernel-hashes': 'bool' } }
921 # @SevGuestProperties:
923 # Properties for sev-guest objects.
925 # @dh-cert-file: guest owners DH certificate (encoded with base64)
927 # @session-file: guest owners session parameters (encoded with base64)
929 # @policy: SEV policy value (default: 0x1)
931 # @handle: SEV firmware handle (default: 0)
933 # @legacy-vm-type: Use legacy KVM_SEV_INIT KVM interface for creating
934 #    the VM.  The newer KVM_SEV_INIT2 interface, from Linux >= 6.10,
935 #    syncs additional vCPU state when initializing the VMSA
936 #    structures, which will result in a different guest measurement.
937 #    Set this to 'on' to force compatibility with older QEMU or kernel
938 #    versions that rely on legacy KVM_SEV_INIT behavior.  'auto' will
939 #    behave identically to 'on', but will automatically switch to
940 #    using KVM_SEV_INIT2 if the user specifies any additional options
941 #    that require it.  If set to 'off', QEMU will require
942 #    KVM_SEV_INIT2 unconditionally.
943 #    (default: off) (since 9.1)
945 # Since: 2.12
947 { 'struct': 'SevGuestProperties',
948   'base': 'SevCommonProperties',
949   'data': { '*dh-cert-file': 'str',
950             '*session-file': 'str',
951             '*policy': 'uint32',
952             '*handle': 'uint32',
953             '*legacy-vm-type': 'OnOffAuto' } }
956 # @SevSnpGuestProperties:
958 # Properties for sev-snp-guest objects.  Most of these are direct
959 # arguments for the KVM_SNP_* interfaces documented in the Linux
960 # kernel source under
961 # Documentation/arch/x86/amd-memory-encryption.rst, which are in turn
962 # closely coupled with the SNP_INIT/SNP_LAUNCH_* firmware commands
963 # documented in the SEV-SNP Firmware ABI Specification (Rev 0.9).
965 # More usage information is also available in the QEMU source tree
966 # under docs/amd-memory-encryption.
968 # @policy: the 'POLICY' parameter to the SNP_LAUNCH_START command, as
969 #     defined in the SEV-SNP firmware ABI (default: 0x30000)
971 # @guest-visible-workarounds: 16-byte, base64-encoded blob to report
972 #     hypervisor-defined workarounds, corresponding to the 'GOSVW'
973 #     parameter of the SNP_LAUNCH_START command defined in the SEV-SNP
974 #     firmware ABI (default: all-zero)
976 # @id-block: 96-byte, base64-encoded blob to provide the 'ID Block'
977 #     structure for the SNP_LAUNCH_FINISH command defined in the
978 #     SEV-SNP firmware ABI (default: all-zero)
980 # @id-auth: 4096-byte, base64-encoded blob to provide the 'ID
981 #     Authentication Information Structure' for the SNP_LAUNCH_FINISH
982 #     command defined in the SEV-SNP firmware ABI (default: all-zero)
984 # @author-key-enabled: true if 'id-auth' blob contains the 'AUTHOR_KEY'
985 #     field defined SEV-SNP firmware ABI (default: false)
987 # @host-data: 32-byte, base64-encoded, user-defined blob to provide to
988 #     the guest, as documented for the 'HOST_DATA' parameter of the
989 #     SNP_LAUNCH_FINISH command in the SEV-SNP firmware ABI (default:
990 #     all-zero)
992 # @vcek-disabled: Guests are by default allowed to choose between VLEK
993 #     (Versioned Loaded Endorsement Key) or VCEK (Versioned Chip
994 #     Endorsement Key) when requesting attestation reports from
995 #     firmware.  Set this to true to disable the use of VCEK.
996 #     (default: false) (since: 9.1)
998 # Since: 9.1
1000 { 'struct': 'SevSnpGuestProperties',
1001   'base': 'SevCommonProperties',
1002   'data': {
1003             '*policy': 'uint64',
1004             '*guest-visible-workarounds': 'str',
1005             '*id-block': 'str',
1006             '*id-auth': 'str',
1007             '*author-key-enabled': 'bool',
1008             '*host-data': 'str',
1009             '*vcek-disabled': 'bool' } }
1012 # @ThreadContextProperties:
1014 # Properties for thread context objects.
1016 # @cpu-affinity: the list of host CPU numbers used as CPU affinity for
1017 #     all threads created in the thread context (default: QEMU main
1018 #     thread CPU affinity)
1020 # @node-affinity: the list of host node numbers that will be resolved
1021 #     to a list of host CPU numbers used as CPU affinity.  This is a
1022 #     shortcut for specifying the list of host CPU numbers belonging
1023 #     to the host nodes manually by setting @cpu-affinity.
1024 #     (default: QEMU main thread affinity)
1026 # Since: 7.2
1028 { 'struct': 'ThreadContextProperties',
1029   'data': { '*cpu-affinity': ['uint16'],
1030             '*node-affinity': ['uint16'] } }
1034 # @ObjectType:
1036 # Features:
1038 # @unstable: Members @x-remote-object and @x-vfio-user-server are
1039 #     experimental.
1041 # Since: 6.0
1043 { 'enum': 'ObjectType',
1044   'data': [
1045     'acpi-generic-initiator',
1046     'authz-list',
1047     'authz-listfile',
1048     'authz-pam',
1049     'authz-simple',
1050     'can-bus',
1051     { 'name': 'can-host-socketcan',
1052       'if': 'CONFIG_LINUX' },
1053     'colo-compare',
1054     'cryptodev-backend',
1055     'cryptodev-backend-builtin',
1056     'cryptodev-backend-lkcf',
1057     { 'name': 'cryptodev-vhost-user',
1058       'if': 'CONFIG_VHOST_CRYPTO' },
1059     'dbus-vmstate',
1060     'filter-buffer',
1061     'filter-dump',
1062     'filter-mirror',
1063     'filter-redirector',
1064     'filter-replay',
1065     'filter-rewriter',
1066     'input-barrier',
1067     { 'name': 'input-linux',
1068       'if': 'CONFIG_LINUX' },
1069     'iommufd',
1070     'iothread',
1071     'main-loop',
1072     { 'name': 'memory-backend-epc',
1073       'if': 'CONFIG_LINUX' },
1074     'memory-backend-file',
1075     { 'name': 'memory-backend-memfd',
1076       'if': 'CONFIG_LINUX' },
1077     'memory-backend-ram',
1078     { 'name': 'memory-backend-shm',
1079       'if': 'CONFIG_POSIX' },
1080     'pef-guest',
1081     { 'name': 'pr-manager-helper',
1082       'if': 'CONFIG_LINUX' },
1083     'qtest',
1084     'rng-builtin',
1085     'rng-egd',
1086     { 'name': 'rng-random',
1087       'if': 'CONFIG_POSIX' },
1088     'secret',
1089     { 'name': 'secret_keyring',
1090       'if': 'CONFIG_SECRET_KEYRING' },
1091     'sev-guest',
1092     'sev-snp-guest',
1093     'thread-context',
1094     's390-pv-guest',
1095     'throttle-group',
1096     'tls-creds-anon',
1097     'tls-creds-psk',
1098     'tls-creds-x509',
1099     'tls-cipher-suites',
1100     { 'name': 'x-remote-object', 'features': [ 'unstable' ] },
1101     { 'name': 'x-vfio-user-server', 'features': [ 'unstable' ] }
1102   ] }
1105 # @ObjectOptions:
1107 # Describes the options of a user creatable QOM object.
1109 # @qom-type: the class name for the object to be created
1111 # @id: the name of the new object
1113 # Since: 6.0
1115 { 'union': 'ObjectOptions',
1116   'base': { 'qom-type': 'ObjectType',
1117             'id': 'str' },
1118   'discriminator': 'qom-type',
1119   'data': {
1120       'acpi-generic-initiator':     'AcpiGenericInitiatorProperties',
1121       'authz-list':                 'AuthZListProperties',
1122       'authz-listfile':             'AuthZListFileProperties',
1123       'authz-pam':                  'AuthZPAMProperties',
1124       'authz-simple':               'AuthZSimpleProperties',
1125       'can-host-socketcan':         { 'type': 'CanHostSocketcanProperties',
1126                                       'if': 'CONFIG_LINUX' },
1127       'colo-compare':               'ColoCompareProperties',
1128       'cryptodev-backend':          'CryptodevBackendProperties',
1129       'cryptodev-backend-builtin':  'CryptodevBackendProperties',
1130       'cryptodev-backend-lkcf':     'CryptodevBackendProperties',
1131       'cryptodev-vhost-user':       { 'type': 'CryptodevVhostUserProperties',
1132                                       'if': 'CONFIG_VHOST_CRYPTO' },
1133       'dbus-vmstate':               'DBusVMStateProperties',
1134       'filter-buffer':              'FilterBufferProperties',
1135       'filter-dump':                'FilterDumpProperties',
1136       'filter-mirror':              'FilterMirrorProperties',
1137       'filter-redirector':          'FilterRedirectorProperties',
1138       'filter-replay':              'NetfilterProperties',
1139       'filter-rewriter':            'FilterRewriterProperties',
1140       'input-barrier':              'InputBarrierProperties',
1141       'input-linux':                { 'type': 'InputLinuxProperties',
1142                                       'if': 'CONFIG_LINUX' },
1143       'iommufd':                    'IOMMUFDProperties',
1144       'iothread':                   'IothreadProperties',
1145       'main-loop':                  'MainLoopProperties',
1146       'memory-backend-epc':         { 'type': 'MemoryBackendEpcProperties',
1147                                       'if': 'CONFIG_LINUX' },
1148       'memory-backend-file':        'MemoryBackendFileProperties',
1149       'memory-backend-memfd':       { 'type': 'MemoryBackendMemfdProperties',
1150                                       'if': 'CONFIG_LINUX' },
1151       'memory-backend-ram':         'MemoryBackendProperties',
1152       'memory-backend-shm':         { 'type': 'MemoryBackendShmProperties',
1153                                       'if': 'CONFIG_POSIX' },
1154       'pr-manager-helper':          { 'type': 'PrManagerHelperProperties',
1155                                       'if': 'CONFIG_LINUX' },
1156       'qtest':                      'QtestProperties',
1157       'rng-builtin':                'RngProperties',
1158       'rng-egd':                    'RngEgdProperties',
1159       'rng-random':                 { 'type': 'RngRandomProperties',
1160                                       'if': 'CONFIG_POSIX' },
1161       'secret':                     'SecretProperties',
1162       'secret_keyring':             { 'type': 'SecretKeyringProperties',
1163                                       'if': 'CONFIG_SECRET_KEYRING' },
1164       'sev-guest':                  'SevGuestProperties',
1165       'sev-snp-guest':              'SevSnpGuestProperties',
1166       'thread-context':             'ThreadContextProperties',
1167       'throttle-group':             'ThrottleGroupProperties',
1168       'tls-creds-anon':             'TlsCredsAnonProperties',
1169       'tls-creds-psk':              'TlsCredsPskProperties',
1170       'tls-creds-x509':             'TlsCredsX509Properties',
1171       'tls-cipher-suites':          'TlsCredsProperties',
1172       'x-remote-object':            'RemoteObjectProperties',
1173       'x-vfio-user-server':         'VfioUserServerProperties'
1174   } }
1177 # @object-add:
1179 # Create a QOM object.
1181 # Errors:
1182 #     - Error if @qom-type is not a valid class name
1184 # Since: 2.0
1186 # .. qmp-example::
1188 #     -> { "execute": "object-add",
1189 #          "arguments": { "qom-type": "rng-random", "id": "rng1",
1190 #                         "filename": "/dev/hwrng" } }
1191 #     <- { "return": {} }
1193 { 'command': 'object-add', 'data': 'ObjectOptions', 'boxed': true,
1194   'allow-preconfig': true }
1197 # @object-del:
1199 # Remove a QOM object.
1201 # @id: the name of the QOM object to remove
1203 # Errors:
1204 #     - Error if @id is not a valid id for a QOM object
1206 # Since: 2.0
1208 # .. qmp-example::
1210 #     -> { "execute": "object-del", "arguments": { "id": "rng1" } }
1211 #     <- { "return": {} }
1213 { 'command': 'object-del', 'data': {'id': 'str'},
1214   'allow-preconfig': true }