qapi: Restrict '(p)memsave' command to machine code
[qemu/ar7.git] / qapi / machine.json
blob5a3bbcae01b3c7627badacf84bb5f1530e017326
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 # @system_reset:
458 # Performs a hard reset of a guest.
460 # Since: 0.14.0
462 # Example:
464 # -> { "execute": "system_reset" }
465 # <- { "return": {} }
468 { 'command': 'system_reset' }
471 # @system_powerdown:
473 # Requests that a guest perform a powerdown operation.
475 # Since: 0.14.0
477 # Notes: A guest may or may not respond to this command.  This command
478 #        returning does not indicate that a guest has accepted the request or
479 #        that it has shut down.  Many guests will respond to this command by
480 #        prompting the user in some way.
481 # Example:
483 # -> { "execute": "system_powerdown" }
484 # <- { "return": {} }
487 { 'command': 'system_powerdown' }
490 # @system_wakeup:
492 # Wake up guest from suspend. If the guest has wake-up from suspend
493 # support enabled (wakeup-suspend-support flag from
494 # query-current-machine), wake-up guest from suspend if the guest is
495 # in SUSPENDED state. Return an error otherwise.
497 # Since:  1.1
499 # Returns:  nothing.
501 # Note: prior to 4.0, this command does nothing in case the guest
502 #       isn't suspended.
504 # Example:
506 # -> { "execute": "system_wakeup" }
507 # <- { "return": {} }
510 { 'command': 'system_wakeup' }
513 # @LostTickPolicy:
515 # Policy for handling lost ticks in timer devices.  Ticks end up getting
516 # lost when, for example, the guest is paused.
518 # @discard: throw away the missed ticks and continue with future injection
519 #           normally.  The guest OS will see the timer jump ahead by a
520 #           potentially quite significant amount all at once, as if the
521 #           intervening chunk of time had simply not existed; needless to
522 #           say, such a sudden jump can easily confuse a guest OS which is
523 #           not specifically prepared to deal with it.  Assuming the guest
524 #           OS can deal correctly with the time jump, the time in the guest
525 #           and in the host should now match.
527 # @delay: continue to deliver ticks at the normal rate.  The guest OS will
528 #         not notice anything is amiss, as from its point of view time will
529 #         have continued to flow normally.  The time in the guest should now
530 #         be behind the time in the host by exactly the amount of time during
531 #         which ticks have been missed.
533 # @slew: deliver ticks at a higher rate to catch up with the missed ticks.
534 #        The guest OS will not notice anything is amiss, as from its point
535 #        of view time will have continued to flow normally.  Once the timer
536 #        has managed to catch up with all the missing ticks, the time in
537 #        the guest and in the host should match.
539 # Since: 2.0
541 { 'enum': 'LostTickPolicy',
542   'data': ['discard', 'delay', 'slew' ] }
545 # @inject-nmi:
547 # Injects a Non-Maskable Interrupt into the default CPU (x86/s390) or all CPUs (ppc64).
548 # The command fails when the guest doesn't support injecting.
550 # Returns:  If successful, nothing
552 # Since:  0.14.0
554 # Note: prior to 2.1, this command was only supported for x86 and s390 VMs
556 # Example:
558 # -> { "execute": "inject-nmi" }
559 # <- { "return": {} }
562 { 'command': 'inject-nmi' }
565 # @NumaOptionsType:
567 # @node: NUMA nodes configuration
569 # @dist: NUMA distance configuration (since 2.10)
571 # @cpu: property based CPU(s) to node mapping (Since: 2.10)
573 # @hmat-lb: memory latency and bandwidth information (Since: 5.0)
575 # @hmat-cache: memory side cache information (Since: 5.0)
577 # Since: 2.1
579 { 'enum': 'NumaOptionsType',
580   'data': [ 'node', 'dist', 'cpu', 'hmat-lb', 'hmat-cache' ] }
583 # @NumaOptions:
585 # A discriminated record of NUMA options. (for OptsVisitor)
587 # Since: 2.1
589 { 'union': 'NumaOptions',
590   'base': { 'type': 'NumaOptionsType' },
591   'discriminator': 'type',
592   'data': {
593     'node': 'NumaNodeOptions',
594     'dist': 'NumaDistOptions',
595     'cpu': 'NumaCpuOptions',
596     'hmat-lb': 'NumaHmatLBOptions',
597     'hmat-cache': 'NumaHmatCacheOptions' }}
600 # @NumaNodeOptions:
602 # Create a guest NUMA node. (for OptsVisitor)
604 # @nodeid: NUMA node ID (increase by 1 from 0 if omitted)
606 # @cpus: VCPUs belonging to this node (assign VCPUS round-robin
607 #         if omitted)
609 # @mem: memory size of this node; mutually exclusive with @memdev.
610 #       Equally divide total memory among nodes if both @mem and @memdev are
611 #       omitted.
613 # @memdev: memory backend object.  If specified for one node,
614 #          it must be specified for all nodes.
616 # @initiator: defined in ACPI 6.3 Chapter 5.2.27.3 Table 5-145,
617 #             points to the nodeid which has the memory controller
618 #             responsible for this NUMA node. This field provides
619 #             additional information as to the initiator node that
620 #             is closest (as in directly attached) to this node, and
621 #             therefore has the best performance (since 5.0)
623 # Since: 2.1
625 { 'struct': 'NumaNodeOptions',
626   'data': {
627    '*nodeid': 'uint16',
628    '*cpus':   ['uint16'],
629    '*mem':    'size',
630    '*memdev': 'str',
631    '*initiator': 'uint16' }}
634 # @NumaDistOptions:
636 # Set the distance between 2 NUMA nodes.
638 # @src: source NUMA node.
640 # @dst: destination NUMA node.
642 # @val: NUMA distance from source node to destination node.
643 #       When a node is unreachable from another node, set the distance
644 #       between them to 255.
646 # Since: 2.10
648 { 'struct': 'NumaDistOptions',
649   'data': {
650    'src': 'uint16',
651    'dst': 'uint16',
652    'val': 'uint8' }}
655 # @X86CPURegister32:
657 # A X86 32-bit register
659 # Since: 1.5
661 { 'enum': 'X86CPURegister32',
662   'data': [ 'EAX', 'EBX', 'ECX', 'EDX', 'ESP', 'EBP', 'ESI', 'EDI' ] }
665 # @X86CPUFeatureWordInfo:
667 # Information about a X86 CPU feature word
669 # @cpuid-input-eax: Input EAX value for CPUID instruction for that feature word
671 # @cpuid-input-ecx: Input ECX value for CPUID instruction for that
672 #                   feature word
674 # @cpuid-register: Output register containing the feature bits
676 # @features: value of output register, containing the feature bits
678 # Since: 1.5
680 { 'struct': 'X86CPUFeatureWordInfo',
681   'data': { 'cpuid-input-eax': 'int',
682             '*cpuid-input-ecx': 'int',
683             'cpuid-register': 'X86CPURegister32',
684             'features': 'int' } }
687 # @DummyForceArrays:
689 # Not used by QMP; hack to let us use X86CPUFeatureWordInfoList internally
691 # Since: 2.5
693 { 'struct': 'DummyForceArrays',
694   'data': { 'unused': ['X86CPUFeatureWordInfo'] } }
697 # @NumaCpuOptions:
699 # Option "-numa cpu" overrides default cpu to node mapping.
700 # It accepts the same set of cpu properties as returned by
701 # query-hotpluggable-cpus[].props, where node-id could be used to
702 # override default node mapping.
704 # Since: 2.10
706 { 'struct': 'NumaCpuOptions',
707    'base': 'CpuInstanceProperties',
708    'data' : {} }
711 # @HmatLBMemoryHierarchy:
713 # The memory hierarchy in the System Locality Latency and Bandwidth
714 # Information Structure of HMAT (Heterogeneous Memory Attribute Table)
716 # For more information about @HmatLBMemoryHierarchy, see chapter
717 # 5.2.27.4: Table 5-146: Field "Flags" of ACPI 6.3 spec.
719 # @memory: the structure represents the memory performance
721 # @first-level: first level of memory side cache
723 # @second-level: second level of memory side cache
725 # @third-level: third level of memory side cache
727 # Since: 5.0
729 { 'enum': 'HmatLBMemoryHierarchy',
730   'data': [ 'memory', 'first-level', 'second-level', 'third-level' ] }
733 # @HmatLBDataType:
735 # Data type in the System Locality Latency and Bandwidth
736 # Information Structure of HMAT (Heterogeneous Memory Attribute Table)
738 # For more information about @HmatLBDataType, see chapter
739 # 5.2.27.4: Table 5-146:  Field "Data Type" of ACPI 6.3 spec.
741 # @access-latency: access latency (nanoseconds)
743 # @read-latency: read latency (nanoseconds)
745 # @write-latency: write latency (nanoseconds)
747 # @access-bandwidth: access bandwidth (Bytes per second)
749 # @read-bandwidth: read bandwidth (Bytes per second)
751 # @write-bandwidth: write bandwidth (Bytes per second)
753 # Since: 5.0
755 { 'enum': 'HmatLBDataType',
756   'data': [ 'access-latency', 'read-latency', 'write-latency',
757             'access-bandwidth', 'read-bandwidth', 'write-bandwidth' ] }
760 # @NumaHmatLBOptions:
762 # Set the system locality latency and bandwidth information
763 # between Initiator and Target proximity Domains.
765 # For more information about @NumaHmatLBOptions, see chapter
766 # 5.2.27.4: Table 5-146 of ACPI 6.3 spec.
768 # @initiator: the Initiator Proximity Domain.
770 # @target: the Target Proximity Domain.
772 # @hierarchy: the Memory Hierarchy. Indicates the performance
773 #             of memory or side cache.
775 # @data-type: presents the type of data, access/read/write
776 #             latency or hit latency.
778 # @latency: the value of latency from @initiator to @target
779 #           proximity domain, the latency unit is "ns(nanosecond)".
781 # @bandwidth: the value of bandwidth between @initiator and @target
782 #             proximity domain, the bandwidth unit is
783 #             "Bytes per second".
785 # Since: 5.0
787 { 'struct': 'NumaHmatLBOptions',
788     'data': {
789     'initiator': 'uint16',
790     'target': 'uint16',
791     'hierarchy': 'HmatLBMemoryHierarchy',
792     'data-type': 'HmatLBDataType',
793     '*latency': 'uint64',
794     '*bandwidth': 'size' }}
797 # @HmatCacheAssociativity:
799 # Cache associativity in the Memory Side Cache Information Structure
800 # of HMAT
802 # For more information of @HmatCacheAssociativity, see chapter
803 # 5.2.27.5: Table 5-147 of ACPI 6.3 spec.
805 # @none: None (no memory side cache in this proximity domain,
806 #              or cache associativity unknown)
808 # @direct: Direct Mapped
810 # @complex: Complex Cache Indexing (implementation specific)
812 # Since: 5.0
814 { 'enum': 'HmatCacheAssociativity',
815   'data': [ 'none', 'direct', 'complex' ] }
818 # @HmatCacheWritePolicy:
820 # Cache write policy in the Memory Side Cache Information Structure
821 # of HMAT
823 # For more information of @HmatCacheWritePolicy, see chapter
824 # 5.2.27.5: Table 5-147: Field "Cache Attributes" of ACPI 6.3 spec.
826 # @none: None (no memory side cache in this proximity domain,
827 #        or cache write policy unknown)
829 # @write-back: Write Back (WB)
831 # @write-through: Write Through (WT)
833 # Since: 5.0
835 { 'enum': 'HmatCacheWritePolicy',
836   'data': [ 'none', 'write-back', 'write-through' ] }
839 # @NumaHmatCacheOptions:
841 # Set the memory side cache information for a given memory domain.
843 # For more information of @NumaHmatCacheOptions, see chapter
844 # 5.2.27.5: Table 5-147: Field "Cache Attributes" of ACPI 6.3 spec.
846 # @node-id: the memory proximity domain to which the memory belongs.
848 # @size: the size of memory side cache in bytes.
850 # @level: the cache level described in this structure.
852 # @associativity: the cache associativity,
853 #                 none/direct-mapped/complex(complex cache indexing).
855 # @policy: the write policy, none/write-back/write-through.
857 # @line: the cache Line size in bytes.
859 # Since: 5.0
861 { 'struct': 'NumaHmatCacheOptions',
862   'data': {
863    'node-id': 'uint32',
864    'size': 'size',
865    'level': 'uint8',
866    'associativity': 'HmatCacheAssociativity',
867    'policy': 'HmatCacheWritePolicy',
868    'line': 'uint16' }}
871 # @HostMemPolicy:
873 # Host memory policy types
875 # @default: restore default policy, remove any nondefault policy
877 # @preferred: set the preferred host nodes for allocation
879 # @bind: a strict policy that restricts memory allocation to the
880 #        host nodes specified
882 # @interleave: memory allocations are interleaved across the set
883 #              of host nodes specified
885 # Since: 2.1
887 { 'enum': 'HostMemPolicy',
888   'data': [ 'default', 'preferred', 'bind', 'interleave' ] }
891 # @memsave:
893 # Save a portion of guest memory to a file.
895 # @val: the virtual address of the guest to start from
897 # @size: the size of memory region to save
899 # @filename: the file to save the memory to as binary data
901 # @cpu-index: the index of the virtual CPU to use for translating the
902 #             virtual address (defaults to CPU 0)
904 # Returns: Nothing on success
906 # Since: 0.14.0
908 # Notes: Errors were not reliably returned until 1.1
910 # Example:
912 # -> { "execute": "memsave",
913 #      "arguments": { "val": 10,
914 #                     "size": 100,
915 #                     "filename": "/tmp/virtual-mem-dump" } }
916 # <- { "return": {} }
919 { 'command': 'memsave',
920   'data': {'val': 'int', 'size': 'int', 'filename': 'str', '*cpu-index': 'int'} }
923 # @pmemsave:
925 # Save a portion of guest physical memory to a file.
927 # @val: the physical address of the guest to start from
929 # @size: the size of memory region to save
931 # @filename: the file to save the memory to as binary data
933 # Returns: Nothing on success
935 # Since: 0.14.0
937 # Notes: Errors were not reliably returned until 1.1
939 # Example:
941 # -> { "execute": "pmemsave",
942 #      "arguments": { "val": 10,
943 #                     "size": 100,
944 #                     "filename": "/tmp/physical-mem-dump" } }
945 # <- { "return": {} }
948 { 'command': 'pmemsave',
949   'data': {'val': 'int', 'size': 'int', 'filename': 'str'} }
952 # @Memdev:
954 # Information about memory backend
956 # @id: backend's ID if backend has 'id' property (since 2.9)
958 # @size: memory backend size
960 # @merge: enables or disables memory merge support
962 # @dump: includes memory backend's memory in a core dump or not
964 # @prealloc: enables or disables memory preallocation
966 # @host-nodes: host nodes for its memory policy
968 # @policy: memory policy of memory backend
970 # Since: 2.1
972 { 'struct': 'Memdev',
973   'data': {
974     '*id':        'str',
975     'size':       'size',
976     'merge':      'bool',
977     'dump':       'bool',
978     'prealloc':   'bool',
979     'host-nodes': ['uint16'],
980     'policy':     'HostMemPolicy' }}
983 # @query-memdev:
985 # Returns information for all memory backends.
987 # Returns: a list of @Memdev.
989 # Since: 2.1
991 # Example:
993 # -> { "execute": "query-memdev" }
994 # <- { "return": [
995 #        {
996 #          "id": "mem1",
997 #          "size": 536870912,
998 #          "merge": false,
999 #          "dump": true,
1000 #          "prealloc": false,
1001 #          "host-nodes": [0, 1],
1002 #          "policy": "bind"
1003 #        },
1004 #        {
1005 #          "size": 536870912,
1006 #          "merge": false,
1007 #          "dump": true,
1008 #          "prealloc": true,
1009 #          "host-nodes": [2, 3],
1010 #          "policy": "preferred"
1011 #        }
1012 #      ]
1013 #    }
1016 { 'command': 'query-memdev', 'returns': ['Memdev'], 'allow-preconfig': true }
1019 # @CpuInstanceProperties:
1021 # List of properties to be used for hotplugging a CPU instance,
1022 # it should be passed by management with device_add command when
1023 # a CPU is being hotplugged.
1025 # @node-id: NUMA node ID the CPU belongs to
1026 # @socket-id: socket number within node/board the CPU belongs to
1027 # @die-id: die number within node/board the CPU belongs to (Since 4.1)
1028 # @core-id: core number within die the CPU belongs to
1029 # @thread-id: thread number within core the CPU belongs to
1031 # Note: currently there are 5 properties that could be present
1032 #       but management should be prepared to pass through other
1033 #       properties with device_add command to allow for future
1034 #       interface extension. This also requires the filed names to be kept in
1035 #       sync with the properties passed to -device/device_add.
1037 # Since: 2.7
1039 { 'struct': 'CpuInstanceProperties',
1040   'data': { '*node-id': 'int',
1041             '*socket-id': 'int',
1042             '*die-id': 'int',
1043             '*core-id': 'int',
1044             '*thread-id': 'int'
1045   }
1049 # @HotpluggableCPU:
1051 # @type: CPU object type for usage with device_add command
1052 # @props: list of properties to be used for hotplugging CPU
1053 # @vcpus-count: number of logical VCPU threads @HotpluggableCPU provides
1054 # @qom-path: link to existing CPU object if CPU is present or
1055 #            omitted if CPU is not present.
1057 # Since: 2.7
1059 { 'struct': 'HotpluggableCPU',
1060   'data': { 'type': 'str',
1061             'vcpus-count': 'int',
1062             'props': 'CpuInstanceProperties',
1063             '*qom-path': 'str'
1064           }
1068 # @query-hotpluggable-cpus:
1070 # TODO: Better documentation; currently there is none.
1072 # Returns: a list of HotpluggableCPU objects.
1074 # Since: 2.7
1076 # Example:
1078 # For pseries machine type started with -smp 2,cores=2,maxcpus=4 -cpu POWER8:
1080 # -> { "execute": "query-hotpluggable-cpus" }
1081 # <- {"return": [
1082 #      { "props": { "core": 8 }, "type": "POWER8-spapr-cpu-core",
1083 #        "vcpus-count": 1 },
1084 #      { "props": { "core": 0 }, "type": "POWER8-spapr-cpu-core",
1085 #        "vcpus-count": 1, "qom-path": "/machine/unattached/device[0]"}
1086 #    ]}'
1088 # For pc machine type started with -smp 1,maxcpus=2:
1090 # -> { "execute": "query-hotpluggable-cpus" }
1091 # <- {"return": [
1092 #      {
1093 #         "type": "qemu64-x86_64-cpu", "vcpus-count": 1,
1094 #         "props": {"core-id": 0, "socket-id": 1, "thread-id": 0}
1095 #      },
1096 #      {
1097 #         "qom-path": "/machine/unattached/device[0]",
1098 #         "type": "qemu64-x86_64-cpu", "vcpus-count": 1,
1099 #         "props": {"core-id": 0, "socket-id": 0, "thread-id": 0}
1100 #      }
1101 #    ]}
1103 # For s390x-virtio-ccw machine type started with -smp 1,maxcpus=2 -cpu qemu
1104 # (Since: 2.11):
1106 # -> { "execute": "query-hotpluggable-cpus" }
1107 # <- {"return": [
1108 #      {
1109 #         "type": "qemu-s390x-cpu", "vcpus-count": 1,
1110 #         "props": { "core-id": 1 }
1111 #      },
1112 #      {
1113 #         "qom-path": "/machine/unattached/device[0]",
1114 #         "type": "qemu-s390x-cpu", "vcpus-count": 1,
1115 #         "props": { "core-id": 0 }
1116 #      }
1117 #    ]}
1120 { 'command': 'query-hotpluggable-cpus', 'returns': ['HotpluggableCPU'],
1121              'allow-preconfig': true }
1124 # @set-numa-node:
1126 # Runtime equivalent of '-numa' CLI option, available at
1127 # preconfigure stage to configure numa mapping before initializing
1128 # machine.
1130 # Since 3.0
1132 { 'command': 'set-numa-node', 'boxed': true,
1133   'data': 'NumaOptions',
1134   'allow-preconfig': true
1138 # @balloon:
1140 # Request the balloon driver to change its balloon size.
1142 # @value: the target logical size of the VM in bytes.
1143 #         We can deduce the size of the balloon using this formula:
1145 #            logical_vm_size = vm_ram_size - balloon_size
1147 #         From it we have: balloon_size = vm_ram_size - @value
1149 # Returns: - Nothing on success
1150 #          - If the balloon driver is enabled but not functional because the KVM
1151 #            kernel module cannot support it, KvmMissingCap
1152 #          - If no balloon device is present, DeviceNotActive
1154 # Notes: This command just issues a request to the guest.  When it returns,
1155 #        the balloon size may not have changed.  A guest can change the balloon
1156 #        size independent of this command.
1158 # Since: 0.14.0
1160 # Example:
1162 # -> { "execute": "balloon", "arguments": { "value": 536870912 } }
1163 # <- { "return": {} }
1165 # With a 2.5GiB guest this command inflated the ballon to 3GiB.
1168 { 'command': 'balloon', 'data': {'value': 'int'} }
1171 # @BalloonInfo:
1173 # Information about the guest balloon device.
1175 # @actual: the logical size of the VM in bytes
1176 #          Formula used: logical_vm_size = vm_ram_size - balloon_size
1178 # Since: 0.14.0
1181 { 'struct': 'BalloonInfo', 'data': {'actual': 'int' } }
1184 # @query-balloon:
1186 # Return information about the balloon device.
1188 # Returns: - @BalloonInfo on success
1189 #          - If the balloon driver is enabled but not functional because the KVM
1190 #            kernel module cannot support it, KvmMissingCap
1191 #          - If no balloon device is present, DeviceNotActive
1193 # Since: 0.14.0
1195 # Example:
1197 # -> { "execute": "query-balloon" }
1198 # <- { "return": {
1199 #          "actual": 1073741824,
1200 #       }
1201 #    }
1204 { 'command': 'query-balloon', 'returns': 'BalloonInfo' }
1207 # @BALLOON_CHANGE:
1209 # Emitted when the guest changes the actual BALLOON level. This value is
1210 # equivalent to the @actual field return by the 'query-balloon' command
1212 # @actual: the logical size of the VM in bytes
1213 #          Formula used: logical_vm_size = vm_ram_size - balloon_size
1215 # Note: this event is rate-limited.
1217 # Since: 1.2
1219 # Example:
1221 # <- { "event": "BALLOON_CHANGE",
1222 #      "data": { "actual": 944766976 },
1223 #      "timestamp": { "seconds": 1267020223, "microseconds": 435656 } }
1226 { 'event': 'BALLOON_CHANGE',
1227   'data': { 'actual': 'int' } }
1230 # @MemoryInfo:
1232 # Actual memory information in bytes.
1234 # @base-memory: size of "base" memory specified with command line
1235 #               option -m.
1237 # @plugged-memory: size of memory that can be hot-unplugged. This field
1238 #                  is omitted if target doesn't support memory hotplug
1239 #                  (i.e. CONFIG_MEM_DEVICE not defined at build time).
1241 # Since: 2.11.0
1243 { 'struct': 'MemoryInfo',
1244   'data'  : { 'base-memory': 'size', '*plugged-memory': 'size' } }
1247 # @query-memory-size-summary:
1249 # Return the amount of initially allocated and present hotpluggable (if
1250 # enabled) memory in bytes.
1252 # Example:
1254 # -> { "execute": "query-memory-size-summary" }
1255 # <- { "return": { "base-memory": 4294967296, "plugged-memory": 0 } }
1257 # Since: 2.11.0
1259 { 'command': 'query-memory-size-summary', 'returns': 'MemoryInfo' }
1262 # @PCDIMMDeviceInfo:
1264 # PCDIMMDevice state information
1266 # @id: device's ID
1268 # @addr: physical address, where device is mapped
1270 # @size: size of memory that the device provides
1272 # @slot: slot number at which device is plugged in
1274 # @node: NUMA node number where device is plugged in
1276 # @memdev: memory backend linked with device
1278 # @hotplugged: true if device was hotplugged
1280 # @hotpluggable: true if device if could be added/removed while machine is running
1282 # Since: 2.1
1284 { 'struct': 'PCDIMMDeviceInfo',
1285   'data': { '*id': 'str',
1286             'addr': 'int',
1287             'size': 'int',
1288             'slot': 'int',
1289             'node': 'int',
1290             'memdev': 'str',
1291             'hotplugged': 'bool',
1292             'hotpluggable': 'bool'
1293           }
1297 # @VirtioPMEMDeviceInfo:
1299 # VirtioPMEM state information
1301 # @id: device's ID
1303 # @memaddr: physical address in memory, where device is mapped
1305 # @size: size of memory that the device provides
1307 # @memdev: memory backend linked with device
1309 # Since: 4.1
1311 { 'struct': 'VirtioPMEMDeviceInfo',
1312   'data': { '*id': 'str',
1313             'memaddr': 'size',
1314             'size': 'size',
1315             'memdev': 'str'
1316           }
1320 # @VirtioMEMDeviceInfo:
1322 # VirtioMEMDevice state information
1324 # @id: device's ID
1326 # @memaddr: physical address in memory, where device is mapped
1328 # @requested-size: the user requested size of the device
1330 # @size: the (current) size of memory that the device provides
1332 # @max-size: the maximum size of memory that the device can provide
1334 # @block-size: the block size of memory that the device provides
1336 # @node: NUMA node number where device is assigned to
1338 # @memdev: memory backend linked with the region
1340 # Since: 5.1
1342 { 'struct': 'VirtioMEMDeviceInfo',
1343   'data': { '*id': 'str',
1344             'memaddr': 'size',
1345             'requested-size': 'size',
1346             'size': 'size',
1347             'max-size': 'size',
1348             'block-size': 'size',
1349             'node': 'int',
1350             'memdev': 'str'
1351           }
1355 # @MemoryDeviceInfo:
1357 # Union containing information about a memory device
1359 # nvdimm is included since 2.12. virtio-pmem is included since 4.1.
1360 # virtio-mem is included since 5.1.
1362 # Since: 2.1
1364 { 'union': 'MemoryDeviceInfo',
1365   'data': { 'dimm': 'PCDIMMDeviceInfo',
1366             'nvdimm': 'PCDIMMDeviceInfo',
1367             'virtio-pmem': 'VirtioPMEMDeviceInfo',
1368             'virtio-mem': 'VirtioMEMDeviceInfo'
1369           }
1373 # @query-memory-devices:
1375 # Lists available memory devices and their state
1377 # Since: 2.1
1379 # Example:
1381 # -> { "execute": "query-memory-devices" }
1382 # <- { "return": [ { "data":
1383 #                       { "addr": 5368709120,
1384 #                         "hotpluggable": true,
1385 #                         "hotplugged": true,
1386 #                         "id": "d1",
1387 #                         "memdev": "/objects/memX",
1388 #                         "node": 0,
1389 #                         "size": 1073741824,
1390 #                         "slot": 0},
1391 #                    "type": "dimm"
1392 #                  } ] }
1395 { 'command': 'query-memory-devices', 'returns': ['MemoryDeviceInfo'] }
1398 # @MEMORY_DEVICE_SIZE_CHANGE:
1400 # Emitted when the size of a memory device changes. Only emitted for memory
1401 # devices that can actually change the size (e.g., virtio-mem due to guest
1402 # action).
1404 # @id: device's ID
1405 # @size: the new size of memory that the device provides
1407 # Note: this event is rate-limited.
1409 # Since: 5.1
1411 # Example:
1413 # <- { "event": "MEMORY_DEVICE_SIZE_CHANGE",
1414 #      "data": { "id": "vm0", "size": 1073741824},
1415 #      "timestamp": { "seconds": 1588168529, "microseconds": 201316 } }
1418 { 'event': 'MEMORY_DEVICE_SIZE_CHANGE',
1419   'data': { '*id': 'str', 'size': 'size' } }
1423 # @MEM_UNPLUG_ERROR:
1425 # Emitted when memory hot unplug error occurs.
1427 # @device: device name
1429 # @msg: Informative message
1431 # Since: 2.4
1433 # Example:
1435 # <- { "event": "MEM_UNPLUG_ERROR"
1436 #      "data": { "device": "dimm1",
1437 #                "msg": "acpi: device unplug for unsupported device"
1438 #      },
1439 #      "timestamp": { "seconds": 1265044230, "microseconds": 450486 } }
1442 { 'event': 'MEM_UNPLUG_ERROR',
1443   'data': { 'device': 'str', 'msg': 'str' } }