migration: Fix potential race on postcopy_qemufile_src
[qemu/ar7.git] / qapi / machine.json
blob604b686e59f27780deaf21f18739da714b16061f
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 # @acpi: machine type supports ACPI (since 8.0)
160 # Since: 1.2
162 { 'struct': 'MachineInfo',
163   'data': { 'name': 'str', '*alias': 'str',
164             '*is-default': 'bool', 'cpu-max': 'int',
165             'hotpluggable-cpus': 'bool',  'numa-mem-supported': 'bool',
166             'deprecated': 'bool', '*default-cpu-type': 'str',
167             '*default-ram-id': 'str', 'acpi': 'bool' } }
170 # @query-machines:
172 # Return a list of supported machines
174 # Returns: a list of MachineInfo
176 # Since: 1.2
178 { 'command': 'query-machines', 'returns': ['MachineInfo'] }
181 # @CurrentMachineParams:
183 # Information describing the running machine parameters.
185 # @wakeup-suspend-support: true if the machine supports wake up from
186 #                          suspend
188 # Since: 4.0
190 { 'struct': 'CurrentMachineParams',
191   'data': { 'wakeup-suspend-support': 'bool'} }
194 # @query-current-machine:
196 # Return information on the current virtual machine.
198 # Returns: CurrentMachineParams
200 # Since: 4.0
202 { 'command': 'query-current-machine', 'returns': 'CurrentMachineParams' }
205 # @TargetInfo:
207 # Information describing the QEMU target.
209 # @arch: the target architecture
211 # Since: 1.2
213 { 'struct': 'TargetInfo',
214   'data': { 'arch': 'SysEmuTarget' } }
217 # @query-target:
219 # Return information about the target for this QEMU
221 # Returns: TargetInfo
223 # Since: 1.2
225 { 'command': 'query-target', 'returns': 'TargetInfo' }
228 # @UuidInfo:
230 # Guest UUID information (Universally Unique Identifier).
232 # @UUID: the UUID of the guest
234 # Since: 0.14
236 # Notes: If no UUID was specified for the guest, a null UUID is returned.
238 { 'struct': 'UuidInfo', 'data': {'UUID': 'str'} }
241 # @query-uuid:
243 # Query the guest UUID information.
245 # Returns: The @UuidInfo for the guest
247 # Since: 0.14
249 # Example:
251 # -> { "execute": "query-uuid" }
252 # <- { "return": { "UUID": "550e8400-e29b-41d4-a716-446655440000" } }
255 { 'command': 'query-uuid', 'returns': 'UuidInfo', 'allow-preconfig': true }
258 # @GuidInfo:
260 # GUID information.
262 # @guid: the globally unique identifier
264 # Since: 2.9
266 { 'struct': 'GuidInfo', 'data': {'guid': 'str'} }
269 # @query-vm-generation-id:
271 # Show Virtual Machine Generation ID
273 # Since: 2.9
275 { 'command': 'query-vm-generation-id', 'returns': 'GuidInfo' }
278 # @system_reset:
280 # Performs a hard reset of a guest.
282 # Since: 0.14
284 # Example:
286 # -> { "execute": "system_reset" }
287 # <- { "return": {} }
290 { 'command': 'system_reset' }
293 # @system_powerdown:
295 # Requests that a guest perform a powerdown operation.
297 # Since: 0.14
299 # Notes: A guest may or may not respond to this command.  This command
300 #        returning does not indicate that a guest has accepted the request or
301 #        that it has shut down.  Many guests will respond to this command by
302 #        prompting the user in some way.
304 # Example:
306 # -> { "execute": "system_powerdown" }
307 # <- { "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": {} }
333 { 'command': 'system_wakeup' }
336 # @LostTickPolicy:
338 # Policy for handling lost ticks in timer devices.  Ticks end up getting
339 # lost when, for example, the guest is paused.
341 # @discard: throw away the missed ticks and continue with future injection
342 #           normally.  The guest OS will see the timer jump ahead by a
343 #           potentially quite significant amount all at once, as if the
344 #           intervening chunk of time had simply not existed; needless to
345 #           say, such a sudden jump can easily confuse a guest OS which is
346 #           not specifically prepared to deal with it.  Assuming the guest
347 #           OS can deal correctly with the time jump, the time in the guest
348 #           and in the host should now match.
350 # @delay: continue to deliver ticks at the normal rate.  The guest OS will
351 #         not notice anything is amiss, as from its point of view time will
352 #         have continued to flow normally.  The time in the guest should now
353 #         be behind the time in the host by exactly the amount of time during
354 #         which ticks have been missed.
356 # @slew: deliver ticks at a higher rate to catch up with the missed ticks.
357 #        The guest OS will not notice anything is amiss, as from its point
358 #        of view time will have continued to flow normally.  Once the timer
359 #        has managed to catch up with all the missing ticks, the time in
360 #        the guest and in the host should match.
362 # Since: 2.0
364 { 'enum': 'LostTickPolicy',
365   'data': ['discard', 'delay', 'slew' ] }
368 # @inject-nmi:
370 # Injects a Non-Maskable Interrupt into the default CPU (x86/s390) or all CPUs (ppc64).
371 # The command fails when the guest doesn't support 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 VMs
379 # Example:
381 # -> { "execute": "inject-nmi" }
382 # <- { "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 } }
415 { 'command': 'query-kvm', 'returns': 'KvmInfo' }
418 # @NumaOptionsType:
420 # @node: NUMA nodes configuration
422 # @dist: NUMA distance configuration (since 2.10)
424 # @cpu: property based CPU(s) to node mapping (Since: 2.10)
426 # @hmat-lb: memory latency and bandwidth information (Since: 5.0)
428 # @hmat-cache: memory side cache information (Since: 5.0)
430 # Since: 2.1
432 { 'enum': 'NumaOptionsType',
433   'data': [ 'node', 'dist', 'cpu', 'hmat-lb', 'hmat-cache' ] }
436 # @NumaOptions:
438 # A discriminated record of NUMA options. (for OptsVisitor)
440 # Since: 2.1
442 { 'union': 'NumaOptions',
443   'base': { 'type': 'NumaOptionsType' },
444   'discriminator': 'type',
445   'data': {
446     'node': 'NumaNodeOptions',
447     'dist': 'NumaDistOptions',
448     'cpu': 'NumaCpuOptions',
449     'hmat-lb': 'NumaHmatLBOptions',
450     'hmat-cache': 'NumaHmatCacheOptions' }}
453 # @NumaNodeOptions:
455 # Create a guest NUMA node. (for OptsVisitor)
457 # @nodeid: NUMA node ID (increase by 1 from 0 if omitted)
459 # @cpus: VCPUs belonging to this node (assign VCPUS round-robin
460 #         if omitted)
462 # @mem: memory size of this node; mutually exclusive with @memdev.
463 #       Equally divide total memory among nodes if both @mem and @memdev are
464 #       omitted.
466 # @memdev: memory backend object.  If specified for one node,
467 #          it must be specified for all nodes.
469 # @initiator: defined in ACPI 6.3 Chapter 5.2.27.3 Table 5-145,
470 #             points to the nodeid which has the memory controller
471 #             responsible for this NUMA node. This field provides
472 #             additional information as to the initiator node that
473 #             is closest (as in directly attached) to this node, and
474 #             therefore has the best performance (since 5.0)
476 # Since: 2.1
478 { 'struct': 'NumaNodeOptions',
479   'data': {
480    '*nodeid': 'uint16',
481    '*cpus':   ['uint16'],
482    '*mem':    'size',
483    '*memdev': 'str',
484    '*initiator': 'uint16' }}
487 # @NumaDistOptions:
489 # Set the distance between 2 NUMA nodes.
491 # @src: source NUMA node.
493 # @dst: destination NUMA node.
495 # @val: NUMA distance from source node to destination node.
496 #       When a node is unreachable from another node, set the distance
497 #       between them to 255.
499 # Since: 2.10
501 { 'struct': 'NumaDistOptions',
502   'data': {
503    'src': 'uint16',
504    'dst': 'uint16',
505    'val': 'uint8' }}
508 # @CXLFixedMemoryWindowOptions:
510 # Create a CXL Fixed Memory Window
512 # @size: Size of the Fixed Memory Window in bytes. Must be a multiple
513 #        of 256MiB.
514 # @interleave-granularity: Number of contiguous bytes for which
515 #                          accesses will go to a given interleave target.
516 #                          Accepted values [256, 512, 1k, 2k, 4k, 8k, 16k]
517 # @targets: Target root bridge IDs from -device ...,id=<ID> for each root
518 #           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 feature word
558 # @cpuid-input-ecx: Input ECX value for CPUID instruction for that
559 #                   feature word
561 # @cpuid-register: Output register containing the feature bits
563 # @features: value of output register, containing the feature bits
565 # Since: 1.5
567 { 'struct': 'X86CPUFeatureWordInfo',
568   'data': { 'cpuid-input-eax': 'int',
569             '*cpuid-input-ecx': 'int',
570             'cpuid-register': 'X86CPURegister32',
571             'features': 'int' } }
574 # @DummyForceArrays:
576 # Not used by QMP; hack to let us use X86CPUFeatureWordInfoList internally
578 # Since: 2.5
580 { 'struct': 'DummyForceArrays',
581   'data': { 'unused': ['X86CPUFeatureWordInfo'] } }
584 # @NumaCpuOptions:
586 # Option "-numa cpu" overrides default cpu to node mapping.
587 # It accepts the same set of cpu properties as returned by
588 # query-hotpluggable-cpus[].props, where node-id could be used to
589 # override default node mapping.
591 # Since: 2.10
593 { 'struct': 'NumaCpuOptions',
594    'base': 'CpuInstanceProperties',
595    'data' : {} }
598 # @HmatLBMemoryHierarchy:
600 # The memory hierarchy in the System Locality Latency and Bandwidth
601 # Information Structure of HMAT (Heterogeneous Memory Attribute Table)
603 # For more information about @HmatLBMemoryHierarchy, see chapter
604 # 5.2.27.4: Table 5-146: Field "Flags" of ACPI 6.3 spec.
606 # @memory: the structure represents the memory performance
608 # @first-level: first level of memory side cache
610 # @second-level: second level of memory side cache
612 # @third-level: third level of memory side cache
614 # Since: 5.0
616 { 'enum': 'HmatLBMemoryHierarchy',
617   'data': [ 'memory', 'first-level', 'second-level', 'third-level' ] }
620 # @HmatLBDataType:
622 # Data type in the System Locality Latency and Bandwidth
623 # Information Structure of HMAT (Heterogeneous Memory Attribute Table)
625 # For more information about @HmatLBDataType, see chapter
626 # 5.2.27.4: Table 5-146:  Field "Data Type" of ACPI 6.3 spec.
628 # @access-latency: access latency (nanoseconds)
630 # @read-latency: read latency (nanoseconds)
632 # @write-latency: write latency (nanoseconds)
634 # @access-bandwidth: access bandwidth (Bytes per second)
636 # @read-bandwidth: read bandwidth (Bytes per second)
638 # @write-bandwidth: write bandwidth (Bytes per second)
640 # Since: 5.0
642 { 'enum': 'HmatLBDataType',
643   'data': [ 'access-latency', 'read-latency', 'write-latency',
644             'access-bandwidth', 'read-bandwidth', 'write-bandwidth' ] }
647 # @NumaHmatLBOptions:
649 # Set the system locality latency and bandwidth information
650 # between Initiator and Target proximity Domains.
652 # For more information about @NumaHmatLBOptions, see chapter
653 # 5.2.27.4: Table 5-146 of ACPI 6.3 spec.
655 # @initiator: the Initiator Proximity Domain.
657 # @target: the Target Proximity Domain.
659 # @hierarchy: the Memory Hierarchy. Indicates the performance
660 #             of memory or side cache.
662 # @data-type: presents the type of data, access/read/write
663 #             latency or hit latency.
665 # @latency: the value of latency from @initiator to @target
666 #           proximity domain, the latency unit is "ns(nanosecond)".
668 # @bandwidth: the value of bandwidth between @initiator and @target
669 #             proximity domain, the bandwidth unit is
670 #             "Bytes per second".
672 # Since: 5.0
674 { 'struct': 'NumaHmatLBOptions',
675     'data': {
676     'initiator': 'uint16',
677     'target': 'uint16',
678     'hierarchy': 'HmatLBMemoryHierarchy',
679     'data-type': 'HmatLBDataType',
680     '*latency': 'uint64',
681     '*bandwidth': 'size' }}
684 # @HmatCacheAssociativity:
686 # Cache associativity in the Memory Side Cache Information Structure
687 # of HMAT
689 # For more information of @HmatCacheAssociativity, see chapter
690 # 5.2.27.5: Table 5-147 of ACPI 6.3 spec.
692 # @none: None (no memory side cache in this proximity domain,
693 #              or cache associativity unknown)
695 # @direct: Direct Mapped
697 # @complex: Complex Cache Indexing (implementation specific)
699 # Since: 5.0
701 { 'enum': 'HmatCacheAssociativity',
702   'data': [ 'none', 'direct', 'complex' ] }
705 # @HmatCacheWritePolicy:
707 # Cache write policy in the Memory Side Cache Information Structure
708 # of HMAT
710 # For more information of @HmatCacheWritePolicy, see chapter
711 # 5.2.27.5: Table 5-147: Field "Cache Attributes" of ACPI 6.3 spec.
713 # @none: None (no memory side cache in this proximity domain,
714 #        or cache write policy unknown)
716 # @write-back: Write Back (WB)
718 # @write-through: Write Through (WT)
720 # Since: 5.0
722 { 'enum': 'HmatCacheWritePolicy',
723   'data': [ 'none', 'write-back', 'write-through' ] }
726 # @NumaHmatCacheOptions:
728 # Set the memory side cache information for a given memory domain.
730 # For more information of @NumaHmatCacheOptions, see chapter
731 # 5.2.27.5: Table 5-147: Field "Cache Attributes" of ACPI 6.3 spec.
733 # @node-id: the memory proximity domain to which the memory belongs.
735 # @size: the size of memory side cache in bytes.
737 # @level: the cache level described in this structure.
739 # @associativity: the cache associativity,
740 #                 none/direct-mapped/complex(complex cache indexing).
742 # @policy: the write policy, none/write-back/write-through.
744 # @line: the cache Line size in bytes.
746 # Since: 5.0
748 { 'struct': 'NumaHmatCacheOptions',
749   'data': {
750    'node-id': 'uint32',
751    'size': 'size',
752    'level': 'uint8',
753    'associativity': 'HmatCacheAssociativity',
754    'policy': 'HmatCacheWritePolicy',
755    'line': 'uint16' }}
758 # @memsave:
760 # Save a portion of guest memory to a file.
762 # @val: the virtual address of the guest to start from
764 # @size: the size of memory region to save
766 # @filename: the file to save the memory to as binary data
768 # @cpu-index: the index of the virtual CPU to use for translating the
769 #             virtual address (defaults to CPU 0)
771 # Returns: Nothing on success
773 # Since: 0.14
775 # Notes: Errors were not reliably returned until 1.1
777 # Example:
779 # -> { "execute": "memsave",
780 #      "arguments": { "val": 10,
781 #                     "size": 100,
782 #                     "filename": "/tmp/virtual-mem-dump" } }
783 # <- { "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": {} }
815 { 'command': 'pmemsave',
816   'data': {'val': 'int', 'size': 'int', 'filename': 'str'} }
819 # @Memdev:
821 # Information about memory backend
823 # @id: backend's ID if backend has 'id' property (since 2.9)
825 # @size: memory backend size
827 # @merge: whether memory merge support is enabled
829 # @dump: whether memory backend's memory is included in a core dump
831 # @prealloc: whether memory was preallocated
833 # @share: whether memory is private to QEMU or shared (since 6.1)
835 # @reserve: whether swap space (or huge pages) was reserved if applicable.
836 #           This corresponds to the user configuration and not the actual
837 #           behavior implemented in the OS to perform the reservation.
838 #           For example, Linux will never reserve swap space for shared
839 #           file mappings. (since 6.1)
841 # @host-nodes: host nodes for its memory policy
843 # @policy: memory policy of memory backend
845 # Since: 2.1
847 { 'struct': 'Memdev',
848   'data': {
849     '*id':        'str',
850     'size':       'size',
851     'merge':      'bool',
852     'dump':       'bool',
853     'prealloc':   'bool',
854     'share':      'bool',
855     '*reserve':    'bool',
856     'host-nodes': ['uint16'],
857     'policy':     'HostMemPolicy' }}
860 # @query-memdev:
862 # Returns information for all memory backends.
864 # Returns: a list of @Memdev.
866 # Since: 2.1
868 # Example:
870 # -> { "execute": "query-memdev" }
871 # <- { "return": [
872 #        {
873 #          "id": "mem1",
874 #          "size": 536870912,
875 #          "merge": false,
876 #          "dump": true,
877 #          "prealloc": false,
878 #          "share": false,
879 #          "host-nodes": [0, 1],
880 #          "policy": "bind"
881 #        },
882 #        {
883 #          "size": 536870912,
884 #          "merge": false,
885 #          "dump": true,
886 #          "prealloc": true,
887 #          "share": false,
888 #          "host-nodes": [2, 3],
889 #          "policy": "preferred"
890 #        }
891 #      ]
892 #    }
895 { 'command': 'query-memdev', 'returns': ['Memdev'], 'allow-preconfig': true }
898 # @CpuInstanceProperties:
900 # List of properties to be used for hotplugging a CPU instance,
901 # it should be passed by management with device_add command when
902 # a CPU is being hotplugged.
904 # @node-id: NUMA node ID the CPU belongs to
905 # @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)
907 # @cluster-id: cluster number within die the CPU belongs to (since 7.1)
908 # @core-id: core number within cluster the CPU belongs to
909 # @thread-id: thread number within core the CPU belongs to
911 # Note: currently there are 6 properties that could be present
912 #       but management should be prepared to pass through other
913 #       properties with device_add command to allow for future
914 #       interface extension. This also requires the filed names to be kept in
915 #       sync with the properties passed to -device/device_add.
917 # Since: 2.7
919 { 'struct': 'CpuInstanceProperties',
920   'data': { '*node-id': 'int',
921             '*socket-id': 'int',
922             '*die-id': 'int',
923             '*cluster-id': 'int',
924             '*core-id': 'int',
925             '*thread-id': 'int'
926   }
930 # @HotpluggableCPU:
932 # @type: CPU object type for usage with device_add command
933 # @props: list of properties to be used for hotplugging CPU
934 # @vcpus-count: number of logical VCPU threads @HotpluggableCPU provides
935 # @qom-path: link to existing CPU object if CPU is present or
936 #            omitted if CPU is not present.
938 # Since: 2.7
940 { 'struct': 'HotpluggableCPU',
941   'data': { 'type': 'str',
942             'vcpus-count': 'int',
943             'props': 'CpuInstanceProperties',
944             '*qom-path': 'str'
945           }
949 # @query-hotpluggable-cpus:
951 # TODO: Better documentation; currently there is none.
953 # Returns: a list of HotpluggableCPU objects.
955 # Since: 2.7
957 # Example:
959 # For pseries machine type started with -smp 2,cores=2,maxcpus=4 -cpu POWER8:
961 # -> { "execute": "query-hotpluggable-cpus" }
962 # <- {"return": [
963 #      { "props": { "core-id": 8 }, "type": "POWER8-spapr-cpu-core",
964 #        "vcpus-count": 1 },
965 #      { "props": { "core-id": 0 }, "type": "POWER8-spapr-cpu-core",
966 #        "vcpus-count": 1, "qom-path": "/machine/unattached/device[0]"}
967 #    ]}'
969 # For pc machine type started with -smp 1,maxcpus=2:
971 # -> { "execute": "query-hotpluggable-cpus" }
972 # <- {"return": [
973 #      {
974 #         "type": "qemu64-x86_64-cpu", "vcpus-count": 1,
975 #         "props": {"core-id": 0, "socket-id": 1, "thread-id": 0}
976 #      },
977 #      {
978 #         "qom-path": "/machine/unattached/device[0]",
979 #         "type": "qemu64-x86_64-cpu", "vcpus-count": 1,
980 #         "props": {"core-id": 0, "socket-id": 0, "thread-id": 0}
981 #      }
982 #    ]}
984 # For s390x-virtio-ccw machine type started with -smp 1,maxcpus=2 -cpu qemu
985 # (Since: 2.11):
987 # -> { "execute": "query-hotpluggable-cpus" }
988 # <- {"return": [
989 #      {
990 #         "type": "qemu-s390x-cpu", "vcpus-count": 1,
991 #         "props": { "core-id": 1 }
992 #      },
993 #      {
994 #         "qom-path": "/machine/unattached/device[0]",
995 #         "type": "qemu-s390x-cpu", "vcpus-count": 1,
996 #         "props": { "core-id": 0 }
997 #      }
998 #    ]}
1001 { 'command': 'query-hotpluggable-cpus', 'returns': ['HotpluggableCPU'],
1002              'allow-preconfig': true }
1005 # @set-numa-node:
1007 # Runtime equivalent of '-numa' CLI option, available at
1008 # preconfigure stage to configure numa mapping before initializing
1009 # machine.
1011 # Since: 3.0
1013 { 'command': 'set-numa-node', 'boxed': true,
1014   'data': 'NumaOptions',
1015   'allow-preconfig': true
1019 # @balloon:
1021 # Request the balloon driver to change its balloon size.
1023 # @value: the target logical size of the VM in bytes.
1024 #         We can deduce the size of the balloon using this formula:
1026 #            logical_vm_size = vm_ram_size - balloon_size
1028 #         From it we have: balloon_size = vm_ram_size - @value
1030 # Returns: - Nothing on success
1031 #          - If the balloon driver is enabled but not functional because the KVM
1032 #            kernel module cannot support it, KvmMissingCap
1033 #          - If no balloon device is present, DeviceNotActive
1035 # Notes: This command just issues a request to the guest.  When it returns,
1036 #        the balloon size may not have changed.  A guest can change the balloon
1037 #        size independent of this command.
1039 # Since: 0.14
1041 # Example:
1043 # -> { "execute": "balloon", "arguments": { "value": 536870912 } }
1044 # <- { "return": {} }
1046 # With a 2.5GiB guest this command inflated the ballon to 3GiB.
1049 { 'command': 'balloon', 'data': {'value': 'int'} }
1052 # @BalloonInfo:
1054 # Information about the guest balloon device.
1056 # @actual: the logical size of the VM in bytes
1057 #          Formula used: logical_vm_size = vm_ram_size - balloon_size
1059 # Since: 0.14
1061 { 'struct': 'BalloonInfo', 'data': {'actual': 'int' } }
1064 # @query-balloon:
1066 # Return information about the balloon device.
1068 # Returns: - @BalloonInfo on success
1069 #          - If the balloon driver is enabled but not functional because the KVM
1070 #            kernel module cannot support it, KvmMissingCap
1071 #          - If no balloon device is present, DeviceNotActive
1073 # Since: 0.14
1075 # Example:
1077 # -> { "execute": "query-balloon" }
1078 # <- { "return": {
1079 #          "actual": 1073741824
1080 #       }
1081 #    }
1084 { 'command': 'query-balloon', 'returns': 'BalloonInfo' }
1087 # @BALLOON_CHANGE:
1089 # Emitted when the guest changes the actual BALLOON level. This value is
1090 # equivalent to the @actual field return by the 'query-balloon' command
1092 # @actual: the logical size of the VM in bytes
1093 #          Formula used: logical_vm_size = vm_ram_size - balloon_size
1095 # Note: this event is rate-limited.
1097 # Since: 1.2
1099 # Example:
1101 # <- { "event": "BALLOON_CHANGE",
1102 #      "data": { "actual": 944766976 },
1103 #      "timestamp": { "seconds": 1267020223, "microseconds": 435656 } }
1106 { 'event': 'BALLOON_CHANGE',
1107   'data': { 'actual': 'int' } }
1110 # @MemoryInfo:
1112 # Actual memory information in bytes.
1114 # @base-memory: size of "base" memory specified with command line
1115 #               option -m.
1117 # @plugged-memory: size of memory that can be hot-unplugged. This field
1118 #                  is omitted if target doesn't support memory hotplug
1119 #                  (i.e. CONFIG_MEM_DEVICE not defined at build time).
1121 # Since: 2.11
1123 { 'struct': 'MemoryInfo',
1124   'data'  : { 'base-memory': 'size', '*plugged-memory': 'size' } }
1127 # @query-memory-size-summary:
1129 # Return the amount of initially allocated and present hotpluggable (if
1130 # enabled) memory in bytes.
1132 # Example:
1134 # -> { "execute": "query-memory-size-summary" }
1135 # <- { "return": { "base-memory": 4294967296, "plugged-memory": 0 } }
1137 # Since: 2.11
1139 { 'command': 'query-memory-size-summary', 'returns': 'MemoryInfo' }
1142 # @PCDIMMDeviceInfo:
1144 # PCDIMMDevice state information
1146 # @id: device's ID
1148 # @addr: physical address, where device is mapped
1150 # @size: size of memory that the device provides
1152 # @slot: slot number at which device is plugged in
1154 # @node: NUMA node number where device is plugged in
1156 # @memdev: memory backend linked with device
1158 # @hotplugged: true if device was hotplugged
1160 # @hotpluggable: true if device if could be added/removed while machine is running
1162 # Since: 2.1
1164 { 'struct': 'PCDIMMDeviceInfo',
1165   'data': { '*id': 'str',
1166             'addr': 'int',
1167             'size': 'int',
1168             'slot': 'int',
1169             'node': 'int',
1170             'memdev': 'str',
1171             'hotplugged': 'bool',
1172             'hotpluggable': 'bool'
1173           }
1177 # @VirtioPMEMDeviceInfo:
1179 # VirtioPMEM state information
1181 # @id: device's ID
1183 # @memaddr: physical address in memory, where device is mapped
1185 # @size: size of memory that the device provides
1187 # @memdev: memory backend linked with device
1189 # Since: 4.1
1191 { 'struct': 'VirtioPMEMDeviceInfo',
1192   'data': { '*id': 'str',
1193             'memaddr': 'size',
1194             'size': 'size',
1195             'memdev': 'str'
1196           }
1200 # @VirtioMEMDeviceInfo:
1202 # VirtioMEMDevice state information
1204 # @id: device's ID
1206 # @memaddr: physical address in memory, where device is mapped
1208 # @requested-size: the user requested size of the device
1210 # @size: the (current) size of memory that the device provides
1212 # @max-size: the maximum size of memory that the device can provide
1214 # @block-size: the block size of memory that the device provides
1216 # @node: NUMA node number where device is assigned to
1218 # @memdev: memory backend linked with the region
1220 # Since: 5.1
1222 { 'struct': 'VirtioMEMDeviceInfo',
1223   'data': { '*id': 'str',
1224             'memaddr': 'size',
1225             'requested-size': 'size',
1226             'size': 'size',
1227             'max-size': 'size',
1228             'block-size': 'size',
1229             'node': 'int',
1230             'memdev': 'str'
1231           }
1235 # @SgxEPCDeviceInfo:
1237 # Sgx EPC state information
1239 # @id: device's ID
1241 # @memaddr: physical address in memory, where device is mapped
1243 # @size: size of memory that the device provides
1245 # @memdev: memory backend linked with device
1247 # @node: the numa node (Since: 7.0)
1249 # Since: 6.2
1251 { 'struct': 'SgxEPCDeviceInfo',
1252   'data': { '*id': 'str',
1253             'memaddr': 'size',
1254             'size': 'size',
1255             'node': 'int',
1256             'memdev': 'str'
1257           }
1261 # @MemoryDeviceInfoKind:
1263 # Since: 2.1
1265 { 'enum': 'MemoryDeviceInfoKind',
1266   'data': [ 'dimm', 'nvdimm', 'virtio-pmem', 'virtio-mem', 'sgx-epc' ] }
1269 # @PCDIMMDeviceInfoWrapper:
1271 # Since: 2.1
1273 { 'struct': 'PCDIMMDeviceInfoWrapper',
1274   'data': { 'data': 'PCDIMMDeviceInfo' } }
1277 # @VirtioPMEMDeviceInfoWrapper:
1279 # Since: 2.1
1281 { 'struct': 'VirtioPMEMDeviceInfoWrapper',
1282   'data': { 'data': 'VirtioPMEMDeviceInfo' } }
1285 # @VirtioMEMDeviceInfoWrapper:
1287 # Since: 2.1
1289 { 'struct': 'VirtioMEMDeviceInfoWrapper',
1290   'data': { 'data': 'VirtioMEMDeviceInfo' } }
1293 # @SgxEPCDeviceInfoWrapper:
1295 # Since: 6.2
1297 { 'struct': 'SgxEPCDeviceInfoWrapper',
1298   'data': { 'data': 'SgxEPCDeviceInfo' } }
1301 # @MemoryDeviceInfo:
1303 # Union containing information about a memory device
1305 # nvdimm is included since 2.12. virtio-pmem is included since 4.1.
1306 # virtio-mem is included since 5.1. sgx-epc is included since 6.2.
1308 # Since: 2.1
1310 { 'union': 'MemoryDeviceInfo',
1311   'base': { 'type': 'MemoryDeviceInfoKind' },
1312   'discriminator': 'type',
1313   'data': { 'dimm': 'PCDIMMDeviceInfoWrapper',
1314             'nvdimm': 'PCDIMMDeviceInfoWrapper',
1315             'virtio-pmem': 'VirtioPMEMDeviceInfoWrapper',
1316             'virtio-mem': 'VirtioMEMDeviceInfoWrapper',
1317             'sgx-epc': 'SgxEPCDeviceInfoWrapper'
1318           }
1322 # @SgxEPC:
1324 # Sgx EPC cmdline information
1326 # @memdev: memory backend linked with device
1328 # @node: the numa node (Since: 7.0)
1330 # Since: 6.2
1332 { 'struct': 'SgxEPC',
1333   'data': { 'memdev': 'str',
1334             'node': 'int'
1335           }
1339 # @SgxEPCProperties:
1341 # SGX properties of machine types.
1343 # @sgx-epc: list of ids of memory-backend-epc objects.
1345 # Since: 6.2
1347 { 'struct': 'SgxEPCProperties',
1348   'data': { 'sgx-epc': ['SgxEPC'] }
1352 # @query-memory-devices:
1354 # Lists available memory devices and their state
1356 # Since: 2.1
1358 # Example:
1360 # -> { "execute": "query-memory-devices" }
1361 # <- { "return": [ { "data":
1362 #                       { "addr": 5368709120,
1363 #                         "hotpluggable": true,
1364 #                         "hotplugged": true,
1365 #                         "id": "d1",
1366 #                         "memdev": "/objects/memX",
1367 #                         "node": 0,
1368 #                         "size": 1073741824,
1369 #                         "slot": 0},
1370 #                    "type": "dimm"
1371 #                  } ] }
1374 { 'command': 'query-memory-devices', 'returns': ['MemoryDeviceInfo'] }
1377 # @MEMORY_DEVICE_SIZE_CHANGE:
1379 # Emitted when the size of a memory device changes. Only emitted for memory
1380 # devices that can actually change the size (e.g., virtio-mem due to guest
1381 # action).
1383 # @id: device's ID
1385 # @size: the new size of memory that the device provides
1387 # @qom-path: path to the device object in the QOM tree (since 6.2)
1389 # Note: this event is rate-limited.
1391 # Since: 5.1
1393 # Example:
1395 # <- { "event": "MEMORY_DEVICE_SIZE_CHANGE",
1396 #      "data": { "id": "vm0", "size": 1073741824,
1397 #                "qom-path": "/machine/unattached/device[2]" },
1398 #      "timestamp": { "seconds": 1588168529, "microseconds": 201316 } }
1401 { 'event': 'MEMORY_DEVICE_SIZE_CHANGE',
1402   'data': { '*id': 'str', 'size': 'size', 'qom-path' : 'str'} }
1405 # @MEM_UNPLUG_ERROR:
1407 # Emitted when memory hot unplug error occurs.
1409 # @device: device name
1411 # @msg: Informative message
1413 # Features:
1414 # @deprecated: This event is deprecated. Use @DEVICE_UNPLUG_GUEST_ERROR
1415 #              instead.
1417 # Since: 2.4
1419 # Example:
1421 # <- { "event": "MEM_UNPLUG_ERROR",
1422 #      "data": { "device": "dimm1",
1423 #                "msg": "acpi: device unplug for unsupported device"
1424 #      },
1425 #      "timestamp": { "seconds": 1265044230, "microseconds": 450486 } }
1428 { 'event': 'MEM_UNPLUG_ERROR',
1429   'data': { 'device': 'str', 'msg': 'str' },
1430   'features': ['deprecated'] }
1433 # @BootConfiguration:
1435 # Schema for virtual machine boot configuration.
1437 # @order: Boot order (a=floppy, c=hard disk, d=CD-ROM, n=network)
1439 # @once: Boot order to apply on first boot
1441 # @menu: Whether to show a boot menu
1443 # @splash: The name of the file to be passed to the firmware as logo picture, if @menu is true.
1445 # @splash-time: How long to show the logo picture, in milliseconds
1447 # @reboot-timeout: Timeout before guest reboots after boot fails
1449 # @strict: Whether to attempt booting from devices not included in the boot order
1451 # Since: 7.1
1453 { 'struct': 'BootConfiguration', 'data': {
1454      '*order': 'str',
1455      '*once': 'str',
1456      '*menu': 'bool',
1457      '*splash': 'str',
1458      '*splash-time': 'int',
1459      '*reboot-timeout': 'int',
1460      '*strict': 'bool' } }
1463 # @SMPConfiguration:
1465 # Schema for CPU topology configuration.  A missing value lets
1466 # QEMU figure out a suitable value based on the ones that are provided.
1468 # @cpus: number of virtual CPUs in the virtual machine
1470 # @sockets: number of sockets in the CPU topology
1472 # @dies: number of dies per socket in the CPU topology
1474 # @clusters: number of clusters per die in the CPU topology (since 7.0)
1476 # @cores: number of cores per cluster in the CPU topology
1478 # @threads: number of threads per core in the CPU topology
1480 # @maxcpus: maximum number of hotpluggable virtual CPUs in the virtual machine
1482 # Since: 6.1
1484 { 'struct': 'SMPConfiguration', 'data': {
1485      '*cpus': 'int',
1486      '*sockets': 'int',
1487      '*dies': 'int',
1488      '*clusters': 'int',
1489      '*cores': 'int',
1490      '*threads': 'int',
1491      '*maxcpus': 'int' } }
1494 # @x-query-irq:
1496 # Query interrupt statistics
1498 # Features:
1499 # @unstable: This command is meant for debugging.
1501 # Returns: interrupt statistics
1503 # Since: 6.2
1505 { 'command': 'x-query-irq',
1506   'returns': 'HumanReadableText',
1507   'features': [ 'unstable' ] }
1510 # @x-query-jit:
1512 # Query TCG compiler statistics
1514 # Features:
1515 # @unstable: This command is meant for debugging.
1517 # Returns: TCG compiler statistics
1519 # Since: 6.2
1521 { 'command': 'x-query-jit',
1522   'returns': 'HumanReadableText',
1523   'if': 'CONFIG_TCG',
1524   'features': [ 'unstable' ] }
1527 # @x-query-numa:
1529 # Query NUMA topology information
1531 # Features:
1532 # @unstable: This command is meant for debugging.
1534 # Returns: topology information
1536 # Since: 6.2
1538 { 'command': 'x-query-numa',
1539   'returns': 'HumanReadableText',
1540   'features': [ 'unstable' ] }
1543 # @x-query-opcount:
1545 # Query TCG opcode counters
1547 # Features:
1548 # @unstable: This command is meant for debugging.
1550 # Returns: TCG opcode counters
1552 # Since: 6.2
1554 { 'command': 'x-query-opcount',
1555   'returns': 'HumanReadableText',
1556   'if': 'CONFIG_TCG',
1557   'features': [ 'unstable' ] }
1560 # @x-query-profile:
1562 # Query TCG profiling information
1564 # Features:
1565 # @unstable: This command is meant for debugging.
1567 # Returns: profile information
1569 # Since: 6.2
1571 { 'command': 'x-query-profile',
1572   'returns': 'HumanReadableText',
1573   'if': 'CONFIG_TCG',
1574   'features': [ 'unstable' ] }
1577 # @x-query-ramblock:
1579 # Query system ramblock information
1581 # Features:
1582 # @unstable: This command is meant for debugging.
1584 # Returns: system ramblock information
1586 # Since: 6.2
1588 { 'command': 'x-query-ramblock',
1589   'returns': 'HumanReadableText',
1590   'features': [ 'unstable' ] }
1593 # @x-query-rdma:
1595 # Query RDMA state
1597 # Features:
1598 # @unstable: This command is meant for debugging.
1600 # Returns: RDMA state
1602 # Since: 6.2
1604 { 'command': 'x-query-rdma',
1605   'returns': 'HumanReadableText',
1606   'features': [ 'unstable' ] }
1609 # @x-query-roms:
1611 # Query information on the registered ROMS
1613 # Features:
1614 # @unstable: This command is meant for debugging.
1616 # Returns: registered ROMs
1618 # Since: 6.2
1620 { 'command': 'x-query-roms',
1621   'returns': 'HumanReadableText',
1622   'features': [ 'unstable' ] }
1625 # @x-query-usb:
1627 # Query information on the USB devices
1629 # Features:
1630 # @unstable: This command is meant for debugging.
1632 # Returns: USB device information
1634 # Since: 6.2
1636 { 'command': 'x-query-usb',
1637   'returns': 'HumanReadableText',
1638   'features': [ 'unstable' ] }
1641 # @SmbiosEntryPointType:
1643 # @32: SMBIOS version 2.1 (32-bit) Entry Point
1645 # @64: SMBIOS version 3.0 (64-bit) Entry Point
1647 # Since: 7.0
1649 { 'enum': 'SmbiosEntryPointType',
1650   'data': [ '32', '64' ] }
1653 # @MemorySizeConfiguration:
1655 # Schema for memory size configuration.
1657 # @size: memory size in bytes
1659 # @max-size: maximum hotpluggable memory size in bytes
1661 # @slots: number of available memory slots for hotplug
1663 # Since: 7.1
1665 { 'struct': 'MemorySizeConfiguration', 'data': {
1666      '*size': 'size',
1667      '*max-size': 'size',
1668      '*slots': 'uint64' } }
1671 # @dumpdtb:
1673 # Save the FDT in dtb format.
1675 # @filename: name of the dtb file to be created
1677 # Since: 7.2
1679 # Example:
1680 #   {"execute": "dumpdtb"}
1681 #    "arguments": { "filename": "fdt.dtb" } }
1684 { 'command': 'dumpdtb',
1685   'data': { 'filename': 'str' },
1686   'if': 'CONFIG_FDT' }