Update version for v4.1.0-rc0 release
[qemu/ar7.git] / qapi / machine.json
blob6db8a7e2eca7bd224989ae8c5f85fedb40e0c1ee
1 # -*- Mode: Python -*-
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.
6 ##
7 # = Machines
8 ##
10 { 'include': 'common.json' }
13 # @CpuInfoArch:
15 # An enumeration of cpu types that enable additional information during
16 # @query-cpus and @query-cpus-fast.
18 # @s390: since 2.12
20 # @riscv: since 2.12
22 # Since: 2.6
24 { 'enum': 'CpuInfoArch',
25   'data': ['x86', 'sparc', 'ppc', 'mips', 'tricore', 's390', 'riscv', 'other' ] }
28 # @CpuInfo:
30 # Information about a virtual CPU
32 # @CPU: the index of the virtual CPU
34 # @current: this only exists for backwards compatibility and should be ignored
36 # @halted: true if the virtual CPU is in the halt state.  Halt usually refers
37 #          to a processor specific low power mode.
39 # @qom_path: path to the CPU object in the QOM tree (since 2.4)
41 # @thread_id: ID of the underlying host thread
43 # @props: properties describing to which node/socket/core/thread
44 #         virtual CPU belongs to, provided if supported by board (since 2.10)
46 # @arch: architecture of the cpu, which determines which additional fields
47 #        will be listed (since 2.6)
49 # Since: 0.14.0
51 # Notes: @halted is a transient state that changes frequently.  By the time the
52 #        data is sent to the client, the guest may no longer be halted.
54 { 'union': 'CpuInfo',
55   'base': {'CPU': 'int', 'current': 'bool', 'halted': 'bool',
56            'qom_path': 'str', 'thread_id': 'int',
57            '*props': 'CpuInstanceProperties', 'arch': 'CpuInfoArch' },
58   'discriminator': 'arch',
59   'data': { 'x86': 'CpuInfoX86',
60             'sparc': 'CpuInfoSPARC',
61             'ppc': 'CpuInfoPPC',
62             'mips': 'CpuInfoMIPS',
63             'tricore': 'CpuInfoTricore',
64             's390': 'CpuInfoS390',
65             'riscv': 'CpuInfoRISCV' } }
68 # @CpuInfoX86:
70 # Additional information about a virtual i386 or x86_64 CPU
72 # @pc: the 64-bit instruction pointer
74 # Since: 2.6
76 { 'struct': 'CpuInfoX86', 'data': { 'pc': 'int' } }
79 # @CpuInfoSPARC:
81 # Additional information about a virtual SPARC CPU
83 # @pc: the PC component of the instruction pointer
85 # @npc: the NPC component of the instruction pointer
87 # Since: 2.6
89 { 'struct': 'CpuInfoSPARC', 'data': { 'pc': 'int', 'npc': 'int' } }
92 # @CpuInfoPPC:
94 # Additional information about a virtual PPC CPU
96 # @nip: the instruction pointer
98 # Since: 2.6
100 { 'struct': 'CpuInfoPPC', 'data': { 'nip': 'int' } }
103 # @CpuInfoMIPS:
105 # Additional information about a virtual MIPS CPU
107 # @PC: the instruction pointer
109 # Since: 2.6
111 { 'struct': 'CpuInfoMIPS', 'data': { 'PC': 'int' } }
114 # @CpuInfoTricore:
116 # Additional information about a virtual Tricore CPU
118 # @PC: the instruction pointer
120 # Since: 2.6
122 { 'struct': 'CpuInfoTricore', 'data': { 'PC': 'int' } }
125 # @CpuInfoRISCV:
127 # Additional information about a virtual RISCV CPU
129 # @pc: the instruction pointer
131 # Since 2.12
133 { 'struct': 'CpuInfoRISCV', 'data': { 'pc': 'int' } }
136 # @CpuS390State:
138 # An enumeration of cpu states that can be assumed by a virtual
139 # S390 CPU
141 # Since: 2.12
143 { 'enum': 'CpuS390State',
144   'prefix': 'S390_CPU_STATE',
145   'data': [ 'uninitialized', 'stopped', 'check-stop', 'operating', 'load' ] }
148 # @CpuInfoS390:
150 # Additional information about a virtual S390 CPU
152 # @cpu-state: the virtual CPU's state
154 # Since: 2.12
156 { 'struct': 'CpuInfoS390', 'data': { 'cpu-state': 'CpuS390State' } }
159 # @query-cpus:
161 # Returns a list of information about each virtual CPU.
163 # This command causes vCPU threads to exit to userspace, which causes
164 # a small interruption to guest CPU execution. This will have a negative
165 # impact on realtime guests and other latency sensitive guest workloads.
166 # It is recommended to use @query-cpus-fast instead of this command to
167 # avoid the vCPU interruption.
169 # Returns: a list of @CpuInfo for each virtual CPU
171 # Since: 0.14.0
173 # Example:
175 # -> { "execute": "query-cpus" }
176 # <- { "return": [
177 #          {
178 #             "CPU":0,
179 #             "current":true,
180 #             "halted":false,
181 #             "qom_path":"/machine/unattached/device[0]",
182 #             "arch":"x86",
183 #             "pc":3227107138,
184 #             "thread_id":3134
185 #          },
186 #          {
187 #             "CPU":1,
188 #             "current":false,
189 #             "halted":true,
190 #             "qom_path":"/machine/unattached/device[2]",
191 #             "arch":"x86",
192 #             "pc":7108165,
193 #             "thread_id":3135
194 #          }
195 #       ]
196 #    }
198 # Notes: This interface is deprecated (since 2.12.0), and it is strongly
199 #        recommended that you avoid using it. Use @query-cpus-fast to
200 #        obtain information about virtual CPUs.
203 { 'command': 'query-cpus', 'returns': ['CpuInfo'] }
206 # @CpuInfoFast:
208 # Information about a virtual CPU
210 # @cpu-index: index of the virtual CPU
212 # @qom-path: path to the CPU object in the QOM tree
214 # @thread-id: ID of the underlying host thread
216 # @props: properties describing to which node/socket/core/thread
217 #         virtual CPU belongs to, provided if supported by board
219 # @arch: base architecture of the cpu; deprecated since 3.0.0 in favor
220 #        of @target
222 # @target: the QEMU system emulation target, which determines which
223 #          additional fields will be listed (since 3.0)
225 # Since: 2.12
228 { 'union'         : 'CpuInfoFast',
229   'base'          : { 'cpu-index'    : 'int',
230                       'qom-path'     : 'str',
231                       'thread-id'    : 'int',
232                       '*props'       : 'CpuInstanceProperties',
233                       'arch'         : 'CpuInfoArch',
234                       'target'       : 'SysEmuTarget' },
235   'discriminator' : 'target',
236   'data'          : { 's390x'        : 'CpuInfoS390' } }
239 # @query-cpus-fast:
241 # Returns information about all virtual CPUs. This command does not
242 # incur a performance penalty and should be used in production
243 # instead of query-cpus.
245 # Returns: list of @CpuInfoFast
247 # Since: 2.12
249 # Example:
251 # -> { "execute": "query-cpus-fast" }
252 # <- { "return": [
253 #         {
254 #             "thread-id": 25627,
255 #             "props": {
256 #                 "core-id": 0,
257 #                 "thread-id": 0,
258 #                 "socket-id": 0
259 #             },
260 #             "qom-path": "/machine/unattached/device[0]",
261 #             "arch":"x86",
262 #             "target":"x86_64",
263 #             "cpu-index": 0
264 #         },
265 #         {
266 #             "thread-id": 25628,
267 #             "props": {
268 #                 "core-id": 0,
269 #                 "thread-id": 0,
270 #                 "socket-id": 1
271 #             },
272 #             "qom-path": "/machine/unattached/device[2]",
273 #             "arch":"x86",
274 #             "target":"x86_64",
275 #             "cpu-index": 1
276 #         }
277 #     ]
278 # }
280 { 'command': 'query-cpus-fast', 'returns': [ 'CpuInfoFast' ] }
283 # @cpu-add:
285 # Adds CPU with specified ID.
287 # @id: ID of CPU to be created, valid values [0..max_cpus)
289 # Returns: Nothing on success
291 # Since: 1.5
293 # Note: This command is deprecated.  The `device_add` command should be
294 #       used instead.  See the `query-hotpluggable-cpus` command for
295 #       details.
297 # Example:
299 # -> { "execute": "cpu-add", "arguments": { "id": 2 } }
300 # <- { "return": {} }
303 { 'command': 'cpu-add', 'data': {'id': 'int'} }
306 # @MachineInfo:
308 # Information describing a machine.
310 # @name: the name of the machine
312 # @alias: an alias for the machine name
314 # @is-default: whether the machine is default
316 # @cpu-max: maximum number of CPUs supported by the machine type
317 #           (since 1.5.0)
319 # @hotpluggable-cpus: cpu hotplug via -device is supported (since 2.7.0)
321 # @numa-mem-supported: true if '-numa node,mem' option is supported by
322 #                      the machine type and false otherwise (since 4.1)
324 # @deprecated: if true, the machine type is deprecated and may be removed
325 #              in future versions of QEMU according to the QEMU deprecation
326 #              policy (since 4.1.0)
328 # Since: 1.2.0
330 { 'struct': 'MachineInfo',
331   'data': { 'name': 'str', '*alias': 'str',
332             '*is-default': 'bool', 'cpu-max': 'int',
333             'hotpluggable-cpus': 'bool',  'numa-mem-supported': 'bool',
334             'deprecated': 'bool' } }
337 # @query-machines:
339 # Return a list of supported machines
341 # Returns: a list of MachineInfo
343 # Since: 1.2.0
345 { 'command': 'query-machines', 'returns': ['MachineInfo'] }
348 # @CurrentMachineParams:
350 # Information describing the running machine parameters.
352 # @wakeup-suspend-support: true if the machine supports wake up from
353 #                          suspend
355 # Since: 4.0
357 { 'struct': 'CurrentMachineParams',
358   'data': { 'wakeup-suspend-support': 'bool'} }
361 # @query-current-machine:
363 # Return information on the current virtual machine.
365 # Returns: CurrentMachineParams
367 # Since: 4.0
369 { 'command': 'query-current-machine', 'returns': 'CurrentMachineParams' }
372 # @NumaOptionsType:
374 # @node: NUMA nodes configuration
376 # @dist: NUMA distance configuration (since 2.10)
378 # @cpu: property based CPU(s) to node mapping (Since: 2.10)
380 # Since: 2.1
382 { 'enum': 'NumaOptionsType',
383   'data': [ 'node', 'dist', 'cpu' ] }
386 # @NumaOptions:
388 # A discriminated record of NUMA options. (for OptsVisitor)
390 # Since: 2.1
392 { 'union': 'NumaOptions',
393   'base': { 'type': 'NumaOptionsType' },
394   'discriminator': 'type',
395   'data': {
396     'node': 'NumaNodeOptions',
397     'dist': 'NumaDistOptions',
398     'cpu': 'NumaCpuOptions' }}
401 # @NumaNodeOptions:
403 # Create a guest NUMA node. (for OptsVisitor)
405 # @nodeid: NUMA node ID (increase by 1 from 0 if omitted)
407 # @cpus: VCPUs belonging to this node (assign VCPUS round-robin
408 #         if omitted)
410 # @mem: memory size of this node; mutually exclusive with @memdev.
411 #       Equally divide total memory among nodes if both @mem and @memdev are
412 #       omitted.
414 # @memdev: memory backend object.  If specified for one node,
415 #          it must be specified for all nodes.
417 # Since: 2.1
419 { 'struct': 'NumaNodeOptions',
420   'data': {
421    '*nodeid': 'uint16',
422    '*cpus':   ['uint16'],
423    '*mem':    'size',
424    '*memdev': 'str' }}
427 # @NumaDistOptions:
429 # Set the distance between 2 NUMA nodes.
431 # @src: source NUMA node.
433 # @dst: destination NUMA node.
435 # @val: NUMA distance from source node to destination node.
436 #       When a node is unreachable from another node, set the distance
437 #       between them to 255.
439 # Since: 2.10
441 { 'struct': 'NumaDistOptions',
442   'data': {
443    'src': 'uint16',
444    'dst': 'uint16',
445    'val': 'uint8' }}
448 # @X86CPURegister32:
450 # A X86 32-bit register
452 # Since: 1.5
454 { 'enum': 'X86CPURegister32',
455   'data': [ 'EAX', 'EBX', 'ECX', 'EDX', 'ESP', 'EBP', 'ESI', 'EDI' ] }
458 # @X86CPUFeatureWordInfo:
460 # Information about a X86 CPU feature word
462 # @cpuid-input-eax: Input EAX value for CPUID instruction for that feature word
464 # @cpuid-input-ecx: Input ECX value for CPUID instruction for that
465 #                   feature word
467 # @cpuid-register: Output register containing the feature bits
469 # @features: value of output register, containing the feature bits
471 # Since: 1.5
473 { 'struct': 'X86CPUFeatureWordInfo',
474   'data': { 'cpuid-input-eax': 'int',
475             '*cpuid-input-ecx': 'int',
476             'cpuid-register': 'X86CPURegister32',
477             'features': 'int' } }
480 # @DummyForceArrays:
482 # Not used by QMP; hack to let us use X86CPUFeatureWordInfoList internally
484 # Since: 2.5
486 { 'struct': 'DummyForceArrays',
487   'data': { 'unused': ['X86CPUFeatureWordInfo'] } }
490 # @NumaCpuOptions:
492 # Option "-numa cpu" overrides default cpu to node mapping.
493 # It accepts the same set of cpu properties as returned by
494 # query-hotpluggable-cpus[].props, where node-id could be used to
495 # override default node mapping.
497 # Since: 2.10
499 { 'struct': 'NumaCpuOptions',
500    'base': 'CpuInstanceProperties',
501    'data' : {} }
504 # @HostMemPolicy:
506 # Host memory policy types
508 # @default: restore default policy, remove any nondefault policy
510 # @preferred: set the preferred host nodes for allocation
512 # @bind: a strict policy that restricts memory allocation to the
513 #        host nodes specified
515 # @interleave: memory allocations are interleaved across the set
516 #              of host nodes specified
518 # Since: 2.1
520 { 'enum': 'HostMemPolicy',
521   'data': [ 'default', 'preferred', 'bind', 'interleave' ] }
524 # @Memdev:
526 # Information about memory backend
528 # @id: backend's ID if backend has 'id' property (since 2.9)
530 # @size: memory backend size
532 # @merge: enables or disables memory merge support
534 # @dump: includes memory backend's memory in a core dump or not
536 # @prealloc: enables or disables memory preallocation
538 # @host-nodes: host nodes for its memory policy
540 # @policy: memory policy of memory backend
542 # Since: 2.1
544 { 'struct': 'Memdev',
545   'data': {
546     '*id':        'str',
547     'size':       'size',
548     'merge':      'bool',
549     'dump':       'bool',
550     'prealloc':   'bool',
551     'host-nodes': ['uint16'],
552     'policy':     'HostMemPolicy' }}
555 # @query-memdev:
557 # Returns information for all memory backends.
559 # Returns: a list of @Memdev.
561 # Since: 2.1
563 # Example:
565 # -> { "execute": "query-memdev" }
566 # <- { "return": [
567 #        {
568 #          "id": "mem1",
569 #          "size": 536870912,
570 #          "merge": false,
571 #          "dump": true,
572 #          "prealloc": false,
573 #          "host-nodes": [0, 1],
574 #          "policy": "bind"
575 #        },
576 #        {
577 #          "size": 536870912,
578 #          "merge": false,
579 #          "dump": true,
580 #          "prealloc": true,
581 #          "host-nodes": [2, 3],
582 #          "policy": "preferred"
583 #        }
584 #      ]
585 #    }
588 { 'command': 'query-memdev', 'returns': ['Memdev'], 'allow-preconfig': true }
591 # @CpuInstanceProperties:
593 # List of properties to be used for hotplugging a CPU instance,
594 # it should be passed by management with device_add command when
595 # a CPU is being hotplugged.
597 # @node-id: NUMA node ID the CPU belongs to
598 # @socket-id: socket number within node/board the CPU belongs to
599 # @die-id: die number within node/board the CPU belongs to (Since 4.1)
600 # @core-id: core number within die the CPU belongs to# @thread-id: thread number within core the CPU belongs to
602 # Note: currently there are 5 properties that could be present
603 # but management should be prepared to pass through other
604 # properties with device_add command to allow for future
605 # interface extension. This also requires the filed names to be kept in
606 # sync with the properties passed to -device/device_add.
608 # Since: 2.7
610 { 'struct': 'CpuInstanceProperties',
611   'data': { '*node-id': 'int',
612             '*socket-id': 'int',
613             '*die-id': 'int',
614             '*core-id': 'int',
615             '*thread-id': 'int'
616   }
620 # @HotpluggableCPU:
622 # @type: CPU object type for usage with device_add command
623 # @props: list of properties to be used for hotplugging CPU
624 # @vcpus-count: number of logical VCPU threads @HotpluggableCPU provides
625 # @qom-path: link to existing CPU object if CPU is present or
626 #            omitted if CPU is not present.
628 # Since: 2.7
630 { 'struct': 'HotpluggableCPU',
631   'data': { 'type': 'str',
632             'vcpus-count': 'int',
633             'props': 'CpuInstanceProperties',
634             '*qom-path': 'str'
635           }
639 # @query-hotpluggable-cpus:
641 # TODO: Better documentation; currently there is none.
643 # Returns: a list of HotpluggableCPU objects.
645 # Since: 2.7
647 # Example:
649 # For pseries machine type started with -smp 2,cores=2,maxcpus=4 -cpu POWER8:
651 # -> { "execute": "query-hotpluggable-cpus" }
652 # <- {"return": [
653 #      { "props": { "core": 8 }, "type": "POWER8-spapr-cpu-core",
654 #        "vcpus-count": 1 },
655 #      { "props": { "core": 0 }, "type": "POWER8-spapr-cpu-core",
656 #        "vcpus-count": 1, "qom-path": "/machine/unattached/device[0]"}
657 #    ]}'
659 # For pc machine type started with -smp 1,maxcpus=2:
661 # -> { "execute": "query-hotpluggable-cpus" }
662 # <- {"return": [
663 #      {
664 #         "type": "qemu64-x86_64-cpu", "vcpus-count": 1,
665 #         "props": {"core-id": 0, "socket-id": 1, "thread-id": 0}
666 #      },
667 #      {
668 #         "qom-path": "/machine/unattached/device[0]",
669 #         "type": "qemu64-x86_64-cpu", "vcpus-count": 1,
670 #         "props": {"core-id": 0, "socket-id": 0, "thread-id": 0}
671 #      }
672 #    ]}
674 # For s390x-virtio-ccw machine type started with -smp 1,maxcpus=2 -cpu qemu
675 # (Since: 2.11):
677 # -> { "execute": "query-hotpluggable-cpus" }
678 # <- {"return": [
679 #      {
680 #         "type": "qemu-s390x-cpu", "vcpus-count": 1,
681 #         "props": { "core-id": 1 }
682 #      },
683 #      {
684 #         "qom-path": "/machine/unattached/device[0]",
685 #         "type": "qemu-s390x-cpu", "vcpus-count": 1,
686 #         "props": { "core-id": 0 }
687 #      }
688 #    ]}
691 { 'command': 'query-hotpluggable-cpus', 'returns': ['HotpluggableCPU'],
692              'allow-preconfig': true }
695 # @set-numa-node:
697 # Runtime equivalent of '-numa' CLI option, available at
698 # preconfigure stage to configure numa mapping before initializing
699 # machine.
701 # Since 3.0
703 { 'command': 'set-numa-node', 'boxed': true,
704   'data': 'NumaOptions',
705   'allow-preconfig': true