xref: /openbmc/qemu/qapi/machine.json (revision 2f95279a)
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# @BootConfiguration:
1612#
1613# Schema for virtual machine boot configuration.
1614#
1615# @order: Boot order (a=floppy, c=hard disk, d=CD-ROM, n=network)
1616#
1617# @once: Boot order to apply on first boot
1618#
1619# @menu: Whether to show a boot menu
1620#
1621# @splash: The name of the file to be passed to the firmware as logo
1622#     picture, if @menu is true.
1623#
1624# @splash-time: How long to show the logo picture, in milliseconds
1625#
1626# @reboot-timeout: Timeout before guest reboots after boot fails
1627#
1628# @strict: Whether to attempt booting from devices not included in the
1629#     boot order
1630#
1631# Since: 7.1
1632##
1633{ 'struct': 'BootConfiguration', 'data': {
1634     '*order': 'str',
1635     '*once': 'str',
1636     '*menu': 'bool',
1637     '*splash': 'str',
1638     '*splash-time': 'int',
1639     '*reboot-timeout': 'int',
1640     '*strict': 'bool' } }
1641
1642##
1643# @SMPConfiguration:
1644#
1645# Schema for CPU topology configuration.  A missing value lets QEMU
1646# figure out a suitable value based on the ones that are provided.
1647#
1648# The members other than @cpus and @maxcpus define a topology of
1649# containers.
1650#
1651# The ordering from highest/coarsest to lowest/finest is:
1652# @drawers, @books, @sockets, @dies, @clusters, @cores, @threads.
1653#
1654# Different architectures support different subsets of topology
1655# containers.
1656#
1657# For example, s390x does not have clusters and dies, and the socket
1658# is the parent container of cores.
1659#
1660# @cpus: number of virtual CPUs in the virtual machine
1661#
1662# @maxcpus: maximum number of hotpluggable virtual CPUs in the virtual
1663#     machine
1664#
1665# @drawers: number of drawers in the CPU topology (since 8.2)
1666#
1667# @books: number of books in the CPU topology (since 8.2)
1668#
1669# @sockets: number of sockets per parent container
1670#
1671# @dies: number of dies per parent container
1672#
1673# @clusters: number of clusters per parent container (since 7.0)
1674#
1675# @modules: number of modules per parent container (since 9.1)
1676#
1677# @cores: number of cores per parent container
1678#
1679# @threads: number of threads per core
1680#
1681# Since: 6.1
1682##
1683{ 'struct': 'SMPConfiguration', 'data': {
1684     '*cpus': 'int',
1685     '*drawers': 'int',
1686     '*books': 'int',
1687     '*sockets': 'int',
1688     '*dies': 'int',
1689     '*clusters': 'int',
1690     '*modules': 'int',
1691     '*cores': 'int',
1692     '*threads': 'int',
1693     '*maxcpus': 'int' } }
1694
1695##
1696# @x-query-irq:
1697#
1698# Query interrupt statistics
1699#
1700# Features:
1701#
1702# @unstable: This command is meant for debugging.
1703#
1704# Returns: interrupt statistics
1705#
1706# Since: 6.2
1707##
1708{ 'command': 'x-query-irq',
1709  'returns': 'HumanReadableText',
1710  'features': [ 'unstable' ] }
1711
1712##
1713# @x-query-jit:
1714#
1715# Query TCG compiler statistics
1716#
1717# Features:
1718#
1719# @unstable: This command is meant for debugging.
1720#
1721# Returns: TCG compiler statistics
1722#
1723# Since: 6.2
1724##
1725{ 'command': 'x-query-jit',
1726  'returns': 'HumanReadableText',
1727  'if': 'CONFIG_TCG',
1728  'features': [ 'unstable' ] }
1729
1730##
1731# @x-query-numa:
1732#
1733# Query NUMA topology information
1734#
1735# Features:
1736#
1737# @unstable: This command is meant for debugging.
1738#
1739# Returns: topology information
1740#
1741# Since: 6.2
1742##
1743{ 'command': 'x-query-numa',
1744  'returns': 'HumanReadableText',
1745  'features': [ 'unstable' ] }
1746
1747##
1748# @x-query-opcount:
1749#
1750# Query TCG opcode counters
1751#
1752# Features:
1753#
1754# @unstable: This command is meant for debugging.
1755#
1756# Returns: TCG opcode counters
1757#
1758# Since: 6.2
1759##
1760{ 'command': 'x-query-opcount',
1761  'returns': 'HumanReadableText',
1762  'if': 'CONFIG_TCG',
1763  'features': [ 'unstable' ] }
1764
1765##
1766# @x-query-ramblock:
1767#
1768# Query system ramblock information
1769#
1770# Features:
1771#
1772# @unstable: This command is meant for debugging.
1773#
1774# Returns: system ramblock information
1775#
1776# Since: 6.2
1777##
1778{ 'command': 'x-query-ramblock',
1779  'returns': 'HumanReadableText',
1780  'features': [ 'unstable' ] }
1781
1782##
1783# @x-query-roms:
1784#
1785# Query information on the registered ROMS
1786#
1787# Features:
1788#
1789# @unstable: This command is meant for debugging.
1790#
1791# Returns: registered ROMs
1792#
1793# Since: 6.2
1794##
1795{ 'command': 'x-query-roms',
1796  'returns': 'HumanReadableText',
1797  'features': [ 'unstable' ] }
1798
1799##
1800# @x-query-usb:
1801#
1802# Query information on the USB devices
1803#
1804# Features:
1805#
1806# @unstable: This command is meant for debugging.
1807#
1808# Returns: USB device information
1809#
1810# Since: 6.2
1811##
1812{ 'command': 'x-query-usb',
1813  'returns': 'HumanReadableText',
1814  'features': [ 'unstable' ] }
1815
1816##
1817# @SmbiosEntryPointType:
1818#
1819# @32: SMBIOS version 2.1 (32-bit) Entry Point
1820#
1821# @64: SMBIOS version 3.0 (64-bit) Entry Point
1822#
1823# @auto: Either 2.x or 3.x SMBIOS version, 2.x if configuration can be
1824#     described by it and 3.x otherwise (since: 9.0)
1825#
1826# Since: 7.0
1827##
1828{ 'enum': 'SmbiosEntryPointType',
1829  'data': [ '32', '64', 'auto' ] }
1830
1831##
1832# @MemorySizeConfiguration:
1833#
1834# Schema for memory size configuration.
1835#
1836# @size: memory size in bytes
1837#
1838# @max-size: maximum hotpluggable memory size in bytes
1839#
1840# @slots: number of available memory slots for hotplug
1841#
1842# Since: 7.1
1843##
1844{ 'struct': 'MemorySizeConfiguration', 'data': {
1845     '*size': 'size',
1846     '*max-size': 'size',
1847     '*slots': 'uint64' } }
1848
1849##
1850# @dumpdtb:
1851#
1852# Save the FDT in dtb format.
1853#
1854# @filename: name of the dtb file to be created
1855#
1856# Since: 7.2
1857#
1858# Example:
1859#
1860#     -> { "execute": "dumpdtb" }
1861#          "arguments": { "filename": "fdt.dtb" } }
1862#     <- { "return": {} }
1863##
1864{ 'command': 'dumpdtb',
1865  'data': { 'filename': 'str' },
1866  'if': 'CONFIG_FDT' }
1867
1868##
1869# @x-query-interrupt-controllers:
1870#
1871# Query information on interrupt controller devices
1872#
1873# Features:
1874#
1875# @unstable: This command is meant for debugging.
1876#
1877# Returns: Interrupt controller devices information
1878#
1879# Since: 9.1
1880##
1881{ 'command': 'x-query-interrupt-controllers',
1882  'returns': 'HumanReadableText',
1883  'features': [ 'unstable' ]}
1884