]> git.ipfire.org Git - thirdparty/qemu.git/blame - qapi/machine.json
qapi/qmp: add ObjectPropertyInfo.default-value
[thirdparty/qemu.git] / qapi / machine.json
CommitLineData
8ac25c84
MA
1# -*- Mode: Python -*-
2#
3# This work is licensed under the terms of the GNU GPL, version 2 or later.
4# See the COPYING file in the top-level directory.
5
6##
7# = Machines
8##
9
ffaee83b
MA
10##
11# @SysEmuTarget:
12#
13# The comprehensive enumeration of QEMU system emulation ("softmmu")
14# targets. Run "./configure --help" in the project root directory, and
15# look for the *-softmmu targets near the "--target-list" option. The
16# individual target constants are not documented here, for the time
17# being.
18#
19# Notes: The resulting QMP strings can be appended to the "qemu-system-"
20# prefix to produce the corresponding QEMU executable name. This
21# is true even for "qemu-system-x86_64".
22#
23# ppcemb: dropped in 3.1
24#
25# Since: 3.0
26##
27{ 'enum' : 'SysEmuTarget',
28 'data' : [ 'aarch64', 'alpha', 'arm', 'cris', 'hppa', 'i386', 'lm32',
29 'm68k', 'microblaze', 'microblazeel', 'mips', 'mips64',
30 'mips64el', 'mipsel', 'moxie', 'nios2', 'or1k', 'ppc',
31 'ppc64', 'riscv32', 'riscv64', 's390x', 'sh4',
32 'sh4eb', 'sparc', 'sparc64', 'tricore', 'unicore32',
33 'x86_64', 'xtensa', 'xtensaeb' ] }
8ac25c84
MA
34
35##
36# @CpuInfoArch:
37#
38# An enumeration of cpu types that enable additional information during
39# @query-cpus and @query-cpus-fast.
40#
41# @s390: since 2.12
42#
43# @riscv: since 2.12
44#
45# Since: 2.6
46##
47{ 'enum': 'CpuInfoArch',
48 'data': ['x86', 'sparc', 'ppc', 'mips', 'tricore', 's390', 'riscv', 'other' ] }
49
50##
51# @CpuInfo:
52#
53# Information about a virtual CPU
54#
55# @CPU: the index of the virtual CPU
56#
57# @current: this only exists for backwards compatibility and should be ignored
58#
59# @halted: true if the virtual CPU is in the halt state. Halt usually refers
60# to a processor specific low power mode.
61#
62# @qom_path: path to the CPU object in the QOM tree (since 2.4)
63#
64# @thread_id: ID of the underlying host thread
65#
66# @props: properties describing to which node/socket/core/thread
67# virtual CPU belongs to, provided if supported by board (since 2.10)
68#
69# @arch: architecture of the cpu, which determines which additional fields
70# will be listed (since 2.6)
71#
72# Since: 0.14.0
73#
74# Notes: @halted is a transient state that changes frequently. By the time the
75# data is sent to the client, the guest may no longer be halted.
76##
77{ 'union': 'CpuInfo',
78 'base': {'CPU': 'int', 'current': 'bool', 'halted': 'bool',
79 'qom_path': 'str', 'thread_id': 'int',
80 '*props': 'CpuInstanceProperties', 'arch': 'CpuInfoArch' },
81 'discriminator': 'arch',
82 'data': { 'x86': 'CpuInfoX86',
83 'sparc': 'CpuInfoSPARC',
84 'ppc': 'CpuInfoPPC',
85 'mips': 'CpuInfoMIPS',
86 'tricore': 'CpuInfoTricore',
87 's390': 'CpuInfoS390',
88 'riscv': 'CpuInfoRISCV' } }
89
90##
91# @CpuInfoX86:
92#
93# Additional information about a virtual i386 or x86_64 CPU
94#
95# @pc: the 64-bit instruction pointer
96#
97# Since: 2.6
98##
99{ 'struct': 'CpuInfoX86', 'data': { 'pc': 'int' } }
100
101##
102# @CpuInfoSPARC:
103#
104# Additional information about a virtual SPARC CPU
105#
106# @pc: the PC component of the instruction pointer
107#
108# @npc: the NPC component of the instruction pointer
109#
110# Since: 2.6
111##
112{ 'struct': 'CpuInfoSPARC', 'data': { 'pc': 'int', 'npc': 'int' } }
113
114##
115# @CpuInfoPPC:
116#
117# Additional information about a virtual PPC CPU
118#
119# @nip: the instruction pointer
120#
121# Since: 2.6
122##
123{ 'struct': 'CpuInfoPPC', 'data': { 'nip': 'int' } }
124
125##
126# @CpuInfoMIPS:
127#
128# Additional information about a virtual MIPS CPU
129#
130# @PC: the instruction pointer
131#
132# Since: 2.6
133##
134{ 'struct': 'CpuInfoMIPS', 'data': { 'PC': 'int' } }
135
136##
137# @CpuInfoTricore:
138#
139# Additional information about a virtual Tricore CPU
140#
141# @PC: the instruction pointer
142#
143# Since: 2.6
144##
145{ 'struct': 'CpuInfoTricore', 'data': { 'PC': 'int' } }
146
147##
148# @CpuInfoRISCV:
149#
150# Additional information about a virtual RISCV CPU
151#
152# @pc: the instruction pointer
153#
154# Since 2.12
155##
156{ 'struct': 'CpuInfoRISCV', 'data': { 'pc': 'int' } }
157
158##
159# @CpuS390State:
160#
161# An enumeration of cpu states that can be assumed by a virtual
162# S390 CPU
163#
164# Since: 2.12
165##
166{ 'enum': 'CpuS390State',
167 'prefix': 'S390_CPU_STATE',
168 'data': [ 'uninitialized', 'stopped', 'check-stop', 'operating', 'load' ] }
169
170##
171# @CpuInfoS390:
172#
173# Additional information about a virtual S390 CPU
174#
175# @cpu-state: the virtual CPU's state
176#
177# Since: 2.12
178##
179{ 'struct': 'CpuInfoS390', 'data': { 'cpu-state': 'CpuS390State' } }
180
181##
182# @query-cpus:
183#
184# Returns a list of information about each virtual CPU.
185#
186# This command causes vCPU threads to exit to userspace, which causes
187# a small interruption to guest CPU execution. This will have a negative
188# impact on realtime guests and other latency sensitive guest workloads.
189# It is recommended to use @query-cpus-fast instead of this command to
190# avoid the vCPU interruption.
191#
192# Returns: a list of @CpuInfo for each virtual CPU
193#
194# Since: 0.14.0
195#
196# Example:
197#
198# -> { "execute": "query-cpus" }
199# <- { "return": [
200# {
201# "CPU":0,
202# "current":true,
203# "halted":false,
204# "qom_path":"/machine/unattached/device[0]",
205# "arch":"x86",
206# "pc":3227107138,
207# "thread_id":3134
208# },
209# {
210# "CPU":1,
211# "current":false,
212# "halted":true,
213# "qom_path":"/machine/unattached/device[2]",
214# "arch":"x86",
215# "pc":7108165,
216# "thread_id":3135
217# }
218# ]
219# }
220#
221# Notes: This interface is deprecated (since 2.12.0), and it is strongly
222# recommended that you avoid using it. Use @query-cpus-fast to
223# obtain information about virtual CPUs.
224#
225##
226{ 'command': 'query-cpus', 'returns': ['CpuInfo'] }
227
228##
229# @CpuInfoFast:
230#
231# Information about a virtual CPU
232#
233# @cpu-index: index of the virtual CPU
234#
235# @qom-path: path to the CPU object in the QOM tree
236#
237# @thread-id: ID of the underlying host thread
238#
239# @props: properties describing to which node/socket/core/thread
240# virtual CPU belongs to, provided if supported by board
241#
242# @arch: base architecture of the cpu; deprecated since 3.0.0 in favor
243# of @target
244#
245# @target: the QEMU system emulation target, which determines which
246# additional fields will be listed (since 3.0)
247#
248# Since: 2.12
249#
250##
251{ 'union' : 'CpuInfoFast',
252 'base' : { 'cpu-index' : 'int',
253 'qom-path' : 'str',
254 'thread-id' : 'int',
255 '*props' : 'CpuInstanceProperties',
256 'arch' : 'CpuInfoArch',
257 'target' : 'SysEmuTarget' },
258 'discriminator' : 'target',
259 'data' : { 's390x' : 'CpuInfoS390' } }
260
261##
262# @query-cpus-fast:
263#
264# Returns information about all virtual CPUs. This command does not
265# incur a performance penalty and should be used in production
266# instead of query-cpus.
267#
268# Returns: list of @CpuInfoFast
269#
270# Since: 2.12
271#
272# Example:
273#
274# -> { "execute": "query-cpus-fast" }
275# <- { "return": [
276# {
277# "thread-id": 25627,
278# "props": {
279# "core-id": 0,
280# "thread-id": 0,
281# "socket-id": 0
282# },
283# "qom-path": "/machine/unattached/device[0]",
284# "arch":"x86",
285# "target":"x86_64",
286# "cpu-index": 0
287# },
288# {
289# "thread-id": 25628,
290# "props": {
291# "core-id": 0,
292# "thread-id": 0,
293# "socket-id": 1
294# },
295# "qom-path": "/machine/unattached/device[2]",
296# "arch":"x86",
297# "target":"x86_64",
298# "cpu-index": 1
299# }
300# ]
301# }
302##
303{ 'command': 'query-cpus-fast', 'returns': [ 'CpuInfoFast' ] }
304
305##
306# @cpu-add:
307#
308# Adds CPU with specified ID.
309#
310# @id: ID of CPU to be created, valid values [0..max_cpus)
311#
312# Returns: Nothing on success
313#
314# Since: 1.5
315#
316# Note: This command is deprecated. The `device_add` command should be
317# used instead. See the `query-hotpluggable-cpus` command for
318# details.
319#
320# Example:
321#
322# -> { "execute": "cpu-add", "arguments": { "id": 2 } }
323# <- { "return": {} }
324#
325##
326{ 'command': 'cpu-add', 'data': {'id': 'int'} }
327
328##
329# @MachineInfo:
330#
331# Information describing a machine.
332#
333# @name: the name of the machine
334#
335# @alias: an alias for the machine name
336#
337# @is-default: whether the machine is default
338#
339# @cpu-max: maximum number of CPUs supported by the machine type
340# (since 1.5.0)
341#
342# @hotpluggable-cpus: cpu hotplug via -device is supported (since 2.7.0)
343#
cd5ff833
IM
344# @numa-mem-supported: true if '-numa node,mem' option is supported by
345# the machine type and false otherwise (since 4.1)
346#
79974027
EH
347# @deprecated: if true, the machine type is deprecated and may be removed
348# in future versions of QEMU according to the QEMU deprecation
349# policy (since 4.1.0)
350#
04109957
DB
351# @default-cpu-type: default CPU model typename if none is requested via
352# the -cpu argument. (since 4.2)
353#
8ac25c84
MA
354# Since: 1.2.0
355##
356{ 'struct': 'MachineInfo',
357 'data': { 'name': 'str', '*alias': 'str',
358 '*is-default': 'bool', 'cpu-max': 'int',
79974027 359 'hotpluggable-cpus': 'bool', 'numa-mem-supported': 'bool',
04109957 360 'deprecated': 'bool', '*default-cpu-type': 'str' } }
8ac25c84
MA
361
362##
363# @query-machines:
364#
365# Return a list of supported machines
366#
367# Returns: a list of MachineInfo
368#
369# Since: 1.2.0
370##
371{ 'command': 'query-machines', 'returns': ['MachineInfo'] }
372
373##
374# @CurrentMachineParams:
375#
376# Information describing the running machine parameters.
377#
378# @wakeup-suspend-support: true if the machine supports wake up from
379# suspend
380#
381# Since: 4.0
382##
383{ 'struct': 'CurrentMachineParams',
384 'data': { 'wakeup-suspend-support': 'bool'} }
385
386##
387# @query-current-machine:
388#
389# Return information on the current virtual machine.
390#
391# Returns: CurrentMachineParams
392#
393# Since: 4.0
394##
395{ 'command': 'query-current-machine', 'returns': 'CurrentMachineParams' }
396
ffaee83b
MA
397##
398# @TargetInfo:
399#
400# Information describing the QEMU target.
401#
402# @arch: the target architecture
403#
404# Since: 1.2.0
405##
406{ 'struct': 'TargetInfo',
407 'data': { 'arch': 'SysEmuTarget' } }
408
409##
410# @query-target:
411#
412# Return information about the target for this QEMU
413#
414# Returns: TargetInfo
415#
416# Since: 1.2.0
417##
418{ 'command': 'query-target', 'returns': 'TargetInfo' }
419
8ac25c84
MA
420##
421# @NumaOptionsType:
422#
423# @node: NUMA nodes configuration
424#
425# @dist: NUMA distance configuration (since 2.10)
426#
427# @cpu: property based CPU(s) to node mapping (Since: 2.10)
428#
9b12dfa0
LJ
429# @hmat-lb: memory latency and bandwidth information (Since: 5.0)
430#
c412a48d
LJ
431# @hmat-cache: memory side cache information (Since: 5.0)
432#
8ac25c84
MA
433# Since: 2.1
434##
435{ 'enum': 'NumaOptionsType',
c412a48d 436 'data': [ 'node', 'dist', 'cpu', 'hmat-lb', 'hmat-cache' ] }
8ac25c84
MA
437
438##
439# @NumaOptions:
440#
441# A discriminated record of NUMA options. (for OptsVisitor)
442#
443# Since: 2.1
444##
445{ 'union': 'NumaOptions',
446 'base': { 'type': 'NumaOptionsType' },
447 'discriminator': 'type',
448 'data': {
449 'node': 'NumaNodeOptions',
450 'dist': 'NumaDistOptions',
9b12dfa0 451 'cpu': 'NumaCpuOptions',
c412a48d
LJ
452 'hmat-lb': 'NumaHmatLBOptions',
453 'hmat-cache': 'NumaHmatCacheOptions' }}
8ac25c84
MA
454
455##
456# @NumaNodeOptions:
457#
458# Create a guest NUMA node. (for OptsVisitor)
459#
460# @nodeid: NUMA node ID (increase by 1 from 0 if omitted)
461#
462# @cpus: VCPUs belonging to this node (assign VCPUS round-robin
463# if omitted)
464#
465# @mem: memory size of this node; mutually exclusive with @memdev.
466# Equally divide total memory among nodes if both @mem and @memdev are
467# omitted.
468#
469# @memdev: memory backend object. If specified for one node,
470# it must be specified for all nodes.
471#
244b3f44
TX
472# @initiator: defined in ACPI 6.3 Chapter 5.2.27.3 Table 5-145,
473# points to the nodeid which has the memory controller
474# responsible for this NUMA node. This field provides
475# additional information as to the initiator node that
476# is closest (as in directly attached) to this node, and
477# therefore has the best performance (since 5.0)
478#
8ac25c84
MA
479# Since: 2.1
480##
481{ 'struct': 'NumaNodeOptions',
482 'data': {
483 '*nodeid': 'uint16',
484 '*cpus': ['uint16'],
485 '*mem': 'size',
244b3f44
TX
486 '*memdev': 'str',
487 '*initiator': 'uint16' }}
8ac25c84
MA
488
489##
490# @NumaDistOptions:
491#
492# Set the distance between 2 NUMA nodes.
493#
494# @src: source NUMA node.
495#
496# @dst: destination NUMA node.
497#
498# @val: NUMA distance from source node to destination node.
499# When a node is unreachable from another node, set the distance
500# between them to 255.
501#
502# Since: 2.10
503##
504{ 'struct': 'NumaDistOptions',
505 'data': {
506 'src': 'uint16',
507 'dst': 'uint16',
508 'val': 'uint8' }}
509
510##
511# @X86CPURegister32:
512#
513# A X86 32-bit register
514#
515# Since: 1.5
516##
517{ 'enum': 'X86CPURegister32',
518 'data': [ 'EAX', 'EBX', 'ECX', 'EDX', 'ESP', 'EBP', 'ESI', 'EDI' ] }
519
520##
521# @X86CPUFeatureWordInfo:
522#
523# Information about a X86 CPU feature word
524#
525# @cpuid-input-eax: Input EAX value for CPUID instruction for that feature word
526#
527# @cpuid-input-ecx: Input ECX value for CPUID instruction for that
528# feature word
529#
530# @cpuid-register: Output register containing the feature bits
531#
532# @features: value of output register, containing the feature bits
533#
534# Since: 1.5
535##
536{ 'struct': 'X86CPUFeatureWordInfo',
537 'data': { 'cpuid-input-eax': 'int',
538 '*cpuid-input-ecx': 'int',
539 'cpuid-register': 'X86CPURegister32',
540 'features': 'int' } }
541
542##
543# @DummyForceArrays:
544#
545# Not used by QMP; hack to let us use X86CPUFeatureWordInfoList internally
546#
547# Since: 2.5
548##
549{ 'struct': 'DummyForceArrays',
550 'data': { 'unused': ['X86CPUFeatureWordInfo'] } }
551
552##
553# @NumaCpuOptions:
554#
555# Option "-numa cpu" overrides default cpu to node mapping.
556# It accepts the same set of cpu properties as returned by
557# query-hotpluggable-cpus[].props, where node-id could be used to
558# override default node mapping.
559#
560# Since: 2.10
561##
562{ 'struct': 'NumaCpuOptions',
563 'base': 'CpuInstanceProperties',
564 'data' : {} }
565
9b12dfa0
LJ
566##
567# @HmatLBMemoryHierarchy:
568#
569# The memory hierarchy in the System Locality Latency and Bandwidth
570# Information Structure of HMAT (Heterogeneous Memory Attribute Table)
571#
572# For more information about @HmatLBMemoryHierarchy, see chapter
573# 5.2.27.4: Table 5-146: Field "Flags" of ACPI 6.3 spec.
574#
575# @memory: the structure represents the memory performance
576#
577# @first-level: first level of memory side cache
578#
579# @second-level: second level of memory side cache
580#
581# @third-level: third level of memory side cache
582#
583# Since: 5.0
584##
585{ 'enum': 'HmatLBMemoryHierarchy',
586 'data': [ 'memory', 'first-level', 'second-level', 'third-level' ] }
587
588##
589# @HmatLBDataType:
590#
591# Data type in the System Locality Latency and Bandwidth
592# Information Structure of HMAT (Heterogeneous Memory Attribute Table)
593#
594# For more information about @HmatLBDataType, see chapter
595# 5.2.27.4: Table 5-146: Field "Data Type" of ACPI 6.3 spec.
596#
597# @access-latency: access latency (nanoseconds)
598#
599# @read-latency: read latency (nanoseconds)
600#
601# @write-latency: write latency (nanoseconds)
602#
603# @access-bandwidth: access bandwidth (Bytes per second)
604#
605# @read-bandwidth: read bandwidth (Bytes per second)
606#
607# @write-bandwidth: write bandwidth (Bytes per second)
608#
609# Since: 5.0
610##
611{ 'enum': 'HmatLBDataType',
612 'data': [ 'access-latency', 'read-latency', 'write-latency',
613 'access-bandwidth', 'read-bandwidth', 'write-bandwidth' ] }
614
615##
616# @NumaHmatLBOptions:
617#
618# Set the system locality latency and bandwidth information
619# between Initiator and Target proximity Domains.
620#
621# For more information about @NumaHmatLBOptions, see chapter
622# 5.2.27.4: Table 5-146 of ACPI 6.3 spec.
623#
624# @initiator: the Initiator Proximity Domain.
625#
626# @target: the Target Proximity Domain.
627#
628# @hierarchy: the Memory Hierarchy. Indicates the performance
629# of memory or side cache.
630#
631# @data-type: presents the type of data, access/read/write
632# latency or hit latency.
633#
634# @latency: the value of latency from @initiator to @target
635# proximity domain, the latency unit is "ns(nanosecond)".
636#
637# @bandwidth: the value of bandwidth between @initiator and @target
638# proximity domain, the bandwidth unit is
639# "Bytes per second".
640#
641# Since: 5.0
642##
643{ 'struct': 'NumaHmatLBOptions',
644 'data': {
645 'initiator': 'uint16',
646 'target': 'uint16',
647 'hierarchy': 'HmatLBMemoryHierarchy',
648 'data-type': 'HmatLBDataType',
649 '*latency': 'uint64',
650 '*bandwidth': 'size' }}
651
c412a48d
LJ
652##
653# @HmatCacheAssociativity:
654#
655# Cache associativity in the Memory Side Cache Information Structure
656# of HMAT
657#
658# For more information of @HmatCacheAssociativity, see chapter
659# 5.2.27.5: Table 5-147 of ACPI 6.3 spec.
660#
661# @none: None (no memory side cache in this proximity domain,
662# or cache associativity unknown)
663#
664# @direct: Direct Mapped
665#
666# @complex: Complex Cache Indexing (implementation specific)
667#
668# Since: 5.0
669##
670{ 'enum': 'HmatCacheAssociativity',
671 'data': [ 'none', 'direct', 'complex' ] }
672
673##
674# @HmatCacheWritePolicy:
675#
676# Cache write policy in the Memory Side Cache Information Structure
677# of HMAT
678#
679# For more information of @HmatCacheWritePolicy, see chapter
680# 5.2.27.5: Table 5-147: Field "Cache Attributes" of ACPI 6.3 spec.
681#
682# @none: None (no memory side cache in this proximity domain,
683# or cache write policy unknown)
684#
685# @write-back: Write Back (WB)
686#
687# @write-through: Write Through (WT)
688#
689# Since: 5.0
690##
691{ 'enum': 'HmatCacheWritePolicy',
692 'data': [ 'none', 'write-back', 'write-through' ] }
693
694##
695# @NumaHmatCacheOptions:
696#
697# Set the memory side cache information for a given memory domain.
698#
699# For more information of @NumaHmatCacheOptions, see chapter
700# 5.2.27.5: Table 5-147: Field "Cache Attributes" of ACPI 6.3 spec.
701#
702# @node-id: the memory proximity domain to which the memory belongs.
703#
704# @size: the size of memory side cache in bytes.
705#
706# @level: the cache level described in this structure.
707#
708# @associativity: the cache associativity,
709# none/direct-mapped/complex(complex cache indexing).
710#
711# @policy: the write policy, none/write-back/write-through.
712#
713# @line: the cache Line size in bytes.
714#
715# Since: 5.0
716##
717{ 'struct': 'NumaHmatCacheOptions',
718 'data': {
719 'node-id': 'uint32',
720 'size': 'size',
721 'level': 'uint8',
722 'associativity': 'HmatCacheAssociativity',
723 'policy': 'HmatCacheWritePolicy',
724 'line': 'uint16' }}
725
8ac25c84
MA
726##
727# @HostMemPolicy:
728#
729# Host memory policy types
730#
731# @default: restore default policy, remove any nondefault policy
732#
733# @preferred: set the preferred host nodes for allocation
734#
735# @bind: a strict policy that restricts memory allocation to the
736# host nodes specified
737#
738# @interleave: memory allocations are interleaved across the set
739# of host nodes specified
740#
741# Since: 2.1
742##
743{ 'enum': 'HostMemPolicy',
744 'data': [ 'default', 'preferred', 'bind', 'interleave' ] }
745
746##
747# @Memdev:
748#
749# Information about memory backend
750#
751# @id: backend's ID if backend has 'id' property (since 2.9)
752#
753# @size: memory backend size
754#
755# @merge: enables or disables memory merge support
756#
757# @dump: includes memory backend's memory in a core dump or not
758#
759# @prealloc: enables or disables memory preallocation
760#
761# @host-nodes: host nodes for its memory policy
762#
763# @policy: memory policy of memory backend
764#
765# Since: 2.1
766##
767{ 'struct': 'Memdev',
768 'data': {
769 '*id': 'str',
770 'size': 'size',
771 'merge': 'bool',
772 'dump': 'bool',
773 'prealloc': 'bool',
774 'host-nodes': ['uint16'],
775 'policy': 'HostMemPolicy' }}
776
777##
778# @query-memdev:
779#
780# Returns information for all memory backends.
781#
782# Returns: a list of @Memdev.
783#
784# Since: 2.1
785#
786# Example:
787#
788# -> { "execute": "query-memdev" }
789# <- { "return": [
790# {
791# "id": "mem1",
792# "size": 536870912,
793# "merge": false,
794# "dump": true,
795# "prealloc": false,
796# "host-nodes": [0, 1],
797# "policy": "bind"
798# },
799# {
800# "size": 536870912,
801# "merge": false,
802# "dump": true,
803# "prealloc": true,
804# "host-nodes": [2, 3],
805# "policy": "preferred"
806# }
807# ]
808# }
809#
810##
811{ 'command': 'query-memdev', 'returns': ['Memdev'], 'allow-preconfig': true }
812
813##
814# @CpuInstanceProperties:
815#
816# List of properties to be used for hotplugging a CPU instance,
817# it should be passed by management with device_add command when
818# a CPU is being hotplugged.
819#
820# @node-id: NUMA node ID the CPU belongs to
821# @socket-id: socket number within node/board the CPU belongs to
176d2cda
LX
822# @die-id: die number within node/board the CPU belongs to (Since 4.1)
823# @core-id: core number within die the CPU belongs to# @thread-id: thread number within core the CPU belongs to
8ac25c84 824#
176d2cda 825# Note: currently there are 5 properties that could be present
8ac25c84
MA
826# but management should be prepared to pass through other
827# properties with device_add command to allow for future
828# interface extension. This also requires the filed names to be kept in
829# sync with the properties passed to -device/device_add.
830#
831# Since: 2.7
832##
833{ 'struct': 'CpuInstanceProperties',
834 'data': { '*node-id': 'int',
835 '*socket-id': 'int',
176d2cda 836 '*die-id': 'int',
8ac25c84
MA
837 '*core-id': 'int',
838 '*thread-id': 'int'
839 }
840}
841
842##
843# @HotpluggableCPU:
844#
845# @type: CPU object type for usage with device_add command
846# @props: list of properties to be used for hotplugging CPU
847# @vcpus-count: number of logical VCPU threads @HotpluggableCPU provides
848# @qom-path: link to existing CPU object if CPU is present or
849# omitted if CPU is not present.
850#
851# Since: 2.7
852##
853{ 'struct': 'HotpluggableCPU',
854 'data': { 'type': 'str',
855 'vcpus-count': 'int',
856 'props': 'CpuInstanceProperties',
857 '*qom-path': 'str'
858 }
859}
860
861##
862# @query-hotpluggable-cpus:
863#
864# TODO: Better documentation; currently there is none.
865#
866# Returns: a list of HotpluggableCPU objects.
867#
868# Since: 2.7
869#
870# Example:
871#
872# For pseries machine type started with -smp 2,cores=2,maxcpus=4 -cpu POWER8:
873#
874# -> { "execute": "query-hotpluggable-cpus" }
875# <- {"return": [
876# { "props": { "core": 8 }, "type": "POWER8-spapr-cpu-core",
877# "vcpus-count": 1 },
878# { "props": { "core": 0 }, "type": "POWER8-spapr-cpu-core",
879# "vcpus-count": 1, "qom-path": "/machine/unattached/device[0]"}
880# ]}'
881#
882# For pc machine type started with -smp 1,maxcpus=2:
883#
884# -> { "execute": "query-hotpluggable-cpus" }
885# <- {"return": [
886# {
887# "type": "qemu64-x86_64-cpu", "vcpus-count": 1,
888# "props": {"core-id": 0, "socket-id": 1, "thread-id": 0}
889# },
890# {
891# "qom-path": "/machine/unattached/device[0]",
892# "type": "qemu64-x86_64-cpu", "vcpus-count": 1,
893# "props": {"core-id": 0, "socket-id": 0, "thread-id": 0}
894# }
895# ]}
896#
897# For s390x-virtio-ccw machine type started with -smp 1,maxcpus=2 -cpu qemu
898# (Since: 2.11):
899#
900# -> { "execute": "query-hotpluggable-cpus" }
901# <- {"return": [
902# {
903# "type": "qemu-s390x-cpu", "vcpus-count": 1,
904# "props": { "core-id": 1 }
905# },
906# {
907# "qom-path": "/machine/unattached/device[0]",
908# "type": "qemu-s390x-cpu", "vcpus-count": 1,
909# "props": { "core-id": 0 }
910# }
911# ]}
912#
913##
914{ 'command': 'query-hotpluggable-cpus', 'returns': ['HotpluggableCPU'],
915 'allow-preconfig': true }
916
917##
918# @set-numa-node:
919#
920# Runtime equivalent of '-numa' CLI option, available at
921# preconfigure stage to configure numa mapping before initializing
922# machine.
923#
924# Since 3.0
925##
926{ 'command': 'set-numa-node', 'boxed': true,
927 'data': 'NumaOptions',
928 'allow-preconfig': true
929}