target/arm: Move CPU state dumping routines to cpu.c
[qemu/ar7.git] / qapi / misc.json
blobdc4cf9da20a40a28dc5d4e21cd8e69db4983a57d
1 # -*- Mode: Python -*-
4 ##
5 # = Miscellanea
6 ##
8 { 'include': 'common.json' }
11 # @qmp_capabilities:
13 # Enable QMP capabilities.
15 # Arguments:
17 # @enable:   An optional list of QMPCapability values to enable.  The
18 #            client must not enable any capability that is not
19 #            mentioned in the QMP greeting message.  If the field is not
20 #            provided, it means no QMP capabilities will be enabled.
21 #            (since 2.12)
23 # Example:
25 # -> { "execute": "qmp_capabilities",
26 #      "arguments": { "enable": [ "oob" ] } }
27 # <- { "return": {} }
29 # Notes: This command is valid exactly when first connecting: it must be
30 # issued before any other command will be accepted, and will fail once the
31 # monitor is accepting other commands. (see qemu docs/interop/qmp-spec.txt)
33 # The QMP client needs to explicitly enable QMP capabilities, otherwise
34 # all the QMP capabilities will be turned off by default.
36 # Since: 0.13
39 { 'command': 'qmp_capabilities',
40   'data': { '*enable': [ 'QMPCapability' ] },
41   'allow-preconfig': true }
44 # @QMPCapability:
46 # Enumeration of capabilities to be advertised during initial client
47 # connection, used for agreeing on particular QMP extension behaviors.
49 # @oob:   QMP ability to support out-of-band requests.
50 #         (Please refer to qmp-spec.txt for more information on OOB)
52 # Since: 2.12
55 { 'enum': 'QMPCapability',
56   'data': [ 'oob' ] }
59 # @VersionTriple:
61 # A three-part version number.
63 # @major:  The major version number.
65 # @minor:  The minor version number.
67 # @micro:  The micro version number.
69 # Since: 2.4
71 { 'struct': 'VersionTriple',
72   'data': {'major': 'int', 'minor': 'int', 'micro': 'int'} }
76 # @VersionInfo:
78 # A description of QEMU's version.
80 # @qemu:        The version of QEMU.  By current convention, a micro
81 #               version of 50 signifies a development branch.  A micro version
82 #               greater than or equal to 90 signifies a release candidate for
83 #               the next minor version.  A micro version of less than 50
84 #               signifies a stable release.
86 # @package:     QEMU will always set this field to an empty string.  Downstream
87 #               versions of QEMU should set this to a non-empty string.  The
88 #               exact format depends on the downstream however it highly
89 #               recommended that a unique name is used.
91 # Since: 0.14.0
93 { 'struct': 'VersionInfo',
94   'data': {'qemu': 'VersionTriple', 'package': 'str'} }
97 # @query-version:
99 # Returns the current version of QEMU.
101 # Returns:  A @VersionInfo object describing the current version of QEMU.
103 # Since: 0.14.0
105 # Example:
107 # -> { "execute": "query-version" }
108 # <- {
109 #       "return":{
110 #          "qemu":{
111 #             "major":0,
112 #             "minor":11,
113 #             "micro":5
114 #          },
115 #          "package":""
116 #       }
117 #    }
120 { 'command': 'query-version', 'returns': 'VersionInfo',
121   'allow-preconfig': true }
124 # @CommandInfo:
126 # Information about a QMP command
128 # @name: The command name
130 # Since: 0.14.0
132 { 'struct': 'CommandInfo', 'data': {'name': 'str'} }
135 # @query-commands:
137 # Return a list of supported QMP commands by this server
139 # Returns: A list of @CommandInfo for all supported commands
141 # Since: 0.14.0
143 # Example:
145 # -> { "execute": "query-commands" }
146 # <- {
147 #      "return":[
148 #         {
149 #            "name":"query-balloon"
150 #         },
151 #         {
152 #            "name":"system_powerdown"
153 #         }
154 #      ]
155 #    }
157 # Note: This example has been shortened as the real response is too long.
160 { 'command': 'query-commands', 'returns': ['CommandInfo'],
161   'allow-preconfig': true }
164 # @LostTickPolicy:
166 # Policy for handling lost ticks in timer devices.
168 # @discard: throw away the missed tick(s) and continue with future injection
169 #           normally.  Guest time may be delayed, unless the OS has explicit
170 #           handling of lost ticks
172 # @delay: continue to deliver ticks at the normal rate.  Guest time will be
173 #         delayed due to the late tick
175 # @slew: deliver ticks at a higher rate to catch up with the missed tick. The
176 #        guest time should not be delayed once catchup is complete.
178 # Since: 2.0
180 { 'enum': 'LostTickPolicy',
181   'data': ['discard', 'delay', 'slew' ] }
184 # @add_client:
186 # Allow client connections for VNC, Spice and socket based
187 # character devices to be passed in to QEMU via SCM_RIGHTS.
189 # @protocol: protocol name. Valid names are "vnc", "spice" or the
190 #            name of a character device (eg. from -chardev id=XXXX)
192 # @fdname: file descriptor name previously passed via 'getfd' command
194 # @skipauth: whether to skip authentication. Only applies
195 #            to "vnc" and "spice" protocols
197 # @tls: whether to perform TLS. Only applies to the "spice"
198 #       protocol
200 # Returns: nothing on success.
202 # Since: 0.14.0
204 # Example:
206 # -> { "execute": "add_client", "arguments": { "protocol": "vnc",
207 #                                              "fdname": "myclient" } }
208 # <- { "return": {} }
211 { 'command': 'add_client',
212   'data': { 'protocol': 'str', 'fdname': 'str', '*skipauth': 'bool',
213             '*tls': 'bool' } }
216 # @NameInfo:
218 # Guest name information.
220 # @name: The name of the guest
222 # Since: 0.14.0
224 { 'struct': 'NameInfo', 'data': {'*name': 'str'} }
227 # @query-name:
229 # Return the name information of a guest.
231 # Returns: @NameInfo of the guest
233 # Since: 0.14.0
235 # Example:
237 # -> { "execute": "query-name" }
238 # <- { "return": { "name": "qemu-name" } }
241 { 'command': 'query-name', 'returns': 'NameInfo', 'allow-preconfig': true }
244 # @KvmInfo:
246 # Information about support for KVM acceleration
248 # @enabled: true if KVM acceleration is active
250 # @present: true if KVM acceleration is built into this executable
252 # Since: 0.14.0
254 { 'struct': 'KvmInfo', 'data': {'enabled': 'bool', 'present': 'bool'} }
257 # @query-kvm:
259 # Returns information about KVM acceleration
261 # Returns: @KvmInfo
263 # Since: 0.14.0
265 # Example:
267 # -> { "execute": "query-kvm" }
268 # <- { "return": { "enabled": true, "present": true } }
271 { 'command': 'query-kvm', 'returns': 'KvmInfo' }
274 # @UuidInfo:
276 # Guest UUID information (Universally Unique Identifier).
278 # @UUID: the UUID of the guest
280 # Since: 0.14.0
282 # Notes: If no UUID was specified for the guest, a null UUID is returned.
284 { 'struct': 'UuidInfo', 'data': {'UUID': 'str'} }
287 # @query-uuid:
289 # Query the guest UUID information.
291 # Returns: The @UuidInfo for the guest
293 # Since: 0.14.0
295 # Example:
297 # -> { "execute": "query-uuid" }
298 # <- { "return": { "UUID": "550e8400-e29b-41d4-a716-446655440000" } }
301 { 'command': 'query-uuid', 'returns': 'UuidInfo', 'allow-preconfig': true }
304 # @EventInfo:
306 # Information about a QMP event
308 # @name: The event name
310 # Since: 1.2.0
312 { 'struct': 'EventInfo', 'data': {'name': 'str'} }
315 # @query-events:
317 # Return information on QMP events.
319 # Returns: A list of @EventInfo.
321 # Since: 1.2.0
323 # Note: This command is deprecated, because its output doesn't reflect
324 # compile-time configuration.  Use query-qmp-schema instead.
326 # Example:
328 # -> { "execute": "query-events" }
329 # <- {
330 #      "return": [
331 #          {
332 #             "name":"SHUTDOWN"
333 #          },
334 #          {
335 #             "name":"RESET"
336 #          }
337 #       ]
338 #    }
340 # Note: This example has been shortened as the real response is too long.
343 { 'command': 'query-events', 'returns': ['EventInfo'] }
346 # @CpuInfoArch:
348 # An enumeration of cpu types that enable additional information during
349 # @query-cpus and @query-cpus-fast.
351 # @s390: since 2.12
353 # @riscv: since 2.12
355 # Since: 2.6
357 { 'enum': 'CpuInfoArch',
358   'data': ['x86', 'sparc', 'ppc', 'mips', 'tricore', 's390', 'riscv', 'other' ] }
361 # @CpuInfo:
363 # Information about a virtual CPU
365 # @CPU: the index of the virtual CPU
367 # @current: this only exists for backwards compatibility and should be ignored
369 # @halted: true if the virtual CPU is in the halt state.  Halt usually refers
370 #          to a processor specific low power mode.
372 # @qom_path: path to the CPU object in the QOM tree (since 2.4)
374 # @thread_id: ID of the underlying host thread
376 # @props: properties describing to which node/socket/core/thread
377 #         virtual CPU belongs to, provided if supported by board (since 2.10)
379 # @arch: architecture of the cpu, which determines which additional fields
380 #        will be listed (since 2.6)
382 # Since: 0.14.0
384 # Notes: @halted is a transient state that changes frequently.  By the time the
385 #        data is sent to the client, the guest may no longer be halted.
387 { 'union': 'CpuInfo',
388   'base': {'CPU': 'int', 'current': 'bool', 'halted': 'bool',
389            'qom_path': 'str', 'thread_id': 'int',
390            '*props': 'CpuInstanceProperties', 'arch': 'CpuInfoArch' },
391   'discriminator': 'arch',
392   'data': { 'x86': 'CpuInfoX86',
393             'sparc': 'CpuInfoSPARC',
394             'ppc': 'CpuInfoPPC',
395             'mips': 'CpuInfoMIPS',
396             'tricore': 'CpuInfoTricore',
397             's390': 'CpuInfoS390',
398             'riscv': 'CpuInfoRISCV' } }
401 # @CpuInfoX86:
403 # Additional information about a virtual i386 or x86_64 CPU
405 # @pc: the 64-bit instruction pointer
407 # Since: 2.6
409 { 'struct': 'CpuInfoX86', 'data': { 'pc': 'int' } }
412 # @CpuInfoSPARC:
414 # Additional information about a virtual SPARC CPU
416 # @pc: the PC component of the instruction pointer
418 # @npc: the NPC component of the instruction pointer
420 # Since: 2.6
422 { 'struct': 'CpuInfoSPARC', 'data': { 'pc': 'int', 'npc': 'int' } }
425 # @CpuInfoPPC:
427 # Additional information about a virtual PPC CPU
429 # @nip: the instruction pointer
431 # Since: 2.6
433 { 'struct': 'CpuInfoPPC', 'data': { 'nip': 'int' } }
436 # @CpuInfoMIPS:
438 # Additional information about a virtual MIPS CPU
440 # @PC: the instruction pointer
442 # Since: 2.6
444 { 'struct': 'CpuInfoMIPS', 'data': { 'PC': 'int' } }
447 # @CpuInfoTricore:
449 # Additional information about a virtual Tricore CPU
451 # @PC: the instruction pointer
453 # Since: 2.6
455 { 'struct': 'CpuInfoTricore', 'data': { 'PC': 'int' } }
458 # @CpuInfoRISCV:
460 # Additional information about a virtual RISCV CPU
462 # @pc: the instruction pointer
464 # Since 2.12
466 { 'struct': 'CpuInfoRISCV', 'data': { 'pc': 'int' } }
469 # @CpuS390State:
471 # An enumeration of cpu states that can be assumed by a virtual
472 # S390 CPU
474 # Since: 2.12
476 { 'enum': 'CpuS390State',
477   'prefix': 'S390_CPU_STATE',
478   'data': [ 'uninitialized', 'stopped', 'check-stop', 'operating', 'load' ] }
481 # @CpuInfoS390:
483 # Additional information about a virtual S390 CPU
485 # @cpu-state: the virtual CPU's state
487 # Since: 2.12
489 { 'struct': 'CpuInfoS390', 'data': { 'cpu-state': 'CpuS390State' } }
492 # @query-cpus:
494 # Returns a list of information about each virtual CPU.
496 # This command causes vCPU threads to exit to userspace, which causes
497 # a small interruption to guest CPU execution. This will have a negative
498 # impact on realtime guests and other latency sensitive guest workloads.
499 # It is recommended to use @query-cpus-fast instead of this command to
500 # avoid the vCPU interruption.
502 # Returns: a list of @CpuInfo for each virtual CPU
504 # Since: 0.14.0
506 # Example:
508 # -> { "execute": "query-cpus" }
509 # <- { "return": [
510 #          {
511 #             "CPU":0,
512 #             "current":true,
513 #             "halted":false,
514 #             "qom_path":"/machine/unattached/device[0]",
515 #             "arch":"x86",
516 #             "pc":3227107138,
517 #             "thread_id":3134
518 #          },
519 #          {
520 #             "CPU":1,
521 #             "current":false,
522 #             "halted":true,
523 #             "qom_path":"/machine/unattached/device[2]",
524 #             "arch":"x86",
525 #             "pc":7108165,
526 #             "thread_id":3135
527 #          }
528 #       ]
529 #    }
531 # Notes: This interface is deprecated (since 2.12.0), and it is strongly
532 #        recommended that you avoid using it. Use @query-cpus-fast to
533 #        obtain information about virtual CPUs.
536 { 'command': 'query-cpus', 'returns': ['CpuInfo'] }
539 # @CpuInfoFast:
541 # Information about a virtual CPU
543 # @cpu-index: index of the virtual CPU
545 # @qom-path: path to the CPU object in the QOM tree
547 # @thread-id: ID of the underlying host thread
549 # @props: properties describing to which node/socket/core/thread
550 #         virtual CPU belongs to, provided if supported by board
552 # @arch: base architecture of the cpu; deprecated since 3.0.0 in favor
553 #        of @target
555 # @target: the QEMU system emulation target, which determines which
556 #          additional fields will be listed (since 3.0)
558 # Since: 2.12
561 { 'union'         : 'CpuInfoFast',
562   'base'          : { 'cpu-index'    : 'int',
563                       'qom-path'     : 'str',
564                       'thread-id'    : 'int',
565                       '*props'       : 'CpuInstanceProperties',
566                       'arch'         : 'CpuInfoArch',
567                       'target'       : 'SysEmuTarget' },
568   'discriminator' : 'target',
569   'data'          : { 's390x'        : 'CpuInfoS390' } }
572 # @query-cpus-fast:
574 # Returns information about all virtual CPUs. This command does not
575 # incur a performance penalty and should be used in production
576 # instead of query-cpus.
578 # Returns: list of @CpuInfoFast
580 # Since: 2.12
582 # Example:
584 # -> { "execute": "query-cpus-fast" }
585 # <- { "return": [
586 #         {
587 #             "thread-id": 25627,
588 #             "props": {
589 #                 "core-id": 0,
590 #                 "thread-id": 0,
591 #                 "socket-id": 0
592 #             },
593 #             "qom-path": "/machine/unattached/device[0]",
594 #             "arch":"x86",
595 #             "target":"x86_64",
596 #             "cpu-index": 0
597 #         },
598 #         {
599 #             "thread-id": 25628,
600 #             "props": {
601 #                 "core-id": 0,
602 #                 "thread-id": 0,
603 #                 "socket-id": 1
604 #             },
605 #             "qom-path": "/machine/unattached/device[2]",
606 #             "arch":"x86",
607 #             "target":"x86_64",
608 #             "cpu-index": 1
609 #         }
610 #     ]
611 # }
613 { 'command': 'query-cpus-fast', 'returns': [ 'CpuInfoFast' ] }
616 # @IOThreadInfo:
618 # Information about an iothread
620 # @id: the identifier of the iothread
622 # @thread-id: ID of the underlying host thread
624 # @poll-max-ns: maximum polling time in ns, 0 means polling is disabled
625 #               (since 2.9)
627 # @poll-grow: how many ns will be added to polling time, 0 means that it's not
628 #             configured (since 2.9)
630 # @poll-shrink: how many ns will be removed from polling time, 0 means that
631 #               it's not configured (since 2.9)
633 # Since: 2.0
635 { 'struct': 'IOThreadInfo',
636   'data': {'id': 'str',
637            'thread-id': 'int',
638            'poll-max-ns': 'int',
639            'poll-grow': 'int',
640            'poll-shrink': 'int' } }
643 # @query-iothreads:
645 # Returns a list of information about each iothread.
647 # Note: this list excludes the QEMU main loop thread, which is not declared
648 # using the -object iothread command-line option.  It is always the main thread
649 # of the process.
651 # Returns: a list of @IOThreadInfo for each iothread
653 # Since: 2.0
655 # Example:
657 # -> { "execute": "query-iothreads" }
658 # <- { "return": [
659 #          {
660 #             "id":"iothread0",
661 #             "thread-id":3134
662 #          },
663 #          {
664 #             "id":"iothread1",
665 #             "thread-id":3135
666 #          }
667 #       ]
668 #    }
671 { 'command': 'query-iothreads', 'returns': ['IOThreadInfo'],
672   'allow-preconfig': true }
675 # @BalloonInfo:
677 # Information about the guest balloon device.
679 # @actual: the number of bytes the balloon currently contains
681 # Since: 0.14.0
684 { 'struct': 'BalloonInfo', 'data': {'actual': 'int' } }
687 # @query-balloon:
689 # Return information about the balloon device.
691 # Returns: @BalloonInfo on success
693 #          If the balloon driver is enabled but not functional because the KVM
694 #          kernel module cannot support it, KvmMissingCap
696 #          If no balloon device is present, DeviceNotActive
698 # Since: 0.14.0
700 # Example:
702 # -> { "execute": "query-balloon" }
703 # <- { "return": {
704 #          "actual": 1073741824,
705 #       }
706 #    }
709 { 'command': 'query-balloon', 'returns': 'BalloonInfo' }
712 # @BALLOON_CHANGE:
714 # Emitted when the guest changes the actual BALLOON level. This value is
715 # equivalent to the @actual field return by the 'query-balloon' command
717 # @actual: actual level of the guest memory balloon in bytes
719 # Note: this event is rate-limited.
721 # Since: 1.2
723 # Example:
725 # <- { "event": "BALLOON_CHANGE",
726 #      "data": { "actual": 944766976 },
727 #      "timestamp": { "seconds": 1267020223, "microseconds": 435656 } }
730 { 'event': 'BALLOON_CHANGE',
731   'data': { 'actual': 'int' } }
734 # @PciMemoryRange:
736 # A PCI device memory region
738 # @base: the starting address (guest physical)
740 # @limit: the ending address (guest physical)
742 # Since: 0.14.0
744 { 'struct': 'PciMemoryRange', 'data': {'base': 'int', 'limit': 'int'} }
747 # @PciMemoryRegion:
749 # Information about a PCI device I/O region.
751 # @bar: the index of the Base Address Register for this region
753 # @type: 'io' if the region is a PIO region
754 #        'memory' if the region is a MMIO region
756 # @size: memory size
758 # @prefetch: if @type is 'memory', true if the memory is prefetchable
760 # @mem_type_64: if @type is 'memory', true if the BAR is 64-bit
762 # Since: 0.14.0
764 { 'struct': 'PciMemoryRegion',
765   'data': {'bar': 'int', 'type': 'str', 'address': 'int', 'size': 'int',
766            '*prefetch': 'bool', '*mem_type_64': 'bool' } }
769 # @PciBusInfo:
771 # Information about a bus of a PCI Bridge device
773 # @number: primary bus interface number.  This should be the number of the
774 #          bus the device resides on.
776 # @secondary: secondary bus interface number.  This is the number of the
777 #             main bus for the bridge
779 # @subordinate: This is the highest number bus that resides below the
780 #               bridge.
782 # @io_range: The PIO range for all devices on this bridge
784 # @memory_range: The MMIO range for all devices on this bridge
786 # @prefetchable_range: The range of prefetchable MMIO for all devices on
787 #                      this bridge
789 # Since: 2.4
791 { 'struct': 'PciBusInfo',
792   'data': {'number': 'int', 'secondary': 'int', 'subordinate': 'int',
793            'io_range': 'PciMemoryRange',
794            'memory_range': 'PciMemoryRange',
795            'prefetchable_range': 'PciMemoryRange' } }
798 # @PciBridgeInfo:
800 # Information about a PCI Bridge device
802 # @bus: information about the bus the device resides on
804 # @devices: a list of @PciDeviceInfo for each device on this bridge
806 # Since: 0.14.0
808 { 'struct': 'PciBridgeInfo',
809   'data': {'bus': 'PciBusInfo', '*devices': ['PciDeviceInfo']} }
812 # @PciDeviceClass:
814 # Information about the Class of a PCI device
816 # @desc: a string description of the device's class
818 # @class: the class code of the device
820 # Since: 2.4
822 { 'struct': 'PciDeviceClass',
823   'data': {'*desc': 'str', 'class': 'int'} }
826 # @PciDeviceId:
828 # Information about the Id of a PCI device
830 # @device: the PCI device id
832 # @vendor: the PCI vendor id
834 # @subsystem: the PCI subsystem id (since 3.1)
836 # @subsystem-vendor: the PCI subsystem vendor id (since 3.1)
838 # Since: 2.4
840 { 'struct': 'PciDeviceId',
841   'data': {'device': 'int', 'vendor': 'int', '*subsystem': 'int',
842             '*subsystem-vendor': 'int'} }
845 # @PciDeviceInfo:
847 # Information about a PCI device
849 # @bus: the bus number of the device
851 # @slot: the slot the device is located in
853 # @function: the function of the slot used by the device
855 # @class_info: the class of the device
857 # @id: the PCI device id
859 # @irq: if an IRQ is assigned to the device, the IRQ number
861 # @qdev_id: the device name of the PCI device
863 # @pci_bridge: if the device is a PCI bridge, the bridge information
865 # @regions: a list of the PCI I/O regions associated with the device
867 # Notes: the contents of @class_info.desc are not stable and should only be
868 #        treated as informational.
870 # Since: 0.14.0
872 { 'struct': 'PciDeviceInfo',
873   'data': {'bus': 'int', 'slot': 'int', 'function': 'int',
874            'class_info': 'PciDeviceClass', 'id': 'PciDeviceId',
875            '*irq': 'int', 'qdev_id': 'str', '*pci_bridge': 'PciBridgeInfo',
876            'regions': ['PciMemoryRegion']} }
879 # @PciInfo:
881 # Information about a PCI bus
883 # @bus: the bus index
885 # @devices: a list of devices on this bus
887 # Since: 0.14.0
889 { 'struct': 'PciInfo', 'data': {'bus': 'int', 'devices': ['PciDeviceInfo']} }
892 # @query-pci:
894 # Return information about the PCI bus topology of the guest.
896 # Returns: a list of @PciInfo for each PCI bus. Each bus is
897 # represented by a json-object, which has a key with a json-array of
898 # all PCI devices attached to it. Each device is represented by a
899 # json-object.
901 # Since: 0.14.0
903 # Example:
905 # -> { "execute": "query-pci" }
906 # <- { "return": [
907 #          {
908 #             "bus": 0,
909 #             "devices": [
910 #                {
911 #                   "bus": 0,
912 #                   "qdev_id": "",
913 #                   "slot": 0,
914 #                   "class_info": {
915 #                      "class": 1536,
916 #                      "desc": "Host bridge"
917 #                   },
918 #                   "id": {
919 #                      "device": 32902,
920 #                      "vendor": 4663
921 #                   },
922 #                   "function": 0,
923 #                   "regions": [
924 #                   ]
925 #                },
926 #                {
927 #                   "bus": 0,
928 #                   "qdev_id": "",
929 #                   "slot": 1,
930 #                   "class_info": {
931 #                      "class": 1537,
932 #                      "desc": "ISA bridge"
933 #                   },
934 #                   "id": {
935 #                      "device": 32902,
936 #                      "vendor": 28672
937 #                   },
938 #                   "function": 0,
939 #                   "regions": [
940 #                   ]
941 #                },
942 #                {
943 #                   "bus": 0,
944 #                   "qdev_id": "",
945 #                   "slot": 1,
946 #                   "class_info": {
947 #                      "class": 257,
948 #                      "desc": "IDE controller"
949 #                   },
950 #                   "id": {
951 #                      "device": 32902,
952 #                      "vendor": 28688
953 #                   },
954 #                   "function": 1,
955 #                   "regions": [
956 #                      {
957 #                         "bar": 4,
958 #                         "size": 16,
959 #                         "address": 49152,
960 #                         "type": "io"
961 #                      }
962 #                   ]
963 #                },
964 #                {
965 #                   "bus": 0,
966 #                   "qdev_id": "",
967 #                   "slot": 2,
968 #                   "class_info": {
969 #                      "class": 768,
970 #                      "desc": "VGA controller"
971 #                   },
972 #                   "id": {
973 #                      "device": 4115,
974 #                      "vendor": 184
975 #                   },
976 #                   "function": 0,
977 #                   "regions": [
978 #                      {
979 #                         "prefetch": true,
980 #                         "mem_type_64": false,
981 #                         "bar": 0,
982 #                         "size": 33554432,
983 #                         "address": 4026531840,
984 #                         "type": "memory"
985 #                      },
986 #                      {
987 #                         "prefetch": false,
988 #                         "mem_type_64": false,
989 #                         "bar": 1,
990 #                         "size": 4096,
991 #                         "address": 4060086272,
992 #                         "type": "memory"
993 #                      },
994 #                      {
995 #                         "prefetch": false,
996 #                         "mem_type_64": false,
997 #                         "bar": 6,
998 #                         "size": 65536,
999 #                         "address": -1,
1000 #                         "type": "memory"
1001 #                      }
1002 #                   ]
1003 #                },
1004 #                {
1005 #                   "bus": 0,
1006 #                   "qdev_id": "",
1007 #                   "irq": 11,
1008 #                   "slot": 4,
1009 #                   "class_info": {
1010 #                      "class": 1280,
1011 #                      "desc": "RAM controller"
1012 #                   },
1013 #                   "id": {
1014 #                      "device": 6900,
1015 #                      "vendor": 4098
1016 #                   },
1017 #                   "function": 0,
1018 #                   "regions": [
1019 #                      {
1020 #                         "bar": 0,
1021 #                         "size": 32,
1022 #                         "address": 49280,
1023 #                         "type": "io"
1024 #                      }
1025 #                   ]
1026 #                }
1027 #             ]
1028 #          }
1029 #       ]
1030 #    }
1032 # Note: This example has been shortened as the real response is too long.
1035 { 'command': 'query-pci', 'returns': ['PciInfo'] }
1038 # @quit:
1040 # This command will cause the QEMU process to exit gracefully.  While every
1041 # attempt is made to send the QMP response before terminating, this is not
1042 # guaranteed.  When using this interface, a premature EOF would not be
1043 # unexpected.
1045 # Since: 0.14.0
1047 # Example:
1049 # -> { "execute": "quit" }
1050 # <- { "return": {} }
1052 { 'command': 'quit' }
1055 # @stop:
1057 # Stop all guest VCPU execution.
1059 # Since:  0.14.0
1061 # Notes:  This function will succeed even if the guest is already in the stopped
1062 #         state.  In "inmigrate" state, it will ensure that the guest
1063 #         remains paused once migration finishes, as if the -S option was
1064 #         passed on the command line.
1066 # Example:
1068 # -> { "execute": "stop" }
1069 # <- { "return": {} }
1072 { 'command': 'stop' }
1075 # @system_reset:
1077 # Performs a hard reset of a guest.
1079 # Since: 0.14.0
1081 # Example:
1083 # -> { "execute": "system_reset" }
1084 # <- { "return": {} }
1087 { 'command': 'system_reset' }
1090 # @system_powerdown:
1092 # Requests that a guest perform a powerdown operation.
1094 # Since: 0.14.0
1096 # Notes: A guest may or may not respond to this command.  This command
1097 #        returning does not indicate that a guest has accepted the request or
1098 #        that it has shut down.  Many guests will respond to this command by
1099 #        prompting the user in some way.
1100 # Example:
1102 # -> { "execute": "system_powerdown" }
1103 # <- { "return": {} }
1106 { 'command': 'system_powerdown' }
1109 # @cpu-add:
1111 # Adds CPU with specified ID.
1113 # @id: ID of CPU to be created, valid values [0..max_cpus)
1115 # Returns: Nothing on success
1117 # Since: 1.5
1119 # Note: This command is deprecated.  The `device_add` command should be
1120 #       used instead.  See the `query-hotpluggable-cpus` command for
1121 #       details.
1123 # Example:
1125 # -> { "execute": "cpu-add", "arguments": { "id": 2 } }
1126 # <- { "return": {} }
1129 { 'command': 'cpu-add', 'data': {'id': 'int'} }
1132 # @memsave:
1134 # Save a portion of guest memory to a file.
1136 # @val: the virtual address of the guest to start from
1138 # @size: the size of memory region to save
1140 # @filename: the file to save the memory to as binary data
1142 # @cpu-index: the index of the virtual CPU to use for translating the
1143 #                       virtual address (defaults to CPU 0)
1145 # Returns: Nothing on success
1147 # Since: 0.14.0
1149 # Notes: Errors were not reliably returned until 1.1
1151 # Example:
1153 # -> { "execute": "memsave",
1154 #      "arguments": { "val": 10,
1155 #                     "size": 100,
1156 #                     "filename": "/tmp/virtual-mem-dump" } }
1157 # <- { "return": {} }
1160 { 'command': 'memsave',
1161   'data': {'val': 'int', 'size': 'int', 'filename': 'str', '*cpu-index': 'int'} }
1164 # @pmemsave:
1166 # Save a portion of guest physical memory to a file.
1168 # @val: the physical address of the guest to start from
1170 # @size: the size of memory region to save
1172 # @filename: the file to save the memory to as binary data
1174 # Returns: Nothing on success
1176 # Since: 0.14.0
1178 # Notes: Errors were not reliably returned until 1.1
1180 # Example:
1182 # -> { "execute": "pmemsave",
1183 #      "arguments": { "val": 10,
1184 #                     "size": 100,
1185 #                     "filename": "/tmp/physical-mem-dump" } }
1186 # <- { "return": {} }
1189 { 'command': 'pmemsave',
1190   'data': {'val': 'int', 'size': 'int', 'filename': 'str'} }
1193 # @cont:
1195 # Resume guest VCPU execution.
1197 # Since:  0.14.0
1199 # Returns:  If successful, nothing
1201 # Notes:  This command will succeed if the guest is currently running.  It
1202 #         will also succeed if the guest is in the "inmigrate" state; in
1203 #         this case, the effect of the command is to make sure the guest
1204 #         starts once migration finishes, removing the effect of the -S
1205 #         command line option if it was passed.
1207 # Example:
1209 # -> { "execute": "cont" }
1210 # <- { "return": {} }
1213 { 'command': 'cont' }
1216 # @x-exit-preconfig:
1218 # Exit from "preconfig" state
1220 # This command makes QEMU exit the preconfig state and proceed with
1221 # VM initialization using configuration data provided on the command line
1222 # and via the QMP monitor during the preconfig state. The command is only
1223 # available during the preconfig state (i.e. when the --preconfig command
1224 # line option was in use).
1226 # Since 3.0
1228 # Returns: nothing
1230 # Example:
1232 # -> { "execute": "x-exit-preconfig" }
1233 # <- { "return": {} }
1236 { 'command': 'x-exit-preconfig', 'allow-preconfig': true }
1239 # @system_wakeup:
1241 # Wake up guest from suspend. If the guest has wake-up from suspend
1242 # support enabled (wakeup-suspend-support flag from
1243 # query-current-machine), wake-up guest from suspend if the guest is
1244 # in SUSPENDED state. Return an error otherwise.
1246 # Since:  1.1
1248 # Returns:  nothing.
1250 # Note: prior to 4.0, this command does nothing in case the guest
1251 # isn't suspended.
1253 # Example:
1255 # -> { "execute": "system_wakeup" }
1256 # <- { "return": {} }
1259 { 'command': 'system_wakeup' }
1262 # @inject-nmi:
1264 # Injects a Non-Maskable Interrupt into the default CPU (x86/s390) or all CPUs (ppc64).
1265 # The command fails when the guest doesn't support injecting.
1267 # Returns:  If successful, nothing
1269 # Since:  0.14.0
1271 # Note: prior to 2.1, this command was only supported for x86 and s390 VMs
1273 # Example:
1275 # -> { "execute": "inject-nmi" }
1276 # <- { "return": {} }
1279 { 'command': 'inject-nmi' }
1282 # @balloon:
1284 # Request the balloon driver to change its balloon size.
1286 # @value: the target size of the balloon in bytes
1288 # Returns: Nothing on success
1289 #          If the balloon driver is enabled but not functional because the KVM
1290 #            kernel module cannot support it, KvmMissingCap
1291 #          If no balloon device is present, DeviceNotActive
1293 # Notes: This command just issues a request to the guest.  When it returns,
1294 #        the balloon size may not have changed.  A guest can change the balloon
1295 #        size independent of this command.
1297 # Since: 0.14.0
1299 # Example:
1301 # -> { "execute": "balloon", "arguments": { "value": 536870912 } }
1302 # <- { "return": {} }
1305 { 'command': 'balloon', 'data': {'value': 'int'} }
1308 # @human-monitor-command:
1310 # Execute a command on the human monitor and return the output.
1312 # @command-line: the command to execute in the human monitor
1314 # @cpu-index: The CPU to use for commands that require an implicit CPU
1316 # Returns: the output of the command as a string
1318 # Since: 0.14.0
1320 # Notes: This command only exists as a stop-gap.  Its use is highly
1321 #        discouraged.  The semantics of this command are not
1322 #        guaranteed: this means that command names, arguments and
1323 #        responses can change or be removed at ANY time.  Applications
1324 #        that rely on long term stability guarantees should NOT
1325 #        use this command.
1327 #        Known limitations:
1329 #        * This command is stateless, this means that commands that depend
1330 #          on state information (such as getfd) might not work
1332 #        * Commands that prompt the user for data don't currently work
1334 # Example:
1336 # -> { "execute": "human-monitor-command",
1337 #      "arguments": { "command-line": "info kvm" } }
1338 # <- { "return": "kvm support: enabled\r\n" }
1341 { 'command': 'human-monitor-command',
1342   'data': {'command-line': 'str', '*cpu-index': 'int'},
1343   'returns': 'str' }
1346 # @ObjectPropertyInfo:
1348 # @name: the name of the property
1350 # @type: the type of the property.  This will typically come in one of four
1351 #        forms:
1353 #        1) A primitive type such as 'u8', 'u16', 'bool', 'str', or 'double'.
1354 #           These types are mapped to the appropriate JSON type.
1356 #        2) A child type in the form 'child<subtype>' where subtype is a qdev
1357 #           device type name.  Child properties create the composition tree.
1359 #        3) A link type in the form 'link<subtype>' where subtype is a qdev
1360 #           device type name.  Link properties form the device model graph.
1362 # @description: if specified, the description of the property.
1364 # Since: 1.2
1366 { 'struct': 'ObjectPropertyInfo',
1367   'data': { 'name': 'str', 'type': 'str', '*description': 'str' } }
1370 # @qom-list:
1372 # This command will list any properties of a object given a path in the object
1373 # model.
1375 # @path: the path within the object model.  See @qom-get for a description of
1376 #        this parameter.
1378 # Returns: a list of @ObjectPropertyInfo that describe the properties of the
1379 #          object.
1381 # Since: 1.2
1383 # Example:
1385 # -> { "execute": "qom-list",
1386 #      "arguments": { "path": "/chardevs" } }
1387 # <- { "return": [ { "name": "type", "type": "string" },
1388 #                  { "name": "parallel0", "type": "child<chardev-vc>" },
1389 #                  { "name": "serial0", "type": "child<chardev-vc>" },
1390 #                  { "name": "mon0", "type": "child<chardev-stdio>" } ] }
1393 { 'command': 'qom-list',
1394   'data': { 'path': 'str' },
1395   'returns': [ 'ObjectPropertyInfo' ],
1396   'allow-preconfig': true }
1399 # @qom-get:
1401 # This command will get a property from a object model path and return the
1402 # value.
1404 # @path: The path within the object model.  There are two forms of supported
1405 #        paths--absolute and partial paths.
1407 #        Absolute paths are derived from the root object and can follow child<>
1408 #        or link<> properties.  Since they can follow link<> properties, they
1409 #        can be arbitrarily long.  Absolute paths look like absolute filenames
1410 #        and are prefixed  with a leading slash.
1412 #        Partial paths look like relative filenames.  They do not begin
1413 #        with a prefix.  The matching rules for partial paths are subtle but
1414 #        designed to make specifying objects easy.  At each level of the
1415 #        composition tree, the partial path is matched as an absolute path.
1416 #        The first match is not returned.  At least two matches are searched
1417 #        for.  A successful result is only returned if only one match is
1418 #        found.  If more than one match is found, a flag is return to
1419 #        indicate that the match was ambiguous.
1421 # @property: The property name to read
1423 # Returns: The property value.  The type depends on the property
1424 #          type. child<> and link<> properties are returned as #str
1425 #          pathnames.  All integer property types (u8, u16, etc) are
1426 #          returned as #int.
1428 # Since: 1.2
1430 # Example:
1432 # 1. Use absolute path
1434 # -> { "execute": "qom-get",
1435 #      "arguments": { "path": "/machine/unattached/device[0]",
1436 #                     "property": "hotplugged" } }
1437 # <- { "return": false }
1439 # 2. Use partial path
1441 # -> { "execute": "qom-get",
1442 #      "arguments": { "path": "unattached/sysbus",
1443 #                     "property": "type" } }
1444 # <- { "return": "System" }
1447 { 'command': 'qom-get',
1448   'data': { 'path': 'str', 'property': 'str' },
1449   'returns': 'any',
1450   'allow-preconfig': true }
1453 # @qom-set:
1455 # This command will set a property from a object model path.
1457 # @path: see @qom-get for a description of this parameter
1459 # @property: the property name to set
1461 # @value: a value who's type is appropriate for the property type.  See @qom-get
1462 #         for a description of type mapping.
1464 # Since: 1.2
1466 # Example:
1468 # -> { "execute": "qom-set",
1469 #      "arguments": { "path": "/machine",
1470 #                     "property": "graphics",
1471 #                     "value": false } }
1472 # <- { "return": {} }
1475 { 'command': 'qom-set',
1476   'data': { 'path': 'str', 'property': 'str', 'value': 'any' },
1477   'allow-preconfig': true }
1480 # @change:
1482 # This command is multiple commands multiplexed together.
1484 # @device: This is normally the name of a block device but it may also be 'vnc'.
1485 #          when it's 'vnc', then sub command depends on @target
1487 # @target: If @device is a block device, then this is the new filename.
1488 #          If @device is 'vnc', then if the value 'password' selects the vnc
1489 #          change password command.   Otherwise, this specifies a new server URI
1490 #          address to listen to for VNC connections.
1492 # @arg:    If @device is a block device, then this is an optional format to open
1493 #          the device with.
1494 #          If @device is 'vnc' and @target is 'password', this is the new VNC
1495 #          password to set.  See change-vnc-password for additional notes.
1497 # Returns: Nothing on success.
1498 #          If @device is not a valid block device, DeviceNotFound
1500 # Notes:  This interface is deprecated, and it is strongly recommended that you
1501 #         avoid using it.  For changing block devices, use
1502 #         blockdev-change-medium; for changing VNC parameters, use
1503 #         change-vnc-password.
1505 # Since: 0.14.0
1507 # Example:
1509 # 1. Change a removable medium
1511 # -> { "execute": "change",
1512 #      "arguments": { "device": "ide1-cd0",
1513 #                     "target": "/srv/images/Fedora-12-x86_64-DVD.iso" } }
1514 # <- { "return": {} }
1516 # 2. Change VNC password
1518 # -> { "execute": "change",
1519 #      "arguments": { "device": "vnc", "target": "password",
1520 #                     "arg": "foobar1" } }
1521 # <- { "return": {} }
1524 { 'command': 'change',
1525   'data': {'device': 'str', 'target': 'str', '*arg': 'str'} }
1528 # @ObjectTypeInfo:
1530 # This structure describes a search result from @qom-list-types
1532 # @name: the type name found in the search
1534 # @abstract: the type is abstract and can't be directly instantiated.
1535 #            Omitted if false. (since 2.10)
1537 # @parent: Name of parent type, if any (since 2.10)
1539 # Since: 1.1
1541 { 'struct': 'ObjectTypeInfo',
1542   'data': { 'name': 'str', '*abstract': 'bool', '*parent': 'str' } }
1545 # @qom-list-types:
1547 # This command will return a list of types given search parameters
1549 # @implements: if specified, only return types that implement this type name
1551 # @abstract: if true, include abstract types in the results
1553 # Returns: a list of @ObjectTypeInfo or an empty list if no results are found
1555 # Since: 1.1
1557 { 'command': 'qom-list-types',
1558   'data': { '*implements': 'str', '*abstract': 'bool' },
1559   'returns': [ 'ObjectTypeInfo' ],
1560   'allow-preconfig': true }
1563 # @device-list-properties:
1565 # List properties associated with a device.
1567 # @typename: the type name of a device
1569 # Returns: a list of ObjectPropertyInfo describing a devices properties
1571 # Note: objects can create properties at runtime, for example to describe
1572 # links between different devices and/or objects. These properties
1573 # are not included in the output of this command.
1575 # Since: 1.2
1577 { 'command': 'device-list-properties',
1578   'data': { 'typename': 'str'},
1579   'returns': [ 'ObjectPropertyInfo' ] }
1582 # @qom-list-properties:
1584 # List properties associated with a QOM object.
1586 # @typename: the type name of an object
1588 # Note: objects can create properties at runtime, for example to describe
1589 # links between different devices and/or objects. These properties
1590 # are not included in the output of this command.
1592 # Returns: a list of ObjectPropertyInfo describing object properties
1594 # Since: 2.12
1596 { 'command': 'qom-list-properties',
1597   'data': { 'typename': 'str'},
1598   'returns': [ 'ObjectPropertyInfo' ],
1599   'allow-preconfig': true }
1602 # @xen-set-global-dirty-log:
1604 # Enable or disable the global dirty log mode.
1606 # @enable: true to enable, false to disable.
1608 # Returns: nothing
1610 # Since: 1.3
1612 # Example:
1614 # -> { "execute": "xen-set-global-dirty-log",
1615 #      "arguments": { "enable": true } }
1616 # <- { "return": {} }
1619 { 'command': 'xen-set-global-dirty-log', 'data': { 'enable': 'bool' } }
1622 # @device_add:
1624 # @driver: the name of the new device's driver
1626 # @bus: the device's parent bus (device tree path)
1628 # @id: the device's ID, must be unique
1630 # Additional arguments depend on the type.
1632 # Add a device.
1634 # Notes:
1635 # 1. For detailed information about this command, please refer to the
1636 #    'docs/qdev-device-use.txt' file.
1638 # 2. It's possible to list device properties by running QEMU with the
1639 #    "-device DEVICE,help" command-line argument, where DEVICE is the
1640 #    device's name
1642 # Example:
1644 # -> { "execute": "device_add",
1645 #      "arguments": { "driver": "e1000", "id": "net1",
1646 #                     "bus": "pci.0",
1647 #                     "mac": "52:54:00:12:34:56" } }
1648 # <- { "return": {} }
1650 # TODO: This command effectively bypasses QAPI completely due to its
1651 # "additional arguments" business.  It shouldn't have been added to
1652 # the schema in this form.  It should be qapified properly, or
1653 # replaced by a properly qapified command.
1655 # Since: 0.13
1657 { 'command': 'device_add',
1658   'data': {'driver': 'str', '*bus': 'str', '*id': 'str'},
1659   'gen': false } # so we can get the additional arguments
1662 # @device_del:
1664 # Remove a device from a guest
1666 # @id: the device's ID or QOM path
1668 # Returns: Nothing on success
1669 #          If @id is not a valid device, DeviceNotFound
1671 # Notes: When this command completes, the device may not be removed from the
1672 #        guest.  Hot removal is an operation that requires guest cooperation.
1673 #        This command merely requests that the guest begin the hot removal
1674 #        process.  Completion of the device removal process is signaled with a
1675 #        DEVICE_DELETED event. Guest reset will automatically complete removal
1676 #        for all devices.
1678 # Since: 0.14.0
1680 # Example:
1682 # -> { "execute": "device_del",
1683 #      "arguments": { "id": "net1" } }
1684 # <- { "return": {} }
1686 # -> { "execute": "device_del",
1687 #      "arguments": { "id": "/machine/peripheral-anon/device[0]" } }
1688 # <- { "return": {} }
1691 { 'command': 'device_del', 'data': {'id': 'str'} }
1694 # @DEVICE_DELETED:
1696 # Emitted whenever the device removal completion is acknowledged by the guest.
1697 # At this point, it's safe to reuse the specified device ID. Device removal can
1698 # be initiated by the guest or by HMP/QMP commands.
1700 # @device: device name
1702 # @path: device path
1704 # Since: 1.5
1706 # Example:
1708 # <- { "event": "DEVICE_DELETED",
1709 #      "data": { "device": "virtio-net-pci-0",
1710 #                "path": "/machine/peripheral/virtio-net-pci-0" },
1711 #      "timestamp": { "seconds": 1265044230, "microseconds": 450486 } }
1714 { 'event': 'DEVICE_DELETED',
1715   'data': { '*device': 'str', 'path': 'str' } }
1718 # @DumpGuestMemoryFormat:
1720 # An enumeration of guest-memory-dump's format.
1722 # @elf: elf format
1724 # @kdump-zlib: kdump-compressed format with zlib-compressed
1726 # @kdump-lzo: kdump-compressed format with lzo-compressed
1728 # @kdump-snappy: kdump-compressed format with snappy-compressed
1730 # @win-dmp: Windows full crashdump format,
1731 #           can be used instead of ELF converting (since 2.13)
1733 # Since: 2.0
1735 { 'enum': 'DumpGuestMemoryFormat',
1736   'data': [ 'elf', 'kdump-zlib', 'kdump-lzo', 'kdump-snappy', 'win-dmp' ] }
1739 # @dump-guest-memory:
1741 # Dump guest's memory to vmcore. It is a synchronous operation that can take
1742 # very long depending on the amount of guest memory.
1744 # @paging: if true, do paging to get guest's memory mapping. This allows
1745 #          using gdb to process the core file.
1747 #          IMPORTANT: this option can make QEMU allocate several gigabytes
1748 #                     of RAM. This can happen for a large guest, or a
1749 #                     malicious guest pretending to be large.
1751 #          Also, paging=true has the following limitations:
1753 #             1. The guest may be in a catastrophic state or can have corrupted
1754 #                memory, which cannot be trusted
1755 #             2. The guest can be in real-mode even if paging is enabled. For
1756 #                example, the guest uses ACPI to sleep, and ACPI sleep state
1757 #                goes in real-mode
1758 #             3. Currently only supported on i386 and x86_64.
1760 # @protocol: the filename or file descriptor of the vmcore. The supported
1761 #            protocols are:
1763 #            1. file: the protocol starts with "file:", and the following
1764 #               string is the file's path.
1765 #            2. fd: the protocol starts with "fd:", and the following string
1766 #               is the fd's name.
1768 # @detach: if true, QMP will return immediately rather than
1769 #          waiting for the dump to finish. The user can track progress
1770 #          using "query-dump". (since 2.6).
1772 # @begin: if specified, the starting physical address.
1774 # @length: if specified, the memory size, in bytes. If you don't
1775 #          want to dump all guest's memory, please specify the start @begin
1776 #          and @length
1778 # @format: if specified, the format of guest memory dump. But non-elf
1779 #          format is conflict with paging and filter, ie. @paging, @begin and
1780 #          @length is not allowed to be specified with non-elf @format at the
1781 #          same time (since 2.0)
1783 # Note: All boolean arguments default to false
1785 # Returns: nothing on success
1787 # Since: 1.2
1789 # Example:
1791 # -> { "execute": "dump-guest-memory",
1792 #      "arguments": { "protocol": "fd:dump" } }
1793 # <- { "return": {} }
1796 { 'command': 'dump-guest-memory',
1797   'data': { 'paging': 'bool', 'protocol': 'str', '*detach': 'bool',
1798             '*begin': 'int', '*length': 'int',
1799             '*format': 'DumpGuestMemoryFormat'} }
1802 # @DumpStatus:
1804 # Describe the status of a long-running background guest memory dump.
1806 # @none: no dump-guest-memory has started yet.
1808 # @active: there is one dump running in background.
1810 # @completed: the last dump has finished successfully.
1812 # @failed: the last dump has failed.
1814 # Since: 2.6
1816 { 'enum': 'DumpStatus',
1817   'data': [ 'none', 'active', 'completed', 'failed' ] }
1820 # @DumpQueryResult:
1822 # The result format for 'query-dump'.
1824 # @status: enum of @DumpStatus, which shows current dump status
1826 # @completed: bytes written in latest dump (uncompressed)
1828 # @total: total bytes to be written in latest dump (uncompressed)
1830 # Since: 2.6
1832 { 'struct': 'DumpQueryResult',
1833   'data': { 'status': 'DumpStatus',
1834             'completed': 'int',
1835             'total': 'int' } }
1838 # @query-dump:
1840 # Query latest dump status.
1842 # Returns: A @DumpStatus object showing the dump status.
1844 # Since: 2.6
1846 # Example:
1848 # -> { "execute": "query-dump" }
1849 # <- { "return": { "status": "active", "completed": 1024000,
1850 #                  "total": 2048000 } }
1853 { 'command': 'query-dump', 'returns': 'DumpQueryResult' }
1856 # @DUMP_COMPLETED:
1858 # Emitted when background dump has completed
1860 # @result: final dump status
1862 # @error: human-readable error string that provides
1863 #         hint on why dump failed. Only presents on failure. The
1864 #         user should not try to interpret the error string.
1866 # Since: 2.6
1868 # Example:
1870 # { "event": "DUMP_COMPLETED",
1871 #   "data": {"result": {"total": 1090650112, "status": "completed",
1872 #                       "completed": 1090650112} } }
1875 { 'event': 'DUMP_COMPLETED' ,
1876   'data': { 'result': 'DumpQueryResult', '*error': 'str' } }
1879 # @DumpGuestMemoryCapability:
1881 # A list of the available formats for dump-guest-memory
1883 # Since: 2.0
1885 { 'struct': 'DumpGuestMemoryCapability',
1886   'data': {
1887       'formats': ['DumpGuestMemoryFormat'] } }
1890 # @query-dump-guest-memory-capability:
1892 # Returns the available formats for dump-guest-memory
1894 # Returns:  A @DumpGuestMemoryCapability object listing available formats for
1895 #           dump-guest-memory
1897 # Since: 2.0
1899 # Example:
1901 # -> { "execute": "query-dump-guest-memory-capability" }
1902 # <- { "return": { "formats":
1903 #                  ["elf", "kdump-zlib", "kdump-lzo", "kdump-snappy"] }
1906 { 'command': 'query-dump-guest-memory-capability',
1907   'returns': 'DumpGuestMemoryCapability' }
1910 # @object-add:
1912 # Create a QOM object.
1914 # @qom-type: the class name for the object to be created
1916 # @id: the name of the new object
1918 # @props: a dictionary of properties to be passed to the backend
1920 # Returns: Nothing on success
1921 #          Error if @qom-type is not a valid class name
1923 # Since: 2.0
1925 # Example:
1927 # -> { "execute": "object-add",
1928 #      "arguments": { "qom-type": "rng-random", "id": "rng1",
1929 #                     "props": { "filename": "/dev/hwrng" } } }
1930 # <- { "return": {} }
1933 { 'command': 'object-add',
1934   'data': {'qom-type': 'str', 'id': 'str', '*props': 'any'} }
1937 # @object-del:
1939 # Remove a QOM object.
1941 # @id: the name of the QOM object to remove
1943 # Returns: Nothing on success
1944 #          Error if @id is not a valid id for a QOM object
1946 # Since: 2.0
1948 # Example:
1950 # -> { "execute": "object-del", "arguments": { "id": "rng1" } }
1951 # <- { "return": {} }
1954 { 'command': 'object-del', 'data': {'id': 'str'} }
1957 # @getfd:
1959 # Receive a file descriptor via SCM rights and assign it a name
1961 # @fdname: file descriptor name
1963 # Returns: Nothing on success
1965 # Since: 0.14.0
1967 # Notes: If @fdname already exists, the file descriptor assigned to
1968 #        it will be closed and replaced by the received file
1969 #        descriptor.
1971 #        The 'closefd' command can be used to explicitly close the
1972 #        file descriptor when it is no longer needed.
1974 # Example:
1976 # -> { "execute": "getfd", "arguments": { "fdname": "fd1" } }
1977 # <- { "return": {} }
1980 { 'command': 'getfd', 'data': {'fdname': 'str'} }
1983 # @closefd:
1985 # Close a file descriptor previously passed via SCM rights
1987 # @fdname: file descriptor name
1989 # Returns: Nothing on success
1991 # Since: 0.14.0
1993 # Example:
1995 # -> { "execute": "closefd", "arguments": { "fdname": "fd1" } }
1996 # <- { "return": {} }
1999 { 'command': 'closefd', 'data': {'fdname': 'str'} }
2002 # @MachineInfo:
2004 # Information describing a machine.
2006 # @name: the name of the machine
2008 # @alias: an alias for the machine name
2010 # @is-default: whether the machine is default
2012 # @cpu-max: maximum number of CPUs supported by the machine type
2013 #           (since 1.5.0)
2015 # @hotpluggable-cpus: cpu hotplug via -device is supported (since 2.7.0)
2017 # Since: 1.2.0
2019 { 'struct': 'MachineInfo',
2020   'data': { 'name': 'str', '*alias': 'str',
2021             '*is-default': 'bool', 'cpu-max': 'int',
2022             'hotpluggable-cpus': 'bool'} }
2025 # @query-machines:
2027 # Return a list of supported machines
2029 # Returns: a list of MachineInfo
2031 # Since: 1.2.0
2033 { 'command': 'query-machines', 'returns': ['MachineInfo'] }
2036 # @CurrentMachineParams:
2038 # Information describing the running machine parameters.
2040 # @wakeup-suspend-support: true if the machine supports wake up from
2041 #                          suspend
2043 # Since: 4.0
2045 { 'struct': 'CurrentMachineParams',
2046   'data': { 'wakeup-suspend-support': 'bool'} }
2049 # @query-current-machine:
2051 # Return information on the current virtual machine.
2053 # Returns: CurrentMachineParams
2055 # Since: 4.0
2057 { 'command': 'query-current-machine', 'returns': 'CurrentMachineParams' }
2060 # @MemoryInfo:
2062 # Actual memory information in bytes.
2064 # @base-memory: size of "base" memory specified with command line
2065 #               option -m.
2067 # @plugged-memory: size of memory that can be hot-unplugged. This field
2068 #                  is omitted if target doesn't support memory hotplug
2069 #                  (i.e. CONFIG_MEM_DEVICE not defined at build time).
2071 # Since: 2.11.0
2073 { 'struct': 'MemoryInfo',
2074   'data'  : { 'base-memory': 'size', '*plugged-memory': 'size' } }
2077 # @query-memory-size-summary:
2079 # Return the amount of initially allocated and present hotpluggable (if
2080 # enabled) memory in bytes.
2082 # Example:
2084 # -> { "execute": "query-memory-size-summary" }
2085 # <- { "return": { "base-memory": 4294967296, "plugged-memory": 0 } }
2087 # Since: 2.11.0
2089 { 'command': 'query-memory-size-summary', 'returns': 'MemoryInfo' }
2093 # @CpuModelInfo:
2095 # Virtual CPU model.
2097 # A CPU model consists of the name of a CPU definition, to which
2098 # delta changes are applied (e.g. features added/removed). Most magic values
2099 # that an architecture might require should be hidden behind the name.
2100 # However, if required, architectures can expose relevant properties.
2102 # @name: the name of the CPU definition the model is based on
2103 # @props: a dictionary of QOM properties to be applied
2105 # Since: 2.8.0
2107 { 'struct': 'CpuModelInfo',
2108   'data': { 'name': 'str',
2109             '*props': 'any' } }
2112 # @CpuModelExpansionType:
2114 # An enumeration of CPU model expansion types.
2116 # @static: Expand to a static CPU model, a combination of a static base
2117 #          model name and property delta changes. As the static base model will
2118 #          never change, the expanded CPU model will be the same, independent of
2119 #          QEMU version, machine type, machine options, and accelerator options.
2120 #          Therefore, the resulting model can be used by tooling without having
2121 #          to specify a compatibility machine - e.g. when displaying the "host"
2122 #          model. The @static CPU models are migration-safe.
2124 # @full: Expand all properties. The produced model is not guaranteed to be
2125 #        migration-safe, but allows tooling to get an insight and work with
2126 #        model details.
2128 # Note: When a non-migration-safe CPU model is expanded in static mode, some
2129 # features enabled by the CPU model may be omitted, because they can't be
2130 # implemented by a static CPU model definition (e.g. cache info passthrough and
2131 # PMU passthrough in x86). If you need an accurate representation of the
2132 # features enabled by a non-migration-safe CPU model, use @full. If you need a
2133 # static representation that will keep ABI compatibility even when changing QEMU
2134 # version or machine-type, use @static (but keep in mind that some features may
2135 # be omitted).
2137 # Since: 2.8.0
2139 { 'enum': 'CpuModelExpansionType',
2140   'data': [ 'static', 'full' ] }
2144 # @CpuModelCompareResult:
2146 # An enumeration of CPU model comparison results. The result is usually
2147 # calculated using e.g. CPU features or CPU generations.
2149 # @incompatible: If model A is incompatible to model B, model A is not
2150 #                guaranteed to run where model B runs and the other way around.
2152 # @identical: If model A is identical to model B, model A is guaranteed to run
2153 #             where model B runs and the other way around.
2155 # @superset: If model A is a superset of model B, model B is guaranteed to run
2156 #            where model A runs. There are no guarantees about the other way.
2158 # @subset: If model A is a subset of model B, model A is guaranteed to run
2159 #          where model B runs. There are no guarantees about the other way.
2161 # Since: 2.8.0
2163 { 'enum': 'CpuModelCompareResult',
2164   'data': [ 'incompatible', 'identical', 'superset', 'subset' ] }
2167 # @AddfdInfo:
2169 # Information about a file descriptor that was added to an fd set.
2171 # @fdset-id: The ID of the fd set that @fd was added to.
2173 # @fd: The file descriptor that was received via SCM rights and
2174 #      added to the fd set.
2176 # Since: 1.2.0
2178 { 'struct': 'AddfdInfo', 'data': {'fdset-id': 'int', 'fd': 'int'} }
2181 # @add-fd:
2183 # Add a file descriptor, that was passed via SCM rights, to an fd set.
2185 # @fdset-id: The ID of the fd set to add the file descriptor to.
2187 # @opaque: A free-form string that can be used to describe the fd.
2189 # Returns: @AddfdInfo on success
2191 #          If file descriptor was not received, FdNotSupplied
2193 #          If @fdset-id is a negative value, InvalidParameterValue
2195 # Notes: The list of fd sets is shared by all monitor connections.
2197 #        If @fdset-id is not specified, a new fd set will be created.
2199 # Since: 1.2.0
2201 # Example:
2203 # -> { "execute": "add-fd", "arguments": { "fdset-id": 1 } }
2204 # <- { "return": { "fdset-id": 1, "fd": 3 } }
2207 { 'command': 'add-fd',
2208   'data': { '*fdset-id': 'int',
2209             '*opaque': 'str' },
2210   'returns': 'AddfdInfo' }
2213 # @remove-fd:
2215 # Remove a file descriptor from an fd set.
2217 # @fdset-id: The ID of the fd set that the file descriptor belongs to.
2219 # @fd: The file descriptor that is to be removed.
2221 # Returns: Nothing on success
2222 #          If @fdset-id or @fd is not found, FdNotFound
2224 # Since: 1.2.0
2226 # Notes: The list of fd sets is shared by all monitor connections.
2228 #        If @fd is not specified, all file descriptors in @fdset-id
2229 #        will be removed.
2231 # Example:
2233 # -> { "execute": "remove-fd", "arguments": { "fdset-id": 1, "fd": 3 } }
2234 # <- { "return": {} }
2237 { 'command': 'remove-fd', 'data': {'fdset-id': 'int', '*fd': 'int'} }
2240 # @FdsetFdInfo:
2242 # Information about a file descriptor that belongs to an fd set.
2244 # @fd: The file descriptor value.
2246 # @opaque: A free-form string that can be used to describe the fd.
2248 # Since: 1.2.0
2250 { 'struct': 'FdsetFdInfo',
2251   'data': {'fd': 'int', '*opaque': 'str'} }
2254 # @FdsetInfo:
2256 # Information about an fd set.
2258 # @fdset-id: The ID of the fd set.
2260 # @fds: A list of file descriptors that belong to this fd set.
2262 # Since: 1.2.0
2264 { 'struct': 'FdsetInfo',
2265   'data': {'fdset-id': 'int', 'fds': ['FdsetFdInfo']} }
2268 # @query-fdsets:
2270 # Return information describing all fd sets.
2272 # Returns: A list of @FdsetInfo
2274 # Since: 1.2.0
2276 # Note: The list of fd sets is shared by all monitor connections.
2278 # Example:
2280 # -> { "execute": "query-fdsets" }
2281 # <- { "return": [
2282 #        {
2283 #          "fds": [
2284 #            {
2285 #              "fd": 30,
2286 #              "opaque": "rdonly:/path/to/file"
2287 #            },
2288 #            {
2289 #              "fd": 24,
2290 #              "opaque": "rdwr:/path/to/file"
2291 #            }
2292 #          ],
2293 #          "fdset-id": 1
2294 #        },
2295 #        {
2296 #          "fds": [
2297 #            {
2298 #              "fd": 28
2299 #            },
2300 #            {
2301 #              "fd": 29
2302 #            }
2303 #          ],
2304 #          "fdset-id": 0
2305 #        }
2306 #      ]
2307 #    }
2310 { 'command': 'query-fdsets', 'returns': ['FdsetInfo'] }
2313 # @TargetInfo:
2315 # Information describing the QEMU target.
2317 # @arch: the target architecture
2319 # Since: 1.2.0
2321 { 'struct': 'TargetInfo',
2322   'data': { 'arch': 'SysEmuTarget' } }
2325 # @query-target:
2327 # Return information about the target for this QEMU
2329 # Returns: TargetInfo
2331 # Since: 1.2.0
2333 { 'command': 'query-target', 'returns': 'TargetInfo' }
2336 # @AcpiTableOptions:
2338 # Specify an ACPI table on the command line to load.
2340 # At most one of @file and @data can be specified. The list of files specified
2341 # by any one of them is loaded and concatenated in order. If both are omitted,
2342 # @data is implied.
2344 # Other fields / optargs can be used to override fields of the generic ACPI
2345 # table header; refer to the ACPI specification 5.0, section 5.2.6 System
2346 # Description Table Header. If a header field is not overridden, then the
2347 # corresponding value from the concatenated blob is used (in case of @file), or
2348 # it is filled in with a hard-coded value (in case of @data).
2350 # String fields are copied into the matching ACPI member from lowest address
2351 # upwards, and silently truncated / NUL-padded to length.
2353 # @sig: table signature / identifier (4 bytes)
2355 # @rev: table revision number (dependent on signature, 1 byte)
2357 # @oem_id: OEM identifier (6 bytes)
2359 # @oem_table_id: OEM table identifier (8 bytes)
2361 # @oem_rev: OEM-supplied revision number (4 bytes)
2363 # @asl_compiler_id: identifier of the utility that created the table
2364 #                   (4 bytes)
2366 # @asl_compiler_rev: revision number of the utility that created the
2367 #                    table (4 bytes)
2369 # @file: colon (:) separated list of pathnames to load and
2370 #        concatenate as table data. The resultant binary blob is expected to
2371 #        have an ACPI table header. At least one file is required. This field
2372 #        excludes @data.
2374 # @data: colon (:) separated list of pathnames to load and
2375 #        concatenate as table data. The resultant binary blob must not have an
2376 #        ACPI table header. At least one file is required. This field excludes
2377 #        @file.
2379 # Since: 1.5
2381 { 'struct': 'AcpiTableOptions',
2382   'data': {
2383     '*sig':               'str',
2384     '*rev':               'uint8',
2385     '*oem_id':            'str',
2386     '*oem_table_id':      'str',
2387     '*oem_rev':           'uint32',
2388     '*asl_compiler_id':   'str',
2389     '*asl_compiler_rev':  'uint32',
2390     '*file':              'str',
2391     '*data':              'str' }}
2394 # @CommandLineParameterType:
2396 # Possible types for an option parameter.
2398 # @string: accepts a character string
2400 # @boolean: accepts "on" or "off"
2402 # @number: accepts a number
2404 # @size: accepts a number followed by an optional suffix (K)ilo,
2405 #        (M)ega, (G)iga, (T)era
2407 # Since: 1.5
2409 { 'enum': 'CommandLineParameterType',
2410   'data': ['string', 'boolean', 'number', 'size'] }
2413 # @CommandLineParameterInfo:
2415 # Details about a single parameter of a command line option.
2417 # @name: parameter name
2419 # @type: parameter @CommandLineParameterType
2421 # @help: human readable text string, not suitable for parsing.
2423 # @default: default value string (since 2.1)
2425 # Since: 1.5
2427 { 'struct': 'CommandLineParameterInfo',
2428   'data': { 'name': 'str',
2429             'type': 'CommandLineParameterType',
2430             '*help': 'str',
2431             '*default': 'str' } }
2434 # @CommandLineOptionInfo:
2436 # Details about a command line option, including its list of parameter details
2438 # @option: option name
2440 # @parameters: an array of @CommandLineParameterInfo
2442 # Since: 1.5
2444 { 'struct': 'CommandLineOptionInfo',
2445   'data': { 'option': 'str', 'parameters': ['CommandLineParameterInfo'] } }
2448 # @query-command-line-options:
2450 # Query command line option schema.
2452 # @option: option name
2454 # Returns: list of @CommandLineOptionInfo for all options (or for the given
2455 #          @option).  Returns an error if the given @option doesn't exist.
2457 # Since: 1.5
2459 # Example:
2461 # -> { "execute": "query-command-line-options",
2462 #      "arguments": { "option": "option-rom" } }
2463 # <- { "return": [
2464 #         {
2465 #             "parameters": [
2466 #                 {
2467 #                     "name": "romfile",
2468 #                     "type": "string"
2469 #                 },
2470 #                 {
2471 #                     "name": "bootindex",
2472 #                     "type": "number"
2473 #                 }
2474 #             ],
2475 #             "option": "option-rom"
2476 #         }
2477 #      ]
2478 #    }
2481 {'command': 'query-command-line-options',
2482  'data': { '*option': 'str' },
2483  'returns': ['CommandLineOptionInfo'],
2484  'allow-preconfig': true }
2487 # @X86CPURegister32:
2489 # A X86 32-bit register
2491 # Since: 1.5
2493 { 'enum': 'X86CPURegister32',
2494   'data': [ 'EAX', 'EBX', 'ECX', 'EDX', 'ESP', 'EBP', 'ESI', 'EDI' ] }
2497 # @X86CPUFeatureWordInfo:
2499 # Information about a X86 CPU feature word
2501 # @cpuid-input-eax: Input EAX value for CPUID instruction for that feature word
2503 # @cpuid-input-ecx: Input ECX value for CPUID instruction for that
2504 #                   feature word
2506 # @cpuid-register: Output register containing the feature bits
2508 # @features: value of output register, containing the feature bits
2510 # Since: 1.5
2512 { 'struct': 'X86CPUFeatureWordInfo',
2513   'data': { 'cpuid-input-eax': 'int',
2514             '*cpuid-input-ecx': 'int',
2515             'cpuid-register': 'X86CPURegister32',
2516             'features': 'int' } }
2519 # @DummyForceArrays:
2521 # Not used by QMP; hack to let us use X86CPUFeatureWordInfoList internally
2523 # Since: 2.5
2525 { 'struct': 'DummyForceArrays',
2526   'data': { 'unused': ['X86CPUFeatureWordInfo'] } }
2530 # @NumaOptionsType:
2532 # @node: NUMA nodes configuration
2534 # @dist: NUMA distance configuration (since 2.10)
2536 # @cpu: property based CPU(s) to node mapping (Since: 2.10)
2538 # Since: 2.1
2540 { 'enum': 'NumaOptionsType',
2541   'data': [ 'node', 'dist', 'cpu' ] }
2544 # @NumaOptions:
2546 # A discriminated record of NUMA options. (for OptsVisitor)
2548 # Since: 2.1
2550 { 'union': 'NumaOptions',
2551   'base': { 'type': 'NumaOptionsType' },
2552   'discriminator': 'type',
2553   'data': {
2554     'node': 'NumaNodeOptions',
2555     'dist': 'NumaDistOptions',
2556     'cpu': 'NumaCpuOptions' }}
2559 # @NumaNodeOptions:
2561 # Create a guest NUMA node. (for OptsVisitor)
2563 # @nodeid: NUMA node ID (increase by 1 from 0 if omitted)
2565 # @cpus: VCPUs belonging to this node (assign VCPUS round-robin
2566 #         if omitted)
2568 # @mem: memory size of this node; mutually exclusive with @memdev.
2569 #       Equally divide total memory among nodes if both @mem and @memdev are
2570 #       omitted.
2572 # @memdev: memory backend object.  If specified for one node,
2573 #          it must be specified for all nodes.
2575 # Since: 2.1
2577 { 'struct': 'NumaNodeOptions',
2578   'data': {
2579    '*nodeid': 'uint16',
2580    '*cpus':   ['uint16'],
2581    '*mem':    'size',
2582    '*memdev': 'str' }}
2585 # @NumaDistOptions:
2587 # Set the distance between 2 NUMA nodes.
2589 # @src: source NUMA node.
2591 # @dst: destination NUMA node.
2593 # @val: NUMA distance from source node to destination node.
2594 #       When a node is unreachable from another node, set the distance
2595 #       between them to 255.
2597 # Since: 2.10
2599 { 'struct': 'NumaDistOptions',
2600   'data': {
2601    'src': 'uint16',
2602    'dst': 'uint16',
2603    'val': 'uint8' }}
2606 # @NumaCpuOptions:
2608 # Option "-numa cpu" overrides default cpu to node mapping.
2609 # It accepts the same set of cpu properties as returned by
2610 # query-hotpluggable-cpus[].props, where node-id could be used to
2611 # override default node mapping.
2613 # Since: 2.10
2615 { 'struct': 'NumaCpuOptions',
2616    'base': 'CpuInstanceProperties',
2617    'data' : {} }
2620 # @HostMemPolicy:
2622 # Host memory policy types
2624 # @default: restore default policy, remove any nondefault policy
2626 # @preferred: set the preferred host nodes for allocation
2628 # @bind: a strict policy that restricts memory allocation to the
2629 #        host nodes specified
2631 # @interleave: memory allocations are interleaved across the set
2632 #              of host nodes specified
2634 # Since: 2.1
2636 { 'enum': 'HostMemPolicy',
2637   'data': [ 'default', 'preferred', 'bind', 'interleave' ] }
2640 # @Memdev:
2642 # Information about memory backend
2644 # @id: backend's ID if backend has 'id' property (since 2.9)
2646 # @size: memory backend size
2648 # @merge: enables or disables memory merge support
2650 # @dump: includes memory backend's memory in a core dump or not
2652 # @prealloc: enables or disables memory preallocation
2654 # @host-nodes: host nodes for its memory policy
2656 # @policy: memory policy of memory backend
2658 # Since: 2.1
2660 { 'struct': 'Memdev',
2661   'data': {
2662     '*id':        'str',
2663     'size':       'size',
2664     'merge':      'bool',
2665     'dump':       'bool',
2666     'prealloc':   'bool',
2667     'host-nodes': ['uint16'],
2668     'policy':     'HostMemPolicy' }}
2671 # @query-memdev:
2673 # Returns information for all memory backends.
2675 # Returns: a list of @Memdev.
2677 # Since: 2.1
2679 # Example:
2681 # -> { "execute": "query-memdev" }
2682 # <- { "return": [
2683 #        {
2684 #          "id": "mem1",
2685 #          "size": 536870912,
2686 #          "merge": false,
2687 #          "dump": true,
2688 #          "prealloc": false,
2689 #          "host-nodes": [0, 1],
2690 #          "policy": "bind"
2691 #        },
2692 #        {
2693 #          "size": 536870912,
2694 #          "merge": false,
2695 #          "dump": true,
2696 #          "prealloc": true,
2697 #          "host-nodes": [2, 3],
2698 #          "policy": "preferred"
2699 #        }
2700 #      ]
2701 #    }
2704 { 'command': 'query-memdev', 'returns': ['Memdev'], 'allow-preconfig': true }
2707 # @PCDIMMDeviceInfo:
2709 # PCDIMMDevice state information
2711 # @id: device's ID
2713 # @addr: physical address, where device is mapped
2715 # @size: size of memory that the device provides
2717 # @slot: slot number at which device is plugged in
2719 # @node: NUMA node number where device is plugged in
2721 # @memdev: memory backend linked with device
2723 # @hotplugged: true if device was hotplugged
2725 # @hotpluggable: true if device if could be added/removed while machine is running
2727 # Since: 2.1
2729 { 'struct': 'PCDIMMDeviceInfo',
2730   'data': { '*id': 'str',
2731             'addr': 'int',
2732             'size': 'int',
2733             'slot': 'int',
2734             'node': 'int',
2735             'memdev': 'str',
2736             'hotplugged': 'bool',
2737             'hotpluggable': 'bool'
2738           }
2742 # @MemoryDeviceInfo:
2744 # Union containing information about a memory device
2746 # Since: 2.1
2748 { 'union': 'MemoryDeviceInfo',
2749   'data': { 'dimm': 'PCDIMMDeviceInfo',
2750             'nvdimm': 'PCDIMMDeviceInfo'
2751           }
2755 # @query-memory-devices:
2757 # Lists available memory devices and their state
2759 # Since: 2.1
2761 # Example:
2763 # -> { "execute": "query-memory-devices" }
2764 # <- { "return": [ { "data":
2765 #                       { "addr": 5368709120,
2766 #                         "hotpluggable": true,
2767 #                         "hotplugged": true,
2768 #                         "id": "d1",
2769 #                         "memdev": "/objects/memX",
2770 #                         "node": 0,
2771 #                         "size": 1073741824,
2772 #                         "slot": 0},
2773 #                    "type": "dimm"
2774 #                  } ] }
2777 { 'command': 'query-memory-devices', 'returns': ['MemoryDeviceInfo'] }
2780 # @MEM_UNPLUG_ERROR:
2782 # Emitted when memory hot unplug error occurs.
2784 # @device: device name
2786 # @msg: Informative message
2788 # Since: 2.4
2790 # Example:
2792 # <- { "event": "MEM_UNPLUG_ERROR"
2793 #      "data": { "device": "dimm1",
2794 #                "msg": "acpi: device unplug for unsupported device"
2795 #      },
2796 #      "timestamp": { "seconds": 1265044230, "microseconds": 450486 } }
2799 { 'event': 'MEM_UNPLUG_ERROR',
2800   'data': { 'device': 'str', 'msg': 'str' } }
2803 # @ACPISlotType:
2805 # @DIMM: memory slot
2806 # @CPU: logical CPU slot (since 2.7)
2808 { 'enum': 'ACPISlotType', 'data': [ 'DIMM', 'CPU' ] }
2811 # @ACPIOSTInfo:
2813 # OSPM Status Indication for a device
2814 # For description of possible values of @source and @status fields
2815 # see "_OST (OSPM Status Indication)" chapter of ACPI5.0 spec.
2817 # @device: device ID associated with slot
2819 # @slot: slot ID, unique per slot of a given @slot-type
2821 # @slot-type: type of the slot
2823 # @source: an integer containing the source event
2825 # @status: an integer containing the status code
2827 # Since: 2.1
2829 { 'struct': 'ACPIOSTInfo',
2830   'data'  : { '*device': 'str',
2831               'slot': 'str',
2832               'slot-type': 'ACPISlotType',
2833               'source': 'int',
2834               'status': 'int' } }
2837 # @query-acpi-ospm-status:
2839 # Return a list of ACPIOSTInfo for devices that support status
2840 # reporting via ACPI _OST method.
2842 # Since: 2.1
2844 # Example:
2846 # -> { "execute": "query-acpi-ospm-status" }
2847 # <- { "return": [ { "device": "d1", "slot": "0", "slot-type": "DIMM", "source": 1, "status": 0},
2848 #                  { "slot": "1", "slot-type": "DIMM", "source": 0, "status": 0},
2849 #                  { "slot": "2", "slot-type": "DIMM", "source": 0, "status": 0},
2850 #                  { "slot": "3", "slot-type": "DIMM", "source": 0, "status": 0}
2851 #    ]}
2854 { 'command': 'query-acpi-ospm-status', 'returns': ['ACPIOSTInfo'] }
2857 # @ACPI_DEVICE_OST:
2859 # Emitted when guest executes ACPI _OST method.
2861 # @info: OSPM Status Indication
2863 # Since: 2.1
2865 # Example:
2867 # <- { "event": "ACPI_DEVICE_OST",
2868 #      "data": { "device": "d1", "slot": "0",
2869 #                "slot-type": "DIMM", "source": 1, "status": 0 } }
2872 { 'event': 'ACPI_DEVICE_OST',
2873      'data': { 'info': 'ACPIOSTInfo' } }
2876 # @ReplayMode:
2878 # Mode of the replay subsystem.
2880 # @none: normal execution mode. Replay or record are not enabled.
2882 # @record: record mode. All non-deterministic data is written into the
2883 #          replay log.
2885 # @play: replay mode. Non-deterministic data required for system execution
2886 #        is read from the log.
2888 # Since: 2.5
2890 { 'enum': 'ReplayMode',
2891   'data': [ 'none', 'record', 'play' ] }
2894 # @xen-load-devices-state:
2896 # Load the state of all devices from file. The RAM and the block devices
2897 # of the VM are not loaded by this command.
2899 # @filename: the file to load the state of the devices from as binary
2900 # data. See xen-save-devices-state.txt for a description of the binary
2901 # format.
2903 # Since: 2.7
2905 # Example:
2907 # -> { "execute": "xen-load-devices-state",
2908 #      "arguments": { "filename": "/tmp/resume" } }
2909 # <- { "return": {} }
2912 { 'command': 'xen-load-devices-state', 'data': {'filename': 'str'} }
2915 # @CpuInstanceProperties:
2917 # List of properties to be used for hotplugging a CPU instance,
2918 # it should be passed by management with device_add command when
2919 # a CPU is being hotplugged.
2921 # @node-id: NUMA node ID the CPU belongs to
2922 # @socket-id: socket number within node/board the CPU belongs to
2923 # @core-id: core number within socket the CPU belongs to
2924 # @thread-id: thread number within core the CPU belongs to
2926 # Note: currently there are 4 properties that could be present
2927 # but management should be prepared to pass through other
2928 # properties with device_add command to allow for future
2929 # interface extension. This also requires the filed names to be kept in
2930 # sync with the properties passed to -device/device_add.
2932 # Since: 2.7
2934 { 'struct': 'CpuInstanceProperties',
2935   'data': { '*node-id': 'int',
2936             '*socket-id': 'int',
2937             '*core-id': 'int',
2938             '*thread-id': 'int'
2939   }
2943 # @HotpluggableCPU:
2945 # @type: CPU object type for usage with device_add command
2946 # @props: list of properties to be used for hotplugging CPU
2947 # @vcpus-count: number of logical VCPU threads @HotpluggableCPU provides
2948 # @qom-path: link to existing CPU object if CPU is present or
2949 #            omitted if CPU is not present.
2951 # Since: 2.7
2953 { 'struct': 'HotpluggableCPU',
2954   'data': { 'type': 'str',
2955             'vcpus-count': 'int',
2956             'props': 'CpuInstanceProperties',
2957             '*qom-path': 'str'
2958           }
2962 # @query-hotpluggable-cpus:
2964 # TODO: Better documentation; currently there is none.
2966 # Returns: a list of HotpluggableCPU objects.
2968 # Since: 2.7
2970 # Example:
2972 # For pseries machine type started with -smp 2,cores=2,maxcpus=4 -cpu POWER8:
2974 # -> { "execute": "query-hotpluggable-cpus" }
2975 # <- {"return": [
2976 #      { "props": { "core": 8 }, "type": "POWER8-spapr-cpu-core",
2977 #        "vcpus-count": 1 },
2978 #      { "props": { "core": 0 }, "type": "POWER8-spapr-cpu-core",
2979 #        "vcpus-count": 1, "qom-path": "/machine/unattached/device[0]"}
2980 #    ]}'
2982 # For pc machine type started with -smp 1,maxcpus=2:
2984 # -> { "execute": "query-hotpluggable-cpus" }
2985 # <- {"return": [
2986 #      {
2987 #         "type": "qemu64-x86_64-cpu", "vcpus-count": 1,
2988 #         "props": {"core-id": 0, "socket-id": 1, "thread-id": 0}
2989 #      },
2990 #      {
2991 #         "qom-path": "/machine/unattached/device[0]",
2992 #         "type": "qemu64-x86_64-cpu", "vcpus-count": 1,
2993 #         "props": {"core-id": 0, "socket-id": 0, "thread-id": 0}
2994 #      }
2995 #    ]}
2997 # For s390x-virtio-ccw machine type started with -smp 1,maxcpus=2 -cpu qemu
2998 # (Since: 2.11):
3000 # -> { "execute": "query-hotpluggable-cpus" }
3001 # <- {"return": [
3002 #      {
3003 #         "type": "qemu-s390x-cpu", "vcpus-count": 1,
3004 #         "props": { "core-id": 1 }
3005 #      },
3006 #      {
3007 #         "qom-path": "/machine/unattached/device[0]",
3008 #         "type": "qemu-s390x-cpu", "vcpus-count": 1,
3009 #         "props": { "core-id": 0 }
3010 #      }
3011 #    ]}
3014 { 'command': 'query-hotpluggable-cpus', 'returns': ['HotpluggableCPU'],
3015              'allow-preconfig': true }
3018 # @GuidInfo:
3020 # GUID information.
3022 # @guid: the globally unique identifier
3024 # Since: 2.9
3026 { 'struct': 'GuidInfo', 'data': {'guid': 'str'} }
3029 # @query-vm-generation-id:
3031 # Show Virtual Machine Generation ID
3033 # Since: 2.9
3035 { 'command': 'query-vm-generation-id', 'returns': 'GuidInfo' }
3038 # @set-numa-node:
3040 # Runtime equivalent of '-numa' CLI option, available at
3041 # preconfigure stage to configure numa mapping before initializing
3042 # machine.
3044 # Since 3.0
3046 { 'command': 'set-numa-node', 'boxed': true,
3047   'data': 'NumaOptions',
3048   'allow-preconfig': true