Update version for v7.0.0-rc3 release
[qemu.git] / qapi / machine.json
blobd25a481ce40f357dc64d1e583d7736c71e5b6629
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              '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
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 removed
151 #              in future versions of QEMU according to the QEMU deprecation
152 #              policy (since 4.1)
154 # @default-cpu-type: default CPU model typename if none is requested via
155 #                    the -cpu argument. (since 4.2)
157 # @default-ram-id: the default ID of initial RAM memory backend (since 5.2)
159 # Since: 1.2
161 { 'struct': 'MachineInfo',
162   'data': { 'name': 'str', '*alias': 'str',
163             '*is-default': 'bool', 'cpu-max': 'int',
164             'hotpluggable-cpus': 'bool',  'numa-mem-supported': 'bool',
165             'deprecated': 'bool', '*default-cpu-type': 'str',
166             '*default-ram-id': 'str' } }
169 # @query-machines:
171 # Return a list of supported machines
173 # Returns: a list of MachineInfo
175 # Since: 1.2
177 { 'command': 'query-machines', 'returns': ['MachineInfo'] }
180 # @CurrentMachineParams:
182 # Information describing the running machine parameters.
184 # @wakeup-suspend-support: true if the machine supports wake up from
185 #                          suspend
187 # Since: 4.0
189 { 'struct': 'CurrentMachineParams',
190   'data': { 'wakeup-suspend-support': 'bool'} }
193 # @query-current-machine:
195 # Return information on the current virtual machine.
197 # Returns: CurrentMachineParams
199 # Since: 4.0
201 { 'command': 'query-current-machine', 'returns': 'CurrentMachineParams' }
204 # @TargetInfo:
206 # Information describing the QEMU target.
208 # @arch: the target architecture
210 # Since: 1.2
212 { 'struct': 'TargetInfo',
213   'data': { 'arch': 'SysEmuTarget' } }
216 # @query-target:
218 # Return information about the target for this QEMU
220 # Returns: TargetInfo
222 # Since: 1.2
224 { 'command': 'query-target', 'returns': 'TargetInfo' }
227 # @UuidInfo:
229 # Guest UUID information (Universally Unique Identifier).
231 # @UUID: the UUID of the guest
233 # Since: 0.14
235 # Notes: If no UUID was specified for the guest, a null UUID is returned.
237 { 'struct': 'UuidInfo', 'data': {'UUID': 'str'} }
240 # @query-uuid:
242 # Query the guest UUID information.
244 # Returns: The @UuidInfo for the guest
246 # Since: 0.14
248 # Example:
250 # -> { "execute": "query-uuid" }
251 # <- { "return": { "UUID": "550e8400-e29b-41d4-a716-446655440000" } }
254 { 'command': 'query-uuid', 'returns': 'UuidInfo', 'allow-preconfig': true }
257 # @GuidInfo:
259 # GUID information.
261 # @guid: the globally unique identifier
263 # Since: 2.9
265 { 'struct': 'GuidInfo', 'data': {'guid': 'str'} }
268 # @query-vm-generation-id:
270 # Show Virtual Machine Generation ID
272 # Since: 2.9
274 { 'command': 'query-vm-generation-id', 'returns': 'GuidInfo' }
277 # @system_reset:
279 # Performs a hard reset of a guest.
281 # Since: 0.14
283 # Example:
285 # -> { "execute": "system_reset" }
286 # <- { "return": {} }
289 { 'command': 'system_reset' }
292 # @system_powerdown:
294 # Requests that a guest perform a powerdown operation.
296 # Since: 0.14
298 # Notes: A guest may or may not respond to this command.  This command
299 #        returning does not indicate that a guest has accepted the request or
300 #        that it has shut down.  Many guests will respond to this command by
301 #        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 # @X86CPURegister32:
508 # A X86 32-bit register
510 # Since: 1.5
512 { 'enum': 'X86CPURegister32',
513   'data': [ 'EAX', 'EBX', 'ECX', 'EDX', 'ESP', 'EBP', 'ESI', 'EDI' ] }
516 # @X86CPUFeatureWordInfo:
518 # Information about a X86 CPU feature word
520 # @cpuid-input-eax: Input EAX value for CPUID instruction for that feature word
522 # @cpuid-input-ecx: Input ECX value for CPUID instruction for that
523 #                   feature word
525 # @cpuid-register: Output register containing the feature bits
527 # @features: value of output register, containing the feature bits
529 # Since: 1.5
531 { 'struct': 'X86CPUFeatureWordInfo',
532   'data': { 'cpuid-input-eax': 'int',
533             '*cpuid-input-ecx': 'int',
534             'cpuid-register': 'X86CPURegister32',
535             'features': 'int' } }
538 # @DummyForceArrays:
540 # Not used by QMP; hack to let us use X86CPUFeatureWordInfoList internally
542 # Since: 2.5
544 { 'struct': 'DummyForceArrays',
545   'data': { 'unused': ['X86CPUFeatureWordInfo'] } }
548 # @NumaCpuOptions:
550 # Option "-numa cpu" overrides default cpu to node mapping.
551 # It accepts the same set of cpu properties as returned by
552 # query-hotpluggable-cpus[].props, where node-id could be used to
553 # override default node mapping.
555 # Since: 2.10
557 { 'struct': 'NumaCpuOptions',
558    'base': 'CpuInstanceProperties',
559    'data' : {} }
562 # @HmatLBMemoryHierarchy:
564 # The memory hierarchy in the System Locality Latency and Bandwidth
565 # Information Structure of HMAT (Heterogeneous Memory Attribute Table)
567 # For more information about @HmatLBMemoryHierarchy, see chapter
568 # 5.2.27.4: Table 5-146: Field "Flags" of ACPI 6.3 spec.
570 # @memory: the structure represents the memory performance
572 # @first-level: first level of memory side cache
574 # @second-level: second level of memory side cache
576 # @third-level: third level of memory side cache
578 # Since: 5.0
580 { 'enum': 'HmatLBMemoryHierarchy',
581   'data': [ 'memory', 'first-level', 'second-level', 'third-level' ] }
584 # @HmatLBDataType:
586 # Data type in the System Locality Latency and Bandwidth
587 # Information Structure of HMAT (Heterogeneous Memory Attribute Table)
589 # For more information about @HmatLBDataType, see chapter
590 # 5.2.27.4: Table 5-146:  Field "Data Type" of ACPI 6.3 spec.
592 # @access-latency: access latency (nanoseconds)
594 # @read-latency: read latency (nanoseconds)
596 # @write-latency: write latency (nanoseconds)
598 # @access-bandwidth: access bandwidth (Bytes per second)
600 # @read-bandwidth: read bandwidth (Bytes per second)
602 # @write-bandwidth: write bandwidth (Bytes per second)
604 # Since: 5.0
606 { 'enum': 'HmatLBDataType',
607   'data': [ 'access-latency', 'read-latency', 'write-latency',
608             'access-bandwidth', 'read-bandwidth', 'write-bandwidth' ] }
611 # @NumaHmatLBOptions:
613 # Set the system locality latency and bandwidth information
614 # between Initiator and Target proximity Domains.
616 # For more information about @NumaHmatLBOptions, see chapter
617 # 5.2.27.4: Table 5-146 of ACPI 6.3 spec.
619 # @initiator: the Initiator Proximity Domain.
621 # @target: the Target Proximity Domain.
623 # @hierarchy: the Memory Hierarchy. Indicates the performance
624 #             of memory or side cache.
626 # @data-type: presents the type of data, access/read/write
627 #             latency or hit latency.
629 # @latency: the value of latency from @initiator to @target
630 #           proximity domain, the latency unit is "ns(nanosecond)".
632 # @bandwidth: the value of bandwidth between @initiator and @target
633 #             proximity domain, the bandwidth unit is
634 #             "Bytes per second".
636 # Since: 5.0
638 { 'struct': 'NumaHmatLBOptions',
639     'data': {
640     'initiator': 'uint16',
641     'target': 'uint16',
642     'hierarchy': 'HmatLBMemoryHierarchy',
643     'data-type': 'HmatLBDataType',
644     '*latency': 'uint64',
645     '*bandwidth': 'size' }}
648 # @HmatCacheAssociativity:
650 # Cache associativity in the Memory Side Cache Information Structure
651 # of HMAT
653 # For more information of @HmatCacheAssociativity, see chapter
654 # 5.2.27.5: Table 5-147 of ACPI 6.3 spec.
656 # @none: None (no memory side cache in this proximity domain,
657 #              or cache associativity unknown)
659 # @direct: Direct Mapped
661 # @complex: Complex Cache Indexing (implementation specific)
663 # Since: 5.0
665 { 'enum': 'HmatCacheAssociativity',
666   'data': [ 'none', 'direct', 'complex' ] }
669 # @HmatCacheWritePolicy:
671 # Cache write policy in the Memory Side Cache Information Structure
672 # of HMAT
674 # For more information of @HmatCacheWritePolicy, see chapter
675 # 5.2.27.5: Table 5-147: Field "Cache Attributes" of ACPI 6.3 spec.
677 # @none: None (no memory side cache in this proximity domain,
678 #        or cache write policy unknown)
680 # @write-back: Write Back (WB)
682 # @write-through: Write Through (WT)
684 # Since: 5.0
686 { 'enum': 'HmatCacheWritePolicy',
687   'data': [ 'none', 'write-back', 'write-through' ] }
690 # @NumaHmatCacheOptions:
692 # Set the memory side cache information for a given memory domain.
694 # For more information of @NumaHmatCacheOptions, see chapter
695 # 5.2.27.5: Table 5-147: Field "Cache Attributes" of ACPI 6.3 spec.
697 # @node-id: the memory proximity domain to which the memory belongs.
699 # @size: the size of memory side cache in bytes.
701 # @level: the cache level described in this structure.
703 # @associativity: the cache associativity,
704 #                 none/direct-mapped/complex(complex cache indexing).
706 # @policy: the write policy, none/write-back/write-through.
708 # @line: the cache Line size in bytes.
710 # Since: 5.0
712 { 'struct': 'NumaHmatCacheOptions',
713   'data': {
714    'node-id': 'uint32',
715    'size': 'size',
716    'level': 'uint8',
717    'associativity': 'HmatCacheAssociativity',
718    'policy': 'HmatCacheWritePolicy',
719    'line': 'uint16' }}
722 # @memsave:
724 # Save a portion of guest memory to a file.
726 # @val: the virtual address of the guest to start from
728 # @size: the size of memory region to save
730 # @filename: the file to save the memory to as binary data
732 # @cpu-index: the index of the virtual CPU to use for translating the
733 #             virtual address (defaults to CPU 0)
735 # Returns: Nothing on success
737 # Since: 0.14
739 # Notes: Errors were not reliably returned until 1.1
741 # Example:
743 # -> { "execute": "memsave",
744 #      "arguments": { "val": 10,
745 #                     "size": 100,
746 #                     "filename": "/tmp/virtual-mem-dump" } }
747 # <- { "return": {} }
750 { 'command': 'memsave',
751   'data': {'val': 'int', 'size': 'int', 'filename': 'str', '*cpu-index': 'int'} }
754 # @pmemsave:
756 # Save a portion of guest physical memory to a file.
758 # @val: the physical address of the guest to start from
760 # @size: the size of memory region to save
762 # @filename: the file to save the memory to as binary data
764 # Returns: Nothing on success
766 # Since: 0.14
768 # Notes: Errors were not reliably returned until 1.1
770 # Example:
772 # -> { "execute": "pmemsave",
773 #      "arguments": { "val": 10,
774 #                     "size": 100,
775 #                     "filename": "/tmp/physical-mem-dump" } }
776 # <- { "return": {} }
779 { 'command': 'pmemsave',
780   'data': {'val': 'int', 'size': 'int', 'filename': 'str'} }
783 # @Memdev:
785 # Information about memory backend
787 # @id: backend's ID if backend has 'id' property (since 2.9)
789 # @size: memory backend size
791 # @merge: whether memory merge support is enabled
793 # @dump: whether memory backend's memory is included in a core dump
795 # @prealloc: whether memory was preallocated
797 # @share: whether memory is private to QEMU or shared (since 6.1)
799 # @reserve: whether swap space (or huge pages) was reserved if applicable.
800 #           This corresponds to the user configuration and not the actual
801 #           behavior implemented in the OS to perform the reservation.
802 #           For example, Linux will never reserve swap space for shared
803 #           file mappings. (since 6.1)
805 # @host-nodes: host nodes for its memory policy
807 # @policy: memory policy of memory backend
809 # Since: 2.1
811 { 'struct': 'Memdev',
812   'data': {
813     '*id':        'str',
814     'size':       'size',
815     'merge':      'bool',
816     'dump':       'bool',
817     'prealloc':   'bool',
818     'share':      'bool',
819     '*reserve':    'bool',
820     'host-nodes': ['uint16'],
821     'policy':     'HostMemPolicy' }}
824 # @query-memdev:
826 # Returns information for all memory backends.
828 # Returns: a list of @Memdev.
830 # Since: 2.1
832 # Example:
834 # -> { "execute": "query-memdev" }
835 # <- { "return": [
836 #        {
837 #          "id": "mem1",
838 #          "size": 536870912,
839 #          "merge": false,
840 #          "dump": true,
841 #          "prealloc": false,
842 #          "share": false,
843 #          "host-nodes": [0, 1],
844 #          "policy": "bind"
845 #        },
846 #        {
847 #          "size": 536870912,
848 #          "merge": false,
849 #          "dump": true,
850 #          "prealloc": true,
851 #          "share": false,
852 #          "host-nodes": [2, 3],
853 #          "policy": "preferred"
854 #        }
855 #      ]
856 #    }
859 { 'command': 'query-memdev', 'returns': ['Memdev'], 'allow-preconfig': true }
862 # @CpuInstanceProperties:
864 # List of properties to be used for hotplugging a CPU instance,
865 # it should be passed by management with device_add command when
866 # a CPU is being hotplugged.
868 # @node-id: NUMA node ID the CPU belongs to
869 # @socket-id: socket number within node/board the CPU belongs to
870 # @die-id: die number within socket the CPU belongs to (since 4.1)
871 # @core-id: core number within die the CPU belongs to
872 # @thread-id: thread number within core the CPU belongs to
874 # Note: currently there are 5 properties that could be present
875 #       but management should be prepared to pass through other
876 #       properties with device_add command to allow for future
877 #       interface extension. This also requires the filed names to be kept in
878 #       sync with the properties passed to -device/device_add.
880 # Since: 2.7
882 { 'struct': 'CpuInstanceProperties',
883   'data': { '*node-id': 'int',
884             '*socket-id': 'int',
885             '*die-id': 'int',
886             '*core-id': 'int',
887             '*thread-id': 'int'
888   }
892 # @HotpluggableCPU:
894 # @type: CPU object type for usage with device_add command
895 # @props: list of properties to be used for hotplugging CPU
896 # @vcpus-count: number of logical VCPU threads @HotpluggableCPU provides
897 # @qom-path: link to existing CPU object if CPU is present or
898 #            omitted if CPU is not present.
900 # Since: 2.7
902 { 'struct': 'HotpluggableCPU',
903   'data': { 'type': 'str',
904             'vcpus-count': 'int',
905             'props': 'CpuInstanceProperties',
906             '*qom-path': 'str'
907           }
911 # @query-hotpluggable-cpus:
913 # TODO: Better documentation; currently there is none.
915 # Returns: a list of HotpluggableCPU objects.
917 # Since: 2.7
919 # Example:
921 # For pseries machine type started with -smp 2,cores=2,maxcpus=4 -cpu POWER8:
923 # -> { "execute": "query-hotpluggable-cpus" }
924 # <- {"return": [
925 #      { "props": { "core": 8 }, "type": "POWER8-spapr-cpu-core",
926 #        "vcpus-count": 1 },
927 #      { "props": { "core": 0 }, "type": "POWER8-spapr-cpu-core",
928 #        "vcpus-count": 1, "qom-path": "/machine/unattached/device[0]"}
929 #    ]}'
931 # For pc machine type started with -smp 1,maxcpus=2:
933 # -> { "execute": "query-hotpluggable-cpus" }
934 # <- {"return": [
935 #      {
936 #         "type": "qemu64-x86_64-cpu", "vcpus-count": 1,
937 #         "props": {"core-id": 0, "socket-id": 1, "thread-id": 0}
938 #      },
939 #      {
940 #         "qom-path": "/machine/unattached/device[0]",
941 #         "type": "qemu64-x86_64-cpu", "vcpus-count": 1,
942 #         "props": {"core-id": 0, "socket-id": 0, "thread-id": 0}
943 #      }
944 #    ]}
946 # For s390x-virtio-ccw machine type started with -smp 1,maxcpus=2 -cpu qemu
947 # (Since: 2.11):
949 # -> { "execute": "query-hotpluggable-cpus" }
950 # <- {"return": [
951 #      {
952 #         "type": "qemu-s390x-cpu", "vcpus-count": 1,
953 #         "props": { "core-id": 1 }
954 #      },
955 #      {
956 #         "qom-path": "/machine/unattached/device[0]",
957 #         "type": "qemu-s390x-cpu", "vcpus-count": 1,
958 #         "props": { "core-id": 0 }
959 #      }
960 #    ]}
963 { 'command': 'query-hotpluggable-cpus', 'returns': ['HotpluggableCPU'],
964              'allow-preconfig': true }
967 # @set-numa-node:
969 # Runtime equivalent of '-numa' CLI option, available at
970 # preconfigure stage to configure numa mapping before initializing
971 # machine.
973 # Since 3.0
975 { 'command': 'set-numa-node', 'boxed': true,
976   'data': 'NumaOptions',
977   'allow-preconfig': true
981 # @balloon:
983 # Request the balloon driver to change its balloon size.
985 # @value: the target logical size of the VM in bytes.
986 #         We can deduce the size of the balloon using this formula:
988 #            logical_vm_size = vm_ram_size - balloon_size
990 #         From it we have: balloon_size = vm_ram_size - @value
992 # Returns: - Nothing on success
993 #          - If the balloon driver is enabled but not functional because the KVM
994 #            kernel module cannot support it, KvmMissingCap
995 #          - If no balloon device is present, DeviceNotActive
997 # Notes: This command just issues a request to the guest.  When it returns,
998 #        the balloon size may not have changed.  A guest can change the balloon
999 #        size independent of this command.
1001 # Since: 0.14
1003 # Example:
1005 # -> { "execute": "balloon", "arguments": { "value": 536870912 } }
1006 # <- { "return": {} }
1008 # With a 2.5GiB guest this command inflated the ballon to 3GiB.
1011 { 'command': 'balloon', 'data': {'value': 'int'} }
1014 # @BalloonInfo:
1016 # Information about the guest balloon device.
1018 # @actual: the logical size of the VM in bytes
1019 #          Formula used: logical_vm_size = vm_ram_size - balloon_size
1021 # Since: 0.14
1024 { 'struct': 'BalloonInfo', 'data': {'actual': 'int' } }
1027 # @query-balloon:
1029 # Return information about the balloon device.
1031 # Returns: - @BalloonInfo on success
1032 #          - If the balloon driver is enabled but not functional because the KVM
1033 #            kernel module cannot support it, KvmMissingCap
1034 #          - If no balloon device is present, DeviceNotActive
1036 # Since: 0.14
1038 # Example:
1040 # -> { "execute": "query-balloon" }
1041 # <- { "return": {
1042 #          "actual": 1073741824,
1043 #       }
1044 #    }
1047 { 'command': 'query-balloon', 'returns': 'BalloonInfo' }
1050 # @BALLOON_CHANGE:
1052 # Emitted when the guest changes the actual BALLOON level. This value is
1053 # equivalent to the @actual field return by the 'query-balloon' command
1055 # @actual: the logical size of the VM in bytes
1056 #          Formula used: logical_vm_size = vm_ram_size - balloon_size
1058 # Note: this event is rate-limited.
1060 # Since: 1.2
1062 # Example:
1064 # <- { "event": "BALLOON_CHANGE",
1065 #      "data": { "actual": 944766976 },
1066 #      "timestamp": { "seconds": 1267020223, "microseconds": 435656 } }
1069 { 'event': 'BALLOON_CHANGE',
1070   'data': { 'actual': 'int' } }
1073 # @MemoryInfo:
1075 # Actual memory information in bytes.
1077 # @base-memory: size of "base" memory specified with command line
1078 #               option -m.
1080 # @plugged-memory: size of memory that can be hot-unplugged. This field
1081 #                  is omitted if target doesn't support memory hotplug
1082 #                  (i.e. CONFIG_MEM_DEVICE not defined at build time).
1084 # Since: 2.11
1086 { 'struct': 'MemoryInfo',
1087   'data'  : { 'base-memory': 'size', '*plugged-memory': 'size' } }
1090 # @query-memory-size-summary:
1092 # Return the amount of initially allocated and present hotpluggable (if
1093 # enabled) memory in bytes.
1095 # Example:
1097 # -> { "execute": "query-memory-size-summary" }
1098 # <- { "return": { "base-memory": 4294967296, "plugged-memory": 0 } }
1100 # Since: 2.11
1102 { 'command': 'query-memory-size-summary', 'returns': 'MemoryInfo' }
1105 # @PCDIMMDeviceInfo:
1107 # PCDIMMDevice state information
1109 # @id: device's ID
1111 # @addr: physical address, where device is mapped
1113 # @size: size of memory that the device provides
1115 # @slot: slot number at which device is plugged in
1117 # @node: NUMA node number where device is plugged in
1119 # @memdev: memory backend linked with device
1121 # @hotplugged: true if device was hotplugged
1123 # @hotpluggable: true if device if could be added/removed while machine is running
1125 # Since: 2.1
1127 { 'struct': 'PCDIMMDeviceInfo',
1128   'data': { '*id': 'str',
1129             'addr': 'int',
1130             'size': 'int',
1131             'slot': 'int',
1132             'node': 'int',
1133             'memdev': 'str',
1134             'hotplugged': 'bool',
1135             'hotpluggable': 'bool'
1136           }
1140 # @VirtioPMEMDeviceInfo:
1142 # VirtioPMEM state information
1144 # @id: device's ID
1146 # @memaddr: physical address in memory, where device is mapped
1148 # @size: size of memory that the device provides
1150 # @memdev: memory backend linked with device
1152 # Since: 4.1
1154 { 'struct': 'VirtioPMEMDeviceInfo',
1155   'data': { '*id': 'str',
1156             'memaddr': 'size',
1157             'size': 'size',
1158             'memdev': 'str'
1159           }
1163 # @VirtioMEMDeviceInfo:
1165 # VirtioMEMDevice state information
1167 # @id: device's ID
1169 # @memaddr: physical address in memory, where device is mapped
1171 # @requested-size: the user requested size of the device
1173 # @size: the (current) size of memory that the device provides
1175 # @max-size: the maximum size of memory that the device can provide
1177 # @block-size: the block size of memory that the device provides
1179 # @node: NUMA node number where device is assigned to
1181 # @memdev: memory backend linked with the region
1183 # Since: 5.1
1185 { 'struct': 'VirtioMEMDeviceInfo',
1186   'data': { '*id': 'str',
1187             'memaddr': 'size',
1188             'requested-size': 'size',
1189             'size': 'size',
1190             'max-size': 'size',
1191             'block-size': 'size',
1192             'node': 'int',
1193             'memdev': 'str'
1194           }
1198 # @SgxEPCDeviceInfo:
1200 # Sgx EPC state information
1202 # @id: device's ID
1204 # @memaddr: physical address in memory, where device is mapped
1206 # @size: size of memory that the device provides
1208 # @memdev: memory backend linked with device
1210 # @node: the numa node (Since: 7.0)
1212 # Since: 6.2
1214 { 'struct': 'SgxEPCDeviceInfo',
1215   'data': { '*id': 'str',
1216             'memaddr': 'size',
1217             'size': 'size',
1218             'node': 'int',
1219             'memdev': 'str'
1220           }
1224 # @MemoryDeviceInfoKind:
1226 # Since: 2.1
1228 { 'enum': 'MemoryDeviceInfoKind',
1229   'data': [ 'dimm', 'nvdimm', 'virtio-pmem', 'virtio-mem', 'sgx-epc' ] }
1232 # @PCDIMMDeviceInfoWrapper:
1234 # Since: 2.1
1236 { 'struct': 'PCDIMMDeviceInfoWrapper',
1237   'data': { 'data': 'PCDIMMDeviceInfo' } }
1240 # @VirtioPMEMDeviceInfoWrapper:
1242 # Since: 2.1
1244 { 'struct': 'VirtioPMEMDeviceInfoWrapper',
1245   'data': { 'data': 'VirtioPMEMDeviceInfo' } }
1248 # @VirtioMEMDeviceInfoWrapper:
1250 # Since: 2.1
1252 { 'struct': 'VirtioMEMDeviceInfoWrapper',
1253   'data': { 'data': 'VirtioMEMDeviceInfo' } }
1256 # @SgxEPCDeviceInfoWrapper:
1258 # Since: 6.2
1260 { 'struct': 'SgxEPCDeviceInfoWrapper',
1261   'data': { 'data': 'SgxEPCDeviceInfo' } }
1264 # @MemoryDeviceInfo:
1266 # Union containing information about a memory device
1268 # nvdimm is included since 2.12. virtio-pmem is included since 4.1.
1269 # virtio-mem is included since 5.1. sgx-epc is included since 6.2.
1271 # Since: 2.1
1273 { 'union': 'MemoryDeviceInfo',
1274   'base': { 'type': 'MemoryDeviceInfoKind' },
1275   'discriminator': 'type',
1276   'data': { 'dimm': 'PCDIMMDeviceInfoWrapper',
1277             'nvdimm': 'PCDIMMDeviceInfoWrapper',
1278             'virtio-pmem': 'VirtioPMEMDeviceInfoWrapper',
1279             'virtio-mem': 'VirtioMEMDeviceInfoWrapper',
1280             'sgx-epc': 'SgxEPCDeviceInfoWrapper'
1281           }
1285 # @SgxEPC:
1287 # Sgx EPC cmdline information
1289 # @memdev: memory backend linked with device
1291 # @node: the numa node (Since: 7.0)
1293 # Since: 6.2
1295 { 'struct': 'SgxEPC',
1296   'data': { 'memdev': 'str',
1297             'node': 'int'
1298           }
1302 # @SgxEPCProperties:
1304 # SGX properties of machine types.
1306 # @sgx-epc: list of ids of memory-backend-epc objects.
1308 # Since: 6.2
1310 { 'struct': 'SgxEPCProperties',
1311   'data': { 'sgx-epc': ['SgxEPC'] }
1315 # @query-memory-devices:
1317 # Lists available memory devices and their state
1319 # Since: 2.1
1321 # Example:
1323 # -> { "execute": "query-memory-devices" }
1324 # <- { "return": [ { "data":
1325 #                       { "addr": 5368709120,
1326 #                         "hotpluggable": true,
1327 #                         "hotplugged": true,
1328 #                         "id": "d1",
1329 #                         "memdev": "/objects/memX",
1330 #                         "node": 0,
1331 #                         "size": 1073741824,
1332 #                         "slot": 0},
1333 #                    "type": "dimm"
1334 #                  } ] }
1337 { 'command': 'query-memory-devices', 'returns': ['MemoryDeviceInfo'] }
1340 # @MEMORY_DEVICE_SIZE_CHANGE:
1342 # Emitted when the size of a memory device changes. Only emitted for memory
1343 # devices that can actually change the size (e.g., virtio-mem due to guest
1344 # action).
1346 # @id: device's ID
1348 # @size: the new size of memory that the device provides
1350 # @qom-path: path to the device object in the QOM tree (since 6.2)
1352 # Note: this event is rate-limited.
1354 # Since: 5.1
1356 # Example:
1358 # <- { "event": "MEMORY_DEVICE_SIZE_CHANGE",
1359 #      "data": { "id": "vm0", "size": 1073741824,
1360 #                "qom-path": "/machine/unattached/device[2]" },
1361 #      "timestamp": { "seconds": 1588168529, "microseconds": 201316 } }
1364 { 'event': 'MEMORY_DEVICE_SIZE_CHANGE',
1365   'data': { '*id': 'str', 'size': 'size', 'qom-path' : 'str'} }
1369 # @MEM_UNPLUG_ERROR:
1371 # Emitted when memory hot unplug error occurs.
1373 # @device: device name
1375 # @msg: Informative message
1377 # Features:
1378 # @deprecated: This event is deprecated. Use @DEVICE_UNPLUG_GUEST_ERROR
1379 #              instead.
1381 # Since: 2.4
1383 # Example:
1385 # <- { "event": "MEM_UNPLUG_ERROR"
1386 #      "data": { "device": "dimm1",
1387 #                "msg": "acpi: device unplug for unsupported device"
1388 #      },
1389 #      "timestamp": { "seconds": 1265044230, "microseconds": 450486 } }
1392 { 'event': 'MEM_UNPLUG_ERROR',
1393   'data': { 'device': 'str', 'msg': 'str' },
1394   'features': ['deprecated'] }
1397 # @SMPConfiguration:
1399 # Schema for CPU topology configuration.  A missing value lets
1400 # QEMU figure out a suitable value based on the ones that are provided.
1402 # @cpus: number of virtual CPUs in the virtual machine
1404 # @sockets: number of sockets in the CPU topology
1406 # @dies: number of dies per socket in the CPU topology
1408 # @clusters: number of clusters per die in the CPU topology (since 7.0)
1410 # @cores: number of cores per cluster in the CPU topology
1412 # @threads: number of threads per core in the CPU topology
1414 # @maxcpus: maximum number of hotpluggable virtual CPUs in the virtual machine
1416 # Since: 6.1
1418 { 'struct': 'SMPConfiguration', 'data': {
1419      '*cpus': 'int',
1420      '*sockets': 'int',
1421      '*dies': 'int',
1422      '*clusters': 'int',
1423      '*cores': 'int',
1424      '*threads': 'int',
1425      '*maxcpus': 'int' } }
1428 # @x-query-irq:
1430 # Query interrupt statistics
1432 # Features:
1433 # @unstable: This command is meant for debugging.
1435 # Returns: interrupt statistics
1437 # Since: 6.2
1439 { 'command': 'x-query-irq',
1440   'returns': 'HumanReadableText',
1441   'features': [ 'unstable' ] }
1444 # @x-query-jit:
1446 # Query TCG compiler statistics
1448 # Features:
1449 # @unstable: This command is meant for debugging.
1451 # Returns: TCG compiler statistics
1453 # Since: 6.2
1455 { 'command': 'x-query-jit',
1456   'returns': 'HumanReadableText',
1457   'if': 'CONFIG_TCG',
1458   'features': [ 'unstable' ] }
1461 # @x-query-numa:
1463 # Query NUMA topology information
1465 # Features:
1466 # @unstable: This command is meant for debugging.
1468 # Returns: topology information
1470 # Since: 6.2
1472 { 'command': 'x-query-numa',
1473   'returns': 'HumanReadableText',
1474   'features': [ 'unstable' ] }
1477 # @x-query-opcount:
1479 # Query TCG opcode counters
1481 # Features:
1482 # @unstable: This command is meant for debugging.
1484 # Returns: TCG opcode counters
1486 # Since: 6.2
1488 { 'command': 'x-query-opcount',
1489   'returns': 'HumanReadableText',
1490   'if': 'CONFIG_TCG',
1491   'features': [ 'unstable' ] }
1494 # @x-query-profile:
1496 # Query TCG profiling information
1498 # Features:
1499 # @unstable: This command is meant for debugging.
1501 # Returns: profile information
1503 # Since: 6.2
1505 { 'command': 'x-query-profile',
1506   'returns': 'HumanReadableText',
1507   'if': 'CONFIG_TCG',
1508   'features': [ 'unstable' ] }
1511 # @x-query-ramblock:
1513 # Query system ramblock information
1515 # Features:
1516 # @unstable: This command is meant for debugging.
1518 # Returns: system ramblock information
1520 # Since: 6.2
1522 { 'command': 'x-query-ramblock',
1523   'returns': 'HumanReadableText',
1524   'features': [ 'unstable' ] }
1527 # @x-query-rdma:
1529 # Query RDMA state
1531 # Features:
1532 # @unstable: This command is meant for debugging.
1534 # Returns: RDMA state
1536 # Since: 6.2
1538 { 'command': 'x-query-rdma',
1539   'returns': 'HumanReadableText',
1540   'features': [ 'unstable' ] }
1543 # @x-query-roms:
1545 # Query information on the registered ROMS
1547 # Features:
1548 # @unstable: This command is meant for debugging.
1550 # Returns: registered ROMs
1552 # Since: 6.2
1554 { 'command': 'x-query-roms',
1555   'returns': 'HumanReadableText',
1556   'features': [ 'unstable' ] }
1559 # @x-query-usb:
1561 # Query information on the USB devices
1563 # Features:
1564 # @unstable: This command is meant for debugging.
1566 # Returns: USB device information
1568 # Since: 6.2
1570 { 'command': 'x-query-usb',
1571   'returns': 'HumanReadableText',
1572   'features': [ 'unstable' ] }
1575 # @SmbiosEntryPointType:
1577 # @32: SMBIOS version 2.1 (32-bit) Entry Point
1579 # @64: SMBIOS version 3.0 (64-bit) Entry Point
1581 # Since: 7.0
1583 { 'enum': 'SmbiosEntryPointType',
1584   'data': [ '32', '64' ] }