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