xref: /openbmc/qemu/qapi/machine.json (revision bc2e34e3)
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 executable
31#    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 this
375#    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': {'val': 'int', 'size': 'int', 'filename': 'str', '*cpu-index': 'int'} }
856
857##
858# @pmemsave:
859#
860# Save a portion of guest physical memory to a file.
861#
862# @val: the physical address of the guest to start from
863#
864# @size: the size of memory region to save
865#
866# @filename: the file to save the memory to as binary data
867#
868# Since: 0.14
869#
870# .. caution:: Errors were not reliably returned until 1.1.
871#
872# .. qmp-example::
873#
874#     -> { "execute": "pmemsave",
875#          "arguments": { "val": 10,
876#                         "size": 100,
877#                         "filename": "/tmp/physical-mem-dump" } }
878#     <- { "return": {} }
879##
880{ 'command': 'pmemsave',
881  'data': {'val': 'int', 'size': 'int', 'filename': 'str'} }
882
883##
884# @Memdev:
885#
886# Information about memory backend
887#
888# @id: backend's ID if backend has 'id' property (since 2.9)
889#
890# @size: memory backend size
891#
892# @merge: whether memory merge support is enabled
893#
894# @dump: whether memory backend's memory is included in a core dump
895#
896# @prealloc: whether memory was preallocated
897#
898# @share: whether memory is private to QEMU or shared (since 6.1)
899#
900# @reserve: whether swap space (or huge pages) was reserved if
901#     applicable.  This corresponds to the user configuration and not
902#     the actual behavior implemented in the OS to perform the
903#     reservation.  For example, Linux will never reserve swap space
904#     for shared file mappings.  (since 6.1)
905#
906# @host-nodes: host nodes for its memory policy
907#
908# @policy: memory policy of memory backend
909#
910# Since: 2.1
911##
912{ 'struct': 'Memdev',
913  'data': {
914    '*id':        'str',
915    'size':       'size',
916    'merge':      'bool',
917    'dump':       'bool',
918    'prealloc':   'bool',
919    'share':      'bool',
920    '*reserve':    'bool',
921    'host-nodes': ['uint16'],
922    'policy':     'HostMemPolicy' }}
923
924##
925# @query-memdev:
926#
927# Returns information for all memory backends.
928#
929# Returns: a list of @Memdev.
930#
931# Since: 2.1
932#
933# .. qmp-example::
934#
935#     -> { "execute": "query-memdev" }
936#     <- { "return": [
937#            {
938#              "id": "mem1",
939#              "size": 536870912,
940#              "merge": false,
941#              "dump": true,
942#              "prealloc": false,
943#              "share": false,
944#              "host-nodes": [0, 1],
945#              "policy": "bind"
946#            },
947#            {
948#              "size": 536870912,
949#              "merge": false,
950#              "dump": true,
951#              "prealloc": true,
952#              "share": false,
953#              "host-nodes": [2, 3],
954#              "policy": "preferred"
955#            }
956#          ]
957#        }
958##
959{ 'command': 'query-memdev', 'returns': ['Memdev'], 'allow-preconfig': true }
960
961##
962# @CpuInstanceProperties:
963#
964# Properties identifying a CPU.
965#
966# Which members are optional and which mandatory depends on the
967# architecture and board.
968#
969# For s390x see :ref:`cpu-topology-s390x`.
970#
971# The ids other than the node-id specify the position of the CPU
972# within the CPU topology (as defined by the machine property "smp",
973# thus see also type @SMPConfiguration)
974#
975# @node-id: NUMA node ID the CPU belongs to
976#
977# @drawer-id: drawer number within CPU topology the CPU belongs to
978#     (since 8.2)
979#
980# @book-id: book number within parent container the CPU belongs to
981#     (since 8.2)
982#
983# @socket-id: socket number within parent container the CPU belongs to
984#
985# @die-id: die number within the parent container the CPU belongs to
986#     (since 4.1)
987#
988# @cluster-id: cluster number within the parent container the CPU
989#     belongs to (since 7.1)
990#
991# @module-id: module number within the parent container the CPU belongs
992#     to (since 9.1)
993#
994# @core-id: core number within the parent container the CPU belongs to
995#
996# @thread-id: thread number within the core the CPU  belongs to
997#
998# Since: 2.7
999##
1000{ 'struct': 'CpuInstanceProperties',
1001  # Keep these in sync with the properties device_add accepts
1002  'data': { '*node-id': 'int',
1003            '*drawer-id': 'int',
1004            '*book-id': 'int',
1005            '*socket-id': 'int',
1006            '*die-id': 'int',
1007            '*cluster-id': 'int',
1008            '*module-id': 'int',
1009            '*core-id': 'int',
1010            '*thread-id': 'int'
1011  }
1012}
1013
1014##
1015# @HotpluggableCPU:
1016#
1017# @type: CPU object type for usage with device_add command
1018#
1019# @props: list of properties to pass for hotplugging a CPU with
1020#     device_add
1021#
1022# @vcpus-count: number of logical VCPU threads @HotpluggableCPU
1023#     provides
1024#
1025# @qom-path: link to existing CPU object if CPU is present or omitted
1026#     if CPU is not present.
1027#
1028# .. note:: Management should be prepared to pass through additional
1029#    properties with device_add.
1030#
1031# Since: 2.7
1032##
1033{ 'struct': 'HotpluggableCPU',
1034  'data': { 'type': 'str',
1035            'vcpus-count': 'int',
1036            'props': 'CpuInstanceProperties',
1037            '*qom-path': 'str'
1038          }
1039}
1040
1041##
1042# @query-hotpluggable-cpus:
1043#
1044# TODO: Better documentation; currently there is none.
1045#
1046# Returns: a list of HotpluggableCPU objects.
1047#
1048# Since: 2.7
1049#
1050# .. qmp-example::
1051#    :annotated:
1052#
1053#    For pseries machine type started with
1054#    ``-smp 2,cores=2,maxcpus=4 -cpu POWER8``::
1055#
1056#     -> { "execute": "query-hotpluggable-cpus" }
1057#     <- {"return": [
1058#          { "props": { "core-id": 8 }, "type": "POWER8-spapr-cpu-core",
1059#            "vcpus-count": 1 },
1060#          { "props": { "core-id": 0 }, "type": "POWER8-spapr-cpu-core",
1061#            "vcpus-count": 1, "qom-path": "/machine/unattached/device[0]"}
1062#        ]}
1063#
1064# .. qmp-example::
1065#    :annotated:
1066#
1067#    For pc machine type started with ``-smp 1,maxcpus=2``::
1068#
1069#     -> { "execute": "query-hotpluggable-cpus" }
1070#     <- {"return": [
1071#          {
1072#             "type": "qemu64-x86_64-cpu", "vcpus-count": 1,
1073#             "props": {"core-id": 0, "socket-id": 1, "thread-id": 0}
1074#          },
1075#          {
1076#             "qom-path": "/machine/unattached/device[0]",
1077#             "type": "qemu64-x86_64-cpu", "vcpus-count": 1,
1078#             "props": {"core-id": 0, "socket-id": 0, "thread-id": 0}
1079#          }
1080#        ]}
1081#
1082# .. qmp-example::
1083#    :annotated:
1084#
1085#    For s390x-virtio-ccw machine type started with
1086#    ``-smp 1,maxcpus=2 -cpu qemu`` (Since: 2.11)::
1087#
1088#     -> { "execute": "query-hotpluggable-cpus" }
1089#     <- {"return": [
1090#          {
1091#             "type": "qemu-s390x-cpu", "vcpus-count": 1,
1092#             "props": { "core-id": 1 }
1093#          },
1094#          {
1095#             "qom-path": "/machine/unattached/device[0]",
1096#             "type": "qemu-s390x-cpu", "vcpus-count": 1,
1097#             "props": { "core-id": 0 }
1098#          }
1099#        ]}
1100##
1101{ 'command': 'query-hotpluggable-cpus', 'returns': ['HotpluggableCPU'],
1102             'allow-preconfig': true }
1103
1104##
1105# @set-numa-node:
1106#
1107# Runtime equivalent of '-numa' CLI option, available at preconfigure
1108# stage to configure numa mapping before initializing machine.
1109#
1110# Since: 3.0
1111##
1112{ 'command': 'set-numa-node', 'boxed': true,
1113  'data': 'NumaOptions',
1114  'allow-preconfig': true
1115}
1116
1117##
1118# @balloon:
1119#
1120# Request the balloon driver to change its balloon size.
1121#
1122# @value: the target logical size of the VM in bytes.  We can deduce
1123#     the size of the balloon using this formula:
1124#
1125#        logical_vm_size = vm_ram_size - balloon_size
1126#
1127#     From it we have: balloon_size = vm_ram_size - @value
1128#
1129# Errors:
1130#     - If the balloon driver is enabled but not functional because
1131#       the KVM kernel module cannot support it, KVMMissingCap
1132#     - If no balloon device is present, DeviceNotActive
1133#
1134# .. note:: This command just issues a request to the guest.  When it
1135#    returns, the balloon size may not have changed.  A guest can change
1136#    the balloon size independent of this command.
1137#
1138# Since: 0.14
1139#
1140# .. qmp-example::
1141#    :annotated:
1142#
1143#    ::
1144#
1145#      -> { "execute": "balloon", "arguments": { "value": 536870912 } }
1146#      <- { "return": {} }
1147#
1148#    With a 2.5GiB guest this command inflated the ballon to 3GiB.
1149##
1150{ 'command': 'balloon', 'data': {'value': 'int'} }
1151
1152##
1153# @BalloonInfo:
1154#
1155# Information about the guest balloon device.
1156#
1157# @actual: the logical size of the VM in bytes Formula used:
1158#     logical_vm_size = vm_ram_size - balloon_size
1159#
1160# Since: 0.14
1161##
1162{ 'struct': 'BalloonInfo', 'data': {'actual': 'int' } }
1163
1164##
1165# @query-balloon:
1166#
1167# Return information about the balloon device.
1168#
1169# Returns:
1170#     @BalloonInfo
1171#
1172# Errors:
1173#     - If the balloon driver is enabled but not functional because
1174#       the KVM kernel module cannot support it, KVMMissingCap
1175#     - If no balloon device is present, DeviceNotActive
1176#
1177# Since: 0.14
1178#
1179# .. qmp-example::
1180#
1181#     -> { "execute": "query-balloon" }
1182#     <- { "return": {
1183#              "actual": 1073741824
1184#           }
1185#        }
1186##
1187{ 'command': 'query-balloon', 'returns': 'BalloonInfo' }
1188
1189##
1190# @BALLOON_CHANGE:
1191#
1192# Emitted when the guest changes the actual BALLOON level.  This value
1193# is equivalent to the @actual field return by the 'query-balloon'
1194# command
1195#
1196# @actual: the logical size of the VM in bytes Formula used:
1197#     logical_vm_size = vm_ram_size - balloon_size
1198#
1199# .. note:: This event is rate-limited.
1200#
1201# Since: 1.2
1202#
1203# .. qmp-example::
1204#
1205#     <- { "event": "BALLOON_CHANGE",
1206#          "data": { "actual": 944766976 },
1207#          "timestamp": { "seconds": 1267020223, "microseconds": 435656 } }
1208##
1209{ 'event': 'BALLOON_CHANGE',
1210  'data': { 'actual': 'int' } }
1211
1212##
1213# @HvBalloonInfo:
1214#
1215# hv-balloon guest-provided memory status information.
1216#
1217# @committed: the amount of memory in use inside the guest plus the
1218#     amount of the memory unusable inside the guest (ballooned out,
1219#     offline, etc.)
1220#
1221# @available: the amount of the memory inside the guest available for
1222#     new allocations ("free")
1223#
1224# Since: 8.2
1225##
1226{ 'struct': 'HvBalloonInfo',
1227  'data': { 'committed': 'size', 'available': 'size' } }
1228
1229##
1230# @query-hv-balloon-status-report:
1231#
1232# Returns the hv-balloon driver data contained in the last received
1233# "STATUS" message from the guest.
1234#
1235# Returns:
1236#     @HvBalloonInfo
1237#
1238# Errors:
1239#     - If no hv-balloon device is present, guest memory status
1240#       reporting is not enabled or no guest memory status report
1241#       received yet, GenericError
1242#
1243# Since: 8.2
1244#
1245# .. qmp-example::
1246#
1247#     -> { "execute": "query-hv-balloon-status-report" }
1248#     <- { "return": {
1249#              "committed": 816640000,
1250#              "available": 3333054464
1251#           }
1252#        }
1253##
1254{ 'command': 'query-hv-balloon-status-report', 'returns': 'HvBalloonInfo' }
1255
1256##
1257# @HV_BALLOON_STATUS_REPORT:
1258#
1259# Emitted when the hv-balloon driver receives a "STATUS" message from
1260# the guest.
1261#
1262# .. note:: This event is rate-limited.
1263#
1264# Since: 8.2
1265#
1266# .. qmp-example::
1267#
1268#     <- { "event": "HV_BALLOON_STATUS_REPORT",
1269#          "data": { "committed": 816640000, "available": 3333054464 },
1270#          "timestamp": { "seconds": 1600295492, "microseconds": 661044 } }
1271##
1272{ 'event': 'HV_BALLOON_STATUS_REPORT',
1273  'data': 'HvBalloonInfo' }
1274
1275##
1276# @MemoryInfo:
1277#
1278# Actual memory information in bytes.
1279#
1280# @base-memory: size of "base" memory specified with command line
1281#     option -m.
1282#
1283# @plugged-memory: size of memory that can be hot-unplugged.  This
1284#     field is omitted if target doesn't support memory hotplug (i.e.
1285#     CONFIG_MEM_DEVICE not defined at build time).
1286#
1287# Since: 2.11
1288##
1289{ 'struct': 'MemoryInfo',
1290  'data'  : { 'base-memory': 'size', '*plugged-memory': 'size' } }
1291
1292##
1293# @query-memory-size-summary:
1294#
1295# Return the amount of initially allocated and present hotpluggable
1296# (if enabled) memory in bytes.
1297#
1298# .. qmp-example::
1299#
1300#     -> { "execute": "query-memory-size-summary" }
1301#     <- { "return": { "base-memory": 4294967296, "plugged-memory": 0 } }
1302#
1303# Since: 2.11
1304##
1305{ 'command': 'query-memory-size-summary', 'returns': 'MemoryInfo' }
1306
1307##
1308# @PCDIMMDeviceInfo:
1309#
1310# PCDIMMDevice state information
1311#
1312# @id: device's ID
1313#
1314# @addr: physical address, where device is mapped
1315#
1316# @size: size of memory that the device provides
1317#
1318# @slot: slot number at which device is plugged in
1319#
1320# @node: NUMA node number where device is plugged in
1321#
1322# @memdev: memory backend linked with device
1323#
1324# @hotplugged: true if device was hotplugged
1325#
1326# @hotpluggable: true if device if could be added/removed while
1327#     machine is running
1328#
1329# Since: 2.1
1330##
1331{ 'struct': 'PCDIMMDeviceInfo',
1332  'data': { '*id': 'str',
1333            'addr': 'int',
1334            'size': 'int',
1335            'slot': 'int',
1336            'node': 'int',
1337            'memdev': 'str',
1338            'hotplugged': 'bool',
1339            'hotpluggable': 'bool'
1340          }
1341}
1342
1343##
1344# @VirtioPMEMDeviceInfo:
1345#
1346# VirtioPMEM state information
1347#
1348# @id: device's ID
1349#
1350# @memaddr: physical address in memory, where device is mapped
1351#
1352# @size: size of memory that the device provides
1353#
1354# @memdev: memory backend linked with device
1355#
1356# Since: 4.1
1357##
1358{ 'struct': 'VirtioPMEMDeviceInfo',
1359  'data': { '*id': 'str',
1360            'memaddr': 'size',
1361            'size': 'size',
1362            'memdev': 'str'
1363          }
1364}
1365
1366##
1367# @VirtioMEMDeviceInfo:
1368#
1369# VirtioMEMDevice state information
1370#
1371# @id: device's ID
1372#
1373# @memaddr: physical address in memory, where device is mapped
1374#
1375# @requested-size: the user requested size of the device
1376#
1377# @size: the (current) size of memory that the device provides
1378#
1379# @max-size: the maximum size of memory that the device can provide
1380#
1381# @block-size: the block size of memory that the device provides
1382#
1383# @node: NUMA node number where device is assigned to
1384#
1385# @memdev: memory backend linked with the region
1386#
1387# Since: 5.1
1388##
1389{ 'struct': 'VirtioMEMDeviceInfo',
1390  'data': { '*id': 'str',
1391            'memaddr': 'size',
1392            'requested-size': 'size',
1393            'size': 'size',
1394            'max-size': 'size',
1395            'block-size': 'size',
1396            'node': 'int',
1397            'memdev': 'str'
1398          }
1399}
1400
1401##
1402# @SgxEPCDeviceInfo:
1403#
1404# Sgx EPC state information
1405#
1406# @id: device's ID
1407#
1408# @memaddr: physical address in memory, where device is mapped
1409#
1410# @size: size of memory that the device provides
1411#
1412# @memdev: memory backend linked with device
1413#
1414# @node: the numa node (Since: 7.0)
1415#
1416# Since: 6.2
1417##
1418{ 'struct': 'SgxEPCDeviceInfo',
1419  'data': { '*id': 'str',
1420            'memaddr': 'size',
1421            'size': 'size',
1422            'node': 'int',
1423            'memdev': 'str'
1424          }
1425}
1426
1427##
1428# @HvBalloonDeviceInfo:
1429#
1430# hv-balloon provided memory state information
1431#
1432# @id: device's ID
1433#
1434# @memaddr: physical address in memory, where device is mapped
1435#
1436# @max-size: the maximum size of memory that the device can provide
1437#
1438# @memdev: memory backend linked with device
1439#
1440# Since: 8.2
1441##
1442{ 'struct': 'HvBalloonDeviceInfo',
1443  'data': { '*id': 'str',
1444            '*memaddr': 'size',
1445            'max-size': 'size',
1446            '*memdev': 'str'
1447          }
1448}
1449
1450##
1451# @MemoryDeviceInfoKind:
1452#
1453# @nvdimm: since 2.12
1454#
1455# @virtio-pmem: since 4.1
1456#
1457# @virtio-mem: since 5.1
1458#
1459# @sgx-epc: since 6.2.
1460#
1461# @hv-balloon: since 8.2.
1462#
1463# Since: 2.1
1464##
1465{ 'enum': 'MemoryDeviceInfoKind',
1466  'data': [ 'dimm', 'nvdimm', 'virtio-pmem', 'virtio-mem', 'sgx-epc',
1467            'hv-balloon' ] }
1468
1469##
1470# @PCDIMMDeviceInfoWrapper:
1471#
1472# @data: PCDIMMDevice state information
1473#
1474# Since: 2.1
1475##
1476{ 'struct': 'PCDIMMDeviceInfoWrapper',
1477  'data': { 'data': 'PCDIMMDeviceInfo' } }
1478
1479##
1480# @VirtioPMEMDeviceInfoWrapper:
1481#
1482# @data: VirtioPMEM state information
1483#
1484# Since: 2.1
1485##
1486{ 'struct': 'VirtioPMEMDeviceInfoWrapper',
1487  'data': { 'data': 'VirtioPMEMDeviceInfo' } }
1488
1489##
1490# @VirtioMEMDeviceInfoWrapper:
1491#
1492# @data: VirtioMEMDevice state information
1493#
1494# Since: 2.1
1495##
1496{ 'struct': 'VirtioMEMDeviceInfoWrapper',
1497  'data': { 'data': 'VirtioMEMDeviceInfo' } }
1498
1499##
1500# @SgxEPCDeviceInfoWrapper:
1501#
1502# @data: Sgx EPC state information
1503#
1504# Since: 6.2
1505##
1506{ 'struct': 'SgxEPCDeviceInfoWrapper',
1507  'data': { 'data': 'SgxEPCDeviceInfo' } }
1508
1509##
1510# @HvBalloonDeviceInfoWrapper:
1511#
1512# @data: hv-balloon provided memory state information
1513#
1514# Since: 8.2
1515##
1516{ 'struct': 'HvBalloonDeviceInfoWrapper',
1517  'data': { 'data': 'HvBalloonDeviceInfo' } }
1518
1519##
1520# @MemoryDeviceInfo:
1521#
1522# Union containing information about a memory device
1523#
1524# @type: memory device type
1525#
1526# Since: 2.1
1527##
1528{ 'union': 'MemoryDeviceInfo',
1529  'base': { 'type': 'MemoryDeviceInfoKind' },
1530  'discriminator': 'type',
1531  'data': { 'dimm': 'PCDIMMDeviceInfoWrapper',
1532            'nvdimm': 'PCDIMMDeviceInfoWrapper',
1533            'virtio-pmem': 'VirtioPMEMDeviceInfoWrapper',
1534            'virtio-mem': 'VirtioMEMDeviceInfoWrapper',
1535            'sgx-epc': 'SgxEPCDeviceInfoWrapper',
1536            'hv-balloon': 'HvBalloonDeviceInfoWrapper'
1537          }
1538}
1539
1540##
1541# @SgxEPC:
1542#
1543# Sgx EPC cmdline information
1544#
1545# @memdev: memory backend linked with device
1546#
1547# @node: the numa node (Since: 7.0)
1548#
1549# Since: 6.2
1550##
1551{ 'struct': 'SgxEPC',
1552  'data': { 'memdev': 'str',
1553            'node': 'int'
1554          }
1555}
1556
1557##
1558# @SgxEPCProperties:
1559#
1560# SGX properties of machine types.
1561#
1562# @sgx-epc: list of ids of memory-backend-epc objects.
1563#
1564# Since: 6.2
1565##
1566{ 'struct': 'SgxEPCProperties',
1567  'data': { 'sgx-epc': ['SgxEPC'] }
1568}
1569
1570##
1571# @query-memory-devices:
1572#
1573# Lists available memory devices and their state
1574#
1575# Since: 2.1
1576#
1577# .. qmp-example::
1578#
1579#     -> { "execute": "query-memory-devices" }
1580#     <- { "return": [ { "data":
1581#                           { "addr": 5368709120,
1582#                             "hotpluggable": true,
1583#                             "hotplugged": true,
1584#                             "id": "d1",
1585#                             "memdev": "/objects/memX",
1586#                             "node": 0,
1587#                             "size": 1073741824,
1588#                             "slot": 0},
1589#                        "type": "dimm"
1590#                      } ] }
1591##
1592{ 'command': 'query-memory-devices', 'returns': ['MemoryDeviceInfo'] }
1593
1594##
1595# @MEMORY_DEVICE_SIZE_CHANGE:
1596#
1597# Emitted when the size of a memory device changes.  Only emitted for
1598# memory devices that can actually change the size (e.g., virtio-mem
1599# due to guest action).
1600#
1601# @id: device's ID
1602#
1603# @size: the new size of memory that the device provides
1604#
1605# @qom-path: path to the device object in the QOM tree (since 6.2)
1606#
1607# .. note:: This event is rate-limited.
1608#
1609# Since: 5.1
1610#
1611# .. qmp-example::
1612#
1613#     <- { "event": "MEMORY_DEVICE_SIZE_CHANGE",
1614#          "data": { "id": "vm0", "size": 1073741824,
1615#                    "qom-path": "/machine/unattached/device[2]" },
1616#          "timestamp": { "seconds": 1588168529, "microseconds": 201316 } }
1617##
1618{ 'event': 'MEMORY_DEVICE_SIZE_CHANGE',
1619  'data': { '*id': 'str', 'size': 'size', 'qom-path' : 'str'} }
1620
1621##
1622# @BootConfiguration:
1623#
1624# Schema for virtual machine boot configuration.
1625#
1626# @order: Boot order (a=floppy, c=hard disk, d=CD-ROM, n=network)
1627#
1628# @once: Boot order to apply on first boot
1629#
1630# @menu: Whether to show a boot menu
1631#
1632# @splash: The name of the file to be passed to the firmware as logo
1633#     picture, if @menu is true.
1634#
1635# @splash-time: How long to show the logo picture, in milliseconds
1636#
1637# @reboot-timeout: Timeout before guest reboots after boot fails
1638#
1639# @strict: Whether to attempt booting from devices not included in the
1640#     boot order
1641#
1642# Since: 7.1
1643##
1644{ 'struct': 'BootConfiguration', 'data': {
1645     '*order': 'str',
1646     '*once': 'str',
1647     '*menu': 'bool',
1648     '*splash': 'str',
1649     '*splash-time': 'int',
1650     '*reboot-timeout': 'int',
1651     '*strict': 'bool' } }
1652
1653##
1654# @SMPConfiguration:
1655#
1656# Schema for CPU topology configuration.  A missing value lets QEMU
1657# figure out a suitable value based on the ones that are provided.
1658#
1659# The members other than @cpus and @maxcpus define a topology of
1660# containers.
1661#
1662# The ordering from highest/coarsest to lowest/finest is:
1663# @drawers, @books, @sockets, @dies, @clusters, @cores, @threads.
1664#
1665# Different architectures support different subsets of topology
1666# containers.
1667#
1668# For example, s390x does not have clusters and dies, and the socket
1669# is the parent container of cores.
1670#
1671# @cpus: number of virtual CPUs in the virtual machine
1672#
1673# @maxcpus: maximum number of hotpluggable virtual CPUs in the virtual
1674#     machine
1675#
1676# @drawers: number of drawers in the CPU topology (since 8.2)
1677#
1678# @books: number of books in the CPU topology (since 8.2)
1679#
1680# @sockets: number of sockets per parent container
1681#
1682# @dies: number of dies per parent container
1683#
1684# @clusters: number of clusters per parent container (since 7.0)
1685#
1686# @modules: number of modules per parent container (since 9.1)
1687#
1688# @cores: number of cores per parent container
1689#
1690# @threads: number of threads per core
1691#
1692# Since: 6.1
1693##
1694{ 'struct': 'SMPConfiguration', 'data': {
1695     '*cpus': 'int',
1696     '*drawers': 'int',
1697     '*books': 'int',
1698     '*sockets': 'int',
1699     '*dies': 'int',
1700     '*clusters': 'int',
1701     '*modules': 'int',
1702     '*cores': 'int',
1703     '*threads': 'int',
1704     '*maxcpus': 'int' } }
1705
1706##
1707# @x-query-irq:
1708#
1709# Query interrupt statistics
1710#
1711# Features:
1712#
1713# @unstable: This command is meant for debugging.
1714#
1715# Returns: interrupt statistics
1716#
1717# Since: 6.2
1718##
1719{ 'command': 'x-query-irq',
1720  'returns': 'HumanReadableText',
1721  'features': [ 'unstable' ] }
1722
1723##
1724# @x-query-jit:
1725#
1726# Query TCG compiler statistics
1727#
1728# Features:
1729#
1730# @unstable: This command is meant for debugging.
1731#
1732# Returns: TCG compiler statistics
1733#
1734# Since: 6.2
1735##
1736{ 'command': 'x-query-jit',
1737  'returns': 'HumanReadableText',
1738  'if': 'CONFIG_TCG',
1739  'features': [ 'unstable' ] }
1740
1741##
1742# @x-query-numa:
1743#
1744# Query NUMA topology information
1745#
1746# Features:
1747#
1748# @unstable: This command is meant for debugging.
1749#
1750# Returns: topology information
1751#
1752# Since: 6.2
1753##
1754{ 'command': 'x-query-numa',
1755  'returns': 'HumanReadableText',
1756  'features': [ 'unstable' ] }
1757
1758##
1759# @x-query-opcount:
1760#
1761# Query TCG opcode counters
1762#
1763# Features:
1764#
1765# @unstable: This command is meant for debugging.
1766#
1767# Returns: TCG opcode counters
1768#
1769# Since: 6.2
1770##
1771{ 'command': 'x-query-opcount',
1772  'returns': 'HumanReadableText',
1773  'if': 'CONFIG_TCG',
1774  'features': [ 'unstable' ] }
1775
1776##
1777# @x-query-ramblock:
1778#
1779# Query system ramblock information
1780#
1781# Features:
1782#
1783# @unstable: This command is meant for debugging.
1784#
1785# Returns: system ramblock information
1786#
1787# Since: 6.2
1788##
1789{ 'command': 'x-query-ramblock',
1790  'returns': 'HumanReadableText',
1791  'features': [ 'unstable' ] }
1792
1793##
1794# @x-query-roms:
1795#
1796# Query information on the registered ROMS
1797#
1798# Features:
1799#
1800# @unstable: This command is meant for debugging.
1801#
1802# Returns: registered ROMs
1803#
1804# Since: 6.2
1805##
1806{ 'command': 'x-query-roms',
1807  'returns': 'HumanReadableText',
1808  'features': [ 'unstable' ] }
1809
1810##
1811# @x-query-usb:
1812#
1813# Query information on the USB devices
1814#
1815# Features:
1816#
1817# @unstable: This command is meant for debugging.
1818#
1819# Returns: USB device information
1820#
1821# Since: 6.2
1822##
1823{ 'command': 'x-query-usb',
1824  'returns': 'HumanReadableText',
1825  'features': [ 'unstable' ] }
1826
1827##
1828# @SmbiosEntryPointType:
1829#
1830# @32: SMBIOS version 2.1 (32-bit) Entry Point
1831#
1832# @64: SMBIOS version 3.0 (64-bit) Entry Point
1833#
1834# @auto: Either 2.x or 3.x SMBIOS version, 2.x if configuration can be
1835#     described by it and 3.x otherwise (since: 9.0)
1836#
1837# Since: 7.0
1838##
1839{ 'enum': 'SmbiosEntryPointType',
1840  'data': [ '32', '64', 'auto' ] }
1841
1842##
1843# @MemorySizeConfiguration:
1844#
1845# Schema for memory size configuration.
1846#
1847# @size: memory size in bytes
1848#
1849# @max-size: maximum hotpluggable memory size in bytes
1850#
1851# @slots: number of available memory slots for hotplug
1852#
1853# Since: 7.1
1854##
1855{ 'struct': 'MemorySizeConfiguration', 'data': {
1856     '*size': 'size',
1857     '*max-size': 'size',
1858     '*slots': 'uint64' } }
1859
1860##
1861# @dumpdtb:
1862#
1863# Save the FDT in dtb format.
1864#
1865# @filename: name of the dtb file to be created
1866#
1867# Since: 7.2
1868#
1869# .. qmp-example::
1870#
1871#     -> { "execute": "dumpdtb" }
1872#          "arguments": { "filename": "fdt.dtb" } }
1873#     <- { "return": {} }
1874##
1875{ 'command': 'dumpdtb',
1876  'data': { 'filename': 'str' },
1877  'if': 'CONFIG_FDT' }
1878
1879##
1880# @x-query-interrupt-controllers:
1881#
1882# Query information on interrupt controller devices
1883#
1884# Features:
1885#
1886# @unstable: This command is meant for debugging.
1887#
1888# Returns: Interrupt controller devices information
1889#
1890# Since: 9.1
1891##
1892{ 'command': 'x-query-interrupt-controllers',
1893  'returns': 'HumanReadableText',
1894  'features': [ 'unstable' ]}
1895