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