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