xref: /openbmc/qemu/qapi/machine.json (revision c51a3f5d)
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# @default-ram-id: the default ID of initial RAM memory backend (since 5.2)
361#
362# Since: 1.2.0
363##
364{ 'struct': 'MachineInfo',
365  'data': { 'name': 'str', '*alias': 'str',
366            '*is-default': 'bool', 'cpu-max': 'int',
367            'hotpluggable-cpus': 'bool',  'numa-mem-supported': 'bool',
368            'deprecated': 'bool', '*default-cpu-type': 'str',
369            '*default-ram-id': 'str' } }
370
371##
372# @query-machines:
373#
374# Return a list of supported machines
375#
376# Returns: a list of MachineInfo
377#
378# Since: 1.2.0
379##
380{ 'command': 'query-machines', 'returns': ['MachineInfo'] }
381
382##
383# @CurrentMachineParams:
384#
385# Information describing the running machine parameters.
386#
387# @wakeup-suspend-support: true if the machine supports wake up from
388#                          suspend
389#
390# Since: 4.0
391##
392{ 'struct': 'CurrentMachineParams',
393  'data': { 'wakeup-suspend-support': 'bool'} }
394
395##
396# @query-current-machine:
397#
398# Return information on the current virtual machine.
399#
400# Returns: CurrentMachineParams
401#
402# Since: 4.0
403##
404{ 'command': 'query-current-machine', 'returns': 'CurrentMachineParams' }
405
406##
407# @TargetInfo:
408#
409# Information describing the QEMU target.
410#
411# @arch: the target architecture
412#
413# Since: 1.2.0
414##
415{ 'struct': 'TargetInfo',
416  'data': { 'arch': 'SysEmuTarget' } }
417
418##
419# @query-target:
420#
421# Return information about the target for this QEMU
422#
423# Returns: TargetInfo
424#
425# Since: 1.2.0
426##
427{ 'command': 'query-target', 'returns': 'TargetInfo' }
428
429##
430# @NumaOptionsType:
431#
432# @node: NUMA nodes configuration
433#
434# @dist: NUMA distance configuration (since 2.10)
435#
436# @cpu: property based CPU(s) to node mapping (Since: 2.10)
437#
438# @hmat-lb: memory latency and bandwidth information (Since: 5.0)
439#
440# @hmat-cache: memory side cache information (Since: 5.0)
441#
442# Since: 2.1
443##
444{ 'enum': 'NumaOptionsType',
445  'data': [ 'node', 'dist', 'cpu', 'hmat-lb', 'hmat-cache' ] }
446
447##
448# @NumaOptions:
449#
450# A discriminated record of NUMA options. (for OptsVisitor)
451#
452# Since: 2.1
453##
454{ 'union': 'NumaOptions',
455  'base': { 'type': 'NumaOptionsType' },
456  'discriminator': 'type',
457  'data': {
458    'node': 'NumaNodeOptions',
459    'dist': 'NumaDistOptions',
460    'cpu': 'NumaCpuOptions',
461    'hmat-lb': 'NumaHmatLBOptions',
462    'hmat-cache': 'NumaHmatCacheOptions' }}
463
464##
465# @NumaNodeOptions:
466#
467# Create a guest NUMA node. (for OptsVisitor)
468#
469# @nodeid: NUMA node ID (increase by 1 from 0 if omitted)
470#
471# @cpus: VCPUs belonging to this node (assign VCPUS round-robin
472#         if omitted)
473#
474# @mem: memory size of this node; mutually exclusive with @memdev.
475#       Equally divide total memory among nodes if both @mem and @memdev are
476#       omitted.
477#
478# @memdev: memory backend object.  If specified for one node,
479#          it must be specified for all nodes.
480#
481# @initiator: defined in ACPI 6.3 Chapter 5.2.27.3 Table 5-145,
482#             points to the nodeid which has the memory controller
483#             responsible for this NUMA node. This field provides
484#             additional information as to the initiator node that
485#             is closest (as in directly attached) to this node, and
486#             therefore has the best performance (since 5.0)
487#
488# Since: 2.1
489##
490{ 'struct': 'NumaNodeOptions',
491  'data': {
492   '*nodeid': 'uint16',
493   '*cpus':   ['uint16'],
494   '*mem':    'size',
495   '*memdev': 'str',
496   '*initiator': 'uint16' }}
497
498##
499# @NumaDistOptions:
500#
501# Set the distance between 2 NUMA nodes.
502#
503# @src: source NUMA node.
504#
505# @dst: destination NUMA node.
506#
507# @val: NUMA distance from source node to destination node.
508#       When a node is unreachable from another node, set the distance
509#       between them to 255.
510#
511# Since: 2.10
512##
513{ 'struct': 'NumaDistOptions',
514  'data': {
515   'src': 'uint16',
516   'dst': 'uint16',
517   'val': 'uint8' }}
518
519##
520# @X86CPURegister32:
521#
522# A X86 32-bit register
523#
524# Since: 1.5
525##
526{ 'enum': 'X86CPURegister32',
527  'data': [ 'EAX', 'EBX', 'ECX', 'EDX', 'ESP', 'EBP', 'ESI', 'EDI' ] }
528
529##
530# @X86CPUFeatureWordInfo:
531#
532# Information about a X86 CPU feature word
533#
534# @cpuid-input-eax: Input EAX value for CPUID instruction for that feature word
535#
536# @cpuid-input-ecx: Input ECX value for CPUID instruction for that
537#                   feature word
538#
539# @cpuid-register: Output register containing the feature bits
540#
541# @features: value of output register, containing the feature bits
542#
543# Since: 1.5
544##
545{ 'struct': 'X86CPUFeatureWordInfo',
546  'data': { 'cpuid-input-eax': 'int',
547            '*cpuid-input-ecx': 'int',
548            'cpuid-register': 'X86CPURegister32',
549            'features': 'int' } }
550
551##
552# @DummyForceArrays:
553#
554# Not used by QMP; hack to let us use X86CPUFeatureWordInfoList internally
555#
556# Since: 2.5
557##
558{ 'struct': 'DummyForceArrays',
559  'data': { 'unused': ['X86CPUFeatureWordInfo'] } }
560
561##
562# @NumaCpuOptions:
563#
564# Option "-numa cpu" overrides default cpu to node mapping.
565# It accepts the same set of cpu properties as returned by
566# query-hotpluggable-cpus[].props, where node-id could be used to
567# override default node mapping.
568#
569# Since: 2.10
570##
571{ 'struct': 'NumaCpuOptions',
572   'base': 'CpuInstanceProperties',
573   'data' : {} }
574
575##
576# @HmatLBMemoryHierarchy:
577#
578# The memory hierarchy in the System Locality Latency and Bandwidth
579# Information Structure of HMAT (Heterogeneous Memory Attribute Table)
580#
581# For more information about @HmatLBMemoryHierarchy, see chapter
582# 5.2.27.4: Table 5-146: Field "Flags" of ACPI 6.3 spec.
583#
584# @memory: the structure represents the memory performance
585#
586# @first-level: first level of memory side cache
587#
588# @second-level: second level of memory side cache
589#
590# @third-level: third level of memory side cache
591#
592# Since: 5.0
593##
594{ 'enum': 'HmatLBMemoryHierarchy',
595  'data': [ 'memory', 'first-level', 'second-level', 'third-level' ] }
596
597##
598# @HmatLBDataType:
599#
600# Data type in the System Locality Latency and Bandwidth
601# Information Structure of HMAT (Heterogeneous Memory Attribute Table)
602#
603# For more information about @HmatLBDataType, see chapter
604# 5.2.27.4: Table 5-146:  Field "Data Type" of ACPI 6.3 spec.
605#
606# @access-latency: access latency (nanoseconds)
607#
608# @read-latency: read latency (nanoseconds)
609#
610# @write-latency: write latency (nanoseconds)
611#
612# @access-bandwidth: access bandwidth (Bytes per second)
613#
614# @read-bandwidth: read bandwidth (Bytes per second)
615#
616# @write-bandwidth: write bandwidth (Bytes per second)
617#
618# Since: 5.0
619##
620{ 'enum': 'HmatLBDataType',
621  'data': [ 'access-latency', 'read-latency', 'write-latency',
622            'access-bandwidth', 'read-bandwidth', 'write-bandwidth' ] }
623
624##
625# @NumaHmatLBOptions:
626#
627# Set the system locality latency and bandwidth information
628# between Initiator and Target proximity Domains.
629#
630# For more information about @NumaHmatLBOptions, see chapter
631# 5.2.27.4: Table 5-146 of ACPI 6.3 spec.
632#
633# @initiator: the Initiator Proximity Domain.
634#
635# @target: the Target Proximity Domain.
636#
637# @hierarchy: the Memory Hierarchy. Indicates the performance
638#             of memory or side cache.
639#
640# @data-type: presents the type of data, access/read/write
641#             latency or hit latency.
642#
643# @latency: the value of latency from @initiator to @target
644#           proximity domain, the latency unit is "ns(nanosecond)".
645#
646# @bandwidth: the value of bandwidth between @initiator and @target
647#             proximity domain, the bandwidth unit is
648#             "Bytes per second".
649#
650# Since: 5.0
651##
652{ 'struct': 'NumaHmatLBOptions',
653    'data': {
654    'initiator': 'uint16',
655    'target': 'uint16',
656    'hierarchy': 'HmatLBMemoryHierarchy',
657    'data-type': 'HmatLBDataType',
658    '*latency': 'uint64',
659    '*bandwidth': 'size' }}
660
661##
662# @HmatCacheAssociativity:
663#
664# Cache associativity in the Memory Side Cache Information Structure
665# of HMAT
666#
667# For more information of @HmatCacheAssociativity, see chapter
668# 5.2.27.5: Table 5-147 of ACPI 6.3 spec.
669#
670# @none: None (no memory side cache in this proximity domain,
671#              or cache associativity unknown)
672#
673# @direct: Direct Mapped
674#
675# @complex: Complex Cache Indexing (implementation specific)
676#
677# Since: 5.0
678##
679{ 'enum': 'HmatCacheAssociativity',
680  'data': [ 'none', 'direct', 'complex' ] }
681
682##
683# @HmatCacheWritePolicy:
684#
685# Cache write policy in the Memory Side Cache Information Structure
686# of HMAT
687#
688# For more information of @HmatCacheWritePolicy, see chapter
689# 5.2.27.5: Table 5-147: Field "Cache Attributes" of ACPI 6.3 spec.
690#
691# @none: None (no memory side cache in this proximity domain,
692#        or cache write policy unknown)
693#
694# @write-back: Write Back (WB)
695#
696# @write-through: Write Through (WT)
697#
698# Since: 5.0
699##
700{ 'enum': 'HmatCacheWritePolicy',
701  'data': [ 'none', 'write-back', 'write-through' ] }
702
703##
704# @NumaHmatCacheOptions:
705#
706# Set the memory side cache information for a given memory domain.
707#
708# For more information of @NumaHmatCacheOptions, see chapter
709# 5.2.27.5: Table 5-147: Field "Cache Attributes" of ACPI 6.3 spec.
710#
711# @node-id: the memory proximity domain to which the memory belongs.
712#
713# @size: the size of memory side cache in bytes.
714#
715# @level: the cache level described in this structure.
716#
717# @associativity: the cache associativity,
718#                 none/direct-mapped/complex(complex cache indexing).
719#
720# @policy: the write policy, none/write-back/write-through.
721#
722# @line: the cache Line size in bytes.
723#
724# Since: 5.0
725##
726{ 'struct': 'NumaHmatCacheOptions',
727  'data': {
728   'node-id': 'uint32',
729   'size': 'size',
730   'level': 'uint8',
731   'associativity': 'HmatCacheAssociativity',
732   'policy': 'HmatCacheWritePolicy',
733   'line': 'uint16' }}
734
735##
736# @HostMemPolicy:
737#
738# Host memory policy types
739#
740# @default: restore default policy, remove any nondefault policy
741#
742# @preferred: set the preferred host nodes for allocation
743#
744# @bind: a strict policy that restricts memory allocation to the
745#        host nodes specified
746#
747# @interleave: memory allocations are interleaved across the set
748#              of host nodes specified
749#
750# Since: 2.1
751##
752{ 'enum': 'HostMemPolicy',
753  'data': [ 'default', 'preferred', 'bind', 'interleave' ] }
754
755##
756# @Memdev:
757#
758# Information about memory backend
759#
760# @id: backend's ID if backend has 'id' property (since 2.9)
761#
762# @size: memory backend size
763#
764# @merge: enables or disables memory merge support
765#
766# @dump: includes memory backend's memory in a core dump or not
767#
768# @prealloc: enables or disables memory preallocation
769#
770# @host-nodes: host nodes for its memory policy
771#
772# @policy: memory policy of memory backend
773#
774# Since: 2.1
775##
776{ 'struct': 'Memdev',
777  'data': {
778    '*id':        'str',
779    'size':       'size',
780    'merge':      'bool',
781    'dump':       'bool',
782    'prealloc':   'bool',
783    'host-nodes': ['uint16'],
784    'policy':     'HostMemPolicy' }}
785
786##
787# @query-memdev:
788#
789# Returns information for all memory backends.
790#
791# Returns: a list of @Memdev.
792#
793# Since: 2.1
794#
795# Example:
796#
797# -> { "execute": "query-memdev" }
798# <- { "return": [
799#        {
800#          "id": "mem1",
801#          "size": 536870912,
802#          "merge": false,
803#          "dump": true,
804#          "prealloc": false,
805#          "host-nodes": [0, 1],
806#          "policy": "bind"
807#        },
808#        {
809#          "size": 536870912,
810#          "merge": false,
811#          "dump": true,
812#          "prealloc": true,
813#          "host-nodes": [2, 3],
814#          "policy": "preferred"
815#        }
816#      ]
817#    }
818#
819##
820{ 'command': 'query-memdev', 'returns': ['Memdev'], 'allow-preconfig': true }
821
822##
823# @CpuInstanceProperties:
824#
825# List of properties to be used for hotplugging a CPU instance,
826# it should be passed by management with device_add command when
827# a CPU is being hotplugged.
828#
829# @node-id: NUMA node ID the CPU belongs to
830# @socket-id: socket number within node/board the CPU belongs to
831# @die-id: die number within node/board the CPU belongs to (Since 4.1)
832# @core-id: core number within die the CPU belongs to
833# @thread-id: thread number within core the CPU belongs to
834#
835# Note: currently there are 5 properties that could be present
836#       but management should be prepared to pass through other
837#       properties with device_add command to allow for future
838#       interface extension. This also requires the filed names to be kept in
839#       sync with the properties passed to -device/device_add.
840#
841# Since: 2.7
842##
843{ 'struct': 'CpuInstanceProperties',
844  'data': { '*node-id': 'int',
845            '*socket-id': 'int',
846            '*die-id': 'int',
847            '*core-id': 'int',
848            '*thread-id': 'int'
849  }
850}
851
852##
853# @HotpluggableCPU:
854#
855# @type: CPU object type for usage with device_add command
856# @props: list of properties to be used for hotplugging CPU
857# @vcpus-count: number of logical VCPU threads @HotpluggableCPU provides
858# @qom-path: link to existing CPU object if CPU is present or
859#            omitted if CPU is not present.
860#
861# Since: 2.7
862##
863{ 'struct': 'HotpluggableCPU',
864  'data': { 'type': 'str',
865            'vcpus-count': 'int',
866            'props': 'CpuInstanceProperties',
867            '*qom-path': 'str'
868          }
869}
870
871##
872# @query-hotpluggable-cpus:
873#
874# TODO: Better documentation; currently there is none.
875#
876# Returns: a list of HotpluggableCPU objects.
877#
878# Since: 2.7
879#
880# Example:
881#
882# For pseries machine type started with -smp 2,cores=2,maxcpus=4 -cpu POWER8:
883#
884# -> { "execute": "query-hotpluggable-cpus" }
885# <- {"return": [
886#      { "props": { "core": 8 }, "type": "POWER8-spapr-cpu-core",
887#        "vcpus-count": 1 },
888#      { "props": { "core": 0 }, "type": "POWER8-spapr-cpu-core",
889#        "vcpus-count": 1, "qom-path": "/machine/unattached/device[0]"}
890#    ]}'
891#
892# For pc machine type started with -smp 1,maxcpus=2:
893#
894# -> { "execute": "query-hotpluggable-cpus" }
895# <- {"return": [
896#      {
897#         "type": "qemu64-x86_64-cpu", "vcpus-count": 1,
898#         "props": {"core-id": 0, "socket-id": 1, "thread-id": 0}
899#      },
900#      {
901#         "qom-path": "/machine/unattached/device[0]",
902#         "type": "qemu64-x86_64-cpu", "vcpus-count": 1,
903#         "props": {"core-id": 0, "socket-id": 0, "thread-id": 0}
904#      }
905#    ]}
906#
907# For s390x-virtio-ccw machine type started with -smp 1,maxcpus=2 -cpu qemu
908# (Since: 2.11):
909#
910# -> { "execute": "query-hotpluggable-cpus" }
911# <- {"return": [
912#      {
913#         "type": "qemu-s390x-cpu", "vcpus-count": 1,
914#         "props": { "core-id": 1 }
915#      },
916#      {
917#         "qom-path": "/machine/unattached/device[0]",
918#         "type": "qemu-s390x-cpu", "vcpus-count": 1,
919#         "props": { "core-id": 0 }
920#      }
921#    ]}
922#
923##
924{ 'command': 'query-hotpluggable-cpus', 'returns': ['HotpluggableCPU'],
925             'allow-preconfig': true }
926
927##
928# @set-numa-node:
929#
930# Runtime equivalent of '-numa' CLI option, available at
931# preconfigure stage to configure numa mapping before initializing
932# machine.
933#
934# Since 3.0
935##
936{ 'command': 'set-numa-node', 'boxed': true,
937  'data': 'NumaOptions',
938  'allow-preconfig': true
939}
940