tests: acpi: add applesmc testcase
[qemu.git] / qapi / machine.json
blobf750a163968bf25077761aaba36280662e37d1be
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, and
18 # look for the \*-softmmu targets near the "--target-list" option. The
19 # individual target constants are not documented here, for the time
20 # being.
22 # @rx: since 5.0
23 # @avr: since 5.1
25 # Notes: The resulting QMP strings can be appended to the "qemu-system-"
26 #        prefix to produce the corresponding QEMU executable name. This
27 #        is true even for "qemu-system-x86_64".
29 # Since: 3.0
31 { 'enum' : 'SysEmuTarget',
32   'data' : [ 'aarch64', 'alpha', 'arm', 'avr', 'cris', 'hppa', 'i386',
33              'loongarch64', 'm68k', 'microblaze', 'microblazeel', 'mips', 'mips64',
34              'mips64el', 'mipsel', 'nios2', 'or1k', 'ppc',
35              'ppc64', 'riscv32', 'riscv64', 'rx', 's390x', 'sh4',
36              'sh4eb', 'sparc', 'sparc64', 'tricore',
37              'x86_64', 'xtensa', 'xtensaeb' ] }
40 # @CpuS390State:
42 # An enumeration of cpu states that can be assumed by a virtual
43 # S390 CPU
45 # Since: 2.12
47 { 'enum': 'CpuS390State',
48   'prefix': 'S390_CPU_STATE',
49   'data': [ 'uninitialized', 'stopped', 'check-stop', 'operating', 'load' ] }
52 # @CpuInfoS390:
54 # Additional information about a virtual S390 CPU
56 # @cpu-state: the virtual CPU's state
58 # Since: 2.12
60 { 'struct': 'CpuInfoS390', 'data': { 'cpu-state': 'CpuS390State' } }
63 # @CpuInfoFast:
65 # Information about a virtual CPU
67 # @cpu-index: index of the virtual CPU
69 # @qom-path: path to the CPU object in the QOM tree
71 # @thread-id: ID of the underlying host thread
73 # @props: properties describing to which node/socket/core/thread
74 #         virtual CPU belongs to, provided if supported by board
76 # @target: the QEMU system emulation target, which determines which
77 #          additional fields will be listed (since 3.0)
79 # Since: 2.12
81 { 'union'         : 'CpuInfoFast',
82   'base'          : { 'cpu-index'    : 'int',
83                       'qom-path'     : 'str',
84                       'thread-id'    : 'int',
85                       '*props'       : 'CpuInstanceProperties',
86                       'target'       : 'SysEmuTarget' },
87   'discriminator' : 'target',
88   'data'          : { 's390x'        : 'CpuInfoS390' } }
91 # @query-cpus-fast:
93 # Returns information about all virtual CPUs.
95 # Returns: list of @CpuInfoFast
97 # Since: 2.12
99 # Example:
101 # -> { "execute": "query-cpus-fast" }
102 # <- { "return": [
103 #         {
104 #             "thread-id": 25627,
105 #             "props": {
106 #                 "core-id": 0,
107 #                 "thread-id": 0,
108 #                 "socket-id": 0
109 #             },
110 #             "qom-path": "/machine/unattached/device[0]",
111 #             "target":"x86_64",
112 #             "cpu-index": 0
113 #         },
114 #         {
115 #             "thread-id": 25628,
116 #             "props": {
117 #                 "core-id": 0,
118 #                 "thread-id": 0,
119 #                 "socket-id": 1
120 #             },
121 #             "qom-path": "/machine/unattached/device[2]",
122 #             "target":"x86_64",
123 #             "cpu-index": 1
124 #         }
125 #     ]
126 # }
128 { 'command': 'query-cpus-fast', 'returns': [ 'CpuInfoFast' ] }
131 # @MachineInfo:
133 # Information describing a machine.
135 # @name: the name of the machine
137 # @alias: an alias for the machine name
139 # @is-default: whether the machine is default
141 # @cpu-max: maximum number of CPUs supported by the machine type
142 #           (since 1.5)
144 # @hotpluggable-cpus: cpu hotplug via -device is supported (since 2.7)
146 # @numa-mem-supported: true if '-numa node,mem' option is supported by
147 #                      the machine type and false otherwise (since 4.1)
149 # @deprecated: if true, the machine type is deprecated and may be removed
150 #              in future versions of QEMU according to the QEMU deprecation
151 #              policy (since 4.1)
153 # @default-cpu-type: default CPU model typename if none is requested via
154 #                    the -cpu argument. (since 4.2)
156 # @default-ram-id: the default ID of initial RAM memory backend (since 5.2)
158 # Since: 1.2
160 { 'struct': 'MachineInfo',
161   'data': { 'name': 'str', '*alias': 'str',
162             '*is-default': 'bool', 'cpu-max': 'int',
163             'hotpluggable-cpus': 'bool',  'numa-mem-supported': 'bool',
164             'deprecated': 'bool', '*default-cpu-type': 'str',
165             '*default-ram-id': 'str' } }
168 # @query-machines:
170 # Return a list of supported machines
172 # Returns: a list of MachineInfo
174 # Since: 1.2
176 { 'command': 'query-machines', 'returns': ['MachineInfo'] }
179 # @CurrentMachineParams:
181 # Information describing the running machine parameters.
183 # @wakeup-suspend-support: true if the machine supports wake up from
184 #                          suspend
186 # Since: 4.0
188 { 'struct': 'CurrentMachineParams',
189   'data': { 'wakeup-suspend-support': 'bool'} }
192 # @query-current-machine:
194 # Return information on the current virtual machine.
196 # Returns: CurrentMachineParams
198 # Since: 4.0
200 { 'command': 'query-current-machine', 'returns': 'CurrentMachineParams' }
203 # @TargetInfo:
205 # Information describing the QEMU target.
207 # @arch: the target architecture
209 # Since: 1.2
211 { 'struct': 'TargetInfo',
212   'data': { 'arch': 'SysEmuTarget' } }
215 # @query-target:
217 # Return information about the target for this QEMU
219 # Returns: TargetInfo
221 # Since: 1.2
223 { 'command': 'query-target', 'returns': 'TargetInfo' }
226 # @UuidInfo:
228 # Guest UUID information (Universally Unique Identifier).
230 # @UUID: the UUID of the guest
232 # Since: 0.14
234 # Notes: If no UUID was specified for the guest, a null UUID is returned.
236 { 'struct': 'UuidInfo', 'data': {'UUID': 'str'} }
239 # @query-uuid:
241 # Query the guest UUID information.
243 # Returns: The @UuidInfo for the guest
245 # Since: 0.14
247 # Example:
249 # -> { "execute": "query-uuid" }
250 # <- { "return": { "UUID": "550e8400-e29b-41d4-a716-446655440000" } }
253 { 'command': 'query-uuid', 'returns': 'UuidInfo', 'allow-preconfig': true }
256 # @GuidInfo:
258 # GUID information.
260 # @guid: the globally unique identifier
262 # Since: 2.9
264 { 'struct': 'GuidInfo', 'data': {'guid': 'str'} }
267 # @query-vm-generation-id:
269 # Show Virtual Machine Generation ID
271 # Since: 2.9
273 { 'command': 'query-vm-generation-id', 'returns': 'GuidInfo' }
276 # @system_reset:
278 # Performs a hard reset of a guest.
280 # Since: 0.14
282 # Example:
284 # -> { "execute": "system_reset" }
285 # <- { "return": {} }
288 { 'command': 'system_reset' }
291 # @system_powerdown:
293 # Requests that a guest perform a powerdown operation.
295 # Since: 0.14
297 # Notes: A guest may or may not respond to this command.  This command
298 #        returning does not indicate that a guest has accepted the request or
299 #        that it has shut down.  Many guests will respond to this command by
300 #        prompting the user in some way.
302 # Example:
304 # -> { "execute": "system_powerdown" }
305 # <- { "return": {} }
308 { 'command': 'system_powerdown' }
311 # @system_wakeup:
313 # Wake up guest from suspend. If the guest has wake-up from suspend
314 # support enabled (wakeup-suspend-support flag from
315 # query-current-machine), wake-up guest from suspend if the guest is
316 # in SUSPENDED state. Return an error otherwise.
318 # Since: 1.1
320 # Returns: nothing.
322 # Note: prior to 4.0, this command does nothing in case the guest
323 #       isn't suspended.
325 # Example:
327 # -> { "execute": "system_wakeup" }
328 # <- { "return": {} }
331 { 'command': 'system_wakeup' }
334 # @LostTickPolicy:
336 # Policy for handling lost ticks in timer devices.  Ticks end up getting
337 # lost when, for example, the guest is paused.
339 # @discard: throw away the missed ticks and continue with future injection
340 #           normally.  The guest OS will see the timer jump ahead by a
341 #           potentially quite significant amount all at once, as if the
342 #           intervening chunk of time had simply not existed; needless to
343 #           say, such a sudden jump can easily confuse a guest OS which is
344 #           not specifically prepared to deal with it.  Assuming the guest
345 #           OS can deal correctly with the time jump, the time in the guest
346 #           and in the host should now match.
348 # @delay: continue to deliver ticks at the normal rate.  The guest OS will
349 #         not notice anything is amiss, as from its point of view time will
350 #         have continued to flow normally.  The time in the guest should now
351 #         be behind the time in the host by exactly the amount of time during
352 #         which ticks have been missed.
354 # @slew: deliver ticks at a higher rate to catch up with the missed ticks.
355 #        The guest OS will not notice anything is amiss, as from its point
356 #        of view time will have continued to flow normally.  Once the timer
357 #        has managed to catch up with all the missing ticks, the time in
358 #        the guest and in the host should match.
360 # Since: 2.0
362 { 'enum': 'LostTickPolicy',
363   'data': ['discard', 'delay', 'slew' ] }
366 # @inject-nmi:
368 # Injects a Non-Maskable Interrupt into the default CPU (x86/s390) or all CPUs (ppc64).
369 # The command fails when the guest doesn't support injecting.
371 # Returns: If successful, nothing
373 # Since: 0.14
375 # Note: prior to 2.1, this command was only supported for x86 and s390 VMs
377 # Example:
379 # -> { "execute": "inject-nmi" }
380 # <- { "return": {} }
383 { 'command': 'inject-nmi' }
386 # @KvmInfo:
388 # Information about support for KVM acceleration
390 # @enabled: true if KVM acceleration is active
392 # @present: true if KVM acceleration is built into this executable
394 # Since: 0.14
396 { 'struct': 'KvmInfo', 'data': {'enabled': 'bool', 'present': 'bool'} }
399 # @query-kvm:
401 # Returns information about KVM acceleration
403 # Returns: @KvmInfo
405 # Since: 0.14
407 # Example:
409 # -> { "execute": "query-kvm" }
410 # <- { "return": { "enabled": true, "present": true } }
413 { 'command': 'query-kvm', 'returns': 'KvmInfo' }
416 # @NumaOptionsType:
418 # @node: NUMA nodes configuration
420 # @dist: NUMA distance configuration (since 2.10)
422 # @cpu: property based CPU(s) to node mapping (Since: 2.10)
424 # @hmat-lb: memory latency and bandwidth information (Since: 5.0)
426 # @hmat-cache: memory side cache information (Since: 5.0)
428 # Since: 2.1
430 { 'enum': 'NumaOptionsType',
431   'data': [ 'node', 'dist', 'cpu', 'hmat-lb', 'hmat-cache' ] }
434 # @NumaOptions:
436 # A discriminated record of NUMA options. (for OptsVisitor)
438 # Since: 2.1
440 { 'union': 'NumaOptions',
441   'base': { 'type': 'NumaOptionsType' },
442   'discriminator': 'type',
443   'data': {
444     'node': 'NumaNodeOptions',
445     'dist': 'NumaDistOptions',
446     'cpu': 'NumaCpuOptions',
447     'hmat-lb': 'NumaHmatLBOptions',
448     'hmat-cache': 'NumaHmatCacheOptions' }}
451 # @NumaNodeOptions:
453 # Create a guest NUMA node. (for OptsVisitor)
455 # @nodeid: NUMA node ID (increase by 1 from 0 if omitted)
457 # @cpus: VCPUs belonging to this node (assign VCPUS round-robin
458 #         if omitted)
460 # @mem: memory size of this node; mutually exclusive with @memdev.
461 #       Equally divide total memory among nodes if both @mem and @memdev are
462 #       omitted.
464 # @memdev: memory backend object.  If specified for one node,
465 #          it must be specified for all nodes.
467 # @initiator: defined in ACPI 6.3 Chapter 5.2.27.3 Table 5-145,
468 #             points to the nodeid which has the memory controller
469 #             responsible for this NUMA node. This field provides
470 #             additional information as to the initiator node that
471 #             is closest (as in directly attached) to this node, and
472 #             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.
494 #       When a node is unreachable from another node, set the distance
495 #       between 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.
512 # @interleave-granularity: Number of contiguous bytes for which
513 #                          accesses will go to a given interleave target.
514 #                          Accepted values [256, 512, 1k, 2k, 4k, 8k, 16k]
515 # @targets: Target root bridge IDs from -device ...,id=<ID> for each root
516 #           bridge.
518 # Since 7.1
520 { 'struct': 'CXLFixedMemoryWindowOptions',
521   'data': {
522       'size': 'size',
523       '*interleave-granularity': 'size',
524       'targets': ['str'] }}
527 # @X86CPURegister32:
529 # A X86 32-bit register
531 # Since: 1.5
533 { 'enum': 'X86CPURegister32',
534   'data': [ 'EAX', 'EBX', 'ECX', 'EDX', 'ESP', 'EBP', 'ESI', 'EDI' ] }
537 # @X86CPUFeatureWordInfo:
539 # Information about a X86 CPU feature word
541 # @cpuid-input-eax: Input EAX value for CPUID instruction for that feature word
543 # @cpuid-input-ecx: Input ECX value for CPUID instruction for that
544 #                   feature word
546 # @cpuid-register: Output register containing the feature bits
548 # @features: value of output register, containing the feature bits
550 # Since: 1.5
552 { 'struct': 'X86CPUFeatureWordInfo',
553   'data': { 'cpuid-input-eax': 'int',
554             '*cpuid-input-ecx': 'int',
555             'cpuid-register': 'X86CPURegister32',
556             'features': 'int' } }
559 # @DummyForceArrays:
561 # Not used by QMP; hack to let us use X86CPUFeatureWordInfoList internally
563 # Since: 2.5
565 { 'struct': 'DummyForceArrays',
566   'data': { 'unused': ['X86CPUFeatureWordInfo'] } }
569 # @NumaCpuOptions:
571 # Option "-numa cpu" overrides default cpu to node mapping.
572 # It accepts the same set of cpu properties as returned by
573 # query-hotpluggable-cpus[].props, where node-id could be used to
574 # override default node mapping.
576 # Since: 2.10
578 { 'struct': 'NumaCpuOptions',
579    'base': 'CpuInstanceProperties',
580    'data' : {} }
583 # @HmatLBMemoryHierarchy:
585 # The memory hierarchy in the System Locality Latency and Bandwidth
586 # Information Structure of HMAT (Heterogeneous Memory Attribute Table)
588 # For more information about @HmatLBMemoryHierarchy, see chapter
589 # 5.2.27.4: Table 5-146: Field "Flags" of ACPI 6.3 spec.
591 # @memory: the structure represents the memory performance
593 # @first-level: first level of memory side cache
595 # @second-level: second level of memory side cache
597 # @third-level: third level of memory side cache
599 # Since: 5.0
601 { 'enum': 'HmatLBMemoryHierarchy',
602   'data': [ 'memory', 'first-level', 'second-level', 'third-level' ] }
605 # @HmatLBDataType:
607 # Data type in the System Locality Latency and Bandwidth
608 # Information Structure of HMAT (Heterogeneous Memory Attribute Table)
610 # For more information about @HmatLBDataType, see chapter
611 # 5.2.27.4: Table 5-146:  Field "Data Type" of ACPI 6.3 spec.
613 # @access-latency: access latency (nanoseconds)
615 # @read-latency: read latency (nanoseconds)
617 # @write-latency: write latency (nanoseconds)
619 # @access-bandwidth: access bandwidth (Bytes per second)
621 # @read-bandwidth: read bandwidth (Bytes per second)
623 # @write-bandwidth: write bandwidth (Bytes per second)
625 # Since: 5.0
627 { 'enum': 'HmatLBDataType',
628   'data': [ 'access-latency', 'read-latency', 'write-latency',
629             'access-bandwidth', 'read-bandwidth', 'write-bandwidth' ] }
632 # @NumaHmatLBOptions:
634 # Set the system locality latency and bandwidth information
635 # between Initiator and Target proximity Domains.
637 # For more information about @NumaHmatLBOptions, see chapter
638 # 5.2.27.4: Table 5-146 of ACPI 6.3 spec.
640 # @initiator: the Initiator Proximity Domain.
642 # @target: the Target Proximity Domain.
644 # @hierarchy: the Memory Hierarchy. Indicates the performance
645 #             of memory or side cache.
647 # @data-type: presents the type of data, access/read/write
648 #             latency or hit latency.
650 # @latency: the value of latency from @initiator to @target
651 #           proximity domain, the latency unit is "ns(nanosecond)".
653 # @bandwidth: the value of bandwidth between @initiator and @target
654 #             proximity domain, the bandwidth unit is
655 #             "Bytes per second".
657 # Since: 5.0
659 { 'struct': 'NumaHmatLBOptions',
660     'data': {
661     'initiator': 'uint16',
662     'target': 'uint16',
663     'hierarchy': 'HmatLBMemoryHierarchy',
664     'data-type': 'HmatLBDataType',
665     '*latency': 'uint64',
666     '*bandwidth': 'size' }}
669 # @HmatCacheAssociativity:
671 # Cache associativity in the Memory Side Cache Information Structure
672 # of HMAT
674 # For more information of @HmatCacheAssociativity, see chapter
675 # 5.2.27.5: Table 5-147 of ACPI 6.3 spec.
677 # @none: None (no memory side cache in this proximity domain,
678 #              or cache associativity unknown)
680 # @direct: Direct Mapped
682 # @complex: Complex Cache Indexing (implementation specific)
684 # Since: 5.0
686 { 'enum': 'HmatCacheAssociativity',
687   'data': [ 'none', 'direct', 'complex' ] }
690 # @HmatCacheWritePolicy:
692 # Cache write policy in the Memory Side Cache Information Structure
693 # of HMAT
695 # For more information of @HmatCacheWritePolicy, see chapter
696 # 5.2.27.5: Table 5-147: Field "Cache Attributes" of ACPI 6.3 spec.
698 # @none: None (no memory side cache in this proximity domain,
699 #        or cache write policy unknown)
701 # @write-back: Write Back (WB)
703 # @write-through: Write Through (WT)
705 # Since: 5.0
707 { 'enum': 'HmatCacheWritePolicy',
708   'data': [ 'none', 'write-back', 'write-through' ] }
711 # @NumaHmatCacheOptions:
713 # Set the memory side cache information for a given memory domain.
715 # For more information of @NumaHmatCacheOptions, see chapter
716 # 5.2.27.5: Table 5-147: Field "Cache Attributes" of ACPI 6.3 spec.
718 # @node-id: the memory proximity domain to which the memory belongs.
720 # @size: the size of memory side cache in bytes.
722 # @level: the cache level described in this structure.
724 # @associativity: the cache associativity,
725 #                 none/direct-mapped/complex(complex cache indexing).
727 # @policy: the write policy, none/write-back/write-through.
729 # @line: the cache Line size in bytes.
731 # Since: 5.0
733 { 'struct': 'NumaHmatCacheOptions',
734   'data': {
735    'node-id': 'uint32',
736    'size': 'size',
737    'level': 'uint8',
738    'associativity': 'HmatCacheAssociativity',
739    'policy': 'HmatCacheWritePolicy',
740    'line': 'uint16' }}
743 # @memsave:
745 # Save a portion of guest memory to a file.
747 # @val: the virtual address of the guest to start from
749 # @size: the size of memory region to save
751 # @filename: the file to save the memory to as binary data
753 # @cpu-index: the index of the virtual CPU to use for translating the
754 #             virtual address (defaults to CPU 0)
756 # Returns: Nothing on success
758 # Since: 0.14
760 # Notes: Errors were not reliably returned until 1.1
762 # Example:
764 # -> { "execute": "memsave",
765 #      "arguments": { "val": 10,
766 #                     "size": 100,
767 #                     "filename": "/tmp/virtual-mem-dump" } }
768 # <- { "return": {} }
771 { 'command': 'memsave',
772   'data': {'val': 'int', 'size': 'int', 'filename': 'str', '*cpu-index': 'int'} }
775 # @pmemsave:
777 # Save a portion of guest physical memory to a file.
779 # @val: the physical address of the guest to start from
781 # @size: the size of memory region to save
783 # @filename: the file to save the memory to as binary data
785 # Returns: Nothing on success
787 # Since: 0.14
789 # Notes: Errors were not reliably returned until 1.1
791 # Example:
793 # -> { "execute": "pmemsave",
794 #      "arguments": { "val": 10,
795 #                     "size": 100,
796 #                     "filename": "/tmp/physical-mem-dump" } }
797 # <- { "return": {} }
800 { 'command': 'pmemsave',
801   'data': {'val': 'int', 'size': 'int', 'filename': 'str'} }
804 # @Memdev:
806 # Information about memory backend
808 # @id: backend's ID if backend has 'id' property (since 2.9)
810 # @size: memory backend size
812 # @merge: whether memory merge support is enabled
814 # @dump: whether memory backend's memory is included in a core dump
816 # @prealloc: whether memory was preallocated
818 # @share: whether memory is private to QEMU or shared (since 6.1)
820 # @reserve: whether swap space (or huge pages) was reserved if applicable.
821 #           This corresponds to the user configuration and not the actual
822 #           behavior implemented in the OS to perform the reservation.
823 #           For example, Linux will never reserve swap space for shared
824 #           file mappings. (since 6.1)
826 # @host-nodes: host nodes for its memory policy
828 # @policy: memory policy of memory backend
830 # Since: 2.1
832 { 'struct': 'Memdev',
833   'data': {
834     '*id':        'str',
835     'size':       'size',
836     'merge':      'bool',
837     'dump':       'bool',
838     'prealloc':   'bool',
839     'share':      'bool',
840     '*reserve':    'bool',
841     'host-nodes': ['uint16'],
842     'policy':     'HostMemPolicy' }}
845 # @query-memdev:
847 # Returns information for all memory backends.
849 # Returns: a list of @Memdev.
851 # Since: 2.1
853 # Example:
855 # -> { "execute": "query-memdev" }
856 # <- { "return": [
857 #        {
858 #          "id": "mem1",
859 #          "size": 536870912,
860 #          "merge": false,
861 #          "dump": true,
862 #          "prealloc": false,
863 #          "share": false,
864 #          "host-nodes": [0, 1],
865 #          "policy": "bind"
866 #        },
867 #        {
868 #          "size": 536870912,
869 #          "merge": false,
870 #          "dump": true,
871 #          "prealloc": true,
872 #          "share": false,
873 #          "host-nodes": [2, 3],
874 #          "policy": "preferred"
875 #        }
876 #      ]
877 #    }
880 { 'command': 'query-memdev', 'returns': ['Memdev'], 'allow-preconfig': true }
883 # @CpuInstanceProperties:
885 # List of properties to be used for hotplugging a CPU instance,
886 # it should be passed by management with device_add command when
887 # a CPU is being hotplugged.
889 # @node-id: NUMA node ID the CPU belongs to
890 # @socket-id: socket number within node/board the CPU belongs to
891 # @die-id: die number within socket the CPU belongs to (since 4.1)
892 # @cluster-id: cluster number within die the CPU belongs to (since 7.1)
893 # @core-id: core number within cluster the CPU belongs to
894 # @thread-id: thread number within core the CPU belongs to
896 # Note: currently there are 6 properties that could be present
897 #       but management should be prepared to pass through other
898 #       properties with device_add command to allow for future
899 #       interface extension. This also requires the filed names to be kept in
900 #       sync with the properties passed to -device/device_add.
902 # Since: 2.7
904 { 'struct': 'CpuInstanceProperties',
905   'data': { '*node-id': 'int',
906             '*socket-id': 'int',
907             '*die-id': 'int',
908             '*cluster-id': 'int',
909             '*core-id': 'int',
910             '*thread-id': 'int'
911   }
915 # @HotpluggableCPU:
917 # @type: CPU object type for usage with device_add command
918 # @props: list of properties to be used for hotplugging CPU
919 # @vcpus-count: number of logical VCPU threads @HotpluggableCPU provides
920 # @qom-path: link to existing CPU object if CPU is present or
921 #            omitted if CPU is not present.
923 # Since: 2.7
925 { 'struct': 'HotpluggableCPU',
926   'data': { 'type': 'str',
927             'vcpus-count': 'int',
928             'props': 'CpuInstanceProperties',
929             '*qom-path': 'str'
930           }
934 # @query-hotpluggable-cpus:
936 # TODO: Better documentation; currently there is none.
938 # Returns: a list of HotpluggableCPU objects.
940 # Since: 2.7
942 # Example:
944 # For pseries machine type started with -smp 2,cores=2,maxcpus=4 -cpu POWER8:
946 # -> { "execute": "query-hotpluggable-cpus" }
947 # <- {"return": [
948 #      { "props": { "core": 8 }, "type": "POWER8-spapr-cpu-core",
949 #        "vcpus-count": 1 },
950 #      { "props": { "core": 0 }, "type": "POWER8-spapr-cpu-core",
951 #        "vcpus-count": 1, "qom-path": "/machine/unattached/device[0]"}
952 #    ]}'
954 # For pc machine type started with -smp 1,maxcpus=2:
956 # -> { "execute": "query-hotpluggable-cpus" }
957 # <- {"return": [
958 #      {
959 #         "type": "qemu64-x86_64-cpu", "vcpus-count": 1,
960 #         "props": {"core-id": 0, "socket-id": 1, "thread-id": 0}
961 #      },
962 #      {
963 #         "qom-path": "/machine/unattached/device[0]",
964 #         "type": "qemu64-x86_64-cpu", "vcpus-count": 1,
965 #         "props": {"core-id": 0, "socket-id": 0, "thread-id": 0}
966 #      }
967 #    ]}
969 # For s390x-virtio-ccw machine type started with -smp 1,maxcpus=2 -cpu qemu
970 # (Since: 2.11):
972 # -> { "execute": "query-hotpluggable-cpus" }
973 # <- {"return": [
974 #      {
975 #         "type": "qemu-s390x-cpu", "vcpus-count": 1,
976 #         "props": { "core-id": 1 }
977 #      },
978 #      {
979 #         "qom-path": "/machine/unattached/device[0]",
980 #         "type": "qemu-s390x-cpu", "vcpus-count": 1,
981 #         "props": { "core-id": 0 }
982 #      }
983 #    ]}
986 { 'command': 'query-hotpluggable-cpus', 'returns': ['HotpluggableCPU'],
987              'allow-preconfig': true }
990 # @set-numa-node:
992 # Runtime equivalent of '-numa' CLI option, available at
993 # preconfigure stage to configure numa mapping before initializing
994 # machine.
996 # Since: 3.0
998 { 'command': 'set-numa-node', 'boxed': true,
999   'data': 'NumaOptions',
1000   'allow-preconfig': true
1004 # @balloon:
1006 # Request the balloon driver to change its balloon size.
1008 # @value: the target logical size of the VM in bytes.
1009 #         We can deduce the size of the balloon using this formula:
1011 #            logical_vm_size = vm_ram_size - balloon_size
1013 #         From it we have: balloon_size = vm_ram_size - @value
1015 # Returns: - Nothing on success
1016 #          - If the balloon driver is enabled but not functional because the KVM
1017 #            kernel module cannot support it, KvmMissingCap
1018 #          - If no balloon device is present, DeviceNotActive
1020 # Notes: This command just issues a request to the guest.  When it returns,
1021 #        the balloon size may not have changed.  A guest can change the balloon
1022 #        size independent of this command.
1024 # Since: 0.14
1026 # Example:
1028 # -> { "execute": "balloon", "arguments": { "value": 536870912 } }
1029 # <- { "return": {} }
1031 # With a 2.5GiB guest this command inflated the ballon to 3GiB.
1034 { 'command': 'balloon', 'data': {'value': 'int'} }
1037 # @BalloonInfo:
1039 # Information about the guest balloon device.
1041 # @actual: the logical size of the VM in bytes
1042 #          Formula used: logical_vm_size = vm_ram_size - balloon_size
1044 # Since: 0.14
1046 { 'struct': 'BalloonInfo', 'data': {'actual': 'int' } }
1049 # @query-balloon:
1051 # Return information about the balloon device.
1053 # Returns: - @BalloonInfo on success
1054 #          - If the balloon driver is enabled but not functional because the KVM
1055 #            kernel module cannot support it, KvmMissingCap
1056 #          - If no balloon device is present, DeviceNotActive
1058 # Since: 0.14
1060 # Example:
1062 # -> { "execute": "query-balloon" }
1063 # <- { "return": {
1064 #          "actual": 1073741824,
1065 #       }
1066 #    }
1069 { 'command': 'query-balloon', 'returns': 'BalloonInfo' }
1072 # @BALLOON_CHANGE:
1074 # Emitted when the guest changes the actual BALLOON level. This value is
1075 # equivalent to the @actual field return by the 'query-balloon' command
1077 # @actual: the logical size of the VM in bytes
1078 #          Formula used: logical_vm_size = vm_ram_size - balloon_size
1080 # Note: this event is rate-limited.
1082 # Since: 1.2
1084 # Example:
1086 # <- { "event": "BALLOON_CHANGE",
1087 #      "data": { "actual": 944766976 },
1088 #      "timestamp": { "seconds": 1267020223, "microseconds": 435656 } }
1091 { 'event': 'BALLOON_CHANGE',
1092   'data': { 'actual': 'int' } }
1095 # @MemoryInfo:
1097 # Actual memory information in bytes.
1099 # @base-memory: size of "base" memory specified with command line
1100 #               option -m.
1102 # @plugged-memory: size of memory that can be hot-unplugged. This field
1103 #                  is omitted if target doesn't support memory hotplug
1104 #                  (i.e. CONFIG_MEM_DEVICE not defined at build time).
1106 # Since: 2.11
1108 { 'struct': 'MemoryInfo',
1109   'data'  : { 'base-memory': 'size', '*plugged-memory': 'size' } }
1112 # @query-memory-size-summary:
1114 # Return the amount of initially allocated and present hotpluggable (if
1115 # enabled) memory in bytes.
1117 # Example:
1119 # -> { "execute": "query-memory-size-summary" }
1120 # <- { "return": { "base-memory": 4294967296, "plugged-memory": 0 } }
1122 # Since: 2.11
1124 { 'command': 'query-memory-size-summary', 'returns': 'MemoryInfo' }
1127 # @PCDIMMDeviceInfo:
1129 # PCDIMMDevice state information
1131 # @id: device's ID
1133 # @addr: physical address, where device is mapped
1135 # @size: size of memory that the device provides
1137 # @slot: slot number at which device is plugged in
1139 # @node: NUMA node number where device is plugged in
1141 # @memdev: memory backend linked with device
1143 # @hotplugged: true if device was hotplugged
1145 # @hotpluggable: true if device if could be added/removed while machine is running
1147 # Since: 2.1
1149 { 'struct': 'PCDIMMDeviceInfo',
1150   'data': { '*id': 'str',
1151             'addr': 'int',
1152             'size': 'int',
1153             'slot': 'int',
1154             'node': 'int',
1155             'memdev': 'str',
1156             'hotplugged': 'bool',
1157             'hotpluggable': 'bool'
1158           }
1162 # @VirtioPMEMDeviceInfo:
1164 # VirtioPMEM state information
1166 # @id: device's ID
1168 # @memaddr: physical address in memory, where device is mapped
1170 # @size: size of memory that the device provides
1172 # @memdev: memory backend linked with device
1174 # Since: 4.1
1176 { 'struct': 'VirtioPMEMDeviceInfo',
1177   'data': { '*id': 'str',
1178             'memaddr': 'size',
1179             'size': 'size',
1180             'memdev': 'str'
1181           }
1185 # @VirtioMEMDeviceInfo:
1187 # VirtioMEMDevice state information
1189 # @id: device's ID
1191 # @memaddr: physical address in memory, where device is mapped
1193 # @requested-size: the user requested size of the device
1195 # @size: the (current) size of memory that the device provides
1197 # @max-size: the maximum size of memory that the device can provide
1199 # @block-size: the block size of memory that the device provides
1201 # @node: NUMA node number where device is assigned to
1203 # @memdev: memory backend linked with the region
1205 # Since: 5.1
1207 { 'struct': 'VirtioMEMDeviceInfo',
1208   'data': { '*id': 'str',
1209             'memaddr': 'size',
1210             'requested-size': 'size',
1211             'size': 'size',
1212             'max-size': 'size',
1213             'block-size': 'size',
1214             'node': 'int',
1215             'memdev': 'str'
1216           }
1220 # @SgxEPCDeviceInfo:
1222 # Sgx EPC state information
1224 # @id: device's ID
1226 # @memaddr: physical address in memory, where device is mapped
1228 # @size: size of memory that the device provides
1230 # @memdev: memory backend linked with device
1232 # @node: the numa node (Since: 7.0)
1234 # Since: 6.2
1236 { 'struct': 'SgxEPCDeviceInfo',
1237   'data': { '*id': 'str',
1238             'memaddr': 'size',
1239             'size': 'size',
1240             'node': 'int',
1241             'memdev': 'str'
1242           }
1246 # @MemoryDeviceInfoKind:
1248 # Since: 2.1
1250 { 'enum': 'MemoryDeviceInfoKind',
1251   'data': [ 'dimm', 'nvdimm', 'virtio-pmem', 'virtio-mem', 'sgx-epc' ] }
1254 # @PCDIMMDeviceInfoWrapper:
1256 # Since: 2.1
1258 { 'struct': 'PCDIMMDeviceInfoWrapper',
1259   'data': { 'data': 'PCDIMMDeviceInfo' } }
1262 # @VirtioPMEMDeviceInfoWrapper:
1264 # Since: 2.1
1266 { 'struct': 'VirtioPMEMDeviceInfoWrapper',
1267   'data': { 'data': 'VirtioPMEMDeviceInfo' } }
1270 # @VirtioMEMDeviceInfoWrapper:
1272 # Since: 2.1
1274 { 'struct': 'VirtioMEMDeviceInfoWrapper',
1275   'data': { 'data': 'VirtioMEMDeviceInfo' } }
1278 # @SgxEPCDeviceInfoWrapper:
1280 # Since: 6.2
1282 { 'struct': 'SgxEPCDeviceInfoWrapper',
1283   'data': { 'data': 'SgxEPCDeviceInfo' } }
1286 # @MemoryDeviceInfo:
1288 # Union containing information about a memory device
1290 # nvdimm is included since 2.12. virtio-pmem is included since 4.1.
1291 # virtio-mem is included since 5.1. sgx-epc is included since 6.2.
1293 # Since: 2.1
1295 { 'union': 'MemoryDeviceInfo',
1296   'base': { 'type': 'MemoryDeviceInfoKind' },
1297   'discriminator': 'type',
1298   'data': { 'dimm': 'PCDIMMDeviceInfoWrapper',
1299             'nvdimm': 'PCDIMMDeviceInfoWrapper',
1300             'virtio-pmem': 'VirtioPMEMDeviceInfoWrapper',
1301             'virtio-mem': 'VirtioMEMDeviceInfoWrapper',
1302             'sgx-epc': 'SgxEPCDeviceInfoWrapper'
1303           }
1307 # @SgxEPC:
1309 # Sgx EPC cmdline information
1311 # @memdev: memory backend linked with device
1313 # @node: the numa node (Since: 7.0)
1315 # Since: 6.2
1317 { 'struct': 'SgxEPC',
1318   'data': { 'memdev': 'str',
1319             'node': 'int'
1320           }
1324 # @SgxEPCProperties:
1326 # SGX properties of machine types.
1328 # @sgx-epc: list of ids of memory-backend-epc objects.
1330 # Since: 6.2
1332 { 'struct': 'SgxEPCProperties',
1333   'data': { 'sgx-epc': ['SgxEPC'] }
1337 # @query-memory-devices:
1339 # Lists available memory devices and their state
1341 # Since: 2.1
1343 # Example:
1345 # -> { "execute": "query-memory-devices" }
1346 # <- { "return": [ { "data":
1347 #                       { "addr": 5368709120,
1348 #                         "hotpluggable": true,
1349 #                         "hotplugged": true,
1350 #                         "id": "d1",
1351 #                         "memdev": "/objects/memX",
1352 #                         "node": 0,
1353 #                         "size": 1073741824,
1354 #                         "slot": 0},
1355 #                    "type": "dimm"
1356 #                  } ] }
1359 { 'command': 'query-memory-devices', 'returns': ['MemoryDeviceInfo'] }
1362 # @MEMORY_DEVICE_SIZE_CHANGE:
1364 # Emitted when the size of a memory device changes. Only emitted for memory
1365 # devices that can actually change the size (e.g., virtio-mem due to guest
1366 # action).
1368 # @id: device's ID
1370 # @size: the new size of memory that the device provides
1372 # @qom-path: path to the device object in the QOM tree (since 6.2)
1374 # Note: this event is rate-limited.
1376 # Since: 5.1
1378 # Example:
1380 # <- { "event": "MEMORY_DEVICE_SIZE_CHANGE",
1381 #      "data": { "id": "vm0", "size": 1073741824,
1382 #                "qom-path": "/machine/unattached/device[2]" },
1383 #      "timestamp": { "seconds": 1588168529, "microseconds": 201316 } }
1386 { 'event': 'MEMORY_DEVICE_SIZE_CHANGE',
1387   'data': { '*id': 'str', 'size': 'size', 'qom-path' : 'str'} }
1390 # @MEM_UNPLUG_ERROR:
1392 # Emitted when memory hot unplug error occurs.
1394 # @device: device name
1396 # @msg: Informative message
1398 # Features:
1399 # @deprecated: This event is deprecated. Use @DEVICE_UNPLUG_GUEST_ERROR
1400 #              instead.
1402 # Since: 2.4
1404 # Example:
1406 # <- { "event": "MEM_UNPLUG_ERROR"
1407 #      "data": { "device": "dimm1",
1408 #                "msg": "acpi: device unplug for unsupported device"
1409 #      },
1410 #      "timestamp": { "seconds": 1265044230, "microseconds": 450486 } }
1413 { 'event': 'MEM_UNPLUG_ERROR',
1414   'data': { 'device': 'str', 'msg': 'str' },
1415   'features': ['deprecated'] }
1418 # @BootConfiguration:
1420 # Schema for virtual machine boot configuration.
1422 # @order: Boot order (a=floppy, c=hard disk, d=CD-ROM, n=network)
1424 # @once: Boot order to apply on first boot
1426 # @menu: Whether to show a boot menu
1428 # @splash: The name of the file to be passed to the firmware as logo picture, if @menu is true.
1430 # @splash-time: How long to show the logo picture, in milliseconds
1432 # @reboot-timeout: Timeout before guest reboots after boot fails
1434 # @strict: Whether to attempt booting from devices not included in the boot order
1436 # Since: 7.1
1438 { 'struct': 'BootConfiguration', 'data': {
1439      '*order': 'str',
1440      '*once': 'str',
1441      '*menu': 'bool',
1442      '*splash': 'str',
1443      '*splash-time': 'int',
1444      '*reboot-timeout': 'int',
1445      '*strict': 'bool' } }
1448 # @SMPConfiguration:
1450 # Schema for CPU topology configuration.  A missing value lets
1451 # QEMU figure out a suitable value based on the ones that are provided.
1453 # @cpus: number of virtual CPUs in the virtual machine
1455 # @sockets: number of sockets in the CPU topology
1457 # @dies: number of dies per socket in the CPU topology
1459 # @clusters: number of clusters per die in the CPU topology (since 7.0)
1461 # @cores: number of cores per cluster in the CPU topology
1463 # @threads: number of threads per core in the CPU topology
1465 # @maxcpus: maximum number of hotpluggable virtual CPUs in the virtual machine
1467 # Since: 6.1
1469 { 'struct': 'SMPConfiguration', 'data': {
1470      '*cpus': 'int',
1471      '*sockets': 'int',
1472      '*dies': 'int',
1473      '*clusters': 'int',
1474      '*cores': 'int',
1475      '*threads': 'int',
1476      '*maxcpus': 'int' } }
1479 # @x-query-irq:
1481 # Query interrupt statistics
1483 # Features:
1484 # @unstable: This command is meant for debugging.
1486 # Returns: interrupt statistics
1488 # Since: 6.2
1490 { 'command': 'x-query-irq',
1491   'returns': 'HumanReadableText',
1492   'features': [ 'unstable' ] }
1495 # @x-query-jit:
1497 # Query TCG compiler statistics
1499 # Features:
1500 # @unstable: This command is meant for debugging.
1502 # Returns: TCG compiler statistics
1504 # Since: 6.2
1506 { 'command': 'x-query-jit',
1507   'returns': 'HumanReadableText',
1508   'if': 'CONFIG_TCG',
1509   'features': [ 'unstable' ] }
1512 # @x-query-numa:
1514 # Query NUMA topology information
1516 # Features:
1517 # @unstable: This command is meant for debugging.
1519 # Returns: topology information
1521 # Since: 6.2
1523 { 'command': 'x-query-numa',
1524   'returns': 'HumanReadableText',
1525   'features': [ 'unstable' ] }
1528 # @x-query-opcount:
1530 # Query TCG opcode counters
1532 # Features:
1533 # @unstable: This command is meant for debugging.
1535 # Returns: TCG opcode counters
1537 # Since: 6.2
1539 { 'command': 'x-query-opcount',
1540   'returns': 'HumanReadableText',
1541   'if': 'CONFIG_TCG',
1542   'features': [ 'unstable' ] }
1545 # @x-query-profile:
1547 # Query TCG profiling information
1549 # Features:
1550 # @unstable: This command is meant for debugging.
1552 # Returns: profile information
1554 # Since: 6.2
1556 { 'command': 'x-query-profile',
1557   'returns': 'HumanReadableText',
1558   'if': 'CONFIG_TCG',
1559   'features': [ 'unstable' ] }
1562 # @x-query-ramblock:
1564 # Query system ramblock information
1566 # Features:
1567 # @unstable: This command is meant for debugging.
1569 # Returns: system ramblock information
1571 # Since: 6.2
1573 { 'command': 'x-query-ramblock',
1574   'returns': 'HumanReadableText',
1575   'features': [ 'unstable' ] }
1578 # @x-query-rdma:
1580 # Query RDMA state
1582 # Features:
1583 # @unstable: This command is meant for debugging.
1585 # Returns: RDMA state
1587 # Since: 6.2
1589 { 'command': 'x-query-rdma',
1590   'returns': 'HumanReadableText',
1591   'features': [ 'unstable' ] }
1594 # @x-query-roms:
1596 # Query information on the registered ROMS
1598 # Features:
1599 # @unstable: This command is meant for debugging.
1601 # Returns: registered ROMs
1603 # Since: 6.2
1605 { 'command': 'x-query-roms',
1606   'returns': 'HumanReadableText',
1607   'features': [ 'unstable' ] }
1610 # @x-query-usb:
1612 # Query information on the USB devices
1614 # Features:
1615 # @unstable: This command is meant for debugging.
1617 # Returns: USB device information
1619 # Since: 6.2
1621 { 'command': 'x-query-usb',
1622   'returns': 'HumanReadableText',
1623   'features': [ 'unstable' ] }
1626 # @SmbiosEntryPointType:
1628 # @32: SMBIOS version 2.1 (32-bit) Entry Point
1630 # @64: SMBIOS version 3.0 (64-bit) Entry Point
1632 # Since: 7.0
1634 { 'enum': 'SmbiosEntryPointType',
1635   'data': [ '32', '64' ] }
1638 # @MemorySizeConfiguration:
1640 # Schema for memory size configuration.
1642 # @size: memory size in bytes
1644 # @max-size: maximum hotpluggable memory size in bytes
1646 # @slots: number of available memory slots for hotplug
1648 # Since: 7.1
1650 { 'struct': 'MemorySizeConfiguration', 'data': {
1651      '*size': 'size',
1652      '*max-size': 'size',
1653      '*slots': 'uint64' } }