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