tcg: Split out exec/user/guest-base.h
[qemu/ar7.git] / qapi / machine.json
blob37660d8f2a1dff0490330d43ee9b74250c4a5536
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 # = Machines
9 ##
11 { 'include': 'common.json' }
14 # @SysEmuTarget:
16 # The comprehensive enumeration of QEMU system emulation ("softmmu")
17 # targets.  Run "./configure --help" in the project root directory,
18 # and look for the \*-softmmu targets near the "--target-list" option.
19 # The individual target constants are not documented here, for the
20 # time being.
22 # @rx: since 5.0
24 # @avr: since 5.1
26 # Notes: The resulting QMP strings can be appended to the
27 #     "qemu-system-" prefix to produce the corresponding QEMU
28 #     executable name.  This is true even for "qemu-system-x86_64".
30 # Since: 3.0
32 { 'enum' : 'SysEmuTarget',
33   'data' : [ 'aarch64', 'alpha', 'arm', 'avr', 'cris', 'hppa', 'i386',
34              'loongarch64', 'm68k', 'microblaze', 'microblazeel', 'mips', 'mips64',
35              'mips64el', 'mipsel', 'nios2', 'or1k', 'ppc',
36              'ppc64', 'riscv32', 'riscv64', 'rx', 's390x', 'sh4',
37              'sh4eb', 'sparc', 'sparc64', 'tricore',
38              'x86_64', 'xtensa', 'xtensaeb' ] }
41 # @CpuS390State:
43 # An enumeration of cpu states that can be assumed by a virtual S390
44 # CPU
46 # Since: 2.12
48 { 'enum': 'CpuS390State',
49   'prefix': 'S390_CPU_STATE',
50   'data': [ 'uninitialized', 'stopped', 'check-stop', 'operating', 'load' ] }
53 # @CpuInfoS390:
55 # Additional information about a virtual S390 CPU
57 # @cpu-state: the virtual CPU's state
59 # Since: 2.12
61 { 'struct': 'CpuInfoS390', 'data': { 'cpu-state': 'CpuS390State' } }
64 # @CpuInfoFast:
66 # Information about a virtual CPU
68 # @cpu-index: index of the virtual CPU
70 # @qom-path: path to the CPU object in the QOM tree
72 # @thread-id: ID of the underlying host thread
74 # @props: properties describing to which node/socket/core/thread
75 #     virtual CPU belongs to, provided if supported by board
77 # @target: the QEMU system emulation target, which determines which
78 #     additional fields will be listed (since 3.0)
80 # Since: 2.12
82 { 'union'         : 'CpuInfoFast',
83   'base'          : { 'cpu-index'    : 'int',
84                       'qom-path'     : 'str',
85                       'thread-id'    : 'int',
86                       '*props'       : 'CpuInstanceProperties',
87                       'target'       : 'SysEmuTarget' },
88   'discriminator' : 'target',
89   'data'          : { 's390x'        : 'CpuInfoS390' } }
92 # @query-cpus-fast:
94 # Returns information about all virtual CPUs.
96 # Returns: list of @CpuInfoFast
98 # Since: 2.12
100 # Example:
102 # -> { "execute": "query-cpus-fast" }
103 # <- { "return": [
104 #         {
105 #             "thread-id": 25627,
106 #             "props": {
107 #                 "core-id": 0,
108 #                 "thread-id": 0,
109 #                 "socket-id": 0
110 #             },
111 #             "qom-path": "/machine/unattached/device[0]",
112 #             "target":"x86_64",
113 #             "cpu-index": 0
114 #         },
115 #         {
116 #             "thread-id": 25628,
117 #             "props": {
118 #                 "core-id": 0,
119 #                 "thread-id": 0,
120 #                 "socket-id": 1
121 #             },
122 #             "qom-path": "/machine/unattached/device[2]",
123 #             "target":"x86_64",
124 #             "cpu-index": 1
125 #         }
126 #     ]
127 # }
129 { 'command': 'query-cpus-fast', 'returns': [ 'CpuInfoFast' ] }
132 # @MachineInfo:
134 # Information describing a machine.
136 # @name: the name of the machine
138 # @alias: an alias for the machine name
140 # @is-default: whether the machine is default
142 # @cpu-max: maximum number of CPUs supported by the machine type
143 #     (since 1.5)
145 # @hotpluggable-cpus: cpu hotplug via -device is supported (since 2.7)
147 # @numa-mem-supported: true if '-numa node,mem' option is supported by
148 #     the machine type and false otherwise (since 4.1)
150 # @deprecated: if true, the machine type is deprecated and may be
151 #     removed in future versions of QEMU according to the QEMU
152 #     deprecation policy (since 4.1)
154 # @default-cpu-type: default CPU model typename if none is requested
155 #     via the -cpu argument.  (since 4.2)
157 # @default-ram-id: the default ID of initial RAM memory backend (since
158 #     5.2)
160 # @acpi: machine type supports ACPI (since 8.0)
162 # Since: 1.2
164 { 'struct': 'MachineInfo',
165   'data': { 'name': 'str', '*alias': 'str',
166             '*is-default': 'bool', 'cpu-max': 'int',
167             'hotpluggable-cpus': 'bool',  'numa-mem-supported': 'bool',
168             'deprecated': 'bool', '*default-cpu-type': 'str',
169             '*default-ram-id': 'str', 'acpi': 'bool' } }
172 # @query-machines:
174 # Return a list of supported machines
176 # Returns: a list of MachineInfo
178 # Since: 1.2
180 { 'command': 'query-machines', 'returns': ['MachineInfo'] }
183 # @CurrentMachineParams:
185 # Information describing the running machine parameters.
187 # @wakeup-suspend-support: true if the machine supports wake up from
188 #     suspend
190 # Since: 4.0
192 { 'struct': 'CurrentMachineParams',
193   'data': { 'wakeup-suspend-support': 'bool'} }
196 # @query-current-machine:
198 # Return information on the current virtual machine.
200 # Returns: CurrentMachineParams
202 # Since: 4.0
204 { 'command': 'query-current-machine', 'returns': 'CurrentMachineParams' }
207 # @TargetInfo:
209 # Information describing the QEMU target.
211 # @arch: the target architecture
213 # Since: 1.2
215 { 'struct': 'TargetInfo',
216   'data': { 'arch': 'SysEmuTarget' } }
219 # @query-target:
221 # Return information about the target for this QEMU
223 # Returns: TargetInfo
225 # Since: 1.2
227 { 'command': 'query-target', 'returns': 'TargetInfo' }
230 # @UuidInfo:
232 # Guest UUID information (Universally Unique Identifier).
234 # @UUID: the UUID of the guest
236 # Since: 0.14
238 # Notes: If no UUID was specified for the guest, a null UUID is
239 #     returned.
241 { 'struct': 'UuidInfo', 'data': {'UUID': 'str'} }
244 # @query-uuid:
246 # Query the guest UUID information.
248 # Returns: The @UuidInfo for the guest
250 # Since: 0.14
252 # Example:
254 # -> { "execute": "query-uuid" }
255 # <- { "return": { "UUID": "550e8400-e29b-41d4-a716-446655440000" } }
257 { 'command': 'query-uuid', 'returns': 'UuidInfo', 'allow-preconfig': true }
260 # @GuidInfo:
262 # GUID information.
264 # @guid: the globally unique identifier
266 # Since: 2.9
268 { 'struct': 'GuidInfo', 'data': {'guid': 'str'} }
271 # @query-vm-generation-id:
273 # Show Virtual Machine Generation ID
275 # Since: 2.9
277 { 'command': 'query-vm-generation-id', 'returns': 'GuidInfo' }
280 # @system_reset:
282 # Performs a hard reset of a guest.
284 # Since: 0.14
286 # Example:
288 # -> { "execute": "system_reset" }
289 # <- { "return": {} }
291 { 'command': 'system_reset' }
294 # @system_powerdown:
296 # Requests that a guest perform a powerdown operation.
298 # Since: 0.14
300 # Notes: A guest may or may not respond to this command.  This command
301 #     returning does not indicate that a guest has accepted the
302 #     request or that it has shut down.  Many guests will respond to
303 #     this command by prompting the user in some way.
305 # Example:
307 # -> { "execute": "system_powerdown" }
308 # <- { "return": {} }
310 { 'command': 'system_powerdown' }
313 # @system_wakeup:
315 # Wake up guest from suspend.  If the guest has wake-up from suspend
316 # support enabled (wakeup-suspend-support flag from
317 # query-current-machine), wake-up guest from suspend if the guest is
318 # in SUSPENDED state.  Return an error otherwise.
320 # Since: 1.1
322 # Returns: nothing.
324 # Note: prior to 4.0, this command does nothing in case the guest
325 #     isn't suspended.
327 # Example:
329 # -> { "execute": "system_wakeup" }
330 # <- { "return": {} }
332 { 'command': 'system_wakeup' }
335 # @LostTickPolicy:
337 # Policy for handling lost ticks in timer devices.  Ticks end up
338 # getting lost when, for example, the guest is paused.
340 # @discard: throw away the missed ticks and continue with future
341 #     injection normally.  The guest OS will see the timer jump ahead
342 #     by a potentially quite significant amount all at once, as if the
343 #     intervening chunk of time had simply not existed; needless to
344 #     say, such a sudden jump can easily confuse a guest OS which is
345 #     not specifically prepared to deal with it.  Assuming the guest
346 #     OS can deal correctly with the time jump, the time in the guest
347 #     and in the host should now match.
349 # @delay: continue to deliver ticks at the normal rate.  The guest OS
350 #     will not notice anything is amiss, as from its point of view
351 #     time will have continued to flow normally.  The time in the
352 #     guest should now be behind the time in the host by exactly the
353 #     amount of time during which ticks have been missed.
355 # @slew: deliver ticks at a higher rate to catch up with the missed
356 #     ticks.  The guest OS will not notice anything is amiss, as from
357 #     its point of view time will have continued to flow normally.
358 #     Once the timer has managed to catch up with all the missing
359 #     ticks, the time in the guest and in the host should match.
361 # Since: 2.0
363 { 'enum': 'LostTickPolicy',
364   'data': ['discard', 'delay', 'slew' ] }
367 # @inject-nmi:
369 # Injects a Non-Maskable Interrupt into the default CPU (x86/s390) or
370 # all CPUs (ppc64). The command fails when the guest doesn't support
371 # injecting.
373 # Returns: If successful, nothing
375 # Since: 0.14
377 # Note: prior to 2.1, this command was only supported for x86 and s390
378 #     VMs
380 # Example:
382 # -> { "execute": "inject-nmi" }
383 # <- { "return": {} }
385 { 'command': 'inject-nmi' }
388 # @KvmInfo:
390 # Information about support for KVM acceleration
392 # @enabled: true if KVM acceleration is active
394 # @present: true if KVM acceleration is built into this executable
396 # Since: 0.14
398 { 'struct': 'KvmInfo', 'data': {'enabled': 'bool', 'present': 'bool'} }
401 # @query-kvm:
403 # Returns information about KVM acceleration
405 # Returns: @KvmInfo
407 # Since: 0.14
409 # Example:
411 # -> { "execute": "query-kvm" }
412 # <- { "return": { "enabled": true, "present": true } }
414 { 'command': 'query-kvm', 'returns': 'KvmInfo' }
417 # @NumaOptionsType:
419 # @node: NUMA nodes configuration
421 # @dist: NUMA distance configuration (since 2.10)
423 # @cpu: property based CPU(s) to node mapping (Since: 2.10)
425 # @hmat-lb: memory latency and bandwidth information (Since: 5.0)
427 # @hmat-cache: memory side cache information (Since: 5.0)
429 # Since: 2.1
431 { 'enum': 'NumaOptionsType',
432   'data': [ 'node', 'dist', 'cpu', 'hmat-lb', 'hmat-cache' ] }
435 # @NumaOptions:
437 # A discriminated record of NUMA options.  (for OptsVisitor)
439 # Since: 2.1
441 { 'union': 'NumaOptions',
442   'base': { 'type': 'NumaOptionsType' },
443   'discriminator': 'type',
444   'data': {
445     'node': 'NumaNodeOptions',
446     'dist': 'NumaDistOptions',
447     'cpu': 'NumaCpuOptions',
448     'hmat-lb': 'NumaHmatLBOptions',
449     'hmat-cache': 'NumaHmatCacheOptions' }}
452 # @NumaNodeOptions:
454 # Create a guest NUMA node.  (for OptsVisitor)
456 # @nodeid: NUMA node ID (increase by 1 from 0 if omitted)
458 # @cpus: VCPUs belonging to this node (assign VCPUS round-robin if
459 #     omitted)
461 # @mem: memory size of this node; mutually exclusive with @memdev.
462 #     Equally divide total memory among nodes if both @mem and @memdev
463 #     are omitted.
465 # @memdev: memory backend object.  If specified for one node, it must
466 #     be specified for all nodes.
468 # @initiator: defined in ACPI 6.3 Chapter 5.2.27.3 Table 5-145, points
469 #     to the nodeid which has the memory controller responsible for
470 #     this NUMA node.  This field provides additional information as
471 #     to the initiator node that is closest (as in directly attached)
472 #     to this node, and therefore has the best performance (since 5.0)
474 # Since: 2.1
476 { 'struct': 'NumaNodeOptions',
477   'data': {
478    '*nodeid': 'uint16',
479    '*cpus':   ['uint16'],
480    '*mem':    'size',
481    '*memdev': 'str',
482    '*initiator': 'uint16' }}
485 # @NumaDistOptions:
487 # Set the distance between 2 NUMA nodes.
489 # @src: source NUMA node.
491 # @dst: destination NUMA node.
493 # @val: NUMA distance from source node to destination node.  When a
494 #     node is unreachable from another node, set the distance between
495 #     them to 255.
497 # Since: 2.10
499 { 'struct': 'NumaDistOptions',
500   'data': {
501    'src': 'uint16',
502    'dst': 'uint16',
503    'val': 'uint8' }}
506 # @CXLFixedMemoryWindowOptions:
508 # Create a CXL Fixed Memory Window
510 # @size: Size of the Fixed Memory Window in bytes.  Must be a multiple
511 #     of 256MiB.
513 # @interleave-granularity: Number of contiguous bytes for which
514 #     accesses will go to a given interleave target.  Accepted values
515 #     [256, 512, 1k, 2k, 4k, 8k, 16k]
517 # @targets: Target root bridge IDs from -device ...,id=<ID> for each
518 #     root bridge.
520 # Since: 7.1
522 { 'struct': 'CXLFixedMemoryWindowOptions',
523   'data': {
524       'size': 'size',
525       '*interleave-granularity': 'size',
526       'targets': ['str'] }}
529 # @CXLFMWProperties:
531 # List of CXL Fixed Memory Windows.
533 # @cxl-fmw: List of CXLFixedMemoryWindowOptions
535 # Since: 7.1
537 { 'struct' : 'CXLFMWProperties',
538   'data': { 'cxl-fmw': ['CXLFixedMemoryWindowOptions'] }
542 # @X86CPURegister32:
544 # A X86 32-bit register
546 # Since: 1.5
548 { 'enum': 'X86CPURegister32',
549   'data': [ 'EAX', 'EBX', 'ECX', 'EDX', 'ESP', 'EBP', 'ESI', 'EDI' ] }
552 # @X86CPUFeatureWordInfo:
554 # Information about a X86 CPU feature word
556 # @cpuid-input-eax: Input EAX value for CPUID instruction for that
557 #     feature word
559 # @cpuid-input-ecx: Input ECX value for CPUID instruction for that
560 #     feature word
562 # @cpuid-register: Output register containing the feature bits
564 # @features: value of output register, containing the feature bits
566 # Since: 1.5
568 { 'struct': 'X86CPUFeatureWordInfo',
569   'data': { 'cpuid-input-eax': 'int',
570             '*cpuid-input-ecx': 'int',
571             'cpuid-register': 'X86CPURegister32',
572             'features': 'int' } }
575 # @DummyForceArrays:
577 # Not used by QMP; hack to let us use X86CPUFeatureWordInfoList
578 # internally
580 # Since: 2.5
582 { 'struct': 'DummyForceArrays',
583   'data': { 'unused': ['X86CPUFeatureWordInfo'] } }
586 # @NumaCpuOptions:
588 # Option "-numa cpu" overrides default cpu to node mapping.  It
589 # accepts the same set of cpu properties as returned by
590 # query-hotpluggable-cpus[].props, where node-id could be used to
591 # override default node mapping.
593 # Since: 2.10
595 { 'struct': 'NumaCpuOptions',
596    'base': 'CpuInstanceProperties',
597    'data' : {} }
600 # @HmatLBMemoryHierarchy:
602 # The memory hierarchy in the System Locality Latency and Bandwidth
603 # Information Structure of HMAT (Heterogeneous Memory Attribute Table)
605 # For more information about @HmatLBMemoryHierarchy, see chapter
606 # 5.2.27.4: Table 5-146: Field "Flags" of ACPI 6.3 spec.
608 # @memory: the structure represents the memory performance
610 # @first-level: first level of memory side cache
612 # @second-level: second level of memory side cache
614 # @third-level: third level of memory side cache
616 # Since: 5.0
618 { 'enum': 'HmatLBMemoryHierarchy',
619   'data': [ 'memory', 'first-level', 'second-level', 'third-level' ] }
622 # @HmatLBDataType:
624 # Data type in the System Locality Latency and Bandwidth Information
625 # Structure of HMAT (Heterogeneous Memory Attribute Table)
627 # For more information about @HmatLBDataType, see chapter 5.2.27.4:
628 # Table 5-146:  Field "Data Type" of ACPI 6.3 spec.
630 # @access-latency: access latency (nanoseconds)
632 # @read-latency: read latency (nanoseconds)
634 # @write-latency: write latency (nanoseconds)
636 # @access-bandwidth: access bandwidth (Bytes per second)
638 # @read-bandwidth: read bandwidth (Bytes per second)
640 # @write-bandwidth: write bandwidth (Bytes per second)
642 # Since: 5.0
644 { 'enum': 'HmatLBDataType',
645   'data': [ 'access-latency', 'read-latency', 'write-latency',
646             'access-bandwidth', 'read-bandwidth', 'write-bandwidth' ] }
649 # @NumaHmatLBOptions:
651 # Set the system locality latency and bandwidth information between
652 # Initiator and Target proximity Domains.
654 # For more information about @NumaHmatLBOptions, see chapter 5.2.27.4:
655 # Table 5-146 of ACPI 6.3 spec.
657 # @initiator: the Initiator Proximity Domain.
659 # @target: the Target Proximity Domain.
661 # @hierarchy: the Memory Hierarchy.  Indicates the performance of
662 #     memory or side cache.
664 # @data-type: presents the type of data, access/read/write latency or
665 #     hit latency.
667 # @latency: the value of latency from @initiator to @target proximity
668 #     domain, the latency unit is "ns(nanosecond)".
670 # @bandwidth: the value of bandwidth between @initiator and @target
671 #     proximity domain, the bandwidth unit is "Bytes per second".
673 # Since: 5.0
675 { 'struct': 'NumaHmatLBOptions',
676     'data': {
677     'initiator': 'uint16',
678     'target': 'uint16',
679     'hierarchy': 'HmatLBMemoryHierarchy',
680     'data-type': 'HmatLBDataType',
681     '*latency': 'uint64',
682     '*bandwidth': 'size' }}
685 # @HmatCacheAssociativity:
687 # Cache associativity in the Memory Side Cache Information Structure
688 # of HMAT
690 # For more information of @HmatCacheAssociativity, see chapter
691 # 5.2.27.5: Table 5-147 of ACPI 6.3 spec.
693 # @none: None (no memory side cache in this proximity domain, or cache
694 #     associativity unknown)
696 # @direct: Direct Mapped
698 # @complex: Complex Cache Indexing (implementation specific)
700 # Since: 5.0
702 { 'enum': 'HmatCacheAssociativity',
703   'data': [ 'none', 'direct', 'complex' ] }
706 # @HmatCacheWritePolicy:
708 # Cache write policy in the Memory Side Cache Information Structure of
709 # HMAT
711 # For more information of @HmatCacheWritePolicy, see chapter 5.2.27.5:
712 # Table 5-147: Field "Cache Attributes" of ACPI 6.3 spec.
714 # @none: None (no memory side cache in this proximity domain, or cache
715 #     write policy unknown)
717 # @write-back: Write Back (WB)
719 # @write-through: Write Through (WT)
721 # Since: 5.0
723 { 'enum': 'HmatCacheWritePolicy',
724   'data': [ 'none', 'write-back', 'write-through' ] }
727 # @NumaHmatCacheOptions:
729 # Set the memory side cache information for a given memory domain.
731 # For more information of @NumaHmatCacheOptions, see chapter 5.2.27.5:
732 # Table 5-147: Field "Cache Attributes" of ACPI 6.3 spec.
734 # @node-id: the memory proximity domain to which the memory belongs.
736 # @size: the size of memory side cache in bytes.
738 # @level: the cache level described in this structure.
740 # @associativity: the cache associativity,
741 #     none/direct-mapped/complex(complex cache indexing).
743 # @policy: the write policy, none/write-back/write-through.
745 # @line: the cache Line size in bytes.
747 # Since: 5.0
749 { 'struct': 'NumaHmatCacheOptions',
750   'data': {
751    'node-id': 'uint32',
752    'size': 'size',
753    'level': 'uint8',
754    'associativity': 'HmatCacheAssociativity',
755    'policy': 'HmatCacheWritePolicy',
756    'line': 'uint16' }}
759 # @memsave:
761 # Save a portion of guest memory to a file.
763 # @val: the virtual address of the guest to start from
765 # @size: the size of memory region to save
767 # @filename: the file to save the memory to as binary data
769 # @cpu-index: the index of the virtual CPU to use for translating the
770 #     virtual address (defaults to CPU 0)
772 # Returns: Nothing on success
774 # Since: 0.14
776 # Notes: Errors were not reliably returned until 1.1
778 # Example:
780 # -> { "execute": "memsave",
781 #      "arguments": { "val": 10,
782 #                     "size": 100,
783 #                     "filename": "/tmp/virtual-mem-dump" } }
784 # <- { "return": {} }
786 { 'command': 'memsave',
787   'data': {'val': 'int', 'size': 'int', 'filename': 'str', '*cpu-index': 'int'} }
790 # @pmemsave:
792 # Save a portion of guest physical memory to a file.
794 # @val: the physical address of the guest to start from
796 # @size: the size of memory region to save
798 # @filename: the file to save the memory to as binary data
800 # Returns: Nothing on success
802 # Since: 0.14
804 # Notes: Errors were not reliably returned until 1.1
806 # Example:
808 # -> { "execute": "pmemsave",
809 #      "arguments": { "val": 10,
810 #                     "size": 100,
811 #                     "filename": "/tmp/physical-mem-dump" } }
812 # <- { "return": {} }
814 { 'command': 'pmemsave',
815   'data': {'val': 'int', 'size': 'int', 'filename': 'str'} }
818 # @Memdev:
820 # Information about memory backend
822 # @id: backend's ID if backend has 'id' property (since 2.9)
824 # @size: memory backend size
826 # @merge: whether memory merge support is enabled
828 # @dump: whether memory backend's memory is included in a core dump
830 # @prealloc: whether memory was preallocated
832 # @share: whether memory is private to QEMU or shared (since 6.1)
834 # @reserve: whether swap space (or huge pages) was reserved if
835 #     applicable.  This corresponds to the user configuration and not
836 #     the actual behavior implemented in the OS to perform the
837 #     reservation.  For example, Linux will never reserve swap space
838 #     for shared file mappings.  (since 6.1)
840 # @host-nodes: host nodes for its memory policy
842 # @policy: memory policy of memory backend
844 # Since: 2.1
846 { 'struct': 'Memdev',
847   'data': {
848     '*id':        'str',
849     'size':       'size',
850     'merge':      'bool',
851     'dump':       'bool',
852     'prealloc':   'bool',
853     'share':      'bool',
854     '*reserve':    'bool',
855     'host-nodes': ['uint16'],
856     'policy':     'HostMemPolicy' }}
859 # @query-memdev:
861 # Returns information for all memory backends.
863 # Returns: a list of @Memdev.
865 # Since: 2.1
867 # Example:
869 # -> { "execute": "query-memdev" }
870 # <- { "return": [
871 #        {
872 #          "id": "mem1",
873 #          "size": 536870912,
874 #          "merge": false,
875 #          "dump": true,
876 #          "prealloc": false,
877 #          "share": false,
878 #          "host-nodes": [0, 1],
879 #          "policy": "bind"
880 #        },
881 #        {
882 #          "size": 536870912,
883 #          "merge": false,
884 #          "dump": true,
885 #          "prealloc": true,
886 #          "share": false,
887 #          "host-nodes": [2, 3],
888 #          "policy": "preferred"
889 #        }
890 #      ]
891 #    }
893 { 'command': 'query-memdev', 'returns': ['Memdev'], 'allow-preconfig': true }
896 # @CpuInstanceProperties:
898 # List of properties to be used for hotplugging a CPU instance, it
899 # should be passed by management with device_add command when a CPU is
900 # being hotplugged.
902 # @node-id: NUMA node ID the CPU belongs to
904 # @socket-id: socket number within node/board the CPU belongs to
906 # @die-id: die number within socket the CPU belongs to (since 4.1)
908 # @cluster-id: cluster number within die the CPU belongs to (since
909 #     7.1)
911 # @core-id: core number within cluster the CPU belongs to
913 # @thread-id: thread number within core the CPU belongs to
915 # Note: currently there are 6 properties that could be present but
916 #     management should be prepared to pass through other properties
917 #     with device_add command to allow for future interface extension.
918 #     This also requires the filed names to be kept in sync with the
919 #     properties passed to -device/device_add.
921 # Since: 2.7
923 { 'struct': 'CpuInstanceProperties',
924   'data': { '*node-id': 'int',
925             '*socket-id': 'int',
926             '*die-id': 'int',
927             '*cluster-id': 'int',
928             '*core-id': 'int',
929             '*thread-id': 'int'
930   }
934 # @HotpluggableCPU:
936 # @type: CPU object type for usage with device_add command
938 # @props: list of properties to be used for hotplugging CPU
940 # @vcpus-count: number of logical VCPU threads @HotpluggableCPU
941 #     provides
943 # @qom-path: link to existing CPU object if CPU is present or omitted
944 #     if CPU is not present.
946 # Since: 2.7
948 { 'struct': 'HotpluggableCPU',
949   'data': { 'type': 'str',
950             'vcpus-count': 'int',
951             'props': 'CpuInstanceProperties',
952             '*qom-path': 'str'
953           }
957 # @query-hotpluggable-cpus:
959 # TODO: Better documentation; currently there is none.
961 # Returns: a list of HotpluggableCPU objects.
963 # Since: 2.7
965 # Examples:
967 # For pseries machine type started with -smp 2,cores=2,maxcpus=4 -cpu
968 # POWER8:
970 # -> { "execute": "query-hotpluggable-cpus" }
971 # <- {"return": [
972 #      { "props": { "core-id": 8 }, "type": "POWER8-spapr-cpu-core",
973 #        "vcpus-count": 1 },
974 #      { "props": { "core-id": 0 }, "type": "POWER8-spapr-cpu-core",
975 #        "vcpus-count": 1, "qom-path": "/machine/unattached/device[0]"}
976 #    ]}'
978 # For pc machine type started with -smp 1,maxcpus=2:
980 # -> { "execute": "query-hotpluggable-cpus" }
981 # <- {"return": [
982 #      {
983 #         "type": "qemu64-x86_64-cpu", "vcpus-count": 1,
984 #         "props": {"core-id": 0, "socket-id": 1, "thread-id": 0}
985 #      },
986 #      {
987 #         "qom-path": "/machine/unattached/device[0]",
988 #         "type": "qemu64-x86_64-cpu", "vcpus-count": 1,
989 #         "props": {"core-id": 0, "socket-id": 0, "thread-id": 0}
990 #      }
991 #    ]}
993 # For s390x-virtio-ccw machine type started with -smp 1,maxcpus=2 -cpu
994 # qemu (Since: 2.11):
996 # -> { "execute": "query-hotpluggable-cpus" }
997 # <- {"return": [
998 #      {
999 #         "type": "qemu-s390x-cpu", "vcpus-count": 1,
1000 #         "props": { "core-id": 1 }
1001 #      },
1002 #      {
1003 #         "qom-path": "/machine/unattached/device[0]",
1004 #         "type": "qemu-s390x-cpu", "vcpus-count": 1,
1005 #         "props": { "core-id": 0 }
1006 #      }
1007 #    ]}
1009 { 'command': 'query-hotpluggable-cpus', 'returns': ['HotpluggableCPU'],
1010              'allow-preconfig': true }
1013 # @set-numa-node:
1015 # Runtime equivalent of '-numa' CLI option, available at preconfigure
1016 # stage to configure numa mapping before initializing machine.
1018 # Since: 3.0
1020 { 'command': 'set-numa-node', 'boxed': true,
1021   'data': 'NumaOptions',
1022   'allow-preconfig': true
1026 # @balloon:
1028 # Request the balloon driver to change its balloon size.
1030 # @value: the target logical size of the VM in bytes.  We can deduce
1031 #     the size of the balloon using this formula:
1033 #        logical_vm_size = vm_ram_size - balloon_size
1035 #     From it we have: balloon_size = vm_ram_size - @value
1037 # Returns:
1038 # - Nothing on success
1039 # - If the balloon driver is enabled but not functional because the
1040 #   KVM kernel module cannot support it, KVMMissingCap
1041 # - If no balloon device is present, DeviceNotActive
1043 # Notes: This command just issues a request to the guest.  When it
1044 #     returns, the balloon size may not have changed.  A guest can
1045 #     change the balloon size independent of this command.
1047 # Since: 0.14
1049 # Example:
1051 # -> { "execute": "balloon", "arguments": { "value": 536870912 } }
1052 # <- { "return": {} }
1054 # With a 2.5GiB guest this command inflated the ballon to 3GiB.
1056 { 'command': 'balloon', 'data': {'value': 'int'} }
1059 # @BalloonInfo:
1061 # Information about the guest balloon device.
1063 # @actual: the logical size of the VM in bytes Formula used:
1064 #     logical_vm_size = vm_ram_size - balloon_size
1066 # Since: 0.14
1068 { 'struct': 'BalloonInfo', 'data': {'actual': 'int' } }
1071 # @query-balloon:
1073 # Return information about the balloon device.
1075 # Returns:
1076 # - @BalloonInfo on success
1077 # - If the balloon driver is enabled but not functional because the
1078 #   KVM kernel module cannot support it, KVMMissingCap
1079 # - If no balloon device is present, DeviceNotActive
1081 # Since: 0.14
1083 # Example:
1085 # -> { "execute": "query-balloon" }
1086 # <- { "return": {
1087 #          "actual": 1073741824
1088 #       }
1089 #    }
1091 { 'command': 'query-balloon', 'returns': 'BalloonInfo' }
1094 # @BALLOON_CHANGE:
1096 # Emitted when the guest changes the actual BALLOON level.  This value
1097 # is equivalent to the @actual field return by the 'query-balloon'
1098 # command
1100 # @actual: the logical size of the VM in bytes Formula used:
1101 #     logical_vm_size = vm_ram_size - balloon_size
1103 # Note: this event is rate-limited.
1105 # Since: 1.2
1107 # Example:
1109 # <- { "event": "BALLOON_CHANGE",
1110 #      "data": { "actual": 944766976 },
1111 #      "timestamp": { "seconds": 1267020223, "microseconds": 435656 } }
1113 { 'event': 'BALLOON_CHANGE',
1114   'data': { 'actual': 'int' } }
1117 # @MemoryInfo:
1119 # Actual memory information in bytes.
1121 # @base-memory: size of "base" memory specified with command line
1122 #     option -m.
1124 # @plugged-memory: size of memory that can be hot-unplugged.  This
1125 #     field is omitted if target doesn't support memory hotplug (i.e.
1126 #     CONFIG_MEM_DEVICE not defined at build time).
1128 # Since: 2.11
1130 { 'struct': 'MemoryInfo',
1131   'data'  : { 'base-memory': 'size', '*plugged-memory': 'size' } }
1134 # @query-memory-size-summary:
1136 # Return the amount of initially allocated and present hotpluggable
1137 # (if enabled) memory in bytes.
1139 # Example:
1141 # -> { "execute": "query-memory-size-summary" }
1142 # <- { "return": { "base-memory": 4294967296, "plugged-memory": 0 } }
1144 # Since: 2.11
1146 { 'command': 'query-memory-size-summary', 'returns': 'MemoryInfo' }
1149 # @PCDIMMDeviceInfo:
1151 # PCDIMMDevice state information
1153 # @id: device's ID
1155 # @addr: physical address, where device is mapped
1157 # @size: size of memory that the device provides
1159 # @slot: slot number at which device is plugged in
1161 # @node: NUMA node number where device is plugged in
1163 # @memdev: memory backend linked with device
1165 # @hotplugged: true if device was hotplugged
1167 # @hotpluggable: true if device if could be added/removed while
1168 #     machine is running
1170 # Since: 2.1
1172 { 'struct': 'PCDIMMDeviceInfo',
1173   'data': { '*id': 'str',
1174             'addr': 'int',
1175             'size': 'int',
1176             'slot': 'int',
1177             'node': 'int',
1178             'memdev': 'str',
1179             'hotplugged': 'bool',
1180             'hotpluggable': 'bool'
1181           }
1185 # @VirtioPMEMDeviceInfo:
1187 # VirtioPMEM state information
1189 # @id: device's ID
1191 # @memaddr: physical address in memory, where device is mapped
1193 # @size: size of memory that the device provides
1195 # @memdev: memory backend linked with device
1197 # Since: 4.1
1199 { 'struct': 'VirtioPMEMDeviceInfo',
1200   'data': { '*id': 'str',
1201             'memaddr': 'size',
1202             'size': 'size',
1203             'memdev': 'str'
1204           }
1208 # @VirtioMEMDeviceInfo:
1210 # VirtioMEMDevice state information
1212 # @id: device's ID
1214 # @memaddr: physical address in memory, where device is mapped
1216 # @requested-size: the user requested size of the device
1218 # @size: the (current) size of memory that the device provides
1220 # @max-size: the maximum size of memory that the device can provide
1222 # @block-size: the block size of memory that the device provides
1224 # @node: NUMA node number where device is assigned to
1226 # @memdev: memory backend linked with the region
1228 # Since: 5.1
1230 { 'struct': 'VirtioMEMDeviceInfo',
1231   'data': { '*id': 'str',
1232             'memaddr': 'size',
1233             'requested-size': 'size',
1234             'size': 'size',
1235             'max-size': 'size',
1236             'block-size': 'size',
1237             'node': 'int',
1238             'memdev': 'str'
1239           }
1243 # @SgxEPCDeviceInfo:
1245 # Sgx EPC state information
1247 # @id: device's ID
1249 # @memaddr: physical address in memory, where device is mapped
1251 # @size: size of memory that the device provides
1253 # @memdev: memory backend linked with device
1255 # @node: the numa node (Since: 7.0)
1257 # Since: 6.2
1259 { 'struct': 'SgxEPCDeviceInfo',
1260   'data': { '*id': 'str',
1261             'memaddr': 'size',
1262             'size': 'size',
1263             'node': 'int',
1264             'memdev': 'str'
1265           }
1269 # @MemoryDeviceInfoKind:
1271 # @nvdimm: since 2.12
1273 # @virtio-pmem: since 4.1
1275 # @virtio-mem: since 5.1
1277 # @sgx-epc: since 6.2.
1279 # Since: 2.1
1281 { 'enum': 'MemoryDeviceInfoKind',
1282   'data': [ 'dimm', 'nvdimm', 'virtio-pmem', 'virtio-mem', 'sgx-epc' ] }
1285 # @PCDIMMDeviceInfoWrapper:
1287 # Since: 2.1
1289 { 'struct': 'PCDIMMDeviceInfoWrapper',
1290   'data': { 'data': 'PCDIMMDeviceInfo' } }
1293 # @VirtioPMEMDeviceInfoWrapper:
1295 # Since: 2.1
1297 { 'struct': 'VirtioPMEMDeviceInfoWrapper',
1298   'data': { 'data': 'VirtioPMEMDeviceInfo' } }
1301 # @VirtioMEMDeviceInfoWrapper:
1303 # Since: 2.1
1305 { 'struct': 'VirtioMEMDeviceInfoWrapper',
1306   'data': { 'data': 'VirtioMEMDeviceInfo' } }
1309 # @SgxEPCDeviceInfoWrapper:
1311 # Since: 6.2
1313 { 'struct': 'SgxEPCDeviceInfoWrapper',
1314   'data': { 'data': 'SgxEPCDeviceInfo' } }
1317 # @MemoryDeviceInfo:
1319 # Union containing information about a memory device
1321 # Since: 2.1
1323 { 'union': 'MemoryDeviceInfo',
1324   'base': { 'type': 'MemoryDeviceInfoKind' },
1325   'discriminator': 'type',
1326   'data': { 'dimm': 'PCDIMMDeviceInfoWrapper',
1327             'nvdimm': 'PCDIMMDeviceInfoWrapper',
1328             'virtio-pmem': 'VirtioPMEMDeviceInfoWrapper',
1329             'virtio-mem': 'VirtioMEMDeviceInfoWrapper',
1330             'sgx-epc': 'SgxEPCDeviceInfoWrapper'
1331           }
1335 # @SgxEPC:
1337 # Sgx EPC cmdline information
1339 # @memdev: memory backend linked with device
1341 # @node: the numa node (Since: 7.0)
1343 # Since: 6.2
1345 { 'struct': 'SgxEPC',
1346   'data': { 'memdev': 'str',
1347             'node': 'int'
1348           }
1352 # @SgxEPCProperties:
1354 # SGX properties of machine types.
1356 # @sgx-epc: list of ids of memory-backend-epc objects.
1358 # Since: 6.2
1360 { 'struct': 'SgxEPCProperties',
1361   'data': { 'sgx-epc': ['SgxEPC'] }
1365 # @query-memory-devices:
1367 # Lists available memory devices and their state
1369 # Since: 2.1
1371 # Example:
1373 # -> { "execute": "query-memory-devices" }
1374 # <- { "return": [ { "data":
1375 #                       { "addr": 5368709120,
1376 #                         "hotpluggable": true,
1377 #                         "hotplugged": true,
1378 #                         "id": "d1",
1379 #                         "memdev": "/objects/memX",
1380 #                         "node": 0,
1381 #                         "size": 1073741824,
1382 #                         "slot": 0},
1383 #                    "type": "dimm"
1384 #                  } ] }
1386 { 'command': 'query-memory-devices', 'returns': ['MemoryDeviceInfo'] }
1389 # @MEMORY_DEVICE_SIZE_CHANGE:
1391 # Emitted when the size of a memory device changes.  Only emitted for
1392 # memory devices that can actually change the size (e.g., virtio-mem
1393 # due to guest action).
1395 # @id: device's ID
1397 # @size: the new size of memory that the device provides
1399 # @qom-path: path to the device object in the QOM tree (since 6.2)
1401 # Note: this event is rate-limited.
1403 # Since: 5.1
1405 # Example:
1407 # <- { "event": "MEMORY_DEVICE_SIZE_CHANGE",
1408 #      "data": { "id": "vm0", "size": 1073741824,
1409 #                "qom-path": "/machine/unattached/device[2]" },
1410 #      "timestamp": { "seconds": 1588168529, "microseconds": 201316 } }
1412 { 'event': 'MEMORY_DEVICE_SIZE_CHANGE',
1413   'data': { '*id': 'str', 'size': 'size', 'qom-path' : 'str'} }
1416 # @MEM_UNPLUG_ERROR:
1418 # Emitted when memory hot unplug error occurs.
1420 # @device: device name
1422 # @msg: Informative message
1424 # Features:
1426 # @deprecated: This event is deprecated.  Use
1427 #     @DEVICE_UNPLUG_GUEST_ERROR instead.
1429 # Since: 2.4
1431 # Example:
1433 # <- { "event": "MEM_UNPLUG_ERROR",
1434 #      "data": { "device": "dimm1",
1435 #                "msg": "acpi: device unplug for unsupported device"
1436 #      },
1437 #      "timestamp": { "seconds": 1265044230, "microseconds": 450486 } }
1439 { 'event': 'MEM_UNPLUG_ERROR',
1440   'data': { 'device': 'str', 'msg': 'str' },
1441   'features': ['deprecated'] }
1444 # @BootConfiguration:
1446 # Schema for virtual machine boot configuration.
1448 # @order: Boot order (a=floppy, c=hard disk, d=CD-ROM, n=network)
1450 # @once: Boot order to apply on first boot
1452 # @menu: Whether to show a boot menu
1454 # @splash: The name of the file to be passed to the firmware as logo
1455 #     picture, if @menu is true.
1457 # @splash-time: How long to show the logo picture, in milliseconds
1459 # @reboot-timeout: Timeout before guest reboots after boot fails
1461 # @strict: Whether to attempt booting from devices not included in the
1462 #     boot order
1464 # Since: 7.1
1466 { 'struct': 'BootConfiguration', 'data': {
1467      '*order': 'str',
1468      '*once': 'str',
1469      '*menu': 'bool',
1470      '*splash': 'str',
1471      '*splash-time': 'int',
1472      '*reboot-timeout': 'int',
1473      '*strict': 'bool' } }
1476 # @SMPConfiguration:
1478 # Schema for CPU topology configuration.  A missing value lets QEMU
1479 # figure out a suitable value based on the ones that are provided.
1481 # @cpus: number of virtual CPUs in the virtual machine
1483 # @sockets: number of sockets in the CPU topology
1485 # @dies: number of dies per socket in the CPU topology
1487 # @clusters: number of clusters per die in the CPU topology (since
1488 #     7.0)
1490 # @cores: number of cores per cluster in the CPU topology
1492 # @threads: number of threads per core in the CPU topology
1494 # @maxcpus: maximum number of hotpluggable virtual CPUs in the virtual
1495 #     machine
1497 # Since: 6.1
1499 { 'struct': 'SMPConfiguration', 'data': {
1500      '*cpus': 'int',
1501      '*sockets': 'int',
1502      '*dies': 'int',
1503      '*clusters': 'int',
1504      '*cores': 'int',
1505      '*threads': 'int',
1506      '*maxcpus': 'int' } }
1509 # @x-query-irq:
1511 # Query interrupt statistics
1513 # Features:
1515 # @unstable: This command is meant for debugging.
1517 # Returns: interrupt statistics
1519 # Since: 6.2
1521 { 'command': 'x-query-irq',
1522   'returns': 'HumanReadableText',
1523   'features': [ 'unstable' ] }
1526 # @x-query-jit:
1528 # Query TCG compiler statistics
1530 # Features:
1532 # @unstable: This command is meant for debugging.
1534 # Returns: TCG compiler statistics
1536 # Since: 6.2
1538 { 'command': 'x-query-jit',
1539   'returns': 'HumanReadableText',
1540   'if': 'CONFIG_TCG',
1541   'features': [ 'unstable' ] }
1544 # @x-query-numa:
1546 # Query NUMA topology information
1548 # Features:
1550 # @unstable: This command is meant for debugging.
1552 # Returns: topology information
1554 # Since: 6.2
1556 { 'command': 'x-query-numa',
1557   'returns': 'HumanReadableText',
1558   'features': [ 'unstable' ] }
1561 # @x-query-opcount:
1563 # Query TCG opcode counters
1565 # Features:
1567 # @unstable: This command is meant for debugging.
1569 # Returns: TCG opcode counters
1571 # Since: 6.2
1573 { 'command': 'x-query-opcount',
1574   'returns': 'HumanReadableText',
1575   'if': 'CONFIG_TCG',
1576   'features': [ 'unstable' ] }
1579 # @x-query-profile:
1581 # Query TCG profiling information
1583 # Features:
1585 # @unstable: This command is meant for debugging.
1587 # Returns: profile information
1589 # Since: 6.2
1591 { 'command': 'x-query-profile',
1592   'returns': 'HumanReadableText',
1593   'if': 'CONFIG_TCG',
1594   'features': [ 'unstable' ] }
1597 # @x-query-ramblock:
1599 # Query system ramblock information
1601 # Features:
1603 # @unstable: This command is meant for debugging.
1605 # Returns: system ramblock information
1607 # Since: 6.2
1609 { 'command': 'x-query-ramblock',
1610   'returns': 'HumanReadableText',
1611   'features': [ 'unstable' ] }
1614 # @x-query-rdma:
1616 # Query RDMA state
1618 # Features:
1620 # @unstable: This command is meant for debugging.
1622 # Returns: RDMA state
1624 # Since: 6.2
1626 { 'command': 'x-query-rdma',
1627   'returns': 'HumanReadableText',
1628   'features': [ 'unstable' ] }
1631 # @x-query-roms:
1633 # Query information on the registered ROMS
1635 # Features:
1637 # @unstable: This command is meant for debugging.
1639 # Returns: registered ROMs
1641 # Since: 6.2
1643 { 'command': 'x-query-roms',
1644   'returns': 'HumanReadableText',
1645   'features': [ 'unstable' ] }
1648 # @x-query-usb:
1650 # Query information on the USB devices
1652 # Features:
1654 # @unstable: This command is meant for debugging.
1656 # Returns: USB device information
1658 # Since: 6.2
1660 { 'command': 'x-query-usb',
1661   'returns': 'HumanReadableText',
1662   'features': [ 'unstable' ] }
1665 # @SmbiosEntryPointType:
1667 # @32: SMBIOS version 2.1 (32-bit) Entry Point
1669 # @64: SMBIOS version 3.0 (64-bit) Entry Point
1671 # Since: 7.0
1673 { 'enum': 'SmbiosEntryPointType',
1674   'data': [ '32', '64' ] }
1677 # @MemorySizeConfiguration:
1679 # Schema for memory size configuration.
1681 # @size: memory size in bytes
1683 # @max-size: maximum hotpluggable memory size in bytes
1685 # @slots: number of available memory slots for hotplug
1687 # Since: 7.1
1689 { 'struct': 'MemorySizeConfiguration', 'data': {
1690      '*size': 'size',
1691      '*max-size': 'size',
1692      '*slots': 'uint64' } }
1695 # @dumpdtb:
1697 # Save the FDT in dtb format.
1699 # @filename: name of the dtb file to be created
1701 # Since: 7.2
1703 # Example:
1705 # -> { "execute": "dumpdtb" }
1706 #      "arguments": { "filename": "fdt.dtb" } }
1707 # <- { "return": {} }
1709 { 'command': 'dumpdtb',
1710   'data': { 'filename': 'str' },
1711   'if': 'CONFIG_FDT' }