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