xref: /openbmc/qemu/qapi/machine.json (revision fb6051e7)
1# -*- Mode: Python -*-
2# vim: filetype=python
3#
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.
6
7##
8# = Machines
9##
10
11{ 'include': 'common.json' }
12{ 'include': 'machine-common.json' }
13
14##
15# @SysEmuTarget:
16#
17# The comprehensive enumeration of QEMU system emulation ("softmmu")
18# targets.  Run "./configure --help" in the project root directory,
19# and look for the \*-softmmu targets near the "--target-list" option.
20# The individual target constants are not documented here, for the
21# time being.
22#
23# @rx: since 5.0
24#
25# @avr: since 5.1
26#
27# @loongarch64: since 7.1
28#
29# .. note:: The resulting QMP strings can be appended to the
30#    "qemu-system-" prefix to produce the corresponding QEMU
31#    executable name.  This is true even for "qemu-system-x86_64".
32#
33# Since: 3.0
34##
35{ 'enum' : 'SysEmuTarget',
36  'data' : [ 'aarch64', 'alpha', 'arm', 'avr', 'cris', 'hppa', 'i386',
37             'loongarch64', 'm68k', 'microblaze', 'microblazeel', 'mips', 'mips64',
38             'mips64el', 'mipsel', 'or1k', 'ppc',
39             'ppc64', 'riscv32', 'riscv64', 'rx', 's390x', 'sh4',
40             'sh4eb', 'sparc', 'sparc64', 'tricore',
41             'x86_64', 'xtensa', 'xtensaeb' ] }
42
43##
44# @CpuS390State:
45#
46# An enumeration of cpu states that can be assumed by a virtual S390
47# CPU
48#
49# Since: 2.12
50##
51{ 'enum': 'CpuS390State',
52  'prefix': 'S390_CPU_STATE',
53  'data': [ 'uninitialized', 'stopped', 'check-stop', 'operating', 'load' ] }
54
55##
56# @CpuInfoS390:
57#
58# Additional information about a virtual S390 CPU
59#
60# @cpu-state: the virtual CPU's state
61#
62# @dedicated: the virtual CPU's dedication (since 8.2)
63#
64# @entitlement: the virtual CPU's entitlement (since 8.2)
65#
66# Since: 2.12
67##
68{ 'struct': 'CpuInfoS390',
69  'data': { 'cpu-state': 'CpuS390State',
70            '*dedicated': 'bool',
71            '*entitlement': 'CpuS390Entitlement' } }
72
73##
74# @CpuInfoFast:
75#
76# Information about a virtual CPU
77#
78# @cpu-index: index of the virtual CPU
79#
80# @qom-path: path to the CPU object in the QOM tree
81#
82# @thread-id: ID of the underlying host thread
83#
84# @props: properties associated with a virtual CPU, e.g. the socket id
85#
86# @target: the QEMU system emulation target, which determines which
87#     additional fields will be listed (since 3.0)
88#
89# Since: 2.12
90##
91{ 'union'         : 'CpuInfoFast',
92  'base'          : { 'cpu-index'    : 'int',
93                      'qom-path'     : 'str',
94                      'thread-id'    : 'int',
95                      '*props'       : 'CpuInstanceProperties',
96                      'target'       : 'SysEmuTarget' },
97  'discriminator' : 'target',
98  'data'          : { 's390x'        : 'CpuInfoS390' } }
99
100##
101# @query-cpus-fast:
102#
103# Returns information about all virtual CPUs.
104#
105# Returns: list of @CpuInfoFast
106#
107# Since: 2.12
108#
109# .. qmp-example::
110#
111#     -> { "execute": "query-cpus-fast" }
112#     <- { "return": [
113#             {
114#                 "thread-id": 25627,
115#                 "props": {
116#                     "core-id": 0,
117#                     "thread-id": 0,
118#                     "socket-id": 0
119#                 },
120#                 "qom-path": "/machine/unattached/device[0]",
121#                 "target":"x86_64",
122#                 "cpu-index": 0
123#             },
124#             {
125#                 "thread-id": 25628,
126#                 "props": {
127#                     "core-id": 0,
128#                     "thread-id": 0,
129#                     "socket-id": 1
130#                 },
131#                 "qom-path": "/machine/unattached/device[2]",
132#                 "target":"x86_64",
133#                 "cpu-index": 1
134#             }
135#         ]
136#     }
137##
138{ 'command': 'query-cpus-fast', 'returns': [ 'CpuInfoFast' ] }
139
140##
141# @CompatProperty:
142#
143# Property default values specific to a machine type, for use by
144# scripts/compare-machine-types.
145#
146# @qom-type: name of the QOM type to which the default applies
147#
148# @property: name of its property to which the default applies
149#
150# @value: the default value (machine-specific default can overwrite
151#     the "default" default, to avoid this use -machine none)
152#
153# Since: 9.1
154##
155{ 'struct': 'CompatProperty',
156  'data': { 'qom-type': 'str',
157            'property': 'str',
158            'value': 'str' } }
159
160##
161# @MachineInfo:
162#
163# Information describing a machine.
164#
165# @name: the name of the machine
166#
167# @alias: an alias for the machine name
168#
169# @is-default: whether the machine is default
170#
171# @cpu-max: maximum number of CPUs supported by the machine type
172#     (since 1.5)
173#
174# @hotpluggable-cpus: cpu hotplug via -device is supported (since 2.7)
175#
176# @numa-mem-supported: true if '-numa node,mem' option is supported by
177#     the machine type and false otherwise (since 4.1)
178#
179# @deprecated: if true, the machine type is deprecated and may be
180#     removed in future versions of QEMU according to the QEMU
181#     deprecation policy (since 4.1)
182#
183# @default-cpu-type: default CPU model typename if none is requested
184#     via the -cpu argument.  (since 4.2)
185#
186# @default-ram-id: the default ID of initial RAM memory backend (since
187#     5.2)
188#
189# @acpi: machine type supports ACPI (since 8.0)
190#
191# @compat-props: The machine type's compatibility properties.  Only
192#     present when query-machines argument @compat-props is true.
193#     (since 9.1)
194#
195# Features:
196#
197# @unstable: Member @compat-props is experimental.
198#
199# Since: 1.2
200##
201{ 'struct': 'MachineInfo',
202  'data': { 'name': 'str', '*alias': 'str',
203            '*is-default': 'bool', 'cpu-max': 'int',
204            'hotpluggable-cpus': 'bool',  'numa-mem-supported': 'bool',
205            'deprecated': 'bool', '*default-cpu-type': 'str',
206            '*default-ram-id': 'str', 'acpi': 'bool',
207            '*compat-props': { 'type': ['CompatProperty'],
208                               'features': ['unstable'] } } }
209
210##
211# @query-machines:
212#
213# Return a list of supported machines
214#
215# @compat-props: if true, also return compatibility properties.
216#     (default: false) (since 9.1)
217#
218# Features:
219#
220# @unstable: Argument @compat-props is experimental.
221#
222# Returns: a list of MachineInfo
223#
224# Since: 1.2
225#
226# .. qmp-example::
227#
228#     -> { "execute": "query-machines", "arguments": { "compat-props": true } }
229#     <- { "return": [
230#               {
231#                  "hotpluggable-cpus": true,
232#                  "name": "pc-q35-6.2",
233#                  "compat-props": [
234#                       {
235#                          "qom-type": "virtio-mem",
236#                          "property": "unplugged-inaccessible",
237#                          "value": "off"
238#                       }
239#                   ],
240#                   "numa-mem-supported": false,
241#                   "default-cpu-type": "qemu64-x86_64-cpu",
242#                   "cpu-max": 288,
243#                   "deprecated": false,
244#                   "default-ram-id": "pc.ram"
245#               },
246#               ...
247#        }
248##
249{ 'command': 'query-machines',
250  'data': { '*compat-props': { 'type': 'bool',
251                               'features': [ 'unstable' ] } },
252  'returns': ['MachineInfo'] }
253
254##
255# @CurrentMachineParams:
256#
257# Information describing the running machine parameters.
258#
259# @wakeup-suspend-support: true if the machine supports wake up from
260#     suspend
261#
262# Since: 4.0
263##
264{ 'struct': 'CurrentMachineParams',
265  'data': { 'wakeup-suspend-support': 'bool'} }
266
267##
268# @query-current-machine:
269#
270# Return information on the current virtual machine.
271#
272# Returns: CurrentMachineParams
273#
274# Since: 4.0
275##
276{ 'command': 'query-current-machine', 'returns': 'CurrentMachineParams' }
277
278##
279# @TargetInfo:
280#
281# Information describing the QEMU target.
282#
283# @arch: the target architecture
284#
285# Since: 1.2
286##
287{ 'struct': 'TargetInfo',
288  'data': { 'arch': 'SysEmuTarget' } }
289
290##
291# @query-target:
292#
293# Return information about the target for this QEMU
294#
295# Returns: TargetInfo
296#
297# Since: 1.2
298##
299{ 'command': 'query-target', 'returns': 'TargetInfo' }
300
301##
302# @UuidInfo:
303#
304# Guest UUID information (Universally Unique Identifier).
305#
306# @UUID: the UUID of the guest
307#
308# Since: 0.14
309#
310# .. note:: If no UUID was specified for the guest, the nil UUID (all
311#    zeroes) is returned.
312##
313{ 'struct': 'UuidInfo', 'data': {'UUID': 'str'} }
314
315##
316# @query-uuid:
317#
318# Query the guest UUID information.
319#
320# Returns: The @UuidInfo for the guest
321#
322# Since: 0.14
323#
324# .. qmp-example::
325#
326#     -> { "execute": "query-uuid" }
327#     <- { "return": { "UUID": "550e8400-e29b-41d4-a716-446655440000" } }
328##
329{ 'command': 'query-uuid', 'returns': 'UuidInfo', 'allow-preconfig': true }
330
331##
332# @GuidInfo:
333#
334# GUID information.
335#
336# @guid: the globally unique identifier
337#
338# Since: 2.9
339##
340{ 'struct': 'GuidInfo', 'data': {'guid': 'str'} }
341
342##
343# @query-vm-generation-id:
344#
345# Show Virtual Machine Generation ID
346#
347# Since: 2.9
348##
349{ 'command': 'query-vm-generation-id', 'returns': 'GuidInfo' }
350
351##
352# @system_reset:
353#
354# Performs a hard reset of a guest.
355#
356# Since: 0.14
357#
358# .. qmp-example::
359#
360#     -> { "execute": "system_reset" }
361#     <- { "return": {} }
362##
363{ 'command': 'system_reset' }
364
365##
366# @system_powerdown:
367#
368# Requests that a guest perform a powerdown operation.
369#
370# Since: 0.14
371#
372# .. note:: A guest may or may not respond to this command.  This
373#    command returning does not indicate that a guest has accepted the
374#    request or that it has shut down.  Many guests will respond to
375#    this command by prompting the user in some way.
376#
377# .. qmp-example::
378#
379#     -> { "execute": "system_powerdown" }
380#     <- { "return": {} }
381##
382{ 'command': 'system_powerdown' }
383
384##
385# @system_wakeup:
386#
387# Wake up guest from suspend.  If the guest has wake-up from suspend
388# support enabled (wakeup-suspend-support flag from
389# query-current-machine), wake-up guest from suspend if the guest is
390# in SUSPENDED state.  Return an error otherwise.
391#
392# Since: 1.1
393#
394# .. note:: Prior to 4.0, this command does nothing in case the guest
395#    isn't suspended.
396#
397# .. qmp-example::
398#
399#     -> { "execute": "system_wakeup" }
400#     <- { "return": {} }
401##
402{ 'command': 'system_wakeup' }
403
404##
405# @LostTickPolicy:
406#
407# Policy for handling lost ticks in timer devices.  Ticks end up
408# getting lost when, for example, the guest is paused.
409#
410# @discard: throw away the missed ticks and continue with future
411#     injection normally.  The guest OS will see the timer jump ahead
412#     by a potentially quite significant amount all at once, as if the
413#     intervening chunk of time had simply not existed; needless to
414#     say, such a sudden jump can easily confuse a guest OS which is
415#     not specifically prepared to deal with it.  Assuming the guest
416#     OS can deal correctly with the time jump, the time in the guest
417#     and in the host should now match.
418#
419# @delay: continue to deliver ticks at the normal rate.  The guest OS
420#     will not notice anything is amiss, as from its point of view
421#     time will have continued to flow normally.  The time in the
422#     guest should now be behind the time in the host by exactly the
423#     amount of time during which ticks have been missed.
424#
425# @slew: deliver ticks at a higher rate to catch up with the missed
426#     ticks.  The guest OS will not notice anything is amiss, as from
427#     its point of view time will have continued to flow normally.
428#     Once the timer has managed to catch up with all the missing
429#     ticks, the time in the guest and in the host should match.
430#
431# Since: 2.0
432##
433{ 'enum': 'LostTickPolicy',
434  'data': ['discard', 'delay', 'slew' ] }
435
436##
437# @inject-nmi:
438#
439# Injects a Non-Maskable Interrupt into the default CPU (x86/s390) or
440# all CPUs (ppc64).  The command fails when the guest doesn't support
441# injecting.
442#
443# Since: 0.14
444#
445# .. note:: Prior to 2.1, this command was only supported for x86 and
446#    s390 VMs.
447#
448# .. qmp-example::
449#
450#     -> { "execute": "inject-nmi" }
451#     <- { "return": {} }
452##
453{ 'command': 'inject-nmi' }
454
455##
456# @KvmInfo:
457#
458# Information about support for KVM acceleration
459#
460# @enabled: true if KVM acceleration is active
461#
462# @present: true if KVM acceleration is built into this executable
463#
464# Since: 0.14
465##
466{ 'struct': 'KvmInfo', 'data': {'enabled': 'bool', 'present': 'bool'} }
467
468##
469# @query-kvm:
470#
471# Returns information about KVM acceleration
472#
473# Returns: @KvmInfo
474#
475# Since: 0.14
476#
477# .. qmp-example::
478#
479#     -> { "execute": "query-kvm" }
480#     <- { "return": { "enabled": true, "present": true } }
481##
482{ 'command': 'query-kvm', 'returns': 'KvmInfo' }
483
484##
485# @NumaOptionsType:
486#
487# @node: NUMA nodes configuration
488#
489# @dist: NUMA distance configuration (since 2.10)
490#
491# @cpu: property based CPU(s) to node mapping (Since: 2.10)
492#
493# @hmat-lb: memory latency and bandwidth information (Since: 5.0)
494#
495# @hmat-cache: memory side cache information (Since: 5.0)
496#
497# Since: 2.1
498##
499{ 'enum': 'NumaOptionsType',
500  'data': [ 'node', 'dist', 'cpu', 'hmat-lb', 'hmat-cache' ] }
501
502##
503# @NumaOptions:
504#
505# A discriminated record of NUMA options.  (for OptsVisitor)
506#
507# @type: NUMA option type
508#
509# Since: 2.1
510##
511{ 'union': 'NumaOptions',
512  'base': { 'type': 'NumaOptionsType' },
513  'discriminator': 'type',
514  'data': {
515    'node': 'NumaNodeOptions',
516    'dist': 'NumaDistOptions',
517    'cpu': 'NumaCpuOptions',
518    'hmat-lb': 'NumaHmatLBOptions',
519    'hmat-cache': 'NumaHmatCacheOptions' }}
520
521##
522# @NumaNodeOptions:
523#
524# Create a guest NUMA node.  (for OptsVisitor)
525#
526# @nodeid: NUMA node ID (increase by 1 from 0 if omitted)
527#
528# @cpus: VCPUs belonging to this node (assign VCPUS round-robin if
529#     omitted)
530#
531# @mem: memory size of this node; mutually exclusive with @memdev.
532#     Equally divide total memory among nodes if both @mem and @memdev
533#     are omitted.
534#
535# @memdev: memory backend object.  If specified for one node, it must
536#     be specified for all nodes.
537#
538# @initiator: defined in ACPI 6.3 Chapter 5.2.27.3 Table 5-145, points
539#     to the nodeid which has the memory controller responsible for
540#     this NUMA node.  This field provides additional information as
541#     to the initiator node that is closest (as in directly attached)
542#     to this node, and therefore has the best performance (since 5.0)
543#
544# Since: 2.1
545##
546{ 'struct': 'NumaNodeOptions',
547  'data': {
548   '*nodeid': 'uint16',
549   '*cpus':   ['uint16'],
550   '*mem':    'size',
551   '*memdev': 'str',
552   '*initiator': 'uint16' }}
553
554##
555# @NumaDistOptions:
556#
557# Set the distance between 2 NUMA nodes.
558#
559# @src: source NUMA node.
560#
561# @dst: destination NUMA node.
562#
563# @val: NUMA distance from source node to destination node.  When a
564#     node is unreachable from another node, set the distance between
565#     them to 255.
566#
567# Since: 2.10
568##
569{ 'struct': 'NumaDistOptions',
570  'data': {
571   'src': 'uint16',
572   'dst': 'uint16',
573   'val': 'uint8' }}
574
575##
576# @CXLFixedMemoryWindowOptions:
577#
578# Create a CXL Fixed Memory Window
579#
580# @size: Size of the Fixed Memory Window in bytes.  Must be a multiple
581#     of 256MiB.
582#
583# @interleave-granularity: Number of contiguous bytes for which
584#     accesses will go to a given interleave target.  Accepted values
585#     [256, 512, 1k, 2k, 4k, 8k, 16k]
586#
587# @targets: Target root bridge IDs from -device ...,id=<ID> for each
588#     root bridge.
589#
590# Since: 7.1
591##
592{ 'struct': 'CXLFixedMemoryWindowOptions',
593  'data': {
594      'size': 'size',
595      '*interleave-granularity': 'size',
596      'targets': ['str'] }}
597
598##
599# @CXLFMWProperties:
600#
601# List of CXL Fixed Memory Windows.
602#
603# @cxl-fmw: List of CXLFixedMemoryWindowOptions
604#
605# Since: 7.1
606##
607{ 'struct' : 'CXLFMWProperties',
608  'data': { 'cxl-fmw': ['CXLFixedMemoryWindowOptions'] }
609}
610
611##
612# @X86CPURegister32:
613#
614# A X86 32-bit register
615#
616# Since: 1.5
617##
618{ 'enum': 'X86CPURegister32',
619  'data': [ 'EAX', 'EBX', 'ECX', 'EDX', 'ESP', 'EBP', 'ESI', 'EDI' ] }
620
621##
622# @X86CPUFeatureWordInfo:
623#
624# Information about a X86 CPU feature word
625#
626# @cpuid-input-eax: Input EAX value for CPUID instruction for that
627#     feature word
628#
629# @cpuid-input-ecx: Input ECX value for CPUID instruction for that
630#     feature word
631#
632# @cpuid-register: Output register containing the feature bits
633#
634# @features: value of output register, containing the feature bits
635#
636# Since: 1.5
637##
638{ 'struct': 'X86CPUFeatureWordInfo',
639  'data': { 'cpuid-input-eax': 'int',
640            '*cpuid-input-ecx': 'int',
641            'cpuid-register': 'X86CPURegister32',
642            'features': 'int' } }
643
644##
645# @DummyForceArrays:
646#
647# Not used by QMP; hack to let us use X86CPUFeatureWordInfoList
648# internally
649#
650# Since: 2.5
651##
652{ 'struct': 'DummyForceArrays',
653  'data': { 'unused': ['X86CPUFeatureWordInfo'] } }
654
655##
656# @NumaCpuOptions:
657#
658# Option "-numa cpu" overrides default cpu to node mapping.  It
659# accepts the same set of cpu properties as returned by
660# query-hotpluggable-cpus[].props, where node-id could be used to
661# override default node mapping.
662#
663# Since: 2.10
664##
665{ 'struct': 'NumaCpuOptions',
666   'base': 'CpuInstanceProperties',
667   'data' : {} }
668
669##
670# @HmatLBMemoryHierarchy:
671#
672# The memory hierarchy in the System Locality Latency and Bandwidth
673# Information Structure of HMAT (Heterogeneous Memory Attribute Table)
674#
675# For more information about @HmatLBMemoryHierarchy, see chapter
676# 5.2.27.4: Table 5-146: Field "Flags" of ACPI 6.3 spec.
677#
678# @memory: the structure represents the memory performance
679#
680# @first-level: first level of memory side cache
681#
682# @second-level: second level of memory side cache
683#
684# @third-level: third level of memory side cache
685#
686# Since: 5.0
687##
688{ 'enum': 'HmatLBMemoryHierarchy',
689  'data': [ 'memory', 'first-level', 'second-level', 'third-level' ] }
690
691##
692# @HmatLBDataType:
693#
694# Data type in the System Locality Latency and Bandwidth Information
695# Structure of HMAT (Heterogeneous Memory Attribute Table)
696#
697# For more information about @HmatLBDataType, see chapter 5.2.27.4:
698# Table 5-146:  Field "Data Type" of ACPI 6.3 spec.
699#
700# @access-latency: access latency (nanoseconds)
701#
702# @read-latency: read latency (nanoseconds)
703#
704# @write-latency: write latency (nanoseconds)
705#
706# @access-bandwidth: access bandwidth (Bytes per second)
707#
708# @read-bandwidth: read bandwidth (Bytes per second)
709#
710# @write-bandwidth: write bandwidth (Bytes per second)
711#
712# Since: 5.0
713##
714{ 'enum': 'HmatLBDataType',
715  'data': [ 'access-latency', 'read-latency', 'write-latency',
716            'access-bandwidth', 'read-bandwidth', 'write-bandwidth' ] }
717
718##
719# @NumaHmatLBOptions:
720#
721# Set the system locality latency and bandwidth information between
722# Initiator and Target proximity Domains.
723#
724# For more information about @NumaHmatLBOptions, see chapter 5.2.27.4:
725# Table 5-146 of ACPI 6.3 spec.
726#
727# @initiator: the Initiator Proximity Domain.
728#
729# @target: the Target Proximity Domain.
730#
731# @hierarchy: the Memory Hierarchy.  Indicates the performance of
732#     memory or side cache.
733#
734# @data-type: presents the type of data, access/read/write latency or
735#     hit latency.
736#
737# @latency: the value of latency from @initiator to @target proximity
738#     domain, the latency unit is "ns(nanosecond)".
739#
740# @bandwidth: the value of bandwidth between @initiator and @target
741#     proximity domain, the bandwidth unit is "Bytes per second".
742#
743# Since: 5.0
744##
745{ 'struct': 'NumaHmatLBOptions',
746    'data': {
747    'initiator': 'uint16',
748    'target': 'uint16',
749    'hierarchy': 'HmatLBMemoryHierarchy',
750    'data-type': 'HmatLBDataType',
751    '*latency': 'uint64',
752    '*bandwidth': 'size' }}
753
754##
755# @HmatCacheAssociativity:
756#
757# Cache associativity in the Memory Side Cache Information Structure
758# of HMAT
759#
760# For more information of @HmatCacheAssociativity, see chapter
761# 5.2.27.5: Table 5-147 of ACPI 6.3 spec.
762#
763# @none: None (no memory side cache in this proximity domain, or cache
764#     associativity unknown)
765#
766# @direct: Direct Mapped
767#
768# @complex: Complex Cache Indexing (implementation specific)
769#
770# Since: 5.0
771##
772{ 'enum': 'HmatCacheAssociativity',
773  'data': [ 'none', 'direct', 'complex' ] }
774
775##
776# @HmatCacheWritePolicy:
777#
778# Cache write policy in the Memory Side Cache Information Structure of
779# HMAT
780#
781# For more information of @HmatCacheWritePolicy, see chapter 5.2.27.5:
782# Table 5-147: Field "Cache Attributes" of ACPI 6.3 spec.
783#
784# @none: None (no memory side cache in this proximity domain, or cache
785#     write policy unknown)
786#
787# @write-back: Write Back (WB)
788#
789# @write-through: Write Through (WT)
790#
791# Since: 5.0
792##
793{ 'enum': 'HmatCacheWritePolicy',
794  'data': [ 'none', 'write-back', 'write-through' ] }
795
796##
797# @NumaHmatCacheOptions:
798#
799# Set the memory side cache information for a given memory domain.
800#
801# For more information of @NumaHmatCacheOptions, see chapter 5.2.27.5:
802# Table 5-147: Field "Cache Attributes" of ACPI 6.3 spec.
803#
804# @node-id: the memory proximity domain to which the memory belongs.
805#
806# @size: the size of memory side cache in bytes.
807#
808# @level: the cache level described in this structure.
809#
810# @associativity: the cache associativity,
811#     none/direct-mapped/complex(complex cache indexing).
812#
813# @policy: the write policy, none/write-back/write-through.
814#
815# @line: the cache Line size in bytes.
816#
817# Since: 5.0
818##
819{ 'struct': 'NumaHmatCacheOptions',
820  'data': {
821   'node-id': 'uint32',
822   'size': 'size',
823   'level': 'uint8',
824   'associativity': 'HmatCacheAssociativity',
825   'policy': 'HmatCacheWritePolicy',
826   'line': 'uint16' }}
827
828##
829# @memsave:
830#
831# Save a portion of guest memory to a file.
832#
833# @val: the virtual address of the guest to start from
834#
835# @size: the size of memory region to save
836#
837# @filename: the file to save the memory to as binary data
838#
839# @cpu-index: the index of the virtual CPU to use for translating the
840#     virtual address (defaults to CPU 0)
841#
842# Since: 0.14
843#
844# .. caution:: Errors were not reliably returned until 1.1.
845#
846# .. qmp-example::
847#
848#     -> { "execute": "memsave",
849#          "arguments": { "val": 10,
850#                         "size": 100,
851#                         "filename": "/tmp/virtual-mem-dump" } }
852#     <- { "return": {} }
853##
854{ 'command': 'memsave',
855  'data': {
856     'val': 'uint64',
857     'size': 'size',
858     'filename': 'str',
859     '*cpu-index': 'int' } }
860
861##
862# @pmemsave:
863#
864# Save a portion of guest physical memory to a file.
865#
866# @val: the physical address of the guest to start from
867#
868# @size: the size of memory region to save
869#
870# @filename: the file to save the memory to as binary data
871#
872# Since: 0.14
873#
874# .. caution:: Errors were not reliably returned until 1.1.
875#
876# .. qmp-example::
877#
878#     -> { "execute": "pmemsave",
879#          "arguments": { "val": 10,
880#                         "size": 100,
881#                         "filename": "/tmp/physical-mem-dump" } }
882#     <- { "return": {} }
883##
884{ 'command': 'pmemsave',
885  'data': {
886    'val': 'uint64',
887    'size': 'size',
888    'filename': 'str' } }
889
890##
891# @Memdev:
892#
893# Information about memory backend
894#
895# @id: backend's ID if backend has 'id' property (since 2.9)
896#
897# @size: memory backend size
898#
899# @merge: whether memory merge support is enabled
900#
901# @dump: whether memory backend's memory is included in a core dump
902#
903# @prealloc: whether memory was preallocated
904#
905# @share: whether memory is private to QEMU or shared (since 6.1)
906#
907# @reserve: whether swap space (or huge pages) was reserved if
908#     applicable.  This corresponds to the user configuration and not
909#     the actual behavior implemented in the OS to perform the
910#     reservation.  For example, Linux will never reserve swap space
911#     for shared file mappings.  (since 6.1)
912#
913# @host-nodes: host nodes for its memory policy
914#
915# @policy: memory policy of memory backend
916#
917# Since: 2.1
918##
919{ 'struct': 'Memdev',
920  'data': {
921    '*id':        'str',
922    'size':       'size',
923    'merge':      'bool',
924    'dump':       'bool',
925    'prealloc':   'bool',
926    'share':      'bool',
927    '*reserve':    'bool',
928    'host-nodes': ['uint16'],
929    'policy':     'HostMemPolicy' }}
930
931##
932# @query-memdev:
933#
934# Returns information for all memory backends.
935#
936# Returns: a list of @Memdev.
937#
938# Since: 2.1
939#
940# .. qmp-example::
941#
942#     -> { "execute": "query-memdev" }
943#     <- { "return": [
944#            {
945#              "id": "mem1",
946#              "size": 536870912,
947#              "merge": false,
948#              "dump": true,
949#              "prealloc": false,
950#              "share": false,
951#              "host-nodes": [0, 1],
952#              "policy": "bind"
953#            },
954#            {
955#              "size": 536870912,
956#              "merge": false,
957#              "dump": true,
958#              "prealloc": true,
959#              "share": false,
960#              "host-nodes": [2, 3],
961#              "policy": "preferred"
962#            }
963#          ]
964#        }
965##
966{ 'command': 'query-memdev', 'returns': ['Memdev'], 'allow-preconfig': true }
967
968##
969# @CpuInstanceProperties:
970#
971# Properties identifying a CPU.
972#
973# Which members are optional and which mandatory depends on the
974# architecture and board.
975#
976# For s390x see :ref:`cpu-topology-s390x`.
977#
978# The ids other than the node-id specify the position of the CPU
979# within the CPU topology (as defined by the machine property "smp",
980# thus see also type @SMPConfiguration)
981#
982# @node-id: NUMA node ID the CPU belongs to
983#
984# @drawer-id: drawer number within CPU topology the CPU belongs to
985#     (since 8.2)
986#
987# @book-id: book number within parent container the CPU belongs to
988#     (since 8.2)
989#
990# @socket-id: socket number within parent container the CPU belongs to
991#
992# @die-id: die number within the parent container the CPU belongs to
993#     (since 4.1)
994#
995# @cluster-id: cluster number within the parent container the CPU
996#     belongs to (since 7.1)
997#
998# @module-id: module number within the parent container the CPU
999#    belongs to (since 9.1)
1000#
1001# @core-id: core number within the parent container the CPU belongs to
1002#
1003# @thread-id: thread number within the core the CPU  belongs to
1004#
1005# Since: 2.7
1006##
1007{ 'struct': 'CpuInstanceProperties',
1008  # Keep these in sync with the properties device_add accepts
1009  'data': { '*node-id': 'int',
1010            '*drawer-id': 'int',
1011            '*book-id': 'int',
1012            '*socket-id': 'int',
1013            '*die-id': 'int',
1014            '*cluster-id': 'int',
1015            '*module-id': 'int',
1016            '*core-id': 'int',
1017            '*thread-id': 'int'
1018  }
1019}
1020
1021##
1022# @HotpluggableCPU:
1023#
1024# @type: CPU object type for usage with device_add command
1025#
1026# @props: list of properties to pass for hotplugging a CPU with
1027#     device_add
1028#
1029# @vcpus-count: number of logical VCPU threads @HotpluggableCPU
1030#     provides
1031#
1032# @qom-path: link to existing CPU object if CPU is present or omitted
1033#     if CPU is not present.
1034#
1035# .. note:: Management should be prepared to pass through additional
1036#    properties with device_add.
1037#
1038# Since: 2.7
1039##
1040{ 'struct': 'HotpluggableCPU',
1041  'data': { 'type': 'str',
1042            'vcpus-count': 'int',
1043            'props': 'CpuInstanceProperties',
1044            '*qom-path': 'str'
1045          }
1046}
1047
1048##
1049# @query-hotpluggable-cpus:
1050#
1051# TODO: Better documentation; currently there is none.
1052#
1053# Returns: a list of HotpluggableCPU objects.
1054#
1055# Since: 2.7
1056#
1057# .. qmp-example::
1058#    :annotated:
1059#
1060#    For pseries machine type started with
1061#    ``-smp 2,cores=2,maxcpus=4 -cpu POWER8``::
1062#
1063#     -> { "execute": "query-hotpluggable-cpus" }
1064#     <- {"return": [
1065#          { "props": { "core-id": 8 }, "type": "POWER8-spapr-cpu-core",
1066#            "vcpus-count": 1 },
1067#          { "props": { "core-id": 0 }, "type": "POWER8-spapr-cpu-core",
1068#            "vcpus-count": 1, "qom-path": "/machine/unattached/device[0]"}
1069#        ]}
1070#
1071# .. qmp-example::
1072#    :annotated:
1073#
1074#    For pc machine type started with ``-smp 1,maxcpus=2``::
1075#
1076#     -> { "execute": "query-hotpluggable-cpus" }
1077#     <- {"return": [
1078#          {
1079#             "type": "qemu64-x86_64-cpu", "vcpus-count": 1,
1080#             "props": {"core-id": 0, "socket-id": 1, "thread-id": 0}
1081#          },
1082#          {
1083#             "qom-path": "/machine/unattached/device[0]",
1084#             "type": "qemu64-x86_64-cpu", "vcpus-count": 1,
1085#             "props": {"core-id": 0, "socket-id": 0, "thread-id": 0}
1086#          }
1087#        ]}
1088#
1089# .. qmp-example::
1090#    :annotated:
1091#
1092#    For s390x-virtio-ccw machine type started with
1093#    ``-smp 1,maxcpus=2 -cpu qemu`` (Since: 2.11)::
1094#
1095#     -> { "execute": "query-hotpluggable-cpus" }
1096#     <- {"return": [
1097#          {
1098#             "type": "qemu-s390x-cpu", "vcpus-count": 1,
1099#             "props": { "core-id": 1 }
1100#          },
1101#          {
1102#             "qom-path": "/machine/unattached/device[0]",
1103#             "type": "qemu-s390x-cpu", "vcpus-count": 1,
1104#             "props": { "core-id": 0 }
1105#          }
1106#        ]}
1107##
1108{ 'command': 'query-hotpluggable-cpus', 'returns': ['HotpluggableCPU'],
1109             'allow-preconfig': true }
1110
1111##
1112# @set-numa-node:
1113#
1114# Runtime equivalent of '-numa' CLI option, available at preconfigure
1115# stage to configure numa mapping before initializing machine.
1116#
1117# Since: 3.0
1118##
1119{ 'command': 'set-numa-node', 'boxed': true,
1120  'data': 'NumaOptions',
1121  'allow-preconfig': true
1122}
1123
1124##
1125# @balloon:
1126#
1127# Request the balloon driver to change its balloon size.
1128#
1129# @value: the target logical size of the VM in bytes.  We can deduce
1130#     the size of the balloon using this formula:
1131#
1132#        logical_vm_size = vm_ram_size - balloon_size
1133#
1134#     From it we have: balloon_size = vm_ram_size - @value
1135#
1136# Errors:
1137#     - If the balloon driver is enabled but not functional because
1138#       the KVM kernel module cannot support it, KVMMissingCap
1139#     - If no balloon device is present, DeviceNotActive
1140#
1141# .. note:: This command just issues a request to the guest.  When it
1142#    returns, the balloon size may not have changed.  A guest can
1143#    change the balloon size independent of this command.
1144#
1145# Since: 0.14
1146#
1147# .. qmp-example::
1148#    :annotated:
1149#
1150#    ::
1151#
1152#      -> { "execute": "balloon", "arguments": { "value": 536870912 } }
1153#      <- { "return": {} }
1154#
1155#    With a 2.5GiB guest this command inflated the ballon to 3GiB.
1156##
1157{ 'command': 'balloon', 'data': {'value': 'int'} }
1158
1159##
1160# @BalloonInfo:
1161#
1162# Information about the guest balloon device.
1163#
1164# @actual: the logical size of the VM in bytes Formula used:
1165#     logical_vm_size = vm_ram_size - balloon_size
1166#
1167# Since: 0.14
1168##
1169{ 'struct': 'BalloonInfo', 'data': {'actual': 'int' } }
1170
1171##
1172# @query-balloon:
1173#
1174# Return information about the balloon device.
1175#
1176# Returns:
1177#     @BalloonInfo
1178#
1179# Errors:
1180#     - If the balloon driver is enabled but not functional because
1181#       the KVM kernel module cannot support it, KVMMissingCap
1182#     - If no balloon device is present, DeviceNotActive
1183#
1184# Since: 0.14
1185#
1186# .. qmp-example::
1187#
1188#     -> { "execute": "query-balloon" }
1189#     <- { "return": {
1190#              "actual": 1073741824
1191#           }
1192#        }
1193##
1194{ 'command': 'query-balloon', 'returns': 'BalloonInfo' }
1195
1196##
1197# @BALLOON_CHANGE:
1198#
1199# Emitted when the guest changes the actual BALLOON level.  This value
1200# is equivalent to the @actual field return by the 'query-balloon'
1201# command
1202#
1203# @actual: the logical size of the VM in bytes Formula used:
1204#     logical_vm_size = vm_ram_size - balloon_size
1205#
1206# .. note:: This event is rate-limited.
1207#
1208# Since: 1.2
1209#
1210# .. qmp-example::
1211#
1212#     <- { "event": "BALLOON_CHANGE",
1213#          "data": { "actual": 944766976 },
1214#          "timestamp": { "seconds": 1267020223, "microseconds": 435656 } }
1215##
1216{ 'event': 'BALLOON_CHANGE',
1217  'data': { 'actual': 'int' } }
1218
1219##
1220# @HvBalloonInfo:
1221#
1222# hv-balloon guest-provided memory status information.
1223#
1224# @committed: the amount of memory in use inside the guest plus the
1225#     amount of the memory unusable inside the guest (ballooned out,
1226#     offline, etc.)
1227#
1228# @available: the amount of the memory inside the guest available for
1229#     new allocations ("free")
1230#
1231# Since: 8.2
1232##
1233{ 'struct': 'HvBalloonInfo',
1234  'data': { 'committed': 'size', 'available': 'size' } }
1235
1236##
1237# @query-hv-balloon-status-report:
1238#
1239# Returns the hv-balloon driver data contained in the last received
1240# "STATUS" message from the guest.
1241#
1242# Returns:
1243#     @HvBalloonInfo
1244#
1245# Errors:
1246#     - If no hv-balloon device is present, guest memory status
1247#       reporting is not enabled or no guest memory status report
1248#       received yet, GenericError
1249#
1250# Since: 8.2
1251#
1252# .. qmp-example::
1253#
1254#     -> { "execute": "query-hv-balloon-status-report" }
1255#     <- { "return": {
1256#              "committed": 816640000,
1257#              "available": 3333054464
1258#           }
1259#        }
1260##
1261{ 'command': 'query-hv-balloon-status-report', 'returns': 'HvBalloonInfo' }
1262
1263##
1264# @HV_BALLOON_STATUS_REPORT:
1265#
1266# Emitted when the hv-balloon driver receives a "STATUS" message from
1267# the guest.
1268#
1269# .. note:: This event is rate-limited.
1270#
1271# Since: 8.2
1272#
1273# .. qmp-example::
1274#
1275#     <- { "event": "HV_BALLOON_STATUS_REPORT",
1276#          "data": { "committed": 816640000, "available": 3333054464 },
1277#          "timestamp": { "seconds": 1600295492, "microseconds": 661044 } }
1278##
1279{ 'event': 'HV_BALLOON_STATUS_REPORT',
1280  'data': 'HvBalloonInfo' }
1281
1282##
1283# @MemoryInfo:
1284#
1285# Actual memory information in bytes.
1286#
1287# @base-memory: size of "base" memory specified with command line
1288#     option -m.
1289#
1290# @plugged-memory: size of memory that can be hot-unplugged.  This
1291#     field is omitted if target doesn't support memory hotplug (i.e.
1292#     CONFIG_MEM_DEVICE not defined at build time).
1293#
1294# Since: 2.11
1295##
1296{ 'struct': 'MemoryInfo',
1297  'data'  : { 'base-memory': 'size', '*plugged-memory': 'size' } }
1298
1299##
1300# @query-memory-size-summary:
1301#
1302# Return the amount of initially allocated and present hotpluggable
1303# (if enabled) memory in bytes.
1304#
1305# .. qmp-example::
1306#
1307#     -> { "execute": "query-memory-size-summary" }
1308#     <- { "return": { "base-memory": 4294967296, "plugged-memory": 0 } }
1309#
1310# Since: 2.11
1311##
1312{ 'command': 'query-memory-size-summary', 'returns': 'MemoryInfo' }
1313
1314##
1315# @PCDIMMDeviceInfo:
1316#
1317# PCDIMMDevice state information
1318#
1319# @id: device's ID
1320#
1321# @addr: physical address, where device is mapped
1322#
1323# @size: size of memory that the device provides
1324#
1325# @slot: slot number at which device is plugged in
1326#
1327# @node: NUMA node number where device is plugged in
1328#
1329# @memdev: memory backend linked with device
1330#
1331# @hotplugged: true if device was hotplugged
1332#
1333# @hotpluggable: true if device if could be added/removed while
1334#     machine is running
1335#
1336# Since: 2.1
1337##
1338{ 'struct': 'PCDIMMDeviceInfo',
1339  'data': { '*id': 'str',
1340            'addr': 'int',
1341            'size': 'int',
1342            'slot': 'int',
1343            'node': 'int',
1344            'memdev': 'str',
1345            'hotplugged': 'bool',
1346            'hotpluggable': 'bool'
1347          }
1348}
1349
1350##
1351# @VirtioPMEMDeviceInfo:
1352#
1353# VirtioPMEM state information
1354#
1355# @id: device's ID
1356#
1357# @memaddr: physical address in memory, where device is mapped
1358#
1359# @size: size of memory that the device provides
1360#
1361# @memdev: memory backend linked with device
1362#
1363# Since: 4.1
1364##
1365{ 'struct': 'VirtioPMEMDeviceInfo',
1366  'data': { '*id': 'str',
1367            'memaddr': 'size',
1368            'size': 'size',
1369            'memdev': 'str'
1370          }
1371}
1372
1373##
1374# @VirtioMEMDeviceInfo:
1375#
1376# VirtioMEMDevice state information
1377#
1378# @id: device's ID
1379#
1380# @memaddr: physical address in memory, where device is mapped
1381#
1382# @requested-size: the user requested size of the device
1383#
1384# @size: the (current) size of memory that the device provides
1385#
1386# @max-size: the maximum size of memory that the device can provide
1387#
1388# @block-size: the block size of memory that the device provides
1389#
1390# @node: NUMA node number where device is assigned to
1391#
1392# @memdev: memory backend linked with the region
1393#
1394# Since: 5.1
1395##
1396{ 'struct': 'VirtioMEMDeviceInfo',
1397  'data': { '*id': 'str',
1398            'memaddr': 'size',
1399            'requested-size': 'size',
1400            'size': 'size',
1401            'max-size': 'size',
1402            'block-size': 'size',
1403            'node': 'int',
1404            'memdev': 'str'
1405          }
1406}
1407
1408##
1409# @SgxEPCDeviceInfo:
1410#
1411# Sgx EPC state information
1412#
1413# @id: device's ID
1414#
1415# @memaddr: physical address in memory, where device is mapped
1416#
1417# @size: size of memory that the device provides
1418#
1419# @memdev: memory backend linked with device
1420#
1421# @node: the numa node (Since: 7.0)
1422#
1423# Since: 6.2
1424##
1425{ 'struct': 'SgxEPCDeviceInfo',
1426  'data': { '*id': 'str',
1427            'memaddr': 'size',
1428            'size': 'size',
1429            'node': 'int',
1430            'memdev': 'str'
1431          }
1432}
1433
1434##
1435# @HvBalloonDeviceInfo:
1436#
1437# hv-balloon provided memory state information
1438#
1439# @id: device's ID
1440#
1441# @memaddr: physical address in memory, where device is mapped
1442#
1443# @max-size: the maximum size of memory that the device can provide
1444#
1445# @memdev: memory backend linked with device
1446#
1447# Since: 8.2
1448##
1449{ 'struct': 'HvBalloonDeviceInfo',
1450  'data': { '*id': 'str',
1451            '*memaddr': 'size',
1452            'max-size': 'size',
1453            '*memdev': 'str'
1454          }
1455}
1456
1457##
1458# @MemoryDeviceInfoKind:
1459#
1460# @nvdimm: since 2.12
1461#
1462# @virtio-pmem: since 4.1
1463#
1464# @virtio-mem: since 5.1
1465#
1466# @sgx-epc: since 6.2.
1467#
1468# @hv-balloon: since 8.2.
1469#
1470# Since: 2.1
1471##
1472{ 'enum': 'MemoryDeviceInfoKind',
1473  'data': [ 'dimm', 'nvdimm', 'virtio-pmem', 'virtio-mem', 'sgx-epc',
1474            'hv-balloon' ] }
1475
1476##
1477# @PCDIMMDeviceInfoWrapper:
1478#
1479# @data: PCDIMMDevice state information
1480#
1481# Since: 2.1
1482##
1483{ 'struct': 'PCDIMMDeviceInfoWrapper',
1484  'data': { 'data': 'PCDIMMDeviceInfo' } }
1485
1486##
1487# @VirtioPMEMDeviceInfoWrapper:
1488#
1489# @data: VirtioPMEM state information
1490#
1491# Since: 2.1
1492##
1493{ 'struct': 'VirtioPMEMDeviceInfoWrapper',
1494  'data': { 'data': 'VirtioPMEMDeviceInfo' } }
1495
1496##
1497# @VirtioMEMDeviceInfoWrapper:
1498#
1499# @data: VirtioMEMDevice state information
1500#
1501# Since: 2.1
1502##
1503{ 'struct': 'VirtioMEMDeviceInfoWrapper',
1504  'data': { 'data': 'VirtioMEMDeviceInfo' } }
1505
1506##
1507# @SgxEPCDeviceInfoWrapper:
1508#
1509# @data: Sgx EPC state information
1510#
1511# Since: 6.2
1512##
1513{ 'struct': 'SgxEPCDeviceInfoWrapper',
1514  'data': { 'data': 'SgxEPCDeviceInfo' } }
1515
1516##
1517# @HvBalloonDeviceInfoWrapper:
1518#
1519# @data: hv-balloon provided memory state information
1520#
1521# Since: 8.2
1522##
1523{ 'struct': 'HvBalloonDeviceInfoWrapper',
1524  'data': { 'data': 'HvBalloonDeviceInfo' } }
1525
1526##
1527# @MemoryDeviceInfo:
1528#
1529# Union containing information about a memory device
1530#
1531# @type: memory device type
1532#
1533# Since: 2.1
1534##
1535{ 'union': 'MemoryDeviceInfo',
1536  'base': { 'type': 'MemoryDeviceInfoKind' },
1537  'discriminator': 'type',
1538  'data': { 'dimm': 'PCDIMMDeviceInfoWrapper',
1539            'nvdimm': 'PCDIMMDeviceInfoWrapper',
1540            'virtio-pmem': 'VirtioPMEMDeviceInfoWrapper',
1541            'virtio-mem': 'VirtioMEMDeviceInfoWrapper',
1542            'sgx-epc': 'SgxEPCDeviceInfoWrapper',
1543            'hv-balloon': 'HvBalloonDeviceInfoWrapper'
1544          }
1545}
1546
1547##
1548# @SgxEPC:
1549#
1550# Sgx EPC cmdline information
1551#
1552# @memdev: memory backend linked with device
1553#
1554# @node: the numa node (Since: 7.0)
1555#
1556# Since: 6.2
1557##
1558{ 'struct': 'SgxEPC',
1559  'data': { 'memdev': 'str',
1560            'node': 'int'
1561          }
1562}
1563
1564##
1565# @SgxEPCProperties:
1566#
1567# SGX properties of machine types.
1568#
1569# @sgx-epc: list of ids of memory-backend-epc objects.
1570#
1571# Since: 6.2
1572##
1573{ 'struct': 'SgxEPCProperties',
1574  'data': { 'sgx-epc': ['SgxEPC'] }
1575}
1576
1577##
1578# @query-memory-devices:
1579#
1580# Lists available memory devices and their state
1581#
1582# Since: 2.1
1583#
1584# .. qmp-example::
1585#
1586#     -> { "execute": "query-memory-devices" }
1587#     <- { "return": [ { "data":
1588#                           { "addr": 5368709120,
1589#                             "hotpluggable": true,
1590#                             "hotplugged": true,
1591#                             "id": "d1",
1592#                             "memdev": "/objects/memX",
1593#                             "node": 0,
1594#                             "size": 1073741824,
1595#                             "slot": 0},
1596#                        "type": "dimm"
1597#                      } ] }
1598##
1599{ 'command': 'query-memory-devices', 'returns': ['MemoryDeviceInfo'] }
1600
1601##
1602# @MEMORY_DEVICE_SIZE_CHANGE:
1603#
1604# Emitted when the size of a memory device changes.  Only emitted for
1605# memory devices that can actually change the size (e.g., virtio-mem
1606# due to guest action).
1607#
1608# @id: device's ID
1609#
1610# @size: the new size of memory that the device provides
1611#
1612# @qom-path: path to the device object in the QOM tree (since 6.2)
1613#
1614# .. note:: This event is rate-limited.
1615#
1616# Since: 5.1
1617#
1618# .. qmp-example::
1619#
1620#     <- { "event": "MEMORY_DEVICE_SIZE_CHANGE",
1621#          "data": { "id": "vm0", "size": 1073741824,
1622#                    "qom-path": "/machine/unattached/device[2]" },
1623#          "timestamp": { "seconds": 1588168529, "microseconds": 201316 } }
1624##
1625{ 'event': 'MEMORY_DEVICE_SIZE_CHANGE',
1626  'data': { '*id': 'str', 'size': 'size', 'qom-path' : 'str'} }
1627
1628##
1629# @BootConfiguration:
1630#
1631# Schema for virtual machine boot configuration.
1632#
1633# @order: Boot order (a=floppy, c=hard disk, d=CD-ROM, n=network)
1634#
1635# @once: Boot order to apply on first boot
1636#
1637# @menu: Whether to show a boot menu
1638#
1639# @splash: The name of the file to be passed to the firmware as logo
1640#     picture, if @menu is true.
1641#
1642# @splash-time: How long to show the logo picture, in milliseconds
1643#
1644# @reboot-timeout: Timeout before guest reboots after boot fails
1645#
1646# @strict: Whether to attempt booting from devices not included in the
1647#     boot order
1648#
1649# Since: 7.1
1650##
1651{ 'struct': 'BootConfiguration', 'data': {
1652     '*order': 'str',
1653     '*once': 'str',
1654     '*menu': 'bool',
1655     '*splash': 'str',
1656     '*splash-time': 'int',
1657     '*reboot-timeout': 'int',
1658     '*strict': 'bool' } }
1659
1660##
1661# @SMPConfiguration:
1662#
1663# Schema for CPU topology configuration.  A missing value lets QEMU
1664# figure out a suitable value based on the ones that are provided.
1665#
1666# The members other than @cpus and @maxcpus define a topology of
1667# containers.
1668#
1669# The ordering from highest/coarsest to lowest/finest is: @drawers,
1670# @books, @sockets, @dies, @clusters, @cores, @threads.
1671#
1672# Different architectures support different subsets of topology
1673# containers.
1674#
1675# For example, s390x does not have clusters and dies, and the socket
1676# is the parent container of cores.
1677#
1678# @cpus: number of virtual CPUs in the virtual machine
1679#
1680# @maxcpus: maximum number of hotpluggable virtual CPUs in the virtual
1681#     machine
1682#
1683# @drawers: number of drawers in the CPU topology (since 8.2)
1684#
1685# @books: number of books in the CPU topology (since 8.2)
1686#
1687# @sockets: number of sockets per parent container
1688#
1689# @dies: number of dies per parent container
1690#
1691# @clusters: number of clusters per parent container (since 7.0)
1692#
1693# @modules: number of modules per parent container (since 9.1)
1694#
1695# @cores: number of cores per parent container
1696#
1697# @threads: number of threads per core
1698#
1699# Since: 6.1
1700##
1701{ 'struct': 'SMPConfiguration', 'data': {
1702     '*cpus': 'int',
1703     '*drawers': 'int',
1704     '*books': 'int',
1705     '*sockets': 'int',
1706     '*dies': 'int',
1707     '*clusters': 'int',
1708     '*modules': 'int',
1709     '*cores': 'int',
1710     '*threads': 'int',
1711     '*maxcpus': 'int' } }
1712
1713##
1714# @x-query-irq:
1715#
1716# Query interrupt statistics
1717#
1718# Features:
1719#
1720# @unstable: This command is meant for debugging.
1721#
1722# Returns: interrupt statistics
1723#
1724# Since: 6.2
1725##
1726{ 'command': 'x-query-irq',
1727  'returns': 'HumanReadableText',
1728  'features': [ 'unstable' ] }
1729
1730##
1731# @x-query-jit:
1732#
1733# Query TCG compiler statistics
1734#
1735# Features:
1736#
1737# @unstable: This command is meant for debugging.
1738#
1739# Returns: TCG compiler statistics
1740#
1741# Since: 6.2
1742##
1743{ 'command': 'x-query-jit',
1744  'returns': 'HumanReadableText',
1745  'if': 'CONFIG_TCG',
1746  'features': [ 'unstable' ] }
1747
1748##
1749# @x-query-numa:
1750#
1751# Query NUMA topology information
1752#
1753# Features:
1754#
1755# @unstable: This command is meant for debugging.
1756#
1757# Returns: topology information
1758#
1759# Since: 6.2
1760##
1761{ 'command': 'x-query-numa',
1762  'returns': 'HumanReadableText',
1763  'features': [ 'unstable' ] }
1764
1765##
1766# @x-query-opcount:
1767#
1768# Query TCG opcode counters
1769#
1770# Features:
1771#
1772# @unstable: This command is meant for debugging.
1773#
1774# Returns: TCG opcode counters
1775#
1776# Since: 6.2
1777##
1778{ 'command': 'x-query-opcount',
1779  'returns': 'HumanReadableText',
1780  'if': 'CONFIG_TCG',
1781  'features': [ 'unstable' ] }
1782
1783##
1784# @x-query-ramblock:
1785#
1786# Query system ramblock information
1787#
1788# Features:
1789#
1790# @unstable: This command is meant for debugging.
1791#
1792# Returns: system ramblock information
1793#
1794# Since: 6.2
1795##
1796{ 'command': 'x-query-ramblock',
1797  'returns': 'HumanReadableText',
1798  'features': [ 'unstable' ] }
1799
1800##
1801# @x-query-roms:
1802#
1803# Query information on the registered ROMS
1804#
1805# Features:
1806#
1807# @unstable: This command is meant for debugging.
1808#
1809# Returns: registered ROMs
1810#
1811# Since: 6.2
1812##
1813{ 'command': 'x-query-roms',
1814  'returns': 'HumanReadableText',
1815  'features': [ 'unstable' ] }
1816
1817##
1818# @x-query-usb:
1819#
1820# Query information on the USB devices
1821#
1822# Features:
1823#
1824# @unstable: This command is meant for debugging.
1825#
1826# Returns: USB device information
1827#
1828# Since: 6.2
1829##
1830{ 'command': 'x-query-usb',
1831  'returns': 'HumanReadableText',
1832  'features': [ 'unstable' ] }
1833
1834##
1835# @SmbiosEntryPointType:
1836#
1837# @32: SMBIOS version 2.1 (32-bit) Entry Point
1838#
1839# @64: SMBIOS version 3.0 (64-bit) Entry Point
1840#
1841# @auto: Either 2.x or 3.x SMBIOS version, 2.x if configuration can be
1842#     described by it and 3.x otherwise (since: 9.0)
1843#
1844# Since: 7.0
1845##
1846{ 'enum': 'SmbiosEntryPointType',
1847  'data': [ '32', '64', 'auto' ] }
1848
1849##
1850# @MemorySizeConfiguration:
1851#
1852# Schema for memory size configuration.
1853#
1854# @size: memory size in bytes
1855#
1856# @max-size: maximum hotpluggable memory size in bytes
1857#
1858# @slots: number of available memory slots for hotplug
1859#
1860# Since: 7.1
1861##
1862{ 'struct': 'MemorySizeConfiguration', 'data': {
1863     '*size': 'size',
1864     '*max-size': 'size',
1865     '*slots': 'uint64' } }
1866
1867##
1868# @dumpdtb:
1869#
1870# Save the FDT in dtb format.
1871#
1872# @filename: name of the dtb file to be created
1873#
1874# Since: 7.2
1875#
1876# .. qmp-example::
1877#
1878#     -> { "execute": "dumpdtb" }
1879#          "arguments": { "filename": "fdt.dtb" } }
1880#     <- { "return": {} }
1881##
1882{ 'command': 'dumpdtb',
1883  'data': { 'filename': 'str' },
1884  'if': 'CONFIG_FDT' }
1885
1886##
1887# @x-query-interrupt-controllers:
1888#
1889# Query information on interrupt controller devices
1890#
1891# Features:
1892#
1893# @unstable: This command is meant for debugging.
1894#
1895# Returns: Interrupt controller devices information
1896#
1897# Since: 9.1
1898##
1899{ 'command': 'x-query-interrupt-controllers',
1900  'returns': 'HumanReadableText',
1901  'features': [ 'unstable' ]}
1902