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