pc-dimm: get_memory_region() will not fail after realize
[qemu.git] / qapi / misc.json
blobc6bc18a859e07bcc0ac4c4436c55d9cca83ec20b
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 # @merge: merge the missed tick(s) into one tick and inject.  Guest time
176 #         may be delayed, depending on how the OS reacts to the merging
177 #         of ticks
179 # @slew: deliver ticks at a higher rate to catch up with the missed tick. The
180 #        guest time should not be delayed once catchup is complete.
182 # Since: 2.0
184 { 'enum': 'LostTickPolicy',
185   'data': ['discard', 'delay', 'merge', 'slew' ] }
188 # @add_client:
190 # Allow client connections for VNC, Spice and socket based
191 # character devices to be passed in to QEMU via SCM_RIGHTS.
193 # @protocol: protocol name. Valid names are "vnc", "spice" or the
194 #            name of a character device (eg. from -chardev id=XXXX)
196 # @fdname: file descriptor name previously passed via 'getfd' command
198 # @skipauth: whether to skip authentication. Only applies
199 #            to "vnc" and "spice" protocols
201 # @tls: whether to perform TLS. Only applies to the "spice"
202 #       protocol
204 # Returns: nothing on success.
206 # Since: 0.14.0
208 # Example:
210 # -> { "execute": "add_client", "arguments": { "protocol": "vnc",
211 #                                              "fdname": "myclient" } }
212 # <- { "return": {} }
215 { 'command': 'add_client',
216   'data': { 'protocol': 'str', 'fdname': 'str', '*skipauth': 'bool',
217             '*tls': 'bool' } }
220 # @NameInfo:
222 # Guest name information.
224 # @name: The name of the guest
226 # Since: 0.14.0
228 { 'struct': 'NameInfo', 'data': {'*name': 'str'} }
231 # @query-name:
233 # Return the name information of a guest.
235 # Returns: @NameInfo of the guest
237 # Since: 0.14.0
239 # Example:
241 # -> { "execute": "query-name" }
242 # <- { "return": { "name": "qemu-name" } }
245 { 'command': 'query-name', 'returns': 'NameInfo', 'allow-preconfig': true }
248 # @KvmInfo:
250 # Information about support for KVM acceleration
252 # @enabled: true if KVM acceleration is active
254 # @present: true if KVM acceleration is built into this executable
256 # Since: 0.14.0
258 { 'struct': 'KvmInfo', 'data': {'enabled': 'bool', 'present': 'bool'} }
261 # @query-kvm:
263 # Returns information about KVM acceleration
265 # Returns: @KvmInfo
267 # Since: 0.14.0
269 # Example:
271 # -> { "execute": "query-kvm" }
272 # <- { "return": { "enabled": true, "present": true } }
275 { 'command': 'query-kvm', 'returns': 'KvmInfo' }
278 # @UuidInfo:
280 # Guest UUID information (Universally Unique Identifier).
282 # @UUID: the UUID of the guest
284 # Since: 0.14.0
286 # Notes: If no UUID was specified for the guest, a null UUID is returned.
288 { 'struct': 'UuidInfo', 'data': {'UUID': 'str'} }
291 # @query-uuid:
293 # Query the guest UUID information.
295 # Returns: The @UuidInfo for the guest
297 # Since: 0.14.0
299 # Example:
301 # -> { "execute": "query-uuid" }
302 # <- { "return": { "UUID": "550e8400-e29b-41d4-a716-446655440000" } }
305 { 'command': 'query-uuid', 'returns': 'UuidInfo', 'allow-preconfig': true }
308 # @EventInfo:
310 # Information about a QMP event
312 # @name: The event name
314 # Since: 1.2.0
316 { 'struct': 'EventInfo', 'data': {'name': 'str'} }
319 # @query-events:
321 # Return a list of supported QMP events by this server
323 # Returns: A list of @EventInfo for all supported events
325 # Since: 1.2.0
327 # Example:
329 # -> { "execute": "query-events" }
330 # <- {
331 #      "return": [
332 #          {
333 #             "name":"SHUTDOWN"
334 #          },
335 #          {
336 #             "name":"RESET"
337 #          }
338 #       ]
339 #    }
341 # Note: This example has been shortened as the real response is too long.
344 { 'command': 'query-events', 'returns': ['EventInfo'] }
347 # @CpuInfoArch:
349 # An enumeration of cpu types that enable additional information during
350 # @query-cpus and @query-cpus-fast.
352 # @s390: since 2.12
354 # @riscv: since 2.12
356 # Since: 2.6
358 { 'enum': 'CpuInfoArch',
359   'data': ['x86', 'sparc', 'ppc', 'mips', 'tricore', 's390', 'riscv', 'other' ] }
362 # @CpuInfo:
364 # Information about a virtual CPU
366 # @CPU: the index of the virtual CPU
368 # @current: this only exists for backwards compatibility and should be ignored
370 # @halted: true if the virtual CPU is in the halt state.  Halt usually refers
371 #          to a processor specific low power mode.
373 # @qom_path: path to the CPU object in the QOM tree (since 2.4)
375 # @thread_id: ID of the underlying host thread
377 # @props: properties describing to which node/socket/core/thread
378 #         virtual CPU belongs to, provided if supported by board (since 2.10)
380 # @arch: architecture of the cpu, which determines which additional fields
381 #        will be listed (since 2.6)
383 # Since: 0.14.0
385 # Notes: @halted is a transient state that changes frequently.  By the time the
386 #        data is sent to the client, the guest may no longer be halted.
388 { 'union': 'CpuInfo',
389   'base': {'CPU': 'int', 'current': 'bool', 'halted': 'bool',
390            'qom_path': 'str', 'thread_id': 'int',
391            '*props': 'CpuInstanceProperties', 'arch': 'CpuInfoArch' },
392   'discriminator': 'arch',
393   'data': { 'x86': 'CpuInfoX86',
394             'sparc': 'CpuInfoSPARC',
395             'ppc': 'CpuInfoPPC',
396             'mips': 'CpuInfoMIPS',
397             'tricore': 'CpuInfoTricore',
398             's390': 'CpuInfoS390',
399             'riscv': 'CpuInfoRISCV' } }
402 # @CpuInfoX86:
404 # Additional information about a virtual i386 or x86_64 CPU
406 # @pc: the 64-bit instruction pointer
408 # Since: 2.6
410 { 'struct': 'CpuInfoX86', 'data': { 'pc': 'int' } }
413 # @CpuInfoSPARC:
415 # Additional information about a virtual SPARC CPU
417 # @pc: the PC component of the instruction pointer
419 # @npc: the NPC component of the instruction pointer
421 # Since: 2.6
423 { 'struct': 'CpuInfoSPARC', 'data': { 'pc': 'int', 'npc': 'int' } }
426 # @CpuInfoPPC:
428 # Additional information about a virtual PPC CPU
430 # @nip: the instruction pointer
432 # Since: 2.6
434 { 'struct': 'CpuInfoPPC', 'data': { 'nip': 'int' } }
437 # @CpuInfoMIPS:
439 # Additional information about a virtual MIPS CPU
441 # @PC: the instruction pointer
443 # Since: 2.6
445 { 'struct': 'CpuInfoMIPS', 'data': { 'PC': 'int' } }
448 # @CpuInfoTricore:
450 # Additional information about a virtual Tricore CPU
452 # @PC: the instruction pointer
454 # Since: 2.6
456 { 'struct': 'CpuInfoTricore', 'data': { 'PC': 'int' } }
459 # @CpuInfoRISCV:
461 # Additional information about a virtual RISCV CPU
463 # @pc: the instruction pointer
465 # Since 2.12
467 { 'struct': 'CpuInfoRISCV', 'data': { 'pc': 'int' } }
470 # @CpuS390State:
472 # An enumeration of cpu states that can be assumed by a virtual
473 # S390 CPU
475 # Since: 2.12
477 { 'enum': 'CpuS390State',
478   'prefix': 'S390_CPU_STATE',
479   'data': [ 'uninitialized', 'stopped', 'check-stop', 'operating', 'load' ] }
482 # @CpuInfoS390:
484 # Additional information about a virtual S390 CPU
486 # @cpu-state: the virtual CPU's state
488 # Since: 2.12
490 { 'struct': 'CpuInfoS390', 'data': { 'cpu-state': 'CpuS390State' } }
493 # @query-cpus:
495 # Returns a list of information about each virtual CPU.
497 # This command causes vCPU threads to exit to userspace, which causes
498 # a small interruption to guest CPU execution. This will have a negative
499 # impact on realtime guests and other latency sensitive guest workloads.
500 # It is recommended to use @query-cpus-fast instead of this command to
501 # avoid the vCPU interruption.
503 # Returns: a list of @CpuInfo for each virtual CPU
505 # Since: 0.14.0
507 # Example:
509 # -> { "execute": "query-cpus" }
510 # <- { "return": [
511 #          {
512 #             "CPU":0,
513 #             "current":true,
514 #             "halted":false,
515 #             "qom_path":"/machine/unattached/device[0]",
516 #             "arch":"x86",
517 #             "pc":3227107138,
518 #             "thread_id":3134
519 #          },
520 #          {
521 #             "CPU":1,
522 #             "current":false,
523 #             "halted":true,
524 #             "qom_path":"/machine/unattached/device[2]",
525 #             "arch":"x86",
526 #             "pc":7108165,
527 #             "thread_id":3135
528 #          }
529 #       ]
530 #    }
532 # Notes: This interface is deprecated (since 2.12.0), and it is strongly
533 #        recommended that you avoid using it. Use @query-cpus-fast to
534 #        obtain information about virtual CPUs.
537 { 'command': 'query-cpus', 'returns': ['CpuInfo'] }
540 # @CpuInfoFast:
542 # Information about a virtual CPU
544 # @cpu-index: index of the virtual CPU
546 # @qom-path: path to the CPU object in the QOM tree
548 # @thread-id: ID of the underlying host thread
550 # @props: properties describing to which node/socket/core/thread
551 #         virtual CPU belongs to, provided if supported by board
553 # @arch: base architecture of the cpu; deprecated since 3.0.0 in favor
554 #        of @target
556 # @target: the QEMU system emulation target, which determines which
557 #          additional fields will be listed (since 3.0)
559 # Since: 2.12
562 { 'union'         : 'CpuInfoFast',
563   'base'          : { 'cpu-index'    : 'int',
564                       'qom-path'     : 'str',
565                       'thread-id'    : 'int',
566                       '*props'       : 'CpuInstanceProperties',
567                       'arch'         : 'CpuInfoArch',
568                       'target'       : 'SysEmuTarget' },
569   'discriminator' : 'target',
570   'data'          : { 's390x'        : 'CpuInfoS390' } }
573 # @query-cpus-fast:
575 # Returns information about all virtual CPUs. This command does not
576 # incur a performance penalty and should be used in production
577 # instead of query-cpus.
579 # Returns: list of @CpuInfoFast
581 # Since: 2.12
583 # Example:
585 # -> { "execute": "query-cpus-fast" }
586 # <- { "return": [
587 #         {
588 #             "thread-id": 25627,
589 #             "props": {
590 #                 "core-id": 0,
591 #                 "thread-id": 0,
592 #                 "socket-id": 0
593 #             },
594 #             "qom-path": "/machine/unattached/device[0]",
595 #             "arch":"x86",
596 #             "target":"x86_64",
597 #             "cpu-index": 0
598 #         },
599 #         {
600 #             "thread-id": 25628,
601 #             "props": {
602 #                 "core-id": 0,
603 #                 "thread-id": 0,
604 #                 "socket-id": 1
605 #             },
606 #             "qom-path": "/machine/unattached/device[2]",
607 #             "arch":"x86",
608 #             "target":"x86_64",
609 #             "cpu-index": 1
610 #         }
611 #     ]
612 # }
614 { 'command': 'query-cpus-fast', 'returns': [ 'CpuInfoFast' ] }
617 # @IOThreadInfo:
619 # Information about an iothread
621 # @id: the identifier of the iothread
623 # @thread-id: ID of the underlying host thread
625 # @poll-max-ns: maximum polling time in ns, 0 means polling is disabled
626 #               (since 2.9)
628 # @poll-grow: how many ns will be added to polling time, 0 means that it's not
629 #             configured (since 2.9)
631 # @poll-shrink: how many ns will be removed from polling time, 0 means that
632 #               it's not configured (since 2.9)
634 # Since: 2.0
636 { 'struct': 'IOThreadInfo',
637   'data': {'id': 'str',
638            'thread-id': 'int',
639            'poll-max-ns': 'int',
640            'poll-grow': 'int',
641            'poll-shrink': 'int' } }
644 # @query-iothreads:
646 # Returns a list of information about each iothread.
648 # Note: this list excludes the QEMU main loop thread, which is not declared
649 # using the -object iothread command-line option.  It is always the main thread
650 # of the process.
652 # Returns: a list of @IOThreadInfo for each iothread
654 # Since: 2.0
656 # Example:
658 # -> { "execute": "query-iothreads" }
659 # <- { "return": [
660 #          {
661 #             "id":"iothread0",
662 #             "thread-id":3134
663 #          },
664 #          {
665 #             "id":"iothread1",
666 #             "thread-id":3135
667 #          }
668 #       ]
669 #    }
672 { 'command': 'query-iothreads', 'returns': ['IOThreadInfo'],
673   'allow-preconfig': true }
676 # @BalloonInfo:
678 # Information about the guest balloon device.
680 # @actual: the number of bytes the balloon currently contains
682 # Since: 0.14.0
685 { 'struct': 'BalloonInfo', 'data': {'actual': 'int' } }
688 # @query-balloon:
690 # Return information about the balloon device.
692 # Returns: @BalloonInfo on success
694 #          If the balloon driver is enabled but not functional because the KVM
695 #          kernel module cannot support it, KvmMissingCap
697 #          If no balloon device is present, DeviceNotActive
699 # Since: 0.14.0
701 # Example:
703 # -> { "execute": "query-balloon" }
704 # <- { "return": {
705 #          "actual": 1073741824,
706 #       }
707 #    }
710 { 'command': 'query-balloon', 'returns': 'BalloonInfo' }
713 # @BALLOON_CHANGE:
715 # Emitted when the guest changes the actual BALLOON level. This value is
716 # equivalent to the @actual field return by the 'query-balloon' command
718 # @actual: actual level of the guest memory balloon in bytes
720 # Note: this event is rate-limited.
722 # Since: 1.2
724 # Example:
726 # <- { "event": "BALLOON_CHANGE",
727 #      "data": { "actual": 944766976 },
728 #      "timestamp": { "seconds": 1267020223, "microseconds": 435656 } }
731 { 'event': 'BALLOON_CHANGE',
732   'data': { 'actual': 'int' } }
735 # @PciMemoryRange:
737 # A PCI device memory region
739 # @base: the starting address (guest physical)
741 # @limit: the ending address (guest physical)
743 # Since: 0.14.0
745 { 'struct': 'PciMemoryRange', 'data': {'base': 'int', 'limit': 'int'} }
748 # @PciMemoryRegion:
750 # Information about a PCI device I/O region.
752 # @bar: the index of the Base Address Register for this region
754 # @type: 'io' if the region is a PIO region
755 #        'memory' if the region is a MMIO region
757 # @size: memory size
759 # @prefetch: if @type is 'memory', true if the memory is prefetchable
761 # @mem_type_64: if @type is 'memory', true if the BAR is 64-bit
763 # Since: 0.14.0
765 { 'struct': 'PciMemoryRegion',
766   'data': {'bar': 'int', 'type': 'str', 'address': 'int', 'size': 'int',
767            '*prefetch': 'bool', '*mem_type_64': 'bool' } }
770 # @PciBusInfo:
772 # Information about a bus of a PCI Bridge device
774 # @number: primary bus interface number.  This should be the number of the
775 #          bus the device resides on.
777 # @secondary: secondary bus interface number.  This is the number of the
778 #             main bus for the bridge
780 # @subordinate: This is the highest number bus that resides below the
781 #               bridge.
783 # @io_range: The PIO range for all devices on this bridge
785 # @memory_range: The MMIO range for all devices on this bridge
787 # @prefetchable_range: The range of prefetchable MMIO for all devices on
788 #                      this bridge
790 # Since: 2.4
792 { 'struct': 'PciBusInfo',
793   'data': {'number': 'int', 'secondary': 'int', 'subordinate': 'int',
794            'io_range': 'PciMemoryRange',
795            'memory_range': 'PciMemoryRange',
796            'prefetchable_range': 'PciMemoryRange' } }
799 # @PciBridgeInfo:
801 # Information about a PCI Bridge device
803 # @bus: information about the bus the device resides on
805 # @devices: a list of @PciDeviceInfo for each device on this bridge
807 # Since: 0.14.0
809 { 'struct': 'PciBridgeInfo',
810   'data': {'bus': 'PciBusInfo', '*devices': ['PciDeviceInfo']} }
813 # @PciDeviceClass:
815 # Information about the Class of a PCI device
817 # @desc: a string description of the device's class
819 # @class: the class code of the device
821 # Since: 2.4
823 { 'struct': 'PciDeviceClass',
824   'data': {'*desc': 'str', 'class': 'int'} }
827 # @PciDeviceId:
829 # Information about the Id of a PCI device
831 # @device: the PCI device id
833 # @vendor: the PCI vendor id
835 # Since: 2.4
837 { 'struct': 'PciDeviceId',
838   'data': {'device': 'int', 'vendor': 'int'} }
841 # @PciDeviceInfo:
843 # Information about a PCI device
845 # @bus: the bus number of the device
847 # @slot: the slot the device is located in
849 # @function: the function of the slot used by the device
851 # @class_info: the class of the device
853 # @id: the PCI device id
855 # @irq: if an IRQ is assigned to the device, the IRQ number
857 # @qdev_id: the device name of the PCI device
859 # @pci_bridge: if the device is a PCI bridge, the bridge information
861 # @regions: a list of the PCI I/O regions associated with the device
863 # Notes: the contents of @class_info.desc are not stable and should only be
864 #        treated as informational.
866 # Since: 0.14.0
868 { 'struct': 'PciDeviceInfo',
869   'data': {'bus': 'int', 'slot': 'int', 'function': 'int',
870            'class_info': 'PciDeviceClass', 'id': 'PciDeviceId',
871            '*irq': 'int', 'qdev_id': 'str', '*pci_bridge': 'PciBridgeInfo',
872            'regions': ['PciMemoryRegion']} }
875 # @PciInfo:
877 # Information about a PCI bus
879 # @bus: the bus index
881 # @devices: a list of devices on this bus
883 # Since: 0.14.0
885 { 'struct': 'PciInfo', 'data': {'bus': 'int', 'devices': ['PciDeviceInfo']} }
888 # @query-pci:
890 # Return information about the PCI bus topology of the guest.
892 # Returns: a list of @PciInfo for each PCI bus. Each bus is
893 # represented by a json-object, which has a key with a json-array of
894 # all PCI devices attached to it. Each device is represented by a
895 # json-object.
897 # Since: 0.14.0
899 # Example:
901 # -> { "execute": "query-pci" }
902 # <- { "return": [
903 #          {
904 #             "bus": 0,
905 #             "devices": [
906 #                {
907 #                   "bus": 0,
908 #                   "qdev_id": "",
909 #                   "slot": 0,
910 #                   "class_info": {
911 #                      "class": 1536,
912 #                      "desc": "Host bridge"
913 #                   },
914 #                   "id": {
915 #                      "device": 32902,
916 #                      "vendor": 4663
917 #                   },
918 #                   "function": 0,
919 #                   "regions": [
920 #                   ]
921 #                },
922 #                {
923 #                   "bus": 0,
924 #                   "qdev_id": "",
925 #                   "slot": 1,
926 #                   "class_info": {
927 #                      "class": 1537,
928 #                      "desc": "ISA bridge"
929 #                   },
930 #                   "id": {
931 #                      "device": 32902,
932 #                      "vendor": 28672
933 #                   },
934 #                   "function": 0,
935 #                   "regions": [
936 #                   ]
937 #                },
938 #                {
939 #                   "bus": 0,
940 #                   "qdev_id": "",
941 #                   "slot": 1,
942 #                   "class_info": {
943 #                      "class": 257,
944 #                      "desc": "IDE controller"
945 #                   },
946 #                   "id": {
947 #                      "device": 32902,
948 #                      "vendor": 28688
949 #                   },
950 #                   "function": 1,
951 #                   "regions": [
952 #                      {
953 #                         "bar": 4,
954 #                         "size": 16,
955 #                         "address": 49152,
956 #                         "type": "io"
957 #                      }
958 #                   ]
959 #                },
960 #                {
961 #                   "bus": 0,
962 #                   "qdev_id": "",
963 #                   "slot": 2,
964 #                   "class_info": {
965 #                      "class": 768,
966 #                      "desc": "VGA controller"
967 #                   },
968 #                   "id": {
969 #                      "device": 4115,
970 #                      "vendor": 184
971 #                   },
972 #                   "function": 0,
973 #                   "regions": [
974 #                      {
975 #                         "prefetch": true,
976 #                         "mem_type_64": false,
977 #                         "bar": 0,
978 #                         "size": 33554432,
979 #                         "address": 4026531840,
980 #                         "type": "memory"
981 #                      },
982 #                      {
983 #                         "prefetch": false,
984 #                         "mem_type_64": false,
985 #                         "bar": 1,
986 #                         "size": 4096,
987 #                         "address": 4060086272,
988 #                         "type": "memory"
989 #                      },
990 #                      {
991 #                         "prefetch": false,
992 #                         "mem_type_64": false,
993 #                         "bar": 6,
994 #                         "size": 65536,
995 #                         "address": -1,
996 #                         "type": "memory"
997 #                      }
998 #                   ]
999 #                },
1000 #                {
1001 #                   "bus": 0,
1002 #                   "qdev_id": "",
1003 #                   "irq": 11,
1004 #                   "slot": 4,
1005 #                   "class_info": {
1006 #                      "class": 1280,
1007 #                      "desc": "RAM controller"
1008 #                   },
1009 #                   "id": {
1010 #                      "device": 6900,
1011 #                      "vendor": 4098
1012 #                   },
1013 #                   "function": 0,
1014 #                   "regions": [
1015 #                      {
1016 #                         "bar": 0,
1017 #                         "size": 32,
1018 #                         "address": 49280,
1019 #                         "type": "io"
1020 #                      }
1021 #                   ]
1022 #                }
1023 #             ]
1024 #          }
1025 #       ]
1026 #    }
1028 # Note: This example has been shortened as the real response is too long.
1031 { 'command': 'query-pci', 'returns': ['PciInfo'] }
1034 # @quit:
1036 # This command will cause the QEMU process to exit gracefully.  While every
1037 # attempt is made to send the QMP response before terminating, this is not
1038 # guaranteed.  When using this interface, a premature EOF would not be
1039 # unexpected.
1041 # Since: 0.14.0
1043 # Example:
1045 # -> { "execute": "quit" }
1046 # <- { "return": {} }
1048 { 'command': 'quit' }
1051 # @stop:
1053 # Stop all guest VCPU execution.
1055 # Since:  0.14.0
1057 # Notes:  This function will succeed even if the guest is already in the stopped
1058 #         state.  In "inmigrate" state, it will ensure that the guest
1059 #         remains paused once migration finishes, as if the -S option was
1060 #         passed on the command line.
1062 # Example:
1064 # -> { "execute": "stop" }
1065 # <- { "return": {} }
1068 { 'command': 'stop' }
1071 # @system_reset:
1073 # Performs a hard reset of a guest.
1075 # Since: 0.14.0
1077 # Example:
1079 # -> { "execute": "system_reset" }
1080 # <- { "return": {} }
1083 { 'command': 'system_reset' }
1086 # @system_powerdown:
1088 # Requests that a guest perform a powerdown operation.
1090 # Since: 0.14.0
1092 # Notes: A guest may or may not respond to this command.  This command
1093 #        returning does not indicate that a guest has accepted the request or
1094 #        that it has shut down.  Many guests will respond to this command by
1095 #        prompting the user in some way.
1096 # Example:
1098 # -> { "execute": "system_powerdown" }
1099 # <- { "return": {} }
1102 { 'command': 'system_powerdown' }
1105 # @cpu-add:
1107 # Adds CPU with specified ID
1109 # @id: ID of CPU to be created, valid values [0..max_cpus)
1111 # Returns: Nothing on success
1113 # Since: 1.5
1115 # Example:
1117 # -> { "execute": "cpu-add", "arguments": { "id": 2 } }
1118 # <- { "return": {} }
1121 { 'command': 'cpu-add', 'data': {'id': 'int'} }
1124 # @memsave:
1126 # Save a portion of guest memory to a file.
1128 # @val: the virtual address of the guest to start from
1130 # @size: the size of memory region to save
1132 # @filename: the file to save the memory to as binary data
1134 # @cpu-index: the index of the virtual CPU to use for translating the
1135 #                       virtual address (defaults to CPU 0)
1137 # Returns: Nothing on success
1139 # Since: 0.14.0
1141 # Notes: Errors were not reliably returned until 1.1
1143 # Example:
1145 # -> { "execute": "memsave",
1146 #      "arguments": { "val": 10,
1147 #                     "size": 100,
1148 #                     "filename": "/tmp/virtual-mem-dump" } }
1149 # <- { "return": {} }
1152 { 'command': 'memsave',
1153   'data': {'val': 'int', 'size': 'int', 'filename': 'str', '*cpu-index': 'int'} }
1156 # @pmemsave:
1158 # Save a portion of guest physical memory to a file.
1160 # @val: the physical address of the guest to start from
1162 # @size: the size of memory region to save
1164 # @filename: the file to save the memory to as binary data
1166 # Returns: Nothing on success
1168 # Since: 0.14.0
1170 # Notes: Errors were not reliably returned until 1.1
1172 # Example:
1174 # -> { "execute": "pmemsave",
1175 #      "arguments": { "val": 10,
1176 #                     "size": 100,
1177 #                     "filename": "/tmp/physical-mem-dump" } }
1178 # <- { "return": {} }
1181 { 'command': 'pmemsave',
1182   'data': {'val': 'int', 'size': 'int', 'filename': 'str'} }
1185 # @cont:
1187 # Resume guest VCPU execution.
1189 # Since:  0.14.0
1191 # Returns:  If successful, nothing
1193 # Notes:  This command will succeed if the guest is currently running.  It
1194 #         will also succeed if the guest is in the "inmigrate" state; in
1195 #         this case, the effect of the command is to make sure the guest
1196 #         starts once migration finishes, removing the effect of the -S
1197 #         command line option if it was passed.
1199 # Example:
1201 # -> { "execute": "cont" }
1202 # <- { "return": {} }
1205 { 'command': 'cont' }
1208 # @exit-preconfig:
1210 # Exit from "preconfig" state
1212 # This command makes QEMU exit the preconfig state and proceed with
1213 # VM initialization using configuration data provided on the command line
1214 # and via the QMP monitor during the preconfig state. The command is only
1215 # available during the preconfig state (i.e. when the --preconfig command
1216 # line option was in use).
1218 # Since 3.0
1220 # Returns: nothing
1222 # Example:
1224 # -> { "execute": "exit-preconfig" }
1225 # <- { "return": {} }
1228 { 'command': 'exit-preconfig', 'allow-preconfig': true }
1231 # @system_wakeup:
1233 # Wakeup guest from suspend.  Does nothing in case the guest isn't suspended.
1235 # Since:  1.1
1237 # Returns:  nothing.
1239 # Example:
1241 # -> { "execute": "system_wakeup" }
1242 # <- { "return": {} }
1245 { 'command': 'system_wakeup' }
1248 # @inject-nmi:
1250 # Injects a Non-Maskable Interrupt into the default CPU (x86/s390) or all CPUs (ppc64).
1251 # The command fails when the guest doesn't support injecting.
1253 # Returns:  If successful, nothing
1255 # Since:  0.14.0
1257 # Note: prior to 2.1, this command was only supported for x86 and s390 VMs
1259 # Example:
1261 # -> { "execute": "inject-nmi" }
1262 # <- { "return": {} }
1265 { 'command': 'inject-nmi' }
1268 # @balloon:
1270 # Request the balloon driver to change its balloon size.
1272 # @value: the target size of the balloon in bytes
1274 # Returns: Nothing on success
1275 #          If the balloon driver is enabled but not functional because the KVM
1276 #            kernel module cannot support it, KvmMissingCap
1277 #          If no balloon device is present, DeviceNotActive
1279 # Notes: This command just issues a request to the guest.  When it returns,
1280 #        the balloon size may not have changed.  A guest can change the balloon
1281 #        size independent of this command.
1283 # Since: 0.14.0
1285 # Example:
1287 # -> { "execute": "balloon", "arguments": { "value": 536870912 } }
1288 # <- { "return": {} }
1291 { 'command': 'balloon', 'data': {'value': 'int'} }
1294 # @human-monitor-command:
1296 # Execute a command on the human monitor and return the output.
1298 # @command-line: the command to execute in the human monitor
1300 # @cpu-index: The CPU to use for commands that require an implicit CPU
1302 # Returns: the output of the command as a string
1304 # Since: 0.14.0
1306 # Notes: This command only exists as a stop-gap.  Its use is highly
1307 #        discouraged.  The semantics of this command are not
1308 #        guaranteed: this means that command names, arguments and
1309 #        responses can change or be removed at ANY time.  Applications
1310 #        that rely on long term stability guarantees should NOT
1311 #        use this command.
1313 #        Known limitations:
1315 #        * This command is stateless, this means that commands that depend
1316 #          on state information (such as getfd) might not work
1318 #        * Commands that prompt the user for data don't currently work
1320 # Example:
1322 # -> { "execute": "human-monitor-command",
1323 #      "arguments": { "command-line": "info kvm" } }
1324 # <- { "return": "kvm support: enabled\r\n" }
1327 { 'command': 'human-monitor-command',
1328   'data': {'command-line': 'str', '*cpu-index': 'int'},
1329   'returns': 'str' }
1332 # @ObjectPropertyInfo:
1334 # @name: the name of the property
1336 # @type: the type of the property.  This will typically come in one of four
1337 #        forms:
1339 #        1) A primitive type such as 'u8', 'u16', 'bool', 'str', or 'double'.
1340 #           These types are mapped to the appropriate JSON type.
1342 #        2) A child type in the form 'child<subtype>' where subtype is a qdev
1343 #           device type name.  Child properties create the composition tree.
1345 #        3) A link type in the form 'link<subtype>' where subtype is a qdev
1346 #           device type name.  Link properties form the device model graph.
1348 # @description: if specified, the description of the property.
1350 # Since: 1.2
1352 { 'struct': 'ObjectPropertyInfo',
1353   'data': { 'name': 'str', 'type': 'str', '*description': 'str' } }
1356 # @qom-list:
1358 # This command will list any properties of a object given a path in the object
1359 # model.
1361 # @path: the path within the object model.  See @qom-get for a description of
1362 #        this parameter.
1364 # Returns: a list of @ObjectPropertyInfo that describe the properties of the
1365 #          object.
1367 # Since: 1.2
1369 { 'command': 'qom-list',
1370   'data': { 'path': 'str' },
1371   'returns': [ 'ObjectPropertyInfo' ],
1372   'allow-preconfig': true }
1375 # @qom-get:
1377 # This command will get a property from a object model path and return the
1378 # value.
1380 # @path: The path within the object model.  There are two forms of supported
1381 #        paths--absolute and partial paths.
1383 #        Absolute paths are derived from the root object and can follow child<>
1384 #        or link<> properties.  Since they can follow link<> properties, they
1385 #        can be arbitrarily long.  Absolute paths look like absolute filenames
1386 #        and are prefixed  with a leading slash.
1388 #        Partial paths look like relative filenames.  They do not begin
1389 #        with a prefix.  The matching rules for partial paths are subtle but
1390 #        designed to make specifying objects easy.  At each level of the
1391 #        composition tree, the partial path is matched as an absolute path.
1392 #        The first match is not returned.  At least two matches are searched
1393 #        for.  A successful result is only returned if only one match is
1394 #        found.  If more than one match is found, a flag is return to
1395 #        indicate that the match was ambiguous.
1397 # @property: The property name to read
1399 # Returns: The property value.  The type depends on the property
1400 #          type. child<> and link<> properties are returned as #str
1401 #          pathnames.  All integer property types (u8, u16, etc) are
1402 #          returned as #int.
1404 # Since: 1.2
1406 { 'command': 'qom-get',
1407   'data': { 'path': 'str', 'property': 'str' },
1408   'returns': 'any',
1409   'allow-preconfig': true }
1412 # @qom-set:
1414 # This command will set a property from a object model path.
1416 # @path: see @qom-get for a description of this parameter
1418 # @property: the property name to set
1420 # @value: a value who's type is appropriate for the property type.  See @qom-get
1421 #         for a description of type mapping.
1423 # Since: 1.2
1425 { 'command': 'qom-set',
1426   'data': { 'path': 'str', 'property': 'str', 'value': 'any' },
1427   'allow-preconfig': true }
1430 # @change:
1432 # This command is multiple commands multiplexed together.
1434 # @device: This is normally the name of a block device but it may also be 'vnc'.
1435 #          when it's 'vnc', then sub command depends on @target
1437 # @target: If @device is a block device, then this is the new filename.
1438 #          If @device is 'vnc', then if the value 'password' selects the vnc
1439 #          change password command.   Otherwise, this specifies a new server URI
1440 #          address to listen to for VNC connections.
1442 # @arg:    If @device is a block device, then this is an optional format to open
1443 #          the device with.
1444 #          If @device is 'vnc' and @target is 'password', this is the new VNC
1445 #          password to set.  See change-vnc-password for additional notes.
1447 # Returns: Nothing on success.
1448 #          If @device is not a valid block device, DeviceNotFound
1450 # Notes:  This interface is deprecated, and it is strongly recommended that you
1451 #         avoid using it.  For changing block devices, use
1452 #         blockdev-change-medium; for changing VNC parameters, use
1453 #         change-vnc-password.
1455 # Since: 0.14.0
1457 # Example:
1459 # 1. Change a removable medium
1461 # -> { "execute": "change",
1462 #      "arguments": { "device": "ide1-cd0",
1463 #                     "target": "/srv/images/Fedora-12-x86_64-DVD.iso" } }
1464 # <- { "return": {} }
1466 # 2. Change VNC password
1468 # -> { "execute": "change",
1469 #      "arguments": { "device": "vnc", "target": "password",
1470 #                     "arg": "foobar1" } }
1471 # <- { "return": {} }
1474 { 'command': 'change',
1475   'data': {'device': 'str', 'target': 'str', '*arg': 'str'} }
1478 # @ObjectTypeInfo:
1480 # This structure describes a search result from @qom-list-types
1482 # @name: the type name found in the search
1484 # @abstract: the type is abstract and can't be directly instantiated.
1485 #            Omitted if false. (since 2.10)
1487 # @parent: Name of parent type, if any (since 2.10)
1489 # Since: 1.1
1491 { 'struct': 'ObjectTypeInfo',
1492   'data': { 'name': 'str', '*abstract': 'bool', '*parent': 'str' } }
1495 # @qom-list-types:
1497 # This command will return a list of types given search parameters
1499 # @implements: if specified, only return types that implement this type name
1501 # @abstract: if true, include abstract types in the results
1503 # Returns: a list of @ObjectTypeInfo or an empty list if no results are found
1505 # Since: 1.1
1507 { 'command': 'qom-list-types',
1508   'data': { '*implements': 'str', '*abstract': 'bool' },
1509   'returns': [ 'ObjectTypeInfo' ],
1510   'allow-preconfig': true }
1513 # @device-list-properties:
1515 # List properties associated with a device.
1517 # @typename: the type name of a device
1519 # Returns: a list of ObjectPropertyInfo describing a devices properties
1521 # Note: objects can create properties at runtime, for example to describe
1522 # links between different devices and/or objects. These properties
1523 # are not included in the output of this command.
1525 # Since: 1.2
1527 { 'command': 'device-list-properties',
1528   'data': { 'typename': 'str'},
1529   'returns': [ 'ObjectPropertyInfo' ] }
1532 # @qom-list-properties:
1534 # List properties associated with a QOM object.
1536 # @typename: the type name of an object
1538 # Note: objects can create properties at runtime, for example to describe
1539 # links between different devices and/or objects. These properties
1540 # are not included in the output of this command.
1542 # Returns: a list of ObjectPropertyInfo describing object properties
1544 # Since: 2.12
1546 { 'command': 'qom-list-properties',
1547   'data': { 'typename': 'str'},
1548   'returns': [ 'ObjectPropertyInfo' ],
1549   'allow-preconfig': true }
1552 # @xen-set-global-dirty-log:
1554 # Enable or disable the global dirty log mode.
1556 # @enable: true to enable, false to disable.
1558 # Returns: nothing
1560 # Since: 1.3
1562 # Example:
1564 # -> { "execute": "xen-set-global-dirty-log",
1565 #      "arguments": { "enable": true } }
1566 # <- { "return": {} }
1569 { 'command': 'xen-set-global-dirty-log', 'data': { 'enable': 'bool' } }
1572 # @device_add:
1574 # @driver: the name of the new device's driver
1576 # @bus: the device's parent bus (device tree path)
1578 # @id: the device's ID, must be unique
1580 # Additional arguments depend on the type.
1582 # Add a device.
1584 # Notes:
1585 # 1. For detailed information about this command, please refer to the
1586 #    'docs/qdev-device-use.txt' file.
1588 # 2. It's possible to list device properties by running QEMU with the
1589 #    "-device DEVICE,help" command-line argument, where DEVICE is the
1590 #    device's name
1592 # Example:
1594 # -> { "execute": "device_add",
1595 #      "arguments": { "driver": "e1000", "id": "net1",
1596 #                     "bus": "pci.0",
1597 #                     "mac": "52:54:00:12:34:56" } }
1598 # <- { "return": {} }
1600 # TODO: This command effectively bypasses QAPI completely due to its
1601 # "additional arguments" business.  It shouldn't have been added to
1602 # the schema in this form.  It should be qapified properly, or
1603 # replaced by a properly qapified command.
1605 # Since: 0.13
1607 { 'command': 'device_add',
1608   'data': {'driver': 'str', '*bus': 'str', '*id': 'str'},
1609   'gen': false } # so we can get the additional arguments
1612 # @device_del:
1614 # Remove a device from a guest
1616 # @id: the device's ID or QOM path
1618 # Returns: Nothing on success
1619 #          If @id is not a valid device, DeviceNotFound
1621 # Notes: When this command completes, the device may not be removed from the
1622 #        guest.  Hot removal is an operation that requires guest cooperation.
1623 #        This command merely requests that the guest begin the hot removal
1624 #        process.  Completion of the device removal process is signaled with a
1625 #        DEVICE_DELETED event. Guest reset will automatically complete removal
1626 #        for all devices.
1628 # Since: 0.14.0
1630 # Example:
1632 # -> { "execute": "device_del",
1633 #      "arguments": { "id": "net1" } }
1634 # <- { "return": {} }
1636 # -> { "execute": "device_del",
1637 #      "arguments": { "id": "/machine/peripheral-anon/device[0]" } }
1638 # <- { "return": {} }
1641 { 'command': 'device_del', 'data': {'id': 'str'} }
1644 # @DEVICE_DELETED:
1646 # Emitted whenever the device removal completion is acknowledged by the guest.
1647 # At this point, it's safe to reuse the specified device ID. Device removal can
1648 # be initiated by the guest or by HMP/QMP commands.
1650 # @device: device name
1652 # @path: device path
1654 # Since: 1.5
1656 # Example:
1658 # <- { "event": "DEVICE_DELETED",
1659 #      "data": { "device": "virtio-net-pci-0",
1660 #                "path": "/machine/peripheral/virtio-net-pci-0" },
1661 #      "timestamp": { "seconds": 1265044230, "microseconds": 450486 } }
1664 { 'event': 'DEVICE_DELETED',
1665   'data': { '*device': 'str', 'path': 'str' } }
1668 # @DumpGuestMemoryFormat:
1670 # An enumeration of guest-memory-dump's format.
1672 # @elf: elf format
1674 # @kdump-zlib: kdump-compressed format with zlib-compressed
1676 # @kdump-lzo: kdump-compressed format with lzo-compressed
1678 # @kdump-snappy: kdump-compressed format with snappy-compressed
1680 # Since: 2.0
1682 { 'enum': 'DumpGuestMemoryFormat',
1683   'data': [ 'elf', 'kdump-zlib', 'kdump-lzo', 'kdump-snappy' ] }
1686 # @dump-guest-memory:
1688 # Dump guest's memory to vmcore. It is a synchronous operation that can take
1689 # very long depending on the amount of guest memory.
1691 # @paging: if true, do paging to get guest's memory mapping. This allows
1692 #          using gdb to process the core file.
1694 #          IMPORTANT: this option can make QEMU allocate several gigabytes
1695 #                     of RAM. This can happen for a large guest, or a
1696 #                     malicious guest pretending to be large.
1698 #          Also, paging=true has the following limitations:
1700 #             1. The guest may be in a catastrophic state or can have corrupted
1701 #                memory, which cannot be trusted
1702 #             2. The guest can be in real-mode even if paging is enabled. For
1703 #                example, the guest uses ACPI to sleep, and ACPI sleep state
1704 #                goes in real-mode
1705 #             3. Currently only supported on i386 and x86_64.
1707 # @protocol: the filename or file descriptor of the vmcore. The supported
1708 #            protocols are:
1710 #            1. file: the protocol starts with "file:", and the following
1711 #               string is the file's path.
1712 #            2. fd: the protocol starts with "fd:", and the following string
1713 #               is the fd's name.
1715 # @detach: if true, QMP will return immediately rather than
1716 #          waiting for the dump to finish. The user can track progress
1717 #          using "query-dump". (since 2.6).
1719 # @begin: if specified, the starting physical address.
1721 # @length: if specified, the memory size, in bytes. If you don't
1722 #          want to dump all guest's memory, please specify the start @begin
1723 #          and @length
1725 # @format: if specified, the format of guest memory dump. But non-elf
1726 #          format is conflict with paging and filter, ie. @paging, @begin and
1727 #          @length is not allowed to be specified with non-elf @format at the
1728 #          same time (since 2.0)
1730 # Note: All boolean arguments default to false
1732 # Returns: nothing on success
1734 # Since: 1.2
1736 # Example:
1738 # -> { "execute": "dump-guest-memory",
1739 #      "arguments": { "protocol": "fd:dump" } }
1740 # <- { "return": {} }
1743 { 'command': 'dump-guest-memory',
1744   'data': { 'paging': 'bool', 'protocol': 'str', '*detach': 'bool',
1745             '*begin': 'int', '*length': 'int',
1746             '*format': 'DumpGuestMemoryFormat'} }
1749 # @DumpStatus:
1751 # Describe the status of a long-running background guest memory dump.
1753 # @none: no dump-guest-memory has started yet.
1755 # @active: there is one dump running in background.
1757 # @completed: the last dump has finished successfully.
1759 # @failed: the last dump has failed.
1761 # Since: 2.6
1763 { 'enum': 'DumpStatus',
1764   'data': [ 'none', 'active', 'completed', 'failed' ] }
1767 # @DumpQueryResult:
1769 # The result format for 'query-dump'.
1771 # @status: enum of @DumpStatus, which shows current dump status
1773 # @completed: bytes written in latest dump (uncompressed)
1775 # @total: total bytes to be written in latest dump (uncompressed)
1777 # Since: 2.6
1779 { 'struct': 'DumpQueryResult',
1780   'data': { 'status': 'DumpStatus',
1781             'completed': 'int',
1782             'total': 'int' } }
1785 # @query-dump:
1787 # Query latest dump status.
1789 # Returns: A @DumpStatus object showing the dump status.
1791 # Since: 2.6
1793 # Example:
1795 # -> { "execute": "query-dump" }
1796 # <- { "return": { "status": "active", "completed": 1024000,
1797 #                  "total": 2048000 } }
1800 { 'command': 'query-dump', 'returns': 'DumpQueryResult' }
1803 # @DUMP_COMPLETED:
1805 # Emitted when background dump has completed
1807 # @result: final dump status
1809 # @error: human-readable error string that provides
1810 #         hint on why dump failed. Only presents on failure. The
1811 #         user should not try to interpret the error string.
1813 # Since: 2.6
1815 # Example:
1817 # { "event": "DUMP_COMPLETED",
1818 #   "data": {"result": {"total": 1090650112, "status": "completed",
1819 #                       "completed": 1090650112} } }
1822 { 'event': 'DUMP_COMPLETED' ,
1823   'data': { 'result': 'DumpQueryResult', '*error': 'str' } }
1826 # @DumpGuestMemoryCapability:
1828 # A list of the available formats for dump-guest-memory
1830 # Since: 2.0
1832 { 'struct': 'DumpGuestMemoryCapability',
1833   'data': {
1834       'formats': ['DumpGuestMemoryFormat'] } }
1837 # @query-dump-guest-memory-capability:
1839 # Returns the available formats for dump-guest-memory
1841 # Returns:  A @DumpGuestMemoryCapability object listing available formats for
1842 #           dump-guest-memory
1844 # Since: 2.0
1846 # Example:
1848 # -> { "execute": "query-dump-guest-memory-capability" }
1849 # <- { "return": { "formats":
1850 #                  ["elf", "kdump-zlib", "kdump-lzo", "kdump-snappy"] }
1853 { 'command': 'query-dump-guest-memory-capability',
1854   'returns': 'DumpGuestMemoryCapability' }
1857 # @dump-skeys:
1859 # Dump guest's storage keys
1861 # @filename: the path to the file to dump to
1863 # This command is only supported on s390 architecture.
1865 # Since: 2.5
1867 # Example:
1869 # -> { "execute": "dump-skeys",
1870 #      "arguments": { "filename": "/tmp/skeys" } }
1871 # <- { "return": {} }
1874 { 'command': 'dump-skeys',
1875   'data': { 'filename': 'str' } }
1878 # @object-add:
1880 # Create a QOM object.
1882 # @qom-type: the class name for the object to be created
1884 # @id: the name of the new object
1886 # @props: a dictionary of properties to be passed to the backend
1888 # Returns: Nothing on success
1889 #          Error if @qom-type is not a valid class name
1891 # Since: 2.0
1893 # Example:
1895 # -> { "execute": "object-add",
1896 #      "arguments": { "qom-type": "rng-random", "id": "rng1",
1897 #                     "props": { "filename": "/dev/hwrng" } } }
1898 # <- { "return": {} }
1901 { 'command': 'object-add',
1902   'data': {'qom-type': 'str', 'id': 'str', '*props': 'any'} }
1905 # @object-del:
1907 # Remove a QOM object.
1909 # @id: the name of the QOM object to remove
1911 # Returns: Nothing on success
1912 #          Error if @id is not a valid id for a QOM object
1914 # Since: 2.0
1916 # Example:
1918 # -> { "execute": "object-del", "arguments": { "id": "rng1" } }
1919 # <- { "return": {} }
1922 { 'command': 'object-del', 'data': {'id': 'str'} }
1925 # @getfd:
1927 # Receive a file descriptor via SCM rights and assign it a name
1929 # @fdname: file descriptor name
1931 # Returns: Nothing on success
1933 # Since: 0.14.0
1935 # Notes: If @fdname already exists, the file descriptor assigned to
1936 #        it will be closed and replaced by the received file
1937 #        descriptor.
1939 #        The 'closefd' command can be used to explicitly close the
1940 #        file descriptor when it is no longer needed.
1942 # Example:
1944 # -> { "execute": "getfd", "arguments": { "fdname": "fd1" } }
1945 # <- { "return": {} }
1948 { 'command': 'getfd', 'data': {'fdname': 'str'} }
1951 # @closefd:
1953 # Close a file descriptor previously passed via SCM rights
1955 # @fdname: file descriptor name
1957 # Returns: Nothing on success
1959 # Since: 0.14.0
1961 # Example:
1963 # -> { "execute": "closefd", "arguments": { "fdname": "fd1" } }
1964 # <- { "return": {} }
1967 { 'command': 'closefd', 'data': {'fdname': 'str'} }
1970 # @MachineInfo:
1972 # Information describing a machine.
1974 # @name: the name of the machine
1976 # @alias: an alias for the machine name
1978 # @is-default: whether the machine is default
1980 # @cpu-max: maximum number of CPUs supported by the machine type
1981 #           (since 1.5.0)
1983 # @hotpluggable-cpus: cpu hotplug via -device is supported (since 2.7.0)
1985 # Since: 1.2.0
1987 { 'struct': 'MachineInfo',
1988   'data': { 'name': 'str', '*alias': 'str',
1989             '*is-default': 'bool', 'cpu-max': 'int',
1990             'hotpluggable-cpus': 'bool'} }
1993 # @query-machines:
1995 # Return a list of supported machines
1997 # Returns: a list of MachineInfo
1999 # Since: 1.2.0
2001 { 'command': 'query-machines', 'returns': ['MachineInfo'] }
2004 # @CpuDefinitionInfo:
2006 # Virtual CPU definition.
2008 # @name: the name of the CPU definition
2010 # @migration-safe: whether a CPU definition can be safely used for
2011 #                  migration in combination with a QEMU compatibility machine
2012 #                  when migrating between different QMU versions and between
2013 #                  hosts with different sets of (hardware or software)
2014 #                  capabilities. If not provided, information is not available
2015 #                  and callers should not assume the CPU definition to be
2016 #                  migration-safe. (since 2.8)
2018 # @static: whether a CPU definition is static and will not change depending on
2019 #          QEMU version, machine type, machine options and accelerator options.
2020 #          A static model is always migration-safe. (since 2.8)
2022 # @unavailable-features: List of properties that prevent
2023 #                        the CPU model from running in the current
2024 #                        host. (since 2.8)
2025 # @typename: Type name that can be used as argument to @device-list-properties,
2026 #            to introspect properties configurable using -cpu or -global.
2027 #            (since 2.9)
2029 # @unavailable-features is a list of QOM property names that
2030 # represent CPU model attributes that prevent the CPU from running.
2031 # If the QOM property is read-only, that means there's no known
2032 # way to make the CPU model run in the current host. Implementations
2033 # that choose not to provide specific information return the
2034 # property name "type".
2035 # If the property is read-write, it means that it MAY be possible
2036 # to run the CPU model in the current host if that property is
2037 # changed. Management software can use it as hints to suggest or
2038 # choose an alternative for the user, or just to generate meaningful
2039 # error messages explaining why the CPU model can't be used.
2040 # If @unavailable-features is an empty list, the CPU model is
2041 # runnable using the current host and machine-type.
2042 # If @unavailable-features is not present, runnability
2043 # information for the CPU is not available.
2045 # Since: 1.2.0
2047 { 'struct': 'CpuDefinitionInfo',
2048   'data': { 'name': 'str', '*migration-safe': 'bool', 'static': 'bool',
2049             '*unavailable-features': [ 'str' ], 'typename': 'str' } }
2052 # @MemoryInfo:
2054 # Actual memory information in bytes.
2056 # @base-memory: size of "base" memory specified with command line
2057 #               option -m.
2059 # @plugged-memory: size of memory that can be hot-unplugged. This field
2060 #                  is omitted if target doesn't support memory hotplug
2061 #                  (i.e. CONFIG_MEM_HOTPLUG not defined on build time).
2063 # Since: 2.11.0
2065 { 'struct': 'MemoryInfo',
2066   'data'  : { 'base-memory': 'size', '*plugged-memory': 'size' } }
2069 # @query-memory-size-summary:
2071 # Return the amount of initially allocated and present hotpluggable (if
2072 # enabled) memory in bytes.
2074 # Example:
2076 # -> { "execute": "query-memory-size-summary" }
2077 # <- { "return": { "base-memory": 4294967296, "plugged-memory": 0 } }
2079 # Since: 2.11.0
2081 { 'command': 'query-memory-size-summary', 'returns': 'MemoryInfo' }
2084 # @query-cpu-definitions:
2086 # Return a list of supported virtual CPU definitions
2088 # Returns: a list of CpuDefInfo
2090 # Since: 1.2.0
2092 { 'command': 'query-cpu-definitions', 'returns': ['CpuDefinitionInfo'] }
2095 # @CpuModelInfo:
2097 # Virtual CPU model.
2099 # A CPU model consists of the name of a CPU definition, to which
2100 # delta changes are applied (e.g. features added/removed). Most magic values
2101 # that an architecture might require should be hidden behind the name.
2102 # However, if required, architectures can expose relevant properties.
2104 # @name: the name of the CPU definition the model is based on
2105 # @props: a dictionary of QOM properties to be applied
2107 # Since: 2.8.0
2109 { 'struct': 'CpuModelInfo',
2110   'data': { 'name': 'str',
2111             '*props': 'any' } }
2114 # @CpuModelExpansionType:
2116 # An enumeration of CPU model expansion types.
2118 # @static: Expand to a static CPU model, a combination of a static base
2119 #          model name and property delta changes. As the static base model will
2120 #          never change, the expanded CPU model will be the same, independent of
2121 #          independent of QEMU version, machine type, machine options, and
2122 #          accelerator options. Therefore, the resulting model can be used by
2123 #          tooling without having to specify a compatibility machine - e.g. when
2124 #          displaying the "host" model. static CPU models are migration-safe.
2126 # @full: Expand all properties. The produced model is not guaranteed to be
2127 #        migration-safe, but allows tooling to get an insight and work with
2128 #        model details.
2130 # Note: When a non-migration-safe CPU model is expanded in static mode, some
2131 # features enabled by the CPU model may be omitted, because they can't be
2132 # implemented by a static CPU model definition (e.g. cache info passthrough and
2133 # PMU passthrough in x86). If you need an accurate representation of the
2134 # features enabled by a non-migration-safe CPU model, use @full. If you need a
2135 # static representation that will keep ABI compatibility even when changing QEMU
2136 # version or machine-type, use @static (but keep in mind that some features may
2137 # be omitted).
2139 # Since: 2.8.0
2141 { 'enum': 'CpuModelExpansionType',
2142   'data': [ 'static', 'full' ] }
2146 # @CpuModelExpansionInfo:
2148 # The result of a cpu model expansion.
2150 # @model: the expanded CpuModelInfo.
2152 # Since: 2.8.0
2154 { 'struct': 'CpuModelExpansionInfo',
2155   'data': { 'model': 'CpuModelInfo' } }
2159 # @query-cpu-model-expansion:
2161 # Expands a given CPU model (or a combination of CPU model + additional options)
2162 # to different granularities, allowing tooling to get an understanding what a
2163 # specific CPU model looks like in QEMU under a certain configuration.
2165 # This interface can be used to query the "host" CPU model.
2167 # The data returned by this command may be affected by:
2169 # * QEMU version: CPU models may look different depending on the QEMU version.
2170 #   (Except for CPU models reported as "static" in query-cpu-definitions.)
2171 # * machine-type: CPU model  may look different depending on the machine-type.
2172 #   (Except for CPU models reported as "static" in query-cpu-definitions.)
2173 # * machine options (including accelerator): in some architectures, CPU models
2174 #   may look different depending on machine and accelerator options. (Except for
2175 #   CPU models reported as "static" in query-cpu-definitions.)
2176 # * "-cpu" arguments and global properties: arguments to the -cpu option and
2177 #   global properties may affect expansion of CPU models. Using
2178 #   query-cpu-model-expansion while using these is not advised.
2180 # Some architectures may not support all expansion types. s390x supports
2181 # "full" and "static".
2183 # Returns: a CpuModelExpansionInfo. Returns an error if expanding CPU models is
2184 #          not supported, if the model cannot be expanded, if the model contains
2185 #          an unknown CPU definition name, unknown properties or properties
2186 #          with a wrong type. Also returns an error if an expansion type is
2187 #          not supported.
2189 # Since: 2.8.0
2191 { 'command': 'query-cpu-model-expansion',
2192   'data': { 'type': 'CpuModelExpansionType',
2193             'model': 'CpuModelInfo' },
2194   'returns': 'CpuModelExpansionInfo' }
2197 # @CpuModelCompareResult:
2199 # An enumeration of CPU model comparison results. The result is usually
2200 # calculated using e.g. CPU features or CPU generations.
2202 # @incompatible: If model A is incompatible to model B, model A is not
2203 #                guaranteed to run where model B runs and the other way around.
2205 # @identical: If model A is identical to model B, model A is guaranteed to run
2206 #             where model B runs and the other way around.
2208 # @superset: If model A is a superset of model B, model B is guaranteed to run
2209 #            where model A runs. There are no guarantees about the other way.
2211 # @subset: If model A is a subset of model B, model A is guaranteed to run
2212 #          where model B runs. There are no guarantees about the other way.
2214 # Since: 2.8.0
2216 { 'enum': 'CpuModelCompareResult',
2217   'data': [ 'incompatible', 'identical', 'superset', 'subset' ] }
2220 # @CpuModelCompareInfo:
2222 # The result of a CPU model comparison.
2224 # @result: The result of the compare operation.
2225 # @responsible-properties: List of properties that led to the comparison result
2226 #                          not being identical.
2228 # @responsible-properties is a list of QOM property names that led to
2229 # both CPUs not being detected as identical. For identical models, this
2230 # list is empty.
2231 # If a QOM property is read-only, that means there's no known way to make the
2232 # CPU models identical. If the special property name "type" is included, the
2233 # models are by definition not identical and cannot be made identical.
2235 # Since: 2.8.0
2237 { 'struct': 'CpuModelCompareInfo',
2238   'data': {'result': 'CpuModelCompareResult',
2239            'responsible-properties': ['str']
2240           }
2244 # @query-cpu-model-comparison:
2246 # Compares two CPU models, returning how they compare in a specific
2247 # configuration. The results indicates how both models compare regarding
2248 # runnability. This result can be used by tooling to make decisions if a
2249 # certain CPU model will run in a certain configuration or if a compatible
2250 # CPU model has to be created by baselining.
2252 # Usually, a CPU model is compared against the maximum possible CPU model
2253 # of a certain configuration (e.g. the "host" model for KVM). If that CPU
2254 # model is identical or a subset, it will run in that configuration.
2256 # The result returned by this command may be affected by:
2258 # * QEMU version: CPU models may look different depending on the QEMU version.
2259 #   (Except for CPU models reported as "static" in query-cpu-definitions.)
2260 # * machine-type: CPU model may look different depending on the machine-type.
2261 #   (Except for CPU models reported as "static" in query-cpu-definitions.)
2262 # * machine options (including accelerator): in some architectures, CPU models
2263 #   may look different depending on machine and accelerator options. (Except for
2264 #   CPU models reported as "static" in query-cpu-definitions.)
2265 # * "-cpu" arguments and global properties: arguments to the -cpu option and
2266 #   global properties may affect expansion of CPU models. Using
2267 #   query-cpu-model-expansion while using these is not advised.
2269 # Some architectures may not support comparing CPU models. s390x supports
2270 # comparing CPU models.
2272 # Returns: a CpuModelBaselineInfo. Returns an error if comparing CPU models is
2273 #          not supported, if a model cannot be used, if a model contains
2274 #          an unknown cpu definition name, unknown properties or properties
2275 #          with wrong types.
2277 # Since: 2.8.0
2279 { 'command': 'query-cpu-model-comparison',
2280   'data': { 'modela': 'CpuModelInfo', 'modelb': 'CpuModelInfo' },
2281   'returns': 'CpuModelCompareInfo' }
2284 # @CpuModelBaselineInfo:
2286 # The result of a CPU model baseline.
2288 # @model: the baselined CpuModelInfo.
2290 # Since: 2.8.0
2292 { 'struct': 'CpuModelBaselineInfo',
2293   'data': { 'model': 'CpuModelInfo' } }
2296 # @query-cpu-model-baseline:
2298 # Baseline two CPU models, creating a compatible third model. The created
2299 # model will always be a static, migration-safe CPU model (see "static"
2300 # CPU model expansion for details).
2302 # This interface can be used by tooling to create a compatible CPU model out
2303 # two CPU models. The created CPU model will be identical to or a subset of
2304 # both CPU models when comparing them. Therefore, the created CPU model is
2305 # guaranteed to run where the given CPU models run.
2307 # The result returned by this command may be affected by:
2309 # * QEMU version: CPU models may look different depending on the QEMU version.
2310 #   (Except for CPU models reported as "static" in query-cpu-definitions.)
2311 # * machine-type: CPU model may look different depending on the machine-type.
2312 #   (Except for CPU models reported as "static" in query-cpu-definitions.)
2313 # * machine options (including accelerator): in some architectures, CPU models
2314 #   may look different depending on machine and accelerator options. (Except for
2315 #   CPU models reported as "static" in query-cpu-definitions.)
2316 # * "-cpu" arguments and global properties: arguments to the -cpu option and
2317 #   global properties may affect expansion of CPU models. Using
2318 #   query-cpu-model-expansion while using these is not advised.
2320 # Some architectures may not support baselining CPU models. s390x supports
2321 # baselining CPU models.
2323 # Returns: a CpuModelBaselineInfo. Returns an error if baselining CPU models is
2324 #          not supported, if a model cannot be used, if a model contains
2325 #          an unknown cpu definition name, unknown properties or properties
2326 #          with wrong types.
2328 # Since: 2.8.0
2330 { 'command': 'query-cpu-model-baseline',
2331   'data': { 'modela': 'CpuModelInfo',
2332             'modelb': 'CpuModelInfo' },
2333   'returns': 'CpuModelBaselineInfo' }
2336 # @AddfdInfo:
2338 # Information about a file descriptor that was added to an fd set.
2340 # @fdset-id: The ID of the fd set that @fd was added to.
2342 # @fd: The file descriptor that was received via SCM rights and
2343 #      added to the fd set.
2345 # Since: 1.2.0
2347 { 'struct': 'AddfdInfo', 'data': {'fdset-id': 'int', 'fd': 'int'} }
2350 # @add-fd:
2352 # Add a file descriptor, that was passed via SCM rights, to an fd set.
2354 # @fdset-id: The ID of the fd set to add the file descriptor to.
2356 # @opaque: A free-form string that can be used to describe the fd.
2358 # Returns: @AddfdInfo on success
2360 #          If file descriptor was not received, FdNotSupplied
2362 #          If @fdset-id is a negative value, InvalidParameterValue
2364 # Notes: The list of fd sets is shared by all monitor connections.
2366 #        If @fdset-id is not specified, a new fd set will be created.
2368 # Since: 1.2.0
2370 # Example:
2372 # -> { "execute": "add-fd", "arguments": { "fdset-id": 1 } }
2373 # <- { "return": { "fdset-id": 1, "fd": 3 } }
2376 { 'command': 'add-fd', 'data': {'*fdset-id': 'int', '*opaque': 'str'},
2377   'returns': 'AddfdInfo' }
2380 # @remove-fd:
2382 # Remove a file descriptor from an fd set.
2384 # @fdset-id: The ID of the fd set that the file descriptor belongs to.
2386 # @fd: The file descriptor that is to be removed.
2388 # Returns: Nothing on success
2389 #          If @fdset-id or @fd is not found, FdNotFound
2391 # Since: 1.2.0
2393 # Notes: The list of fd sets is shared by all monitor connections.
2395 #        If @fd is not specified, all file descriptors in @fdset-id
2396 #        will be removed.
2398 # Example:
2400 # -> { "execute": "remove-fd", "arguments": { "fdset-id": 1, "fd": 3 } }
2401 # <- { "return": {} }
2404 { 'command': 'remove-fd', 'data': {'fdset-id': 'int', '*fd': 'int'} }
2407 # @FdsetFdInfo:
2409 # Information about a file descriptor that belongs to an fd set.
2411 # @fd: The file descriptor value.
2413 # @opaque: A free-form string that can be used to describe the fd.
2415 # Since: 1.2.0
2417 { 'struct': 'FdsetFdInfo',
2418   'data': {'fd': 'int', '*opaque': 'str'} }
2421 # @FdsetInfo:
2423 # Information about an fd set.
2425 # @fdset-id: The ID of the fd set.
2427 # @fds: A list of file descriptors that belong to this fd set.
2429 # Since: 1.2.0
2431 { 'struct': 'FdsetInfo',
2432   'data': {'fdset-id': 'int', 'fds': ['FdsetFdInfo']} }
2435 # @query-fdsets:
2437 # Return information describing all fd sets.
2439 # Returns: A list of @FdsetInfo
2441 # Since: 1.2.0
2443 # Note: The list of fd sets is shared by all monitor connections.
2445 # Example:
2447 # -> { "execute": "query-fdsets" }
2448 # <- { "return": [
2449 #        {
2450 #          "fds": [
2451 #            {
2452 #              "fd": 30,
2453 #              "opaque": "rdonly:/path/to/file"
2454 #            },
2455 #            {
2456 #              "fd": 24,
2457 #              "opaque": "rdwr:/path/to/file"
2458 #            }
2459 #          ],
2460 #          "fdset-id": 1
2461 #        },
2462 #        {
2463 #          "fds": [
2464 #            {
2465 #              "fd": 28
2466 #            },
2467 #            {
2468 #              "fd": 29
2469 #            }
2470 #          ],
2471 #          "fdset-id": 0
2472 #        }
2473 #      ]
2474 #    }
2477 { 'command': 'query-fdsets', 'returns': ['FdsetInfo'] }
2480 # @TargetInfo:
2482 # Information describing the QEMU target.
2484 # @arch: the target architecture
2486 # Since: 1.2.0
2488 { 'struct': 'TargetInfo',
2489   'data': { 'arch': 'SysEmuTarget' } }
2492 # @query-target:
2494 # Return information about the target for this QEMU
2496 # Returns: TargetInfo
2498 # Since: 1.2.0
2500 { 'command': 'query-target', 'returns': 'TargetInfo' }
2503 # @AcpiTableOptions:
2505 # Specify an ACPI table on the command line to load.
2507 # At most one of @file and @data can be specified. The list of files specified
2508 # by any one of them is loaded and concatenated in order. If both are omitted,
2509 # @data is implied.
2511 # Other fields / optargs can be used to override fields of the generic ACPI
2512 # table header; refer to the ACPI specification 5.0, section 5.2.6 System
2513 # Description Table Header. If a header field is not overridden, then the
2514 # corresponding value from the concatenated blob is used (in case of @file), or
2515 # it is filled in with a hard-coded value (in case of @data).
2517 # String fields are copied into the matching ACPI member from lowest address
2518 # upwards, and silently truncated / NUL-padded to length.
2520 # @sig: table signature / identifier (4 bytes)
2522 # @rev: table revision number (dependent on signature, 1 byte)
2524 # @oem_id: OEM identifier (6 bytes)
2526 # @oem_table_id: OEM table identifier (8 bytes)
2528 # @oem_rev: OEM-supplied revision number (4 bytes)
2530 # @asl_compiler_id: identifier of the utility that created the table
2531 #                   (4 bytes)
2533 # @asl_compiler_rev: revision number of the utility that created the
2534 #                    table (4 bytes)
2536 # @file: colon (:) separated list of pathnames to load and
2537 #        concatenate as table data. The resultant binary blob is expected to
2538 #        have an ACPI table header. At least one file is required. This field
2539 #        excludes @data.
2541 # @data: colon (:) separated list of pathnames to load and
2542 #        concatenate as table data. The resultant binary blob must not have an
2543 #        ACPI table header. At least one file is required. This field excludes
2544 #        @file.
2546 # Since: 1.5
2548 { 'struct': 'AcpiTableOptions',
2549   'data': {
2550     '*sig':               'str',
2551     '*rev':               'uint8',
2552     '*oem_id':            'str',
2553     '*oem_table_id':      'str',
2554     '*oem_rev':           'uint32',
2555     '*asl_compiler_id':   'str',
2556     '*asl_compiler_rev':  'uint32',
2557     '*file':              'str',
2558     '*data':              'str' }}
2561 # @CommandLineParameterType:
2563 # Possible types for an option parameter.
2565 # @string: accepts a character string
2567 # @boolean: accepts "on" or "off"
2569 # @number: accepts a number
2571 # @size: accepts a number followed by an optional suffix (K)ilo,
2572 #        (M)ega, (G)iga, (T)era
2574 # Since: 1.5
2576 { 'enum': 'CommandLineParameterType',
2577   'data': ['string', 'boolean', 'number', 'size'] }
2580 # @CommandLineParameterInfo:
2582 # Details about a single parameter of a command line option.
2584 # @name: parameter name
2586 # @type: parameter @CommandLineParameterType
2588 # @help: human readable text string, not suitable for parsing.
2590 # @default: default value string (since 2.1)
2592 # Since: 1.5
2594 { 'struct': 'CommandLineParameterInfo',
2595   'data': { 'name': 'str',
2596             'type': 'CommandLineParameterType',
2597             '*help': 'str',
2598             '*default': 'str' } }
2601 # @CommandLineOptionInfo:
2603 # Details about a command line option, including its list of parameter details
2605 # @option: option name
2607 # @parameters: an array of @CommandLineParameterInfo
2609 # Since: 1.5
2611 { 'struct': 'CommandLineOptionInfo',
2612   'data': { 'option': 'str', 'parameters': ['CommandLineParameterInfo'] } }
2615 # @query-command-line-options:
2617 # Query command line option schema.
2619 # @option: option name
2621 # Returns: list of @CommandLineOptionInfo for all options (or for the given
2622 #          @option).  Returns an error if the given @option doesn't exist.
2624 # Since: 1.5
2626 # Example:
2628 # -> { "execute": "query-command-line-options",
2629 #      "arguments": { "option": "option-rom" } }
2630 # <- { "return": [
2631 #         {
2632 #             "parameters": [
2633 #                 {
2634 #                     "name": "romfile",
2635 #                     "type": "string"
2636 #                 },
2637 #                 {
2638 #                     "name": "bootindex",
2639 #                     "type": "number"
2640 #                 }
2641 #             ],
2642 #             "option": "option-rom"
2643 #         }
2644 #      ]
2645 #    }
2648 {'command': 'query-command-line-options', 'data': { '*option': 'str' },
2649  'returns': ['CommandLineOptionInfo'],
2650  'allow-preconfig': true }
2653 # @X86CPURegister32:
2655 # A X86 32-bit register
2657 # Since: 1.5
2659 { 'enum': 'X86CPURegister32',
2660   'data': [ 'EAX', 'EBX', 'ECX', 'EDX', 'ESP', 'EBP', 'ESI', 'EDI' ] }
2663 # @X86CPUFeatureWordInfo:
2665 # Information about a X86 CPU feature word
2667 # @cpuid-input-eax: Input EAX value for CPUID instruction for that feature word
2669 # @cpuid-input-ecx: Input ECX value for CPUID instruction for that
2670 #                   feature word
2672 # @cpuid-register: Output register containing the feature bits
2674 # @features: value of output register, containing the feature bits
2676 # Since: 1.5
2678 { 'struct': 'X86CPUFeatureWordInfo',
2679   'data': { 'cpuid-input-eax': 'int',
2680             '*cpuid-input-ecx': 'int',
2681             'cpuid-register': 'X86CPURegister32',
2682             'features': 'int' } }
2685 # @DummyForceArrays:
2687 # Not used by QMP; hack to let us use X86CPUFeatureWordInfoList internally
2689 # Since: 2.5
2691 { 'struct': 'DummyForceArrays',
2692   'data': { 'unused': ['X86CPUFeatureWordInfo'] } }
2696 # @NumaOptionsType:
2698 # @node: NUMA nodes configuration
2700 # @dist: NUMA distance configuration (since 2.10)
2702 # @cpu: property based CPU(s) to node mapping (Since: 2.10)
2704 # Since: 2.1
2706 { 'enum': 'NumaOptionsType',
2707   'data': [ 'node', 'dist', 'cpu' ] }
2710 # @NumaOptions:
2712 # A discriminated record of NUMA options. (for OptsVisitor)
2714 # Since: 2.1
2716 { 'union': 'NumaOptions',
2717   'base': { 'type': 'NumaOptionsType' },
2718   'discriminator': 'type',
2719   'data': {
2720     'node': 'NumaNodeOptions',
2721     'dist': 'NumaDistOptions',
2722     'cpu': 'NumaCpuOptions' }}
2725 # @NumaNodeOptions:
2727 # Create a guest NUMA node. (for OptsVisitor)
2729 # @nodeid: NUMA node ID (increase by 1 from 0 if omitted)
2731 # @cpus: VCPUs belonging to this node (assign VCPUS round-robin
2732 #         if omitted)
2734 # @mem: memory size of this node; mutually exclusive with @memdev.
2735 #       Equally divide total memory among nodes if both @mem and @memdev are
2736 #       omitted.
2738 # @memdev: memory backend object.  If specified for one node,
2739 #          it must be specified for all nodes.
2741 # Since: 2.1
2743 { 'struct': 'NumaNodeOptions',
2744   'data': {
2745    '*nodeid': 'uint16',
2746    '*cpus':   ['uint16'],
2747    '*mem':    'size',
2748    '*memdev': 'str' }}
2751 # @NumaDistOptions:
2753 # Set the distance between 2 NUMA nodes.
2755 # @src: source NUMA node.
2757 # @dst: destination NUMA node.
2759 # @val: NUMA distance from source node to destination node.
2760 #       When a node is unreachable from another node, set the distance
2761 #       between them to 255.
2763 # Since: 2.10
2765 { 'struct': 'NumaDistOptions',
2766   'data': {
2767    'src': 'uint16',
2768    'dst': 'uint16',
2769    'val': 'uint8' }}
2772 # @NumaCpuOptions:
2774 # Option "-numa cpu" overrides default cpu to node mapping.
2775 # It accepts the same set of cpu properties as returned by
2776 # query-hotpluggable-cpus[].props, where node-id could be used to
2777 # override default node mapping.
2779 # Since: 2.10
2781 { 'struct': 'NumaCpuOptions',
2782    'base': 'CpuInstanceProperties',
2783    'data' : {} }
2786 # @HostMemPolicy:
2788 # Host memory policy types
2790 # @default: restore default policy, remove any nondefault policy
2792 # @preferred: set the preferred host nodes for allocation
2794 # @bind: a strict policy that restricts memory allocation to the
2795 #        host nodes specified
2797 # @interleave: memory allocations are interleaved across the set
2798 #              of host nodes specified
2800 # Since: 2.1
2802 { 'enum': 'HostMemPolicy',
2803   'data': [ 'default', 'preferred', 'bind', 'interleave' ] }
2806 # @Memdev:
2808 # Information about memory backend
2810 # @id: backend's ID if backend has 'id' property (since 2.9)
2812 # @size: memory backend size
2814 # @merge: enables or disables memory merge support
2816 # @dump: includes memory backend's memory in a core dump or not
2818 # @prealloc: enables or disables memory preallocation
2820 # @host-nodes: host nodes for its memory policy
2822 # @policy: memory policy of memory backend
2824 # Since: 2.1
2826 { 'struct': 'Memdev',
2827   'data': {
2828     '*id':        'str',
2829     'size':       'size',
2830     'merge':      'bool',
2831     'dump':       'bool',
2832     'prealloc':   'bool',
2833     'host-nodes': ['uint16'],
2834     'policy':     'HostMemPolicy' }}
2837 # @query-memdev:
2839 # Returns information for all memory backends.
2841 # Returns: a list of @Memdev.
2843 # Since: 2.1
2845 # Example:
2847 # -> { "execute": "query-memdev" }
2848 # <- { "return": [
2849 #        {
2850 #          "id": "mem1",
2851 #          "size": 536870912,
2852 #          "merge": false,
2853 #          "dump": true,
2854 #          "prealloc": false,
2855 #          "host-nodes": [0, 1],
2856 #          "policy": "bind"
2857 #        },
2858 #        {
2859 #          "size": 536870912,
2860 #          "merge": false,
2861 #          "dump": true,
2862 #          "prealloc": true,
2863 #          "host-nodes": [2, 3],
2864 #          "policy": "preferred"
2865 #        }
2866 #      ]
2867 #    }
2870 { 'command': 'query-memdev', 'returns': ['Memdev'], 'allow-preconfig': true }
2873 # @PCDIMMDeviceInfo:
2875 # PCDIMMDevice state information
2877 # @id: device's ID
2879 # @addr: physical address, where device is mapped
2881 # @size: size of memory that the device provides
2883 # @slot: slot number at which device is plugged in
2885 # @node: NUMA node number where device is plugged in
2887 # @memdev: memory backend linked with device
2889 # @hotplugged: true if device was hotplugged
2891 # @hotpluggable: true if device if could be added/removed while machine is running
2893 # Since: 2.1
2895 { 'struct': 'PCDIMMDeviceInfo',
2896   'data': { '*id': 'str',
2897             'addr': 'int',
2898             'size': 'int',
2899             'slot': 'int',
2900             'node': 'int',
2901             'memdev': 'str',
2902             'hotplugged': 'bool',
2903             'hotpluggable': 'bool'
2904           }
2908 # @MemoryDeviceInfo:
2910 # Union containing information about a memory device
2912 # Since: 2.1
2914 { 'union': 'MemoryDeviceInfo',
2915   'data': { 'dimm': 'PCDIMMDeviceInfo',
2916             'nvdimm': 'PCDIMMDeviceInfo'
2917           }
2921 # @query-memory-devices:
2923 # Lists available memory devices and their state
2925 # Since: 2.1
2927 # Example:
2929 # -> { "execute": "query-memory-devices" }
2930 # <- { "return": [ { "data":
2931 #                       { "addr": 5368709120,
2932 #                         "hotpluggable": true,
2933 #                         "hotplugged": true,
2934 #                         "id": "d1",
2935 #                         "memdev": "/objects/memX",
2936 #                         "node": 0,
2937 #                         "size": 1073741824,
2938 #                         "slot": 0},
2939 #                    "type": "dimm"
2940 #                  } ] }
2943 { 'command': 'query-memory-devices', 'returns': ['MemoryDeviceInfo'] }
2946 # @MEM_UNPLUG_ERROR:
2948 # Emitted when memory hot unplug error occurs.
2950 # @device: device name
2952 # @msg: Informative message
2954 # Since: 2.4
2956 # Example:
2958 # <- { "event": "MEM_UNPLUG_ERROR"
2959 #      "data": { "device": "dimm1",
2960 #                "msg": "acpi: device unplug for unsupported device"
2961 #      },
2962 #      "timestamp": { "seconds": 1265044230, "microseconds": 450486 } }
2965 { 'event': 'MEM_UNPLUG_ERROR',
2966   'data': { 'device': 'str', 'msg': 'str' } }
2969 # @ACPISlotType:
2971 # @DIMM: memory slot
2972 # @CPU: logical CPU slot (since 2.7)
2974 { 'enum': 'ACPISlotType', 'data': [ 'DIMM', 'CPU' ] }
2977 # @ACPIOSTInfo:
2979 # OSPM Status Indication for a device
2980 # For description of possible values of @source and @status fields
2981 # see "_OST (OSPM Status Indication)" chapter of ACPI5.0 spec.
2983 # @device: device ID associated with slot
2985 # @slot: slot ID, unique per slot of a given @slot-type
2987 # @slot-type: type of the slot
2989 # @source: an integer containing the source event
2991 # @status: an integer containing the status code
2993 # Since: 2.1
2995 { 'struct': 'ACPIOSTInfo',
2996   'data'  : { '*device': 'str',
2997               'slot': 'str',
2998               'slot-type': 'ACPISlotType',
2999               'source': 'int',
3000               'status': 'int' } }
3003 # @query-acpi-ospm-status:
3005 # Return a list of ACPIOSTInfo for devices that support status
3006 # reporting via ACPI _OST method.
3008 # Since: 2.1
3010 # Example:
3012 # -> { "execute": "query-acpi-ospm-status" }
3013 # <- { "return": [ { "device": "d1", "slot": "0", "slot-type": "DIMM", "source": 1, "status": 0},
3014 #                  { "slot": "1", "slot-type": "DIMM", "source": 0, "status": 0},
3015 #                  { "slot": "2", "slot-type": "DIMM", "source": 0, "status": 0},
3016 #                  { "slot": "3", "slot-type": "DIMM", "source": 0, "status": 0}
3017 #    ]}
3020 { 'command': 'query-acpi-ospm-status', 'returns': ['ACPIOSTInfo'] }
3023 # @ACPI_DEVICE_OST:
3025 # Emitted when guest executes ACPI _OST method.
3027 # @info: OSPM Status Indication
3029 # Since: 2.1
3031 # Example:
3033 # <- { "event": "ACPI_DEVICE_OST",
3034 #      "data": { "device": "d1", "slot": "0",
3035 #                "slot-type": "DIMM", "source": 1, "status": 0 } }
3038 { 'event': 'ACPI_DEVICE_OST',
3039      'data': { 'info': 'ACPIOSTInfo' } }
3042 # @rtc-reset-reinjection:
3044 # This command will reset the RTC interrupt reinjection backlog.
3045 # Can be used if another mechanism to synchronize guest time
3046 # is in effect, for example QEMU guest agent's guest-set-time
3047 # command.
3049 # Since: 2.1
3051 # Example:
3053 # -> { "execute": "rtc-reset-reinjection" }
3054 # <- { "return": {} }
3057 { 'command': 'rtc-reset-reinjection' }
3060 # @RTC_CHANGE:
3062 # Emitted when the guest changes the RTC time.
3064 # @offset: offset between base RTC clock (as specified by -rtc base), and
3065 #          new RTC clock value
3067 # Note: This event is rate-limited.
3069 # Since: 0.13.0
3071 # Example:
3073 # <-   { "event": "RTC_CHANGE",
3074 #        "data": { "offset": 78 },
3075 #        "timestamp": { "seconds": 1267020223, "microseconds": 435656 } }
3078 { 'event': 'RTC_CHANGE',
3079   'data': { 'offset': 'int' } }
3082 # @ReplayMode:
3084 # Mode of the replay subsystem.
3086 # @none: normal execution mode. Replay or record are not enabled.
3088 # @record: record mode. All non-deterministic data is written into the
3089 #          replay log.
3091 # @play: replay mode. Non-deterministic data required for system execution
3092 #        is read from the log.
3094 # Since: 2.5
3096 { 'enum': 'ReplayMode',
3097   'data': [ 'none', 'record', 'play' ] }
3100 # @xen-load-devices-state:
3102 # Load the state of all devices from file. The RAM and the block devices
3103 # of the VM are not loaded by this command.
3105 # @filename: the file to load the state of the devices from as binary
3106 # data. See xen-save-devices-state.txt for a description of the binary
3107 # format.
3109 # Since: 2.7
3111 # Example:
3113 # -> { "execute": "xen-load-devices-state",
3114 #      "arguments": { "filename": "/tmp/resume" } }
3115 # <- { "return": {} }
3118 { 'command': 'xen-load-devices-state', 'data': {'filename': 'str'} }
3121 # @GICCapability:
3123 # The struct describes capability for a specific GIC (Generic
3124 # Interrupt Controller) version. These bits are not only decided by
3125 # QEMU/KVM software version, but also decided by the hardware that
3126 # the program is running upon.
3128 # @version:  version of GIC to be described. Currently, only 2 and 3
3129 #            are supported.
3131 # @emulated: whether current QEMU/hardware supports emulated GIC
3132 #            device in user space.
3134 # @kernel:   whether current QEMU/hardware supports hardware
3135 #            accelerated GIC device in kernel.
3137 # Since: 2.6
3139 { 'struct': 'GICCapability',
3140   'data': { 'version': 'int',
3141             'emulated': 'bool',
3142             'kernel': 'bool' } }
3145 # @query-gic-capabilities:
3147 # This command is ARM-only. It will return a list of GICCapability
3148 # objects that describe its capability bits.
3150 # Returns: a list of GICCapability objects.
3152 # Since: 2.6
3154 # Example:
3156 # -> { "execute": "query-gic-capabilities" }
3157 # <- { "return": [{ "version": 2, "emulated": true, "kernel": false },
3158 #                 { "version": 3, "emulated": false, "kernel": true } ] }
3161 { 'command': 'query-gic-capabilities', 'returns': ['GICCapability'] }
3164 # @CpuInstanceProperties:
3166 # List of properties to be used for hotplugging a CPU instance,
3167 # it should be passed by management with device_add command when
3168 # a CPU is being hotplugged.
3170 # @node-id: NUMA node ID the CPU belongs to
3171 # @socket-id: socket number within node/board the CPU belongs to
3172 # @core-id: core number within socket the CPU belongs to
3173 # @thread-id: thread number within core the CPU belongs to
3175 # Note: currently there are 4 properties that could be present
3176 # but management should be prepared to pass through other
3177 # properties with device_add command to allow for future
3178 # interface extension. This also requires the filed names to be kept in
3179 # sync with the properties passed to -device/device_add.
3181 # Since: 2.7
3183 { 'struct': 'CpuInstanceProperties',
3184   'data': { '*node-id': 'int',
3185             '*socket-id': 'int',
3186             '*core-id': 'int',
3187             '*thread-id': 'int'
3188   }
3192 # @HotpluggableCPU:
3194 # @type: CPU object type for usage with device_add command
3195 # @props: list of properties to be used for hotplugging CPU
3196 # @vcpus-count: number of logical VCPU threads @HotpluggableCPU provides
3197 # @qom-path: link to existing CPU object if CPU is present or
3198 #            omitted if CPU is not present.
3200 # Since: 2.7
3202 { 'struct': 'HotpluggableCPU',
3203   'data': { 'type': 'str',
3204             'vcpus-count': 'int',
3205             'props': 'CpuInstanceProperties',
3206             '*qom-path': 'str'
3207           }
3211 # @query-hotpluggable-cpus:
3213 # Returns: a list of HotpluggableCPU objects.
3215 # Since: 2.7
3217 # Example:
3219 # For pseries machine type started with -smp 2,cores=2,maxcpus=4 -cpu POWER8:
3221 # -> { "execute": "query-hotpluggable-cpus" }
3222 # <- {"return": [
3223 #      { "props": { "core": 8 }, "type": "POWER8-spapr-cpu-core",
3224 #        "vcpus-count": 1 },
3225 #      { "props": { "core": 0 }, "type": "POWER8-spapr-cpu-core",
3226 #        "vcpus-count": 1, "qom-path": "/machine/unattached/device[0]"}
3227 #    ]}'
3229 # For pc machine type started with -smp 1,maxcpus=2:
3231 # -> { "execute": "query-hotpluggable-cpus" }
3232 # <- {"return": [
3233 #      {
3234 #         "type": "qemu64-x86_64-cpu", "vcpus-count": 1,
3235 #         "props": {"core-id": 0, "socket-id": 1, "thread-id": 0}
3236 #      },
3237 #      {
3238 #         "qom-path": "/machine/unattached/device[0]",
3239 #         "type": "qemu64-x86_64-cpu", "vcpus-count": 1,
3240 #         "props": {"core-id": 0, "socket-id": 0, "thread-id": 0}
3241 #      }
3242 #    ]}
3244 # For s390x-virtio-ccw machine type started with -smp 1,maxcpus=2 -cpu qemu
3245 # (Since: 2.11):
3247 # -> { "execute": "query-hotpluggable-cpus" }
3248 # <- {"return": [
3249 #      {
3250 #         "type": "qemu-s390x-cpu", "vcpus-count": 1,
3251 #         "props": { "core-id": 1 }
3252 #      },
3253 #      {
3254 #         "qom-path": "/machine/unattached/device[0]",
3255 #         "type": "qemu-s390x-cpu", "vcpus-count": 1,
3256 #         "props": { "core-id": 0 }
3257 #      }
3258 #    ]}
3261 { 'command': 'query-hotpluggable-cpus', 'returns': ['HotpluggableCPU'],
3262              'allow-preconfig': true }
3265 # @GuidInfo:
3267 # GUID information.
3269 # @guid: the globally unique identifier
3271 # Since: 2.9
3273 { 'struct': 'GuidInfo', 'data': {'guid': 'str'} }
3276 # @query-vm-generation-id:
3278 # Show Virtual Machine Generation ID
3280 # Since: 2.9
3282 { 'command': 'query-vm-generation-id', 'returns': 'GuidInfo' }
3286 # @SevState:
3288 # An enumeration of SEV state information used during @query-sev.
3290 # @uninit: The guest is uninitialized.
3292 # @launch-update: The guest is currently being launched; plaintext data and
3293 #                 register state is being imported.
3295 # @launch-secret: The guest is currently being launched; ciphertext data
3296 #                 is being imported.
3298 # @running: The guest is fully launched or migrated in.
3300 # @send-update: The guest is currently being migrated out to another machine.
3302 # @receive-update: The guest is currently being migrated from another machine.
3304 # Since: 2.12
3306 { 'enum': 'SevState',
3307   'data': ['uninit', 'launch-update', 'launch-secret', 'running',
3308            'send-update', 'receive-update' ] }
3311 # @SevInfo:
3313 # Information about Secure Encrypted Virtualization (SEV) support
3315 # @enabled: true if SEV is active
3317 # @api-major: SEV API major version
3319 # @api-minor: SEV API minor version
3321 # @build-id: SEV FW build id
3323 # @policy: SEV policy value
3325 # @state: SEV guest state
3327 # @handle: SEV firmware handle
3329 # Since: 2.12
3331 { 'struct': 'SevInfo',
3332     'data': { 'enabled': 'bool',
3333               'api-major': 'uint8',
3334               'api-minor' : 'uint8',
3335               'build-id' : 'uint8',
3336               'policy' : 'uint32',
3337               'state' : 'SevState',
3338               'handle' : 'uint32'
3339             }
3343 # @query-sev:
3345 # Returns information about SEV
3347 # Returns: @SevInfo
3349 # Since: 2.12
3351 # Example:
3353 # -> { "execute": "query-sev" }
3354 # <- { "return": { "enabled": true, "api-major" : 0, "api-minor" : 0,
3355 #                  "build-id" : 0, "policy" : 0, "state" : "running",
3356 #                  "handle" : 1 } }
3359 { 'command': 'query-sev', 'returns': 'SevInfo' }
3362 # @SevLaunchMeasureInfo:
3364 # SEV Guest Launch measurement information
3366 # @data: the measurement value encoded in base64
3368 # Since: 2.12
3371 { 'struct': 'SevLaunchMeasureInfo', 'data': {'data': 'str'} }
3374 # @query-sev-launch-measure:
3376 # Query the SEV guest launch information.
3378 # Returns: The @SevLaunchMeasureInfo for the guest
3380 # Since: 2.12
3382 # Example:
3384 # -> { "execute": "query-sev-launch-measure" }
3385 # <- { "return": { "data": "4l8LXeNlSPUDlXPJG5966/8%YZ" } }
3388 { 'command': 'query-sev-launch-measure', 'returns': 'SevLaunchMeasureInfo' }
3391 # @SevCapability:
3393 # The struct describes capability for a Secure Encrypted Virtualization
3394 # feature.
3396 # @pdh:  Platform Diffie-Hellman key (base64 encoded)
3398 # @cert-chain:  PDH certificate chain (base64 encoded)
3400 # @cbitpos: C-bit location in page table entry
3402 # @reduced-phys-bits: Number of physical Address bit reduction when SEV is
3403 #                     enabled
3405 # Since: 2.12
3407 { 'struct': 'SevCapability',
3408   'data': { 'pdh': 'str',
3409             'cert-chain': 'str',
3410             'cbitpos': 'int',
3411             'reduced-phys-bits': 'int'} }
3414 # @query-sev-capabilities:
3416 # This command is used to get the SEV capabilities, and is supported on AMD
3417 # X86 platforms only.
3419 # Returns: SevCapability objects.
3421 # Since: 2.12
3423 # Example:
3425 # -> { "execute": "query-sev-capabilities" }
3426 # <- { "return": { "pdh": "8CCDD8DDD", "cert-chain": "888CCCDDDEE",
3427 #                  "cbitpos": 47, "reduced-phys-bits": 5}}
3430 { 'command': 'query-sev-capabilities', 'returns': 'SevCapability' }
3433 # @CommandDropReason:
3435 # Reasons that caused one command to be dropped.
3437 # @queue-full: the command queue is full. This can only occur when
3438 #              the client sends a new non-oob command before the
3439 #              response to the previous non-oob command has been
3440 #              received.
3442 # Since: 2.12
3444 { 'enum': 'CommandDropReason',
3445   'data': [ 'queue-full' ] }
3448 # @COMMAND_DROPPED:
3450 # Emitted when a command is dropped due to some reason.  Commands can
3451 # only be dropped when the oob capability is enabled.
3453 # @id: The dropped command's "id" field.
3455 # @reason: The reason why the command is dropped.
3457 # Since: 2.12
3459 # Example:
3461 # { "event": "COMMAND_DROPPED",
3462 #   "data": {"result": {"id": "libvirt-102",
3463 #                       "reason": "queue-full" } } }
3466 { 'event': 'COMMAND_DROPPED' ,
3467   'data': { 'id': 'any', 'reason': 'CommandDropReason' } }
3470 # @x-oob-test:
3472 # Test OOB functionality.  When sending this command with lock=true,
3473 # it'll try to hang the dispatcher.  When sending it with lock=false,
3474 # it'll try to notify the locked thread to continue.  Note: it should
3475 # only be used by QMP test program rather than anything else.
3477 # Since: 2.12
3479 # Example:
3481 # { "execute": "x-oob-test",
3482 #   "arguments": { "lock": true } }
3484 { 'command': 'x-oob-test', 'data' : { 'lock': 'bool' },
3485   'allow-oob': true }
3488 # @set-numa-node:
3490 # Runtime equivalent of '-numa' CLI option, available at
3491 # preconfigure stage to configure numa mapping before initializing
3492 # machine.
3494 # Since 3.0
3496 { 'command': 'set-numa-node', 'boxed': true,
3497   'data': 'NumaOptions',
3498   'allow-preconfig': true