configure: Bump the minimum required Python version to 3.6
[qemu/ar7.git] / qapi / machine.json
blob756dacb06fd244cb1ff1b9c830a4db2192bbe4d1
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 ##
12 # @SysEmuTarget:
14 # The comprehensive enumeration of QEMU system emulation ("softmmu")
15 # targets. Run "./configure --help" in the project root directory, and
16 # look for the \*-softmmu targets near the "--target-list" option. The
17 # individual target constants are not documented here, for the time
18 # being.
20 # @rx: since 5.0
21 # @avr: since 5.1
23 # Notes: The resulting QMP strings can be appended to the "qemu-system-"
24 #        prefix to produce the corresponding QEMU executable name. This
25 #        is true even for "qemu-system-x86_64".
27 # Since: 3.0
29 { 'enum' : 'SysEmuTarget',
30   'data' : [ 'aarch64', 'alpha', 'arm', 'avr', 'cris', 'hppa', 'i386', 'lm32',
31              'm68k', 'microblaze', 'microblazeel', 'mips', 'mips64',
32              'mips64el', 'mipsel', 'moxie', 'nios2', 'or1k', 'ppc',
33              'ppc64', 'riscv32', 'riscv64', 'rx', 's390x', 'sh4',
34              'sh4eb', 'sparc', 'sparc64', 'tricore', 'unicore32',
35              'x86_64', 'xtensa', 'xtensaeb' ] }
38 # @CpuInfoArch:
40 # An enumeration of cpu types that enable additional information during
41 # @query-cpus and @query-cpus-fast.
43 # @s390: since 2.12
45 # @riscv: since 2.12
47 # Since: 2.6
49 { 'enum': 'CpuInfoArch',
50   'data': ['x86', 'sparc', 'ppc', 'mips', 'tricore', 's390', 'riscv', 'other' ] }
53 # @CpuInfo:
55 # Information about a virtual CPU
57 # @CPU: the index of the virtual CPU
59 # @current: this only exists for backwards compatibility and should be ignored
61 # @halted: true if the virtual CPU is in the halt state.  Halt usually refers
62 #          to a processor specific low power mode.
64 # @qom_path: path to the CPU object in the QOM tree (since 2.4)
66 # @thread_id: ID of the underlying host thread
68 # @props: properties describing to which node/socket/core/thread
69 #         virtual CPU belongs to, provided if supported by board (since 2.10)
71 # @arch: architecture of the cpu, which determines which additional fields
72 #        will be listed (since 2.6)
74 # Since: 0.14.0
76 # Notes: @halted is a transient state that changes frequently.  By the time the
77 #        data is sent to the client, the guest may no longer be halted.
79 { 'union': 'CpuInfo',
80   'base': {'CPU': 'int', 'current': 'bool', 'halted': 'bool',
81            'qom_path': 'str', 'thread_id': 'int',
82            '*props': 'CpuInstanceProperties', 'arch': 'CpuInfoArch' },
83   'discriminator': 'arch',
84   'data': { 'x86': 'CpuInfoX86',
85             'sparc': 'CpuInfoSPARC',
86             'ppc': 'CpuInfoPPC',
87             'mips': 'CpuInfoMIPS',
88             'tricore': 'CpuInfoTricore',
89             's390': 'CpuInfoS390',
90             'riscv': 'CpuInfoRISCV' } }
93 # @CpuInfoX86:
95 # Additional information about a virtual i386 or x86_64 CPU
97 # @pc: the 64-bit instruction pointer
99 # Since: 2.6
101 { 'struct': 'CpuInfoX86', 'data': { 'pc': 'int' } }
104 # @CpuInfoSPARC:
106 # Additional information about a virtual SPARC CPU
108 # @pc: the PC component of the instruction pointer
110 # @npc: the NPC component of the instruction pointer
112 # Since: 2.6
114 { 'struct': 'CpuInfoSPARC', 'data': { 'pc': 'int', 'npc': 'int' } }
117 # @CpuInfoPPC:
119 # Additional information about a virtual PPC CPU
121 # @nip: the instruction pointer
123 # Since: 2.6
125 { 'struct': 'CpuInfoPPC', 'data': { 'nip': 'int' } }
128 # @CpuInfoMIPS:
130 # Additional information about a virtual MIPS CPU
132 # @PC: the instruction pointer
134 # Since: 2.6
136 { 'struct': 'CpuInfoMIPS', 'data': { 'PC': 'int' } }
139 # @CpuInfoTricore:
141 # Additional information about a virtual Tricore CPU
143 # @PC: the instruction pointer
145 # Since: 2.6
147 { 'struct': 'CpuInfoTricore', 'data': { 'PC': 'int' } }
150 # @CpuInfoRISCV:
152 # Additional information about a virtual RISCV CPU
154 # @pc: the instruction pointer
156 # Since 2.12
158 { 'struct': 'CpuInfoRISCV', 'data': { 'pc': 'int' } }
161 # @CpuS390State:
163 # An enumeration of cpu states that can be assumed by a virtual
164 # S390 CPU
166 # Since: 2.12
168 { 'enum': 'CpuS390State',
169   'prefix': 'S390_CPU_STATE',
170   'data': [ 'uninitialized', 'stopped', 'check-stop', 'operating', 'load' ] }
173 # @CpuInfoS390:
175 # Additional information about a virtual S390 CPU
177 # @cpu-state: the virtual CPU's state
179 # Since: 2.12
181 { 'struct': 'CpuInfoS390', 'data': { 'cpu-state': 'CpuS390State' } }
184 # @query-cpus:
186 # Returns a list of information about each virtual CPU.
188 # This command causes vCPU threads to exit to userspace, which causes
189 # a small interruption to guest CPU execution. This will have a negative
190 # impact on realtime guests and other latency sensitive guest workloads.
192 # Features:
193 # @deprecated: This command is deprecated, because it interferes with
194 #              the guest.  Use 'query-cpus-fast' instead to avoid the vCPU
195 #              interruption.
197 # Returns: a list of @CpuInfo for each virtual CPU
199 # Since: 0.14.0
201 # Example:
203 # -> { "execute": "query-cpus" }
204 # <- { "return": [
205 #          {
206 #             "CPU":0,
207 #             "current":true,
208 #             "halted":false,
209 #             "qom_path":"/machine/unattached/device[0]",
210 #             "arch":"x86",
211 #             "pc":3227107138,
212 #             "thread_id":3134
213 #          },
214 #          {
215 #             "CPU":1,
216 #             "current":false,
217 #             "halted":true,
218 #             "qom_path":"/machine/unattached/device[2]",
219 #             "arch":"x86",
220 #             "pc":7108165,
221 #             "thread_id":3135
222 #          }
223 #       ]
224 #    }
227 { 'command': 'query-cpus', 'returns': ['CpuInfo'],
228   'features': [ 'deprecated' ] }
231 # @CpuInfoFast:
233 # Information about a virtual CPU
235 # @cpu-index: index of the virtual CPU
237 # @qom-path: path to the CPU object in the QOM tree
239 # @thread-id: ID of the underlying host thread
241 # @props: properties describing to which node/socket/core/thread
242 #         virtual CPU belongs to, provided if supported by board
244 # @arch: base architecture of the cpu
246 # @target: the QEMU system emulation target, which determines which
247 #          additional fields will be listed (since 3.0)
249 # Features:
250 # @deprecated: Member @arch is deprecated.  Use @target instead.
252 # Since: 2.12
255 { 'union'         : 'CpuInfoFast',
256   'base'          : { 'cpu-index'    : 'int',
257                       'qom-path'     : 'str',
258                       'thread-id'    : 'int',
259                       '*props'       : 'CpuInstanceProperties',
260                       'arch'         : { 'type': 'CpuInfoArch',
261                                          'features': [ 'deprecated' ] },
262                       'target'       : 'SysEmuTarget' },
263   'discriminator' : 'target',
264   'data'          : { 's390x'        : 'CpuInfoS390' } }
267 # @query-cpus-fast:
269 # Returns information about all virtual CPUs. This command does not
270 # incur a performance penalty and should be used in production
271 # instead of query-cpus.
273 # Returns: list of @CpuInfoFast
275 # Since: 2.12
277 # Example:
279 # -> { "execute": "query-cpus-fast" }
280 # <- { "return": [
281 #         {
282 #             "thread-id": 25627,
283 #             "props": {
284 #                 "core-id": 0,
285 #                 "thread-id": 0,
286 #                 "socket-id": 0
287 #             },
288 #             "qom-path": "/machine/unattached/device[0]",
289 #             "arch":"x86",
290 #             "target":"x86_64",
291 #             "cpu-index": 0
292 #         },
293 #         {
294 #             "thread-id": 25628,
295 #             "props": {
296 #                 "core-id": 0,
297 #                 "thread-id": 0,
298 #                 "socket-id": 1
299 #             },
300 #             "qom-path": "/machine/unattached/device[2]",
301 #             "arch":"x86",
302 #             "target":"x86_64",
303 #             "cpu-index": 1
304 #         }
305 #     ]
306 # }
308 { 'command': 'query-cpus-fast', 'returns': [ 'CpuInfoFast' ] }
311 # @MachineInfo:
313 # Information describing a machine.
315 # @name: the name of the machine
317 # @alias: an alias for the machine name
319 # @is-default: whether the machine is default
321 # @cpu-max: maximum number of CPUs supported by the machine type
322 #           (since 1.5.0)
324 # @hotpluggable-cpus: cpu hotplug via -device is supported (since 2.7.0)
326 # @numa-mem-supported: true if '-numa node,mem' option is supported by
327 #                      the machine type and false otherwise (since 4.1)
329 # @deprecated: if true, the machine type is deprecated and may be removed
330 #              in future versions of QEMU according to the QEMU deprecation
331 #              policy (since 4.1.0)
333 # @default-cpu-type: default CPU model typename if none is requested via
334 #                    the -cpu argument. (since 4.2)
336 # @default-ram-id: the default ID of initial RAM memory backend (since 5.2)
338 # Since: 1.2.0
340 { 'struct': 'MachineInfo',
341   'data': { 'name': 'str', '*alias': 'str',
342             '*is-default': 'bool', 'cpu-max': 'int',
343             'hotpluggable-cpus': 'bool',  'numa-mem-supported': 'bool',
344             'deprecated': 'bool', '*default-cpu-type': 'str',
345             '*default-ram-id': 'str' } }
348 # @query-machines:
350 # Return a list of supported machines
352 # Returns: a list of MachineInfo
354 # Since: 1.2.0
356 { 'command': 'query-machines', 'returns': ['MachineInfo'] }
359 # @CurrentMachineParams:
361 # Information describing the running machine parameters.
363 # @wakeup-suspend-support: true if the machine supports wake up from
364 #                          suspend
366 # Since: 4.0
368 { 'struct': 'CurrentMachineParams',
369   'data': { 'wakeup-suspend-support': 'bool'} }
372 # @query-current-machine:
374 # Return information on the current virtual machine.
376 # Returns: CurrentMachineParams
378 # Since: 4.0
380 { 'command': 'query-current-machine', 'returns': 'CurrentMachineParams' }
383 # @TargetInfo:
385 # Information describing the QEMU target.
387 # @arch: the target architecture
389 # Since: 1.2.0
391 { 'struct': 'TargetInfo',
392   'data': { 'arch': 'SysEmuTarget' } }
395 # @query-target:
397 # Return information about the target for this QEMU
399 # Returns: TargetInfo
401 # Since: 1.2.0
403 { 'command': 'query-target', 'returns': 'TargetInfo' }
406 # @UuidInfo:
408 # Guest UUID information (Universally Unique Identifier).
410 # @UUID: the UUID of the guest
412 # Since: 0.14.0
414 # Notes: If no UUID was specified for the guest, a null UUID is returned.
416 { 'struct': 'UuidInfo', 'data': {'UUID': 'str'} }
419 # @query-uuid:
421 # Query the guest UUID information.
423 # Returns: The @UuidInfo for the guest
425 # Since: 0.14.0
427 # Example:
429 # -> { "execute": "query-uuid" }
430 # <- { "return": { "UUID": "550e8400-e29b-41d4-a716-446655440000" } }
433 { 'command': 'query-uuid', 'returns': 'UuidInfo', 'allow-preconfig': true }
436 # @GuidInfo:
438 # GUID information.
440 # @guid: the globally unique identifier
442 # Since: 2.9
444 { 'struct': 'GuidInfo', 'data': {'guid': 'str'} }
447 # @query-vm-generation-id:
449 # Show Virtual Machine Generation ID
451 # Since: 2.9
453 { 'command': 'query-vm-generation-id', 'returns': 'GuidInfo' }
456 # @LostTickPolicy:
458 # Policy for handling lost ticks in timer devices.  Ticks end up getting
459 # lost when, for example, the guest is paused.
461 # @discard: throw away the missed ticks and continue with future injection
462 #           normally.  The guest OS will see the timer jump ahead by a
463 #           potentially quite significant amount all at once, as if the
464 #           intervening chunk of time had simply not existed; needless to
465 #           say, such a sudden jump can easily confuse a guest OS which is
466 #           not specifically prepared to deal with it.  Assuming the guest
467 #           OS can deal correctly with the time jump, the time in the guest
468 #           and in the host should now match.
470 # @delay: continue to deliver ticks at the normal rate.  The guest OS will
471 #         not notice anything is amiss, as from its point of view time will
472 #         have continued to flow normally.  The time in the guest should now
473 #         be behind the time in the host by exactly the amount of time during
474 #         which ticks have been missed.
476 # @slew: deliver ticks at a higher rate to catch up with the missed ticks.
477 #        The guest OS will not notice anything is amiss, as from its point
478 #        of view time will have continued to flow normally.  Once the timer
479 #        has managed to catch up with all the missing ticks, the time in
480 #        the guest and in the host should match.
482 # Since: 2.0
484 { 'enum': 'LostTickPolicy',
485   'data': ['discard', 'delay', 'slew' ] }
488 # @NumaOptionsType:
490 # @node: NUMA nodes configuration
492 # @dist: NUMA distance configuration (since 2.10)
494 # @cpu: property based CPU(s) to node mapping (Since: 2.10)
496 # @hmat-lb: memory latency and bandwidth information (Since: 5.0)
498 # @hmat-cache: memory side cache information (Since: 5.0)
500 # Since: 2.1
502 { 'enum': 'NumaOptionsType',
503   'data': [ 'node', 'dist', 'cpu', 'hmat-lb', 'hmat-cache' ] }
506 # @NumaOptions:
508 # A discriminated record of NUMA options. (for OptsVisitor)
510 # Since: 2.1
512 { 'union': 'NumaOptions',
513   'base': { 'type': 'NumaOptionsType' },
514   'discriminator': 'type',
515   'data': {
516     'node': 'NumaNodeOptions',
517     'dist': 'NumaDistOptions',
518     'cpu': 'NumaCpuOptions',
519     'hmat-lb': 'NumaHmatLBOptions',
520     'hmat-cache': 'NumaHmatCacheOptions' }}
523 # @NumaNodeOptions:
525 # Create a guest NUMA node. (for OptsVisitor)
527 # @nodeid: NUMA node ID (increase by 1 from 0 if omitted)
529 # @cpus: VCPUs belonging to this node (assign VCPUS round-robin
530 #         if omitted)
532 # @mem: memory size of this node; mutually exclusive with @memdev.
533 #       Equally divide total memory among nodes if both @mem and @memdev are
534 #       omitted.
536 # @memdev: memory backend object.  If specified for one node,
537 #          it must be specified for all nodes.
539 # @initiator: defined in ACPI 6.3 Chapter 5.2.27.3 Table 5-145,
540 #             points to the nodeid which has the memory controller
541 #             responsible for this NUMA node. This field provides
542 #             additional information as to the initiator node that
543 #             is closest (as in directly attached) to this node, and
544 #             therefore has the best performance (since 5.0)
546 # Since: 2.1
548 { 'struct': 'NumaNodeOptions',
549   'data': {
550    '*nodeid': 'uint16',
551    '*cpus':   ['uint16'],
552    '*mem':    'size',
553    '*memdev': 'str',
554    '*initiator': 'uint16' }}
557 # @NumaDistOptions:
559 # Set the distance between 2 NUMA nodes.
561 # @src: source NUMA node.
563 # @dst: destination NUMA node.
565 # @val: NUMA distance from source node to destination node.
566 #       When a node is unreachable from another node, set the distance
567 #       between them to 255.
569 # Since: 2.10
571 { 'struct': 'NumaDistOptions',
572   'data': {
573    'src': 'uint16',
574    'dst': 'uint16',
575    'val': 'uint8' }}
578 # @X86CPURegister32:
580 # A X86 32-bit register
582 # Since: 1.5
584 { 'enum': 'X86CPURegister32',
585   'data': [ 'EAX', 'EBX', 'ECX', 'EDX', 'ESP', 'EBP', 'ESI', 'EDI' ] }
588 # @X86CPUFeatureWordInfo:
590 # Information about a X86 CPU feature word
592 # @cpuid-input-eax: Input EAX value for CPUID instruction for that feature word
594 # @cpuid-input-ecx: Input ECX value for CPUID instruction for that
595 #                   feature word
597 # @cpuid-register: Output register containing the feature bits
599 # @features: value of output register, containing the feature bits
601 # Since: 1.5
603 { 'struct': 'X86CPUFeatureWordInfo',
604   'data': { 'cpuid-input-eax': 'int',
605             '*cpuid-input-ecx': 'int',
606             'cpuid-register': 'X86CPURegister32',
607             'features': 'int' } }
610 # @DummyForceArrays:
612 # Not used by QMP; hack to let us use X86CPUFeatureWordInfoList internally
614 # Since: 2.5
616 { 'struct': 'DummyForceArrays',
617   'data': { 'unused': ['X86CPUFeatureWordInfo'] } }
620 # @NumaCpuOptions:
622 # Option "-numa cpu" overrides default cpu to node mapping.
623 # It accepts the same set of cpu properties as returned by
624 # query-hotpluggable-cpus[].props, where node-id could be used to
625 # override default node mapping.
627 # Since: 2.10
629 { 'struct': 'NumaCpuOptions',
630    'base': 'CpuInstanceProperties',
631    'data' : {} }
634 # @HmatLBMemoryHierarchy:
636 # The memory hierarchy in the System Locality Latency and Bandwidth
637 # Information Structure of HMAT (Heterogeneous Memory Attribute Table)
639 # For more information about @HmatLBMemoryHierarchy, see chapter
640 # 5.2.27.4: Table 5-146: Field "Flags" of ACPI 6.3 spec.
642 # @memory: the structure represents the memory performance
644 # @first-level: first level of memory side cache
646 # @second-level: second level of memory side cache
648 # @third-level: third level of memory side cache
650 # Since: 5.0
652 { 'enum': 'HmatLBMemoryHierarchy',
653   'data': [ 'memory', 'first-level', 'second-level', 'third-level' ] }
656 # @HmatLBDataType:
658 # Data type in the System Locality Latency and Bandwidth
659 # Information Structure of HMAT (Heterogeneous Memory Attribute Table)
661 # For more information about @HmatLBDataType, see chapter
662 # 5.2.27.4: Table 5-146:  Field "Data Type" of ACPI 6.3 spec.
664 # @access-latency: access latency (nanoseconds)
666 # @read-latency: read latency (nanoseconds)
668 # @write-latency: write latency (nanoseconds)
670 # @access-bandwidth: access bandwidth (Bytes per second)
672 # @read-bandwidth: read bandwidth (Bytes per second)
674 # @write-bandwidth: write bandwidth (Bytes per second)
676 # Since: 5.0
678 { 'enum': 'HmatLBDataType',
679   'data': [ 'access-latency', 'read-latency', 'write-latency',
680             'access-bandwidth', 'read-bandwidth', 'write-bandwidth' ] }
683 # @NumaHmatLBOptions:
685 # Set the system locality latency and bandwidth information
686 # between Initiator and Target proximity Domains.
688 # For more information about @NumaHmatLBOptions, see chapter
689 # 5.2.27.4: Table 5-146 of ACPI 6.3 spec.
691 # @initiator: the Initiator Proximity Domain.
693 # @target: the Target Proximity Domain.
695 # @hierarchy: the Memory Hierarchy. Indicates the performance
696 #             of memory or side cache.
698 # @data-type: presents the type of data, access/read/write
699 #             latency or hit latency.
701 # @latency: the value of latency from @initiator to @target
702 #           proximity domain, the latency unit is "ns(nanosecond)".
704 # @bandwidth: the value of bandwidth between @initiator and @target
705 #             proximity domain, the bandwidth unit is
706 #             "Bytes per second".
708 # Since: 5.0
710 { 'struct': 'NumaHmatLBOptions',
711     'data': {
712     'initiator': 'uint16',
713     'target': 'uint16',
714     'hierarchy': 'HmatLBMemoryHierarchy',
715     'data-type': 'HmatLBDataType',
716     '*latency': 'uint64',
717     '*bandwidth': 'size' }}
720 # @HmatCacheAssociativity:
722 # Cache associativity in the Memory Side Cache Information Structure
723 # of HMAT
725 # For more information of @HmatCacheAssociativity, see chapter
726 # 5.2.27.5: Table 5-147 of ACPI 6.3 spec.
728 # @none: None (no memory side cache in this proximity domain,
729 #              or cache associativity unknown)
731 # @direct: Direct Mapped
733 # @complex: Complex Cache Indexing (implementation specific)
735 # Since: 5.0
737 { 'enum': 'HmatCacheAssociativity',
738   'data': [ 'none', 'direct', 'complex' ] }
741 # @HmatCacheWritePolicy:
743 # Cache write policy in the Memory Side Cache Information Structure
744 # of HMAT
746 # For more information of @HmatCacheWritePolicy, see chapter
747 # 5.2.27.5: Table 5-147: Field "Cache Attributes" of ACPI 6.3 spec.
749 # @none: None (no memory side cache in this proximity domain,
750 #        or cache write policy unknown)
752 # @write-back: Write Back (WB)
754 # @write-through: Write Through (WT)
756 # Since: 5.0
758 { 'enum': 'HmatCacheWritePolicy',
759   'data': [ 'none', 'write-back', 'write-through' ] }
762 # @NumaHmatCacheOptions:
764 # Set the memory side cache information for a given memory domain.
766 # For more information of @NumaHmatCacheOptions, see chapter
767 # 5.2.27.5: Table 5-147: Field "Cache Attributes" of ACPI 6.3 spec.
769 # @node-id: the memory proximity domain to which the memory belongs.
771 # @size: the size of memory side cache in bytes.
773 # @level: the cache level described in this structure.
775 # @associativity: the cache associativity,
776 #                 none/direct-mapped/complex(complex cache indexing).
778 # @policy: the write policy, none/write-back/write-through.
780 # @line: the cache Line size in bytes.
782 # Since: 5.0
784 { 'struct': 'NumaHmatCacheOptions',
785   'data': {
786    'node-id': 'uint32',
787    'size': 'size',
788    'level': 'uint8',
789    'associativity': 'HmatCacheAssociativity',
790    'policy': 'HmatCacheWritePolicy',
791    'line': 'uint16' }}
794 # @HostMemPolicy:
796 # Host memory policy types
798 # @default: restore default policy, remove any nondefault policy
800 # @preferred: set the preferred host nodes for allocation
802 # @bind: a strict policy that restricts memory allocation to the
803 #        host nodes specified
805 # @interleave: memory allocations are interleaved across the set
806 #              of host nodes specified
808 # Since: 2.1
810 { 'enum': 'HostMemPolicy',
811   'data': [ 'default', 'preferred', 'bind', 'interleave' ] }
814 # @Memdev:
816 # Information about memory backend
818 # @id: backend's ID if backend has 'id' property (since 2.9)
820 # @size: memory backend size
822 # @merge: enables or disables memory merge support
824 # @dump: includes memory backend's memory in a core dump or not
826 # @prealloc: enables or disables memory preallocation
828 # @host-nodes: host nodes for its memory policy
830 # @policy: memory policy of memory backend
832 # Since: 2.1
834 { 'struct': 'Memdev',
835   'data': {
836     '*id':        'str',
837     'size':       'size',
838     'merge':      'bool',
839     'dump':       'bool',
840     'prealloc':   '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 #          "host-nodes": [0, 1],
864 #          "policy": "bind"
865 #        },
866 #        {
867 #          "size": 536870912,
868 #          "merge": false,
869 #          "dump": true,
870 #          "prealloc": true,
871 #          "host-nodes": [2, 3],
872 #          "policy": "preferred"
873 #        }
874 #      ]
875 #    }
878 { 'command': 'query-memdev', 'returns': ['Memdev'], 'allow-preconfig': true }
881 # @CpuInstanceProperties:
883 # List of properties to be used for hotplugging a CPU instance,
884 # it should be passed by management with device_add command when
885 # a CPU is being hotplugged.
887 # @node-id: NUMA node ID the CPU belongs to
888 # @socket-id: socket number within node/board the CPU belongs to
889 # @die-id: die number within node/board the CPU belongs to (Since 4.1)
890 # @core-id: core number within die the CPU belongs to
891 # @thread-id: thread number within core the CPU belongs to
893 # Note: currently there are 5 properties that could be present
894 #       but management should be prepared to pass through other
895 #       properties with device_add command to allow for future
896 #       interface extension. This also requires the filed names to be kept in
897 #       sync with the properties passed to -device/device_add.
899 # Since: 2.7
901 { 'struct': 'CpuInstanceProperties',
902   'data': { '*node-id': 'int',
903             '*socket-id': 'int',
904             '*die-id': 'int',
905             '*core-id': 'int',
906             '*thread-id': 'int'
907   }
911 # @HotpluggableCPU:
913 # @type: CPU object type for usage with device_add command
914 # @props: list of properties to be used for hotplugging CPU
915 # @vcpus-count: number of logical VCPU threads @HotpluggableCPU provides
916 # @qom-path: link to existing CPU object if CPU is present or
917 #            omitted if CPU is not present.
919 # Since: 2.7
921 { 'struct': 'HotpluggableCPU',
922   'data': { 'type': 'str',
923             'vcpus-count': 'int',
924             'props': 'CpuInstanceProperties',
925             '*qom-path': 'str'
926           }
930 # @query-hotpluggable-cpus:
932 # TODO: Better documentation; currently there is none.
934 # Returns: a list of HotpluggableCPU objects.
936 # Since: 2.7
938 # Example:
940 # For pseries machine type started with -smp 2,cores=2,maxcpus=4 -cpu POWER8:
942 # -> { "execute": "query-hotpluggable-cpus" }
943 # <- {"return": [
944 #      { "props": { "core": 8 }, "type": "POWER8-spapr-cpu-core",
945 #        "vcpus-count": 1 },
946 #      { "props": { "core": 0 }, "type": "POWER8-spapr-cpu-core",
947 #        "vcpus-count": 1, "qom-path": "/machine/unattached/device[0]"}
948 #    ]}'
950 # For pc machine type started with -smp 1,maxcpus=2:
952 # -> { "execute": "query-hotpluggable-cpus" }
953 # <- {"return": [
954 #      {
955 #         "type": "qemu64-x86_64-cpu", "vcpus-count": 1,
956 #         "props": {"core-id": 0, "socket-id": 1, "thread-id": 0}
957 #      },
958 #      {
959 #         "qom-path": "/machine/unattached/device[0]",
960 #         "type": "qemu64-x86_64-cpu", "vcpus-count": 1,
961 #         "props": {"core-id": 0, "socket-id": 0, "thread-id": 0}
962 #      }
963 #    ]}
965 # For s390x-virtio-ccw machine type started with -smp 1,maxcpus=2 -cpu qemu
966 # (Since: 2.11):
968 # -> { "execute": "query-hotpluggable-cpus" }
969 # <- {"return": [
970 #      {
971 #         "type": "qemu-s390x-cpu", "vcpus-count": 1,
972 #         "props": { "core-id": 1 }
973 #      },
974 #      {
975 #         "qom-path": "/machine/unattached/device[0]",
976 #         "type": "qemu-s390x-cpu", "vcpus-count": 1,
977 #         "props": { "core-id": 0 }
978 #      }
979 #    ]}
982 { 'command': 'query-hotpluggable-cpus', 'returns': ['HotpluggableCPU'],
983              'allow-preconfig': true }
986 # @set-numa-node:
988 # Runtime equivalent of '-numa' CLI option, available at
989 # preconfigure stage to configure numa mapping before initializing
990 # machine.
992 # Since 3.0
994 { 'command': 'set-numa-node', 'boxed': true,
995   'data': 'NumaOptions',
996   'allow-preconfig': true
1000 # @balloon:
1002 # Request the balloon driver to change its balloon size.
1004 # @value: the target logical size of the VM in bytes.
1005 #         We can deduce the size of the balloon using this formula:
1007 #            logical_vm_size = vm_ram_size - balloon_size
1009 #         From it we have: balloon_size = vm_ram_size - @value
1011 # Returns: - Nothing on success
1012 #          - If the balloon driver is enabled but not functional because the KVM
1013 #            kernel module cannot support it, KvmMissingCap
1014 #          - If no balloon device is present, DeviceNotActive
1016 # Notes: This command just issues a request to the guest.  When it returns,
1017 #        the balloon size may not have changed.  A guest can change the balloon
1018 #        size independent of this command.
1020 # Since: 0.14.0
1022 # Example:
1024 # -> { "execute": "balloon", "arguments": { "value": 536870912 } }
1025 # <- { "return": {} }
1027 # With a 2.5GiB guest this command inflated the ballon to 3GiB.
1030 { 'command': 'balloon', 'data': {'value': 'int'} }
1033 # @BalloonInfo:
1035 # Information about the guest balloon device.
1037 # @actual: the logical size of the VM in bytes
1038 #          Formula used: logical_vm_size = vm_ram_size - balloon_size
1040 # Since: 0.14.0
1043 { 'struct': 'BalloonInfo', 'data': {'actual': 'int' } }
1046 # @query-balloon:
1048 # Return information about the balloon device.
1050 # Returns: - @BalloonInfo on success
1051 #          - If the balloon driver is enabled but not functional because the KVM
1052 #            kernel module cannot support it, KvmMissingCap
1053 #          - If no balloon device is present, DeviceNotActive
1055 # Since: 0.14.0
1057 # Example:
1059 # -> { "execute": "query-balloon" }
1060 # <- { "return": {
1061 #          "actual": 1073741824,
1062 #       }
1063 #    }
1066 { 'command': 'query-balloon', 'returns': 'BalloonInfo' }
1069 # @BALLOON_CHANGE:
1071 # Emitted when the guest changes the actual BALLOON level. This value is
1072 # equivalent to the @actual field return by the 'query-balloon' command
1074 # @actual: the logical size of the VM in bytes
1075 #          Formula used: logical_vm_size = vm_ram_size - balloon_size
1077 # Note: this event is rate-limited.
1079 # Since: 1.2
1081 # Example:
1083 # <- { "event": "BALLOON_CHANGE",
1084 #      "data": { "actual": 944766976 },
1085 #      "timestamp": { "seconds": 1267020223, "microseconds": 435656 } }
1088 { 'event': 'BALLOON_CHANGE',
1089   'data': { 'actual': 'int' } }
1092 # @MemoryInfo:
1094 # Actual memory information in bytes.
1096 # @base-memory: size of "base" memory specified with command line
1097 #               option -m.
1099 # @plugged-memory: size of memory that can be hot-unplugged. This field
1100 #                  is omitted if target doesn't support memory hotplug
1101 #                  (i.e. CONFIG_MEM_DEVICE not defined at build time).
1103 # Since: 2.11.0
1105 { 'struct': 'MemoryInfo',
1106   'data'  : { 'base-memory': 'size', '*plugged-memory': 'size' } }
1109 # @query-memory-size-summary:
1111 # Return the amount of initially allocated and present hotpluggable (if
1112 # enabled) memory in bytes.
1114 # Example:
1116 # -> { "execute": "query-memory-size-summary" }
1117 # <- { "return": { "base-memory": 4294967296, "plugged-memory": 0 } }
1119 # Since: 2.11.0
1121 { 'command': 'query-memory-size-summary', 'returns': 'MemoryInfo' }
1124 # @PCDIMMDeviceInfo:
1126 # PCDIMMDevice state information
1128 # @id: device's ID
1130 # @addr: physical address, where device is mapped
1132 # @size: size of memory that the device provides
1134 # @slot: slot number at which device is plugged in
1136 # @node: NUMA node number where device is plugged in
1138 # @memdev: memory backend linked with device
1140 # @hotplugged: true if device was hotplugged
1142 # @hotpluggable: true if device if could be added/removed while machine is running
1144 # Since: 2.1
1146 { 'struct': 'PCDIMMDeviceInfo',
1147   'data': { '*id': 'str',
1148             'addr': 'int',
1149             'size': 'int',
1150             'slot': 'int',
1151             'node': 'int',
1152             'memdev': 'str',
1153             'hotplugged': 'bool',
1154             'hotpluggable': 'bool'
1155           }
1159 # @VirtioPMEMDeviceInfo:
1161 # VirtioPMEM state information
1163 # @id: device's ID
1165 # @memaddr: physical address in memory, where device is mapped
1167 # @size: size of memory that the device provides
1169 # @memdev: memory backend linked with device
1171 # Since: 4.1
1173 { 'struct': 'VirtioPMEMDeviceInfo',
1174   'data': { '*id': 'str',
1175             'memaddr': 'size',
1176             'size': 'size',
1177             'memdev': 'str'
1178           }
1182 # @VirtioMEMDeviceInfo:
1184 # VirtioMEMDevice state information
1186 # @id: device's ID
1188 # @memaddr: physical address in memory, where device is mapped
1190 # @requested-size: the user requested size of the device
1192 # @size: the (current) size of memory that the device provides
1194 # @max-size: the maximum size of memory that the device can provide
1196 # @block-size: the block size of memory that the device provides
1198 # @node: NUMA node number where device is assigned to
1200 # @memdev: memory backend linked with the region
1202 # Since: 5.1
1204 { 'struct': 'VirtioMEMDeviceInfo',
1205   'data': { '*id': 'str',
1206             'memaddr': 'size',
1207             'requested-size': 'size',
1208             'size': 'size',
1209             'max-size': 'size',
1210             'block-size': 'size',
1211             'node': 'int',
1212             'memdev': 'str'
1213           }
1217 # @MemoryDeviceInfo:
1219 # Union containing information about a memory device
1221 # nvdimm is included since 2.12. virtio-pmem is included since 4.1.
1222 # virtio-mem is included since 5.1.
1224 # Since: 2.1
1226 { 'union': 'MemoryDeviceInfo',
1227   'data': { 'dimm': 'PCDIMMDeviceInfo',
1228             'nvdimm': 'PCDIMMDeviceInfo',
1229             'virtio-pmem': 'VirtioPMEMDeviceInfo',
1230             'virtio-mem': 'VirtioMEMDeviceInfo'
1231           }
1235 # @query-memory-devices:
1237 # Lists available memory devices and their state
1239 # Since: 2.1
1241 # Example:
1243 # -> { "execute": "query-memory-devices" }
1244 # <- { "return": [ { "data":
1245 #                       { "addr": 5368709120,
1246 #                         "hotpluggable": true,
1247 #                         "hotplugged": true,
1248 #                         "id": "d1",
1249 #                         "memdev": "/objects/memX",
1250 #                         "node": 0,
1251 #                         "size": 1073741824,
1252 #                         "slot": 0},
1253 #                    "type": "dimm"
1254 #                  } ] }
1257 { 'command': 'query-memory-devices', 'returns': ['MemoryDeviceInfo'] }
1260 # @MEMORY_DEVICE_SIZE_CHANGE:
1262 # Emitted when the size of a memory device changes. Only emitted for memory
1263 # devices that can actually change the size (e.g., virtio-mem due to guest
1264 # action).
1266 # @id: device's ID
1267 # @size: the new size of memory that the device provides
1269 # Note: this event is rate-limited.
1271 # Since: 5.1
1273 # Example:
1275 # <- { "event": "MEMORY_DEVICE_SIZE_CHANGE",
1276 #      "data": { "id": "vm0", "size": 1073741824},
1277 #      "timestamp": { "seconds": 1588168529, "microseconds": 201316 } }
1280 { 'event': 'MEMORY_DEVICE_SIZE_CHANGE',
1281   'data': { '*id': 'str', 'size': 'size' } }
1285 # @MEM_UNPLUG_ERROR:
1287 # Emitted when memory hot unplug error occurs.
1289 # @device: device name
1291 # @msg: Informative message
1293 # Since: 2.4
1295 # Example:
1297 # <- { "event": "MEM_UNPLUG_ERROR"
1298 #      "data": { "device": "dimm1",
1299 #                "msg": "acpi: device unplug for unsupported device"
1300 #      },
1301 #      "timestamp": { "seconds": 1265044230, "microseconds": 450486 } }
1304 { 'event': 'MEM_UNPLUG_ERROR',
1305   'data': { 'device': 'str', 'msg': 'str' } }