tcg/i386: Precompute all guest_base parameters
[qemu/ar7.git] / qapi / misc.json
blob8325e0dc9c8e08e10bb20a520b3e600a455d6b57
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 # @subsystem: the PCI subsystem id (since 3.1)
837 # @subsystem-vendor: the PCI subsystem vendor id (since 3.1)
839 # Since: 2.4
841 { 'struct': 'PciDeviceId',
842   'data': {'device': 'int', 'vendor': 'int', '*subsystem': 'int',
843             '*subsystem-vendor': 'int'} }
846 # @PciDeviceInfo:
848 # Information about a PCI device
850 # @bus: the bus number of the device
852 # @slot: the slot the device is located in
854 # @function: the function of the slot used by the device
856 # @class_info: the class of the device
858 # @id: the PCI device id
860 # @irq: if an IRQ is assigned to the device, the IRQ number
862 # @qdev_id: the device name of the PCI device
864 # @pci_bridge: if the device is a PCI bridge, the bridge information
866 # @regions: a list of the PCI I/O regions associated with the device
868 # Notes: the contents of @class_info.desc are not stable and should only be
869 #        treated as informational.
871 # Since: 0.14.0
873 { 'struct': 'PciDeviceInfo',
874   'data': {'bus': 'int', 'slot': 'int', 'function': 'int',
875            'class_info': 'PciDeviceClass', 'id': 'PciDeviceId',
876            '*irq': 'int', 'qdev_id': 'str', '*pci_bridge': 'PciBridgeInfo',
877            'regions': ['PciMemoryRegion']} }
880 # @PciInfo:
882 # Information about a PCI bus
884 # @bus: the bus index
886 # @devices: a list of devices on this bus
888 # Since: 0.14.0
890 { 'struct': 'PciInfo', 'data': {'bus': 'int', 'devices': ['PciDeviceInfo']} }
893 # @query-pci:
895 # Return information about the PCI bus topology of the guest.
897 # Returns: a list of @PciInfo for each PCI bus. Each bus is
898 # represented by a json-object, which has a key with a json-array of
899 # all PCI devices attached to it. Each device is represented by a
900 # json-object.
902 # Since: 0.14.0
904 # Example:
906 # -> { "execute": "query-pci" }
907 # <- { "return": [
908 #          {
909 #             "bus": 0,
910 #             "devices": [
911 #                {
912 #                   "bus": 0,
913 #                   "qdev_id": "",
914 #                   "slot": 0,
915 #                   "class_info": {
916 #                      "class": 1536,
917 #                      "desc": "Host bridge"
918 #                   },
919 #                   "id": {
920 #                      "device": 32902,
921 #                      "vendor": 4663
922 #                   },
923 #                   "function": 0,
924 #                   "regions": [
925 #                   ]
926 #                },
927 #                {
928 #                   "bus": 0,
929 #                   "qdev_id": "",
930 #                   "slot": 1,
931 #                   "class_info": {
932 #                      "class": 1537,
933 #                      "desc": "ISA bridge"
934 #                   },
935 #                   "id": {
936 #                      "device": 32902,
937 #                      "vendor": 28672
938 #                   },
939 #                   "function": 0,
940 #                   "regions": [
941 #                   ]
942 #                },
943 #                {
944 #                   "bus": 0,
945 #                   "qdev_id": "",
946 #                   "slot": 1,
947 #                   "class_info": {
948 #                      "class": 257,
949 #                      "desc": "IDE controller"
950 #                   },
951 #                   "id": {
952 #                      "device": 32902,
953 #                      "vendor": 28688
954 #                   },
955 #                   "function": 1,
956 #                   "regions": [
957 #                      {
958 #                         "bar": 4,
959 #                         "size": 16,
960 #                         "address": 49152,
961 #                         "type": "io"
962 #                      }
963 #                   ]
964 #                },
965 #                {
966 #                   "bus": 0,
967 #                   "qdev_id": "",
968 #                   "slot": 2,
969 #                   "class_info": {
970 #                      "class": 768,
971 #                      "desc": "VGA controller"
972 #                   },
973 #                   "id": {
974 #                      "device": 4115,
975 #                      "vendor": 184
976 #                   },
977 #                   "function": 0,
978 #                   "regions": [
979 #                      {
980 #                         "prefetch": true,
981 #                         "mem_type_64": false,
982 #                         "bar": 0,
983 #                         "size": 33554432,
984 #                         "address": 4026531840,
985 #                         "type": "memory"
986 #                      },
987 #                      {
988 #                         "prefetch": false,
989 #                         "mem_type_64": false,
990 #                         "bar": 1,
991 #                         "size": 4096,
992 #                         "address": 4060086272,
993 #                         "type": "memory"
994 #                      },
995 #                      {
996 #                         "prefetch": false,
997 #                         "mem_type_64": false,
998 #                         "bar": 6,
999 #                         "size": 65536,
1000 #                         "address": -1,
1001 #                         "type": "memory"
1002 #                      }
1003 #                   ]
1004 #                },
1005 #                {
1006 #                   "bus": 0,
1007 #                   "qdev_id": "",
1008 #                   "irq": 11,
1009 #                   "slot": 4,
1010 #                   "class_info": {
1011 #                      "class": 1280,
1012 #                      "desc": "RAM controller"
1013 #                   },
1014 #                   "id": {
1015 #                      "device": 6900,
1016 #                      "vendor": 4098
1017 #                   },
1018 #                   "function": 0,
1019 #                   "regions": [
1020 #                      {
1021 #                         "bar": 0,
1022 #                         "size": 32,
1023 #                         "address": 49280,
1024 #                         "type": "io"
1025 #                      }
1026 #                   ]
1027 #                }
1028 #             ]
1029 #          }
1030 #       ]
1031 #    }
1033 # Note: This example has been shortened as the real response is too long.
1036 { 'command': 'query-pci', 'returns': ['PciInfo'] }
1039 # @quit:
1041 # This command will cause the QEMU process to exit gracefully.  While every
1042 # attempt is made to send the QMP response before terminating, this is not
1043 # guaranteed.  When using this interface, a premature EOF would not be
1044 # unexpected.
1046 # Since: 0.14.0
1048 # Example:
1050 # -> { "execute": "quit" }
1051 # <- { "return": {} }
1053 { 'command': 'quit' }
1056 # @stop:
1058 # Stop all guest VCPU execution.
1060 # Since:  0.14.0
1062 # Notes:  This function will succeed even if the guest is already in the stopped
1063 #         state.  In "inmigrate" state, it will ensure that the guest
1064 #         remains paused once migration finishes, as if the -S option was
1065 #         passed on the command line.
1067 # Example:
1069 # -> { "execute": "stop" }
1070 # <- { "return": {} }
1073 { 'command': 'stop' }
1076 # @system_reset:
1078 # Performs a hard reset of a guest.
1080 # Since: 0.14.0
1082 # Example:
1084 # -> { "execute": "system_reset" }
1085 # <- { "return": {} }
1088 { 'command': 'system_reset' }
1091 # @system_powerdown:
1093 # Requests that a guest perform a powerdown operation.
1095 # Since: 0.14.0
1097 # Notes: A guest may or may not respond to this command.  This command
1098 #        returning does not indicate that a guest has accepted the request or
1099 #        that it has shut down.  Many guests will respond to this command by
1100 #        prompting the user in some way.
1101 # Example:
1103 # -> { "execute": "system_powerdown" }
1104 # <- { "return": {} }
1107 { 'command': 'system_powerdown' }
1110 # @cpu-add:
1112 # Adds CPU with specified ID.
1114 # @id: ID of CPU to be created, valid values [0..max_cpus)
1116 # Returns: Nothing on success
1118 # Since: 1.5
1120 # Note: This command is deprecated.  The `device_add` command should be
1121 #       used instead.  See the `query-hotpluggable-cpus` command for
1122 #       details.
1124 # Example:
1126 # -> { "execute": "cpu-add", "arguments": { "id": 2 } }
1127 # <- { "return": {} }
1130 { 'command': 'cpu-add', 'data': {'id': 'int'} }
1133 # @memsave:
1135 # Save a portion of guest memory to a file.
1137 # @val: the virtual address of the guest to start from
1139 # @size: the size of memory region to save
1141 # @filename: the file to save the memory to as binary data
1143 # @cpu-index: the index of the virtual CPU to use for translating the
1144 #                       virtual address (defaults to CPU 0)
1146 # Returns: Nothing on success
1148 # Since: 0.14.0
1150 # Notes: Errors were not reliably returned until 1.1
1152 # Example:
1154 # -> { "execute": "memsave",
1155 #      "arguments": { "val": 10,
1156 #                     "size": 100,
1157 #                     "filename": "/tmp/virtual-mem-dump" } }
1158 # <- { "return": {} }
1161 { 'command': 'memsave',
1162   'data': {'val': 'int', 'size': 'int', 'filename': 'str', '*cpu-index': 'int'} }
1165 # @pmemsave:
1167 # Save a portion of guest physical memory to a file.
1169 # @val: the physical address of the guest to start from
1171 # @size: the size of memory region to save
1173 # @filename: the file to save the memory to as binary data
1175 # Returns: Nothing on success
1177 # Since: 0.14.0
1179 # Notes: Errors were not reliably returned until 1.1
1181 # Example:
1183 # -> { "execute": "pmemsave",
1184 #      "arguments": { "val": 10,
1185 #                     "size": 100,
1186 #                     "filename": "/tmp/physical-mem-dump" } }
1187 # <- { "return": {} }
1190 { 'command': 'pmemsave',
1191   'data': {'val': 'int', 'size': 'int', 'filename': 'str'} }
1194 # @cont:
1196 # Resume guest VCPU execution.
1198 # Since:  0.14.0
1200 # Returns:  If successful, nothing
1202 # Notes:  This command will succeed if the guest is currently running.  It
1203 #         will also succeed if the guest is in the "inmigrate" state; in
1204 #         this case, the effect of the command is to make sure the guest
1205 #         starts once migration finishes, removing the effect of the -S
1206 #         command line option if it was passed.
1208 # Example:
1210 # -> { "execute": "cont" }
1211 # <- { "return": {} }
1214 { 'command': 'cont' }
1217 # @x-exit-preconfig:
1219 # Exit from "preconfig" state
1221 # This command makes QEMU exit the preconfig state and proceed with
1222 # VM initialization using configuration data provided on the command line
1223 # and via the QMP monitor during the preconfig state. The command is only
1224 # available during the preconfig state (i.e. when the --preconfig command
1225 # line option was in use).
1227 # Since 3.0
1229 # Returns: nothing
1231 # Example:
1233 # -> { "execute": "x-exit-preconfig" }
1234 # <- { "return": {} }
1237 { 'command': 'x-exit-preconfig', 'allow-preconfig': true }
1240 # @system_wakeup:
1242 # Wakeup guest from suspend.  Does nothing in case the guest isn't suspended.
1244 # Since:  1.1
1246 # Returns:  nothing.
1248 # Example:
1250 # -> { "execute": "system_wakeup" }
1251 # <- { "return": {} }
1254 { 'command': 'system_wakeup' }
1257 # @inject-nmi:
1259 # Injects a Non-Maskable Interrupt into the default CPU (x86/s390) or all CPUs (ppc64).
1260 # The command fails when the guest doesn't support injecting.
1262 # Returns:  If successful, nothing
1264 # Since:  0.14.0
1266 # Note: prior to 2.1, this command was only supported for x86 and s390 VMs
1268 # Example:
1270 # -> { "execute": "inject-nmi" }
1271 # <- { "return": {} }
1274 { 'command': 'inject-nmi' }
1277 # @balloon:
1279 # Request the balloon driver to change its balloon size.
1281 # @value: the target size of the balloon in bytes
1283 # Returns: Nothing on success
1284 #          If the balloon driver is enabled but not functional because the KVM
1285 #            kernel module cannot support it, KvmMissingCap
1286 #          If no balloon device is present, DeviceNotActive
1288 # Notes: This command just issues a request to the guest.  When it returns,
1289 #        the balloon size may not have changed.  A guest can change the balloon
1290 #        size independent of this command.
1292 # Since: 0.14.0
1294 # Example:
1296 # -> { "execute": "balloon", "arguments": { "value": 536870912 } }
1297 # <- { "return": {} }
1300 { 'command': 'balloon', 'data': {'value': 'int'} }
1303 # @human-monitor-command:
1305 # Execute a command on the human monitor and return the output.
1307 # @command-line: the command to execute in the human monitor
1309 # @cpu-index: The CPU to use for commands that require an implicit CPU
1311 # Returns: the output of the command as a string
1313 # Since: 0.14.0
1315 # Notes: This command only exists as a stop-gap.  Its use is highly
1316 #        discouraged.  The semantics of this command are not
1317 #        guaranteed: this means that command names, arguments and
1318 #        responses can change or be removed at ANY time.  Applications
1319 #        that rely on long term stability guarantees should NOT
1320 #        use this command.
1322 #        Known limitations:
1324 #        * This command is stateless, this means that commands that depend
1325 #          on state information (such as getfd) might not work
1327 #        * Commands that prompt the user for data don't currently work
1329 # Example:
1331 # -> { "execute": "human-monitor-command",
1332 #      "arguments": { "command-line": "info kvm" } }
1333 # <- { "return": "kvm support: enabled\r\n" }
1336 { 'command': 'human-monitor-command',
1337   'data': {'command-line': 'str', '*cpu-index': 'int'},
1338   'returns': 'str' }
1341 # @ObjectPropertyInfo:
1343 # @name: the name of the property
1345 # @type: the type of the property.  This will typically come in one of four
1346 #        forms:
1348 #        1) A primitive type such as 'u8', 'u16', 'bool', 'str', or 'double'.
1349 #           These types are mapped to the appropriate JSON type.
1351 #        2) A child type in the form 'child<subtype>' where subtype is a qdev
1352 #           device type name.  Child properties create the composition tree.
1354 #        3) A link type in the form 'link<subtype>' where subtype is a qdev
1355 #           device type name.  Link properties form the device model graph.
1357 # @description: if specified, the description of the property.
1359 # Since: 1.2
1361 { 'struct': 'ObjectPropertyInfo',
1362   'data': { 'name': 'str', 'type': 'str', '*description': 'str' } }
1365 # @qom-list:
1367 # This command will list any properties of a object given a path in the object
1368 # model.
1370 # @path: the path within the object model.  See @qom-get for a description of
1371 #        this parameter.
1373 # Returns: a list of @ObjectPropertyInfo that describe the properties of the
1374 #          object.
1376 # Since: 1.2
1378 { 'command': 'qom-list',
1379   'data': { 'path': 'str' },
1380   'returns': [ 'ObjectPropertyInfo' ],
1381   'allow-preconfig': true }
1384 # @qom-get:
1386 # This command will get a property from a object model path and return the
1387 # value.
1389 # @path: The path within the object model.  There are two forms of supported
1390 #        paths--absolute and partial paths.
1392 #        Absolute paths are derived from the root object and can follow child<>
1393 #        or link<> properties.  Since they can follow link<> properties, they
1394 #        can be arbitrarily long.  Absolute paths look like absolute filenames
1395 #        and are prefixed  with a leading slash.
1397 #        Partial paths look like relative filenames.  They do not begin
1398 #        with a prefix.  The matching rules for partial paths are subtle but
1399 #        designed to make specifying objects easy.  At each level of the
1400 #        composition tree, the partial path is matched as an absolute path.
1401 #        The first match is not returned.  At least two matches are searched
1402 #        for.  A successful result is only returned if only one match is
1403 #        found.  If more than one match is found, a flag is return to
1404 #        indicate that the match was ambiguous.
1406 # @property: The property name to read
1408 # Returns: The property value.  The type depends on the property
1409 #          type. child<> and link<> properties are returned as #str
1410 #          pathnames.  All integer property types (u8, u16, etc) are
1411 #          returned as #int.
1413 # Since: 1.2
1415 { 'command': 'qom-get',
1416   'data': { 'path': 'str', 'property': 'str' },
1417   'returns': 'any',
1418   'allow-preconfig': true }
1421 # @qom-set:
1423 # This command will set a property from a object model path.
1425 # @path: see @qom-get for a description of this parameter
1427 # @property: the property name to set
1429 # @value: a value who's type is appropriate for the property type.  See @qom-get
1430 #         for a description of type mapping.
1432 # Since: 1.2
1434 { 'command': 'qom-set',
1435   'data': { 'path': 'str', 'property': 'str', 'value': 'any' },
1436   'allow-preconfig': true }
1439 # @change:
1441 # This command is multiple commands multiplexed together.
1443 # @device: This is normally the name of a block device but it may also be 'vnc'.
1444 #          when it's 'vnc', then sub command depends on @target
1446 # @target: If @device is a block device, then this is the new filename.
1447 #          If @device is 'vnc', then if the value 'password' selects the vnc
1448 #          change password command.   Otherwise, this specifies a new server URI
1449 #          address to listen to for VNC connections.
1451 # @arg:    If @device is a block device, then this is an optional format to open
1452 #          the device with.
1453 #          If @device is 'vnc' and @target is 'password', this is the new VNC
1454 #          password to set.  See change-vnc-password for additional notes.
1456 # Returns: Nothing on success.
1457 #          If @device is not a valid block device, DeviceNotFound
1459 # Notes:  This interface is deprecated, and it is strongly recommended that you
1460 #         avoid using it.  For changing block devices, use
1461 #         blockdev-change-medium; for changing VNC parameters, use
1462 #         change-vnc-password.
1464 # Since: 0.14.0
1466 # Example:
1468 # 1. Change a removable medium
1470 # -> { "execute": "change",
1471 #      "arguments": { "device": "ide1-cd0",
1472 #                     "target": "/srv/images/Fedora-12-x86_64-DVD.iso" } }
1473 # <- { "return": {} }
1475 # 2. Change VNC password
1477 # -> { "execute": "change",
1478 #      "arguments": { "device": "vnc", "target": "password",
1479 #                     "arg": "foobar1" } }
1480 # <- { "return": {} }
1483 { 'command': 'change',
1484   'data': {'device': 'str', 'target': 'str', '*arg': 'str'} }
1487 # @ObjectTypeInfo:
1489 # This structure describes a search result from @qom-list-types
1491 # @name: the type name found in the search
1493 # @abstract: the type is abstract and can't be directly instantiated.
1494 #            Omitted if false. (since 2.10)
1496 # @parent: Name of parent type, if any (since 2.10)
1498 # Since: 1.1
1500 { 'struct': 'ObjectTypeInfo',
1501   'data': { 'name': 'str', '*abstract': 'bool', '*parent': 'str' } }
1504 # @qom-list-types:
1506 # This command will return a list of types given search parameters
1508 # @implements: if specified, only return types that implement this type name
1510 # @abstract: if true, include abstract types in the results
1512 # Returns: a list of @ObjectTypeInfo or an empty list if no results are found
1514 # Since: 1.1
1516 { 'command': 'qom-list-types',
1517   'data': { '*implements': 'str', '*abstract': 'bool' },
1518   'returns': [ 'ObjectTypeInfo' ],
1519   'allow-preconfig': true }
1522 # @device-list-properties:
1524 # List properties associated with a device.
1526 # @typename: the type name of a device
1528 # Returns: a list of ObjectPropertyInfo describing a devices properties
1530 # Note: objects can create properties at runtime, for example to describe
1531 # links between different devices and/or objects. These properties
1532 # are not included in the output of this command.
1534 # Since: 1.2
1536 { 'command': 'device-list-properties',
1537   'data': { 'typename': 'str'},
1538   'returns': [ 'ObjectPropertyInfo' ] }
1541 # @qom-list-properties:
1543 # List properties associated with a QOM object.
1545 # @typename: the type name of an object
1547 # Note: objects can create properties at runtime, for example to describe
1548 # links between different devices and/or objects. These properties
1549 # are not included in the output of this command.
1551 # Returns: a list of ObjectPropertyInfo describing object properties
1553 # Since: 2.12
1555 { 'command': 'qom-list-properties',
1556   'data': { 'typename': 'str'},
1557   'returns': [ 'ObjectPropertyInfo' ],
1558   'allow-preconfig': true }
1561 # @xen-set-global-dirty-log:
1563 # Enable or disable the global dirty log mode.
1565 # @enable: true to enable, false to disable.
1567 # Returns: nothing
1569 # Since: 1.3
1571 # Example:
1573 # -> { "execute": "xen-set-global-dirty-log",
1574 #      "arguments": { "enable": true } }
1575 # <- { "return": {} }
1578 { 'command': 'xen-set-global-dirty-log', 'data': { 'enable': 'bool' } }
1581 # @device_add:
1583 # @driver: the name of the new device's driver
1585 # @bus: the device's parent bus (device tree path)
1587 # @id: the device's ID, must be unique
1589 # Additional arguments depend on the type.
1591 # Add a device.
1593 # Notes:
1594 # 1. For detailed information about this command, please refer to the
1595 #    'docs/qdev-device-use.txt' file.
1597 # 2. It's possible to list device properties by running QEMU with the
1598 #    "-device DEVICE,help" command-line argument, where DEVICE is the
1599 #    device's name
1601 # Example:
1603 # -> { "execute": "device_add",
1604 #      "arguments": { "driver": "e1000", "id": "net1",
1605 #                     "bus": "pci.0",
1606 #                     "mac": "52:54:00:12:34:56" } }
1607 # <- { "return": {} }
1609 # TODO: This command effectively bypasses QAPI completely due to its
1610 # "additional arguments" business.  It shouldn't have been added to
1611 # the schema in this form.  It should be qapified properly, or
1612 # replaced by a properly qapified command.
1614 # Since: 0.13
1616 { 'command': 'device_add',
1617   'data': {'driver': 'str', '*bus': 'str', '*id': 'str'},
1618   'gen': false } # so we can get the additional arguments
1621 # @device_del:
1623 # Remove a device from a guest
1625 # @id: the device's ID or QOM path
1627 # Returns: Nothing on success
1628 #          If @id is not a valid device, DeviceNotFound
1630 # Notes: When this command completes, the device may not be removed from the
1631 #        guest.  Hot removal is an operation that requires guest cooperation.
1632 #        This command merely requests that the guest begin the hot removal
1633 #        process.  Completion of the device removal process is signaled with a
1634 #        DEVICE_DELETED event. Guest reset will automatically complete removal
1635 #        for all devices.
1637 # Since: 0.14.0
1639 # Example:
1641 # -> { "execute": "device_del",
1642 #      "arguments": { "id": "net1" } }
1643 # <- { "return": {} }
1645 # -> { "execute": "device_del",
1646 #      "arguments": { "id": "/machine/peripheral-anon/device[0]" } }
1647 # <- { "return": {} }
1650 { 'command': 'device_del', 'data': {'id': 'str'} }
1653 # @DEVICE_DELETED:
1655 # Emitted whenever the device removal completion is acknowledged by the guest.
1656 # At this point, it's safe to reuse the specified device ID. Device removal can
1657 # be initiated by the guest or by HMP/QMP commands.
1659 # @device: device name
1661 # @path: device path
1663 # Since: 1.5
1665 # Example:
1667 # <- { "event": "DEVICE_DELETED",
1668 #      "data": { "device": "virtio-net-pci-0",
1669 #                "path": "/machine/peripheral/virtio-net-pci-0" },
1670 #      "timestamp": { "seconds": 1265044230, "microseconds": 450486 } }
1673 { 'event': 'DEVICE_DELETED',
1674   'data': { '*device': 'str', 'path': 'str' } }
1677 # @DumpGuestMemoryFormat:
1679 # An enumeration of guest-memory-dump's format.
1681 # @elf: elf format
1683 # @kdump-zlib: kdump-compressed format with zlib-compressed
1685 # @kdump-lzo: kdump-compressed format with lzo-compressed
1687 # @kdump-snappy: kdump-compressed format with snappy-compressed
1689 # @win-dmp: Windows full crashdump format,
1690 #           can be used instead of ELF converting (since 2.13)
1692 # Since: 2.0
1694 { 'enum': 'DumpGuestMemoryFormat',
1695   'data': [ 'elf', 'kdump-zlib', 'kdump-lzo', 'kdump-snappy', 'win-dmp' ] }
1698 # @dump-guest-memory:
1700 # Dump guest's memory to vmcore. It is a synchronous operation that can take
1701 # very long depending on the amount of guest memory.
1703 # @paging: if true, do paging to get guest's memory mapping. This allows
1704 #          using gdb to process the core file.
1706 #          IMPORTANT: this option can make QEMU allocate several gigabytes
1707 #                     of RAM. This can happen for a large guest, or a
1708 #                     malicious guest pretending to be large.
1710 #          Also, paging=true has the following limitations:
1712 #             1. The guest may be in a catastrophic state or can have corrupted
1713 #                memory, which cannot be trusted
1714 #             2. The guest can be in real-mode even if paging is enabled. For
1715 #                example, the guest uses ACPI to sleep, and ACPI sleep state
1716 #                goes in real-mode
1717 #             3. Currently only supported on i386 and x86_64.
1719 # @protocol: the filename or file descriptor of the vmcore. The supported
1720 #            protocols are:
1722 #            1. file: the protocol starts with "file:", and the following
1723 #               string is the file's path.
1724 #            2. fd: the protocol starts with "fd:", and the following string
1725 #               is the fd's name.
1727 # @detach: if true, QMP will return immediately rather than
1728 #          waiting for the dump to finish. The user can track progress
1729 #          using "query-dump". (since 2.6).
1731 # @begin: if specified, the starting physical address.
1733 # @length: if specified, the memory size, in bytes. If you don't
1734 #          want to dump all guest's memory, please specify the start @begin
1735 #          and @length
1737 # @format: if specified, the format of guest memory dump. But non-elf
1738 #          format is conflict with paging and filter, ie. @paging, @begin and
1739 #          @length is not allowed to be specified with non-elf @format at the
1740 #          same time (since 2.0)
1742 # Note: All boolean arguments default to false
1744 # Returns: nothing on success
1746 # Since: 1.2
1748 # Example:
1750 # -> { "execute": "dump-guest-memory",
1751 #      "arguments": { "protocol": "fd:dump" } }
1752 # <- { "return": {} }
1755 { 'command': 'dump-guest-memory',
1756   'data': { 'paging': 'bool', 'protocol': 'str', '*detach': 'bool',
1757             '*begin': 'int', '*length': 'int',
1758             '*format': 'DumpGuestMemoryFormat'} }
1761 # @DumpStatus:
1763 # Describe the status of a long-running background guest memory dump.
1765 # @none: no dump-guest-memory has started yet.
1767 # @active: there is one dump running in background.
1769 # @completed: the last dump has finished successfully.
1771 # @failed: the last dump has failed.
1773 # Since: 2.6
1775 { 'enum': 'DumpStatus',
1776   'data': [ 'none', 'active', 'completed', 'failed' ] }
1779 # @DumpQueryResult:
1781 # The result format for 'query-dump'.
1783 # @status: enum of @DumpStatus, which shows current dump status
1785 # @completed: bytes written in latest dump (uncompressed)
1787 # @total: total bytes to be written in latest dump (uncompressed)
1789 # Since: 2.6
1791 { 'struct': 'DumpQueryResult',
1792   'data': { 'status': 'DumpStatus',
1793             'completed': 'int',
1794             'total': 'int' } }
1797 # @query-dump:
1799 # Query latest dump status.
1801 # Returns: A @DumpStatus object showing the dump status.
1803 # Since: 2.6
1805 # Example:
1807 # -> { "execute": "query-dump" }
1808 # <- { "return": { "status": "active", "completed": 1024000,
1809 #                  "total": 2048000 } }
1812 { 'command': 'query-dump', 'returns': 'DumpQueryResult' }
1815 # @DUMP_COMPLETED:
1817 # Emitted when background dump has completed
1819 # @result: final dump status
1821 # @error: human-readable error string that provides
1822 #         hint on why dump failed. Only presents on failure. The
1823 #         user should not try to interpret the error string.
1825 # Since: 2.6
1827 # Example:
1829 # { "event": "DUMP_COMPLETED",
1830 #   "data": {"result": {"total": 1090650112, "status": "completed",
1831 #                       "completed": 1090650112} } }
1834 { 'event': 'DUMP_COMPLETED' ,
1835   'data': { 'result': 'DumpQueryResult', '*error': 'str' } }
1838 # @DumpGuestMemoryCapability:
1840 # A list of the available formats for dump-guest-memory
1842 # Since: 2.0
1844 { 'struct': 'DumpGuestMemoryCapability',
1845   'data': {
1846       'formats': ['DumpGuestMemoryFormat'] } }
1849 # @query-dump-guest-memory-capability:
1851 # Returns the available formats for dump-guest-memory
1853 # Returns:  A @DumpGuestMemoryCapability object listing available formats for
1854 #           dump-guest-memory
1856 # Since: 2.0
1858 # Example:
1860 # -> { "execute": "query-dump-guest-memory-capability" }
1861 # <- { "return": { "formats":
1862 #                  ["elf", "kdump-zlib", "kdump-lzo", "kdump-snappy"] }
1865 { 'command': 'query-dump-guest-memory-capability',
1866   'returns': 'DumpGuestMemoryCapability' }
1869 # @dump-skeys:
1871 # Dump guest's storage keys
1873 # @filename: the path to the file to dump to
1875 # This command is only supported on s390 architecture.
1877 # Since: 2.5
1879 # Example:
1881 # -> { "execute": "dump-skeys",
1882 #      "arguments": { "filename": "/tmp/skeys" } }
1883 # <- { "return": {} }
1886 { 'command': 'dump-skeys',
1887   'data': { 'filename': 'str' } }
1890 # @object-add:
1892 # Create a QOM object.
1894 # @qom-type: the class name for the object to be created
1896 # @id: the name of the new object
1898 # @props: a dictionary of properties to be passed to the backend
1900 # Returns: Nothing on success
1901 #          Error if @qom-type is not a valid class name
1903 # Since: 2.0
1905 # Example:
1907 # -> { "execute": "object-add",
1908 #      "arguments": { "qom-type": "rng-random", "id": "rng1",
1909 #                     "props": { "filename": "/dev/hwrng" } } }
1910 # <- { "return": {} }
1913 { 'command': 'object-add',
1914   'data': {'qom-type': 'str', 'id': 'str', '*props': 'any'} }
1917 # @object-del:
1919 # Remove a QOM object.
1921 # @id: the name of the QOM object to remove
1923 # Returns: Nothing on success
1924 #          Error if @id is not a valid id for a QOM object
1926 # Since: 2.0
1928 # Example:
1930 # -> { "execute": "object-del", "arguments": { "id": "rng1" } }
1931 # <- { "return": {} }
1934 { 'command': 'object-del', 'data': {'id': 'str'} }
1937 # @getfd:
1939 # Receive a file descriptor via SCM rights and assign it a name
1941 # @fdname: file descriptor name
1943 # Returns: Nothing on success
1945 # Since: 0.14.0
1947 # Notes: If @fdname already exists, the file descriptor assigned to
1948 #        it will be closed and replaced by the received file
1949 #        descriptor.
1951 #        The 'closefd' command can be used to explicitly close the
1952 #        file descriptor when it is no longer needed.
1954 # Example:
1956 # -> { "execute": "getfd", "arguments": { "fdname": "fd1" } }
1957 # <- { "return": {} }
1960 { 'command': 'getfd', 'data': {'fdname': 'str'} }
1963 # @closefd:
1965 # Close a file descriptor previously passed via SCM rights
1967 # @fdname: file descriptor name
1969 # Returns: Nothing on success
1971 # Since: 0.14.0
1973 # Example:
1975 # -> { "execute": "closefd", "arguments": { "fdname": "fd1" } }
1976 # <- { "return": {} }
1979 { 'command': 'closefd', 'data': {'fdname': 'str'} }
1982 # @MachineInfo:
1984 # Information describing a machine.
1986 # @name: the name of the machine
1988 # @alias: an alias for the machine name
1990 # @is-default: whether the machine is default
1992 # @cpu-max: maximum number of CPUs supported by the machine type
1993 #           (since 1.5.0)
1995 # @hotpluggable-cpus: cpu hotplug via -device is supported (since 2.7.0)
1997 # Since: 1.2.0
1999 { 'struct': 'MachineInfo',
2000   'data': { 'name': 'str', '*alias': 'str',
2001             '*is-default': 'bool', 'cpu-max': 'int',
2002             'hotpluggable-cpus': 'bool'} }
2005 # @query-machines:
2007 # Return a list of supported machines
2009 # Returns: a list of MachineInfo
2011 # Since: 1.2.0
2013 { 'command': 'query-machines', 'returns': ['MachineInfo'] }
2016 # @CpuDefinitionInfo:
2018 # Virtual CPU definition.
2020 # @name: the name of the CPU definition
2022 # @migration-safe: whether a CPU definition can be safely used for
2023 #                  migration in combination with a QEMU compatibility machine
2024 #                  when migrating between different QEMU versions and between
2025 #                  hosts with different sets of (hardware or software)
2026 #                  capabilities. If not provided, information is not available
2027 #                  and callers should not assume the CPU definition to be
2028 #                  migration-safe. (since 2.8)
2030 # @static: whether a CPU definition is static and will not change depending on
2031 #          QEMU version, machine type, machine options and accelerator options.
2032 #          A static model is always migration-safe. (since 2.8)
2034 # @unavailable-features: List of properties that prevent
2035 #                        the CPU model from running in the current
2036 #                        host. (since 2.8)
2037 # @typename: Type name that can be used as argument to @device-list-properties,
2038 #            to introspect properties configurable using -cpu or -global.
2039 #            (since 2.9)
2041 # @unavailable-features is a list of QOM property names that
2042 # represent CPU model attributes that prevent the CPU from running.
2043 # If the QOM property is read-only, that means there's no known
2044 # way to make the CPU model run in the current host. Implementations
2045 # that choose not to provide specific information return the
2046 # property name "type".
2047 # If the property is read-write, it means that it MAY be possible
2048 # to run the CPU model in the current host if that property is
2049 # changed. Management software can use it as hints to suggest or
2050 # choose an alternative for the user, or just to generate meaningful
2051 # error messages explaining why the CPU model can't be used.
2052 # If @unavailable-features is an empty list, the CPU model is
2053 # runnable using the current host and machine-type.
2054 # If @unavailable-features is not present, runnability
2055 # information for the CPU is not available.
2057 # Since: 1.2.0
2059 { 'struct': 'CpuDefinitionInfo',
2060   'data': { 'name': 'str', '*migration-safe': 'bool', 'static': 'bool',
2061             '*unavailable-features': [ 'str' ], 'typename': 'str' } }
2064 # @MemoryInfo:
2066 # Actual memory information in bytes.
2068 # @base-memory: size of "base" memory specified with command line
2069 #               option -m.
2071 # @plugged-memory: size of memory that can be hot-unplugged. This field
2072 #                  is omitted if target doesn't support memory hotplug
2073 #                  (i.e. CONFIG_MEM_DEVICE not defined at build time).
2075 # Since: 2.11.0
2077 { 'struct': 'MemoryInfo',
2078   'data'  : { 'base-memory': 'size', '*plugged-memory': 'size' } }
2081 # @query-memory-size-summary:
2083 # Return the amount of initially allocated and present hotpluggable (if
2084 # enabled) memory in bytes.
2086 # Example:
2088 # -> { "execute": "query-memory-size-summary" }
2089 # <- { "return": { "base-memory": 4294967296, "plugged-memory": 0 } }
2091 # Since: 2.11.0
2093 { 'command': 'query-memory-size-summary', 'returns': 'MemoryInfo' }
2096 # @query-cpu-definitions:
2098 # Return a list of supported virtual CPU definitions
2100 # Returns: a list of CpuDefInfo
2102 # Since: 1.2.0
2104 { 'command': 'query-cpu-definitions', 'returns': ['CpuDefinitionInfo'] }
2107 # @CpuModelInfo:
2109 # Virtual CPU model.
2111 # A CPU model consists of the name of a CPU definition, to which
2112 # delta changes are applied (e.g. features added/removed). Most magic values
2113 # that an architecture might require should be hidden behind the name.
2114 # However, if required, architectures can expose relevant properties.
2116 # @name: the name of the CPU definition the model is based on
2117 # @props: a dictionary of QOM properties to be applied
2119 # Since: 2.8.0
2121 { 'struct': 'CpuModelInfo',
2122   'data': { 'name': 'str',
2123             '*props': 'any' } }
2126 # @CpuModelExpansionType:
2128 # An enumeration of CPU model expansion types.
2130 # @static: Expand to a static CPU model, a combination of a static base
2131 #          model name and property delta changes. As the static base model will
2132 #          never change, the expanded CPU model will be the same, independent of
2133 #          QEMU version, machine type, machine options, and accelerator options.
2134 #          Therefore, the resulting model can be used by tooling without having
2135 #          to specify a compatibility machine - e.g. when displaying the "host"
2136 #          model. The @static CPU models are migration-safe.
2138 # @full: Expand all properties. The produced model is not guaranteed to be
2139 #        migration-safe, but allows tooling to get an insight and work with
2140 #        model details.
2142 # Note: When a non-migration-safe CPU model is expanded in static mode, some
2143 # features enabled by the CPU model may be omitted, because they can't be
2144 # implemented by a static CPU model definition (e.g. cache info passthrough and
2145 # PMU passthrough in x86). If you need an accurate representation of the
2146 # features enabled by a non-migration-safe CPU model, use @full. If you need a
2147 # static representation that will keep ABI compatibility even when changing QEMU
2148 # version or machine-type, use @static (but keep in mind that some features may
2149 # be omitted).
2151 # Since: 2.8.0
2153 { 'enum': 'CpuModelExpansionType',
2154   'data': [ 'static', 'full' ] }
2158 # @CpuModelExpansionInfo:
2160 # The result of a cpu model expansion.
2162 # @model: the expanded CpuModelInfo.
2164 # Since: 2.8.0
2166 { 'struct': 'CpuModelExpansionInfo',
2167   'data': { 'model': 'CpuModelInfo' } }
2171 # @query-cpu-model-expansion:
2173 # Expands a given CPU model (or a combination of CPU model + additional options)
2174 # to different granularities, allowing tooling to get an understanding what a
2175 # specific CPU model looks like in QEMU under a certain configuration.
2177 # This interface can be used to query the "host" CPU model.
2179 # The data returned by this command may be affected by:
2181 # * QEMU version: CPU models may look different depending on the QEMU version.
2182 #   (Except for CPU models reported as "static" in query-cpu-definitions.)
2183 # * machine-type: CPU model  may look different depending on the machine-type.
2184 #   (Except for CPU models reported as "static" in query-cpu-definitions.)
2185 # * machine options (including accelerator): in some architectures, CPU models
2186 #   may look different depending on machine and accelerator options. (Except for
2187 #   CPU models reported as "static" in query-cpu-definitions.)
2188 # * "-cpu" arguments and global properties: arguments to the -cpu option and
2189 #   global properties may affect expansion of CPU models. Using
2190 #   query-cpu-model-expansion while using these is not advised.
2192 # Some architectures may not support all expansion types. s390x supports
2193 # "full" and "static".
2195 # Returns: a CpuModelExpansionInfo. Returns an error if expanding CPU models is
2196 #          not supported, if the model cannot be expanded, if the model contains
2197 #          an unknown CPU definition name, unknown properties or properties
2198 #          with a wrong type. Also returns an error if an expansion type is
2199 #          not supported.
2201 # Since: 2.8.0
2203 { 'command': 'query-cpu-model-expansion',
2204   'data': { 'type': 'CpuModelExpansionType',
2205             'model': 'CpuModelInfo' },
2206   'returns': 'CpuModelExpansionInfo' }
2209 # @CpuModelCompareResult:
2211 # An enumeration of CPU model comparison results. The result is usually
2212 # calculated using e.g. CPU features or CPU generations.
2214 # @incompatible: If model A is incompatible to model B, model A is not
2215 #                guaranteed to run where model B runs and the other way around.
2217 # @identical: If model A is identical to model B, model A is guaranteed to run
2218 #             where model B runs and the other way around.
2220 # @superset: If model A is a superset of model B, model B is guaranteed to run
2221 #            where model A runs. There are no guarantees about the other way.
2223 # @subset: If model A is a subset of model B, model A is guaranteed to run
2224 #          where model B runs. There are no guarantees about the other way.
2226 # Since: 2.8.0
2228 { 'enum': 'CpuModelCompareResult',
2229   'data': [ 'incompatible', 'identical', 'superset', 'subset' ] }
2232 # @CpuModelCompareInfo:
2234 # The result of a CPU model comparison.
2236 # @result: The result of the compare operation.
2237 # @responsible-properties: List of properties that led to the comparison result
2238 #                          not being identical.
2240 # @responsible-properties is a list of QOM property names that led to
2241 # both CPUs not being detected as identical. For identical models, this
2242 # list is empty.
2243 # If a QOM property is read-only, that means there's no known way to make the
2244 # CPU models identical. If the special property name "type" is included, the
2245 # models are by definition not identical and cannot be made identical.
2247 # Since: 2.8.0
2249 { 'struct': 'CpuModelCompareInfo',
2250   'data': {'result': 'CpuModelCompareResult',
2251            'responsible-properties': ['str']
2252           }
2256 # @query-cpu-model-comparison:
2258 # Compares two CPU models, returning how they compare in a specific
2259 # configuration. The results indicates how both models compare regarding
2260 # runnability. This result can be used by tooling to make decisions if a
2261 # certain CPU model will run in a certain configuration or if a compatible
2262 # CPU model has to be created by baselining.
2264 # Usually, a CPU model is compared against the maximum possible CPU model
2265 # of a certain configuration (e.g. the "host" model for KVM). If that CPU
2266 # model is identical or a subset, it will run in that configuration.
2268 # The result returned by this command may be affected by:
2270 # * QEMU version: CPU models may look different depending on the QEMU version.
2271 #   (Except for CPU models reported as "static" in query-cpu-definitions.)
2272 # * machine-type: CPU model may look different depending on the machine-type.
2273 #   (Except for CPU models reported as "static" in query-cpu-definitions.)
2274 # * machine options (including accelerator): in some architectures, CPU models
2275 #   may look different depending on machine and accelerator options. (Except for
2276 #   CPU models reported as "static" in query-cpu-definitions.)
2277 # * "-cpu" arguments and global properties: arguments to the -cpu option and
2278 #   global properties may affect expansion of CPU models. Using
2279 #   query-cpu-model-expansion while using these is not advised.
2281 # Some architectures may not support comparing CPU models. s390x supports
2282 # comparing CPU models.
2284 # Returns: a CpuModelBaselineInfo. Returns an error if comparing CPU models is
2285 #          not supported, if a model cannot be used, if a model contains
2286 #          an unknown cpu definition name, unknown properties or properties
2287 #          with wrong types.
2289 # Since: 2.8.0
2291 { 'command': 'query-cpu-model-comparison',
2292   'data': { 'modela': 'CpuModelInfo', 'modelb': 'CpuModelInfo' },
2293   'returns': 'CpuModelCompareInfo' }
2296 # @CpuModelBaselineInfo:
2298 # The result of a CPU model baseline.
2300 # @model: the baselined CpuModelInfo.
2302 # Since: 2.8.0
2304 { 'struct': 'CpuModelBaselineInfo',
2305   'data': { 'model': 'CpuModelInfo' } }
2308 # @query-cpu-model-baseline:
2310 # Baseline two CPU models, creating a compatible third model. The created
2311 # model will always be a static, migration-safe CPU model (see "static"
2312 # CPU model expansion for details).
2314 # This interface can be used by tooling to create a compatible CPU model out
2315 # two CPU models. The created CPU model will be identical to or a subset of
2316 # both CPU models when comparing them. Therefore, the created CPU model is
2317 # guaranteed to run where the given CPU models run.
2319 # The result returned by this command may be affected by:
2321 # * QEMU version: CPU models may look different depending on the QEMU version.
2322 #   (Except for CPU models reported as "static" in query-cpu-definitions.)
2323 # * machine-type: CPU model may look different depending on the machine-type.
2324 #   (Except for CPU models reported as "static" in query-cpu-definitions.)
2325 # * machine options (including accelerator): in some architectures, CPU models
2326 #   may look different depending on machine and accelerator options. (Except for
2327 #   CPU models reported as "static" in query-cpu-definitions.)
2328 # * "-cpu" arguments and global properties: arguments to the -cpu option and
2329 #   global properties may affect expansion of CPU models. Using
2330 #   query-cpu-model-expansion while using these is not advised.
2332 # Some architectures may not support baselining CPU models. s390x supports
2333 # baselining CPU models.
2335 # Returns: a CpuModelBaselineInfo. Returns an error if baselining CPU models is
2336 #          not supported, if a model cannot be used, if a model contains
2337 #          an unknown cpu definition name, unknown properties or properties
2338 #          with wrong types.
2340 # Since: 2.8.0
2342 { 'command': 'query-cpu-model-baseline',
2343   'data': { 'modela': 'CpuModelInfo',
2344             'modelb': 'CpuModelInfo' },
2345   'returns': 'CpuModelBaselineInfo' }
2348 # @AddfdInfo:
2350 # Information about a file descriptor that was added to an fd set.
2352 # @fdset-id: The ID of the fd set that @fd was added to.
2354 # @fd: The file descriptor that was received via SCM rights and
2355 #      added to the fd set.
2357 # Since: 1.2.0
2359 { 'struct': 'AddfdInfo', 'data': {'fdset-id': 'int', 'fd': 'int'} }
2362 # @add-fd:
2364 # Add a file descriptor, that was passed via SCM rights, to an fd set.
2366 # @fdset-id: The ID of the fd set to add the file descriptor to.
2368 # @opaque: A free-form string that can be used to describe the fd.
2370 # Returns: @AddfdInfo on success
2372 #          If file descriptor was not received, FdNotSupplied
2374 #          If @fdset-id is a negative value, InvalidParameterValue
2376 # Notes: The list of fd sets is shared by all monitor connections.
2378 #        If @fdset-id is not specified, a new fd set will be created.
2380 # Since: 1.2.0
2382 # Example:
2384 # -> { "execute": "add-fd", "arguments": { "fdset-id": 1 } }
2385 # <- { "return": { "fdset-id": 1, "fd": 3 } }
2388 { 'command': 'add-fd',
2389   'data': { '*fdset-id': 'int',
2390             '*opaque': 'str' },
2391   'returns': 'AddfdInfo' }
2394 # @remove-fd:
2396 # Remove a file descriptor from an fd set.
2398 # @fdset-id: The ID of the fd set that the file descriptor belongs to.
2400 # @fd: The file descriptor that is to be removed.
2402 # Returns: Nothing on success
2403 #          If @fdset-id or @fd is not found, FdNotFound
2405 # Since: 1.2.0
2407 # Notes: The list of fd sets is shared by all monitor connections.
2409 #        If @fd is not specified, all file descriptors in @fdset-id
2410 #        will be removed.
2412 # Example:
2414 # -> { "execute": "remove-fd", "arguments": { "fdset-id": 1, "fd": 3 } }
2415 # <- { "return": {} }
2418 { 'command': 'remove-fd', 'data': {'fdset-id': 'int', '*fd': 'int'} }
2421 # @FdsetFdInfo:
2423 # Information about a file descriptor that belongs to an fd set.
2425 # @fd: The file descriptor value.
2427 # @opaque: A free-form string that can be used to describe the fd.
2429 # Since: 1.2.0
2431 { 'struct': 'FdsetFdInfo',
2432   'data': {'fd': 'int', '*opaque': 'str'} }
2435 # @FdsetInfo:
2437 # Information about an fd set.
2439 # @fdset-id: The ID of the fd set.
2441 # @fds: A list of file descriptors that belong to this fd set.
2443 # Since: 1.2.0
2445 { 'struct': 'FdsetInfo',
2446   'data': {'fdset-id': 'int', 'fds': ['FdsetFdInfo']} }
2449 # @query-fdsets:
2451 # Return information describing all fd sets.
2453 # Returns: A list of @FdsetInfo
2455 # Since: 1.2.0
2457 # Note: The list of fd sets is shared by all monitor connections.
2459 # Example:
2461 # -> { "execute": "query-fdsets" }
2462 # <- { "return": [
2463 #        {
2464 #          "fds": [
2465 #            {
2466 #              "fd": 30,
2467 #              "opaque": "rdonly:/path/to/file"
2468 #            },
2469 #            {
2470 #              "fd": 24,
2471 #              "opaque": "rdwr:/path/to/file"
2472 #            }
2473 #          ],
2474 #          "fdset-id": 1
2475 #        },
2476 #        {
2477 #          "fds": [
2478 #            {
2479 #              "fd": 28
2480 #            },
2481 #            {
2482 #              "fd": 29
2483 #            }
2484 #          ],
2485 #          "fdset-id": 0
2486 #        }
2487 #      ]
2488 #    }
2491 { 'command': 'query-fdsets', 'returns': ['FdsetInfo'] }
2494 # @TargetInfo:
2496 # Information describing the QEMU target.
2498 # @arch: the target architecture
2500 # Since: 1.2.0
2502 { 'struct': 'TargetInfo',
2503   'data': { 'arch': 'SysEmuTarget' } }
2506 # @query-target:
2508 # Return information about the target for this QEMU
2510 # Returns: TargetInfo
2512 # Since: 1.2.0
2514 { 'command': 'query-target', 'returns': 'TargetInfo' }
2517 # @AcpiTableOptions:
2519 # Specify an ACPI table on the command line to load.
2521 # At most one of @file and @data can be specified. The list of files specified
2522 # by any one of them is loaded and concatenated in order. If both are omitted,
2523 # @data is implied.
2525 # Other fields / optargs can be used to override fields of the generic ACPI
2526 # table header; refer to the ACPI specification 5.0, section 5.2.6 System
2527 # Description Table Header. If a header field is not overridden, then the
2528 # corresponding value from the concatenated blob is used (in case of @file), or
2529 # it is filled in with a hard-coded value (in case of @data).
2531 # String fields are copied into the matching ACPI member from lowest address
2532 # upwards, and silently truncated / NUL-padded to length.
2534 # @sig: table signature / identifier (4 bytes)
2536 # @rev: table revision number (dependent on signature, 1 byte)
2538 # @oem_id: OEM identifier (6 bytes)
2540 # @oem_table_id: OEM table identifier (8 bytes)
2542 # @oem_rev: OEM-supplied revision number (4 bytes)
2544 # @asl_compiler_id: identifier of the utility that created the table
2545 #                   (4 bytes)
2547 # @asl_compiler_rev: revision number of the utility that created the
2548 #                    table (4 bytes)
2550 # @file: colon (:) separated list of pathnames to load and
2551 #        concatenate as table data. The resultant binary blob is expected to
2552 #        have an ACPI table header. At least one file is required. This field
2553 #        excludes @data.
2555 # @data: colon (:) separated list of pathnames to load and
2556 #        concatenate as table data. The resultant binary blob must not have an
2557 #        ACPI table header. At least one file is required. This field excludes
2558 #        @file.
2560 # Since: 1.5
2562 { 'struct': 'AcpiTableOptions',
2563   'data': {
2564     '*sig':               'str',
2565     '*rev':               'uint8',
2566     '*oem_id':            'str',
2567     '*oem_table_id':      'str',
2568     '*oem_rev':           'uint32',
2569     '*asl_compiler_id':   'str',
2570     '*asl_compiler_rev':  'uint32',
2571     '*file':              'str',
2572     '*data':              'str' }}
2575 # @CommandLineParameterType:
2577 # Possible types for an option parameter.
2579 # @string: accepts a character string
2581 # @boolean: accepts "on" or "off"
2583 # @number: accepts a number
2585 # @size: accepts a number followed by an optional suffix (K)ilo,
2586 #        (M)ega, (G)iga, (T)era
2588 # Since: 1.5
2590 { 'enum': 'CommandLineParameterType',
2591   'data': ['string', 'boolean', 'number', 'size'] }
2594 # @CommandLineParameterInfo:
2596 # Details about a single parameter of a command line option.
2598 # @name: parameter name
2600 # @type: parameter @CommandLineParameterType
2602 # @help: human readable text string, not suitable for parsing.
2604 # @default: default value string (since 2.1)
2606 # Since: 1.5
2608 { 'struct': 'CommandLineParameterInfo',
2609   'data': { 'name': 'str',
2610             'type': 'CommandLineParameterType',
2611             '*help': 'str',
2612             '*default': 'str' } }
2615 # @CommandLineOptionInfo:
2617 # Details about a command line option, including its list of parameter details
2619 # @option: option name
2621 # @parameters: an array of @CommandLineParameterInfo
2623 # Since: 1.5
2625 { 'struct': 'CommandLineOptionInfo',
2626   'data': { 'option': 'str', 'parameters': ['CommandLineParameterInfo'] } }
2629 # @query-command-line-options:
2631 # Query command line option schema.
2633 # @option: option name
2635 # Returns: list of @CommandLineOptionInfo for all options (or for the given
2636 #          @option).  Returns an error if the given @option doesn't exist.
2638 # Since: 1.5
2640 # Example:
2642 # -> { "execute": "query-command-line-options",
2643 #      "arguments": { "option": "option-rom" } }
2644 # <- { "return": [
2645 #         {
2646 #             "parameters": [
2647 #                 {
2648 #                     "name": "romfile",
2649 #                     "type": "string"
2650 #                 },
2651 #                 {
2652 #                     "name": "bootindex",
2653 #                     "type": "number"
2654 #                 }
2655 #             ],
2656 #             "option": "option-rom"
2657 #         }
2658 #      ]
2659 #    }
2662 {'command': 'query-command-line-options',
2663  'data': { '*option': 'str' },
2664  'returns': ['CommandLineOptionInfo'],
2665  'allow-preconfig': true }
2668 # @X86CPURegister32:
2670 # A X86 32-bit register
2672 # Since: 1.5
2674 { 'enum': 'X86CPURegister32',
2675   'data': [ 'EAX', 'EBX', 'ECX', 'EDX', 'ESP', 'EBP', 'ESI', 'EDI' ] }
2678 # @X86CPUFeatureWordInfo:
2680 # Information about a X86 CPU feature word
2682 # @cpuid-input-eax: Input EAX value for CPUID instruction for that feature word
2684 # @cpuid-input-ecx: Input ECX value for CPUID instruction for that
2685 #                   feature word
2687 # @cpuid-register: Output register containing the feature bits
2689 # @features: value of output register, containing the feature bits
2691 # Since: 1.5
2693 { 'struct': 'X86CPUFeatureWordInfo',
2694   'data': { 'cpuid-input-eax': 'int',
2695             '*cpuid-input-ecx': 'int',
2696             'cpuid-register': 'X86CPURegister32',
2697             'features': 'int' } }
2700 # @DummyForceArrays:
2702 # Not used by QMP; hack to let us use X86CPUFeatureWordInfoList internally
2704 # Since: 2.5
2706 { 'struct': 'DummyForceArrays',
2707   'data': { 'unused': ['X86CPUFeatureWordInfo'] } }
2711 # @NumaOptionsType:
2713 # @node: NUMA nodes configuration
2715 # @dist: NUMA distance configuration (since 2.10)
2717 # @cpu: property based CPU(s) to node mapping (Since: 2.10)
2719 # Since: 2.1
2721 { 'enum': 'NumaOptionsType',
2722   'data': [ 'node', 'dist', 'cpu' ] }
2725 # @NumaOptions:
2727 # A discriminated record of NUMA options. (for OptsVisitor)
2729 # Since: 2.1
2731 { 'union': 'NumaOptions',
2732   'base': { 'type': 'NumaOptionsType' },
2733   'discriminator': 'type',
2734   'data': {
2735     'node': 'NumaNodeOptions',
2736     'dist': 'NumaDistOptions',
2737     'cpu': 'NumaCpuOptions' }}
2740 # @NumaNodeOptions:
2742 # Create a guest NUMA node. (for OptsVisitor)
2744 # @nodeid: NUMA node ID (increase by 1 from 0 if omitted)
2746 # @cpus: VCPUs belonging to this node (assign VCPUS round-robin
2747 #         if omitted)
2749 # @mem: memory size of this node; mutually exclusive with @memdev.
2750 #       Equally divide total memory among nodes if both @mem and @memdev are
2751 #       omitted.
2753 # @memdev: memory backend object.  If specified for one node,
2754 #          it must be specified for all nodes.
2756 # Since: 2.1
2758 { 'struct': 'NumaNodeOptions',
2759   'data': {
2760    '*nodeid': 'uint16',
2761    '*cpus':   ['uint16'],
2762    '*mem':    'size',
2763    '*memdev': 'str' }}
2766 # @NumaDistOptions:
2768 # Set the distance between 2 NUMA nodes.
2770 # @src: source NUMA node.
2772 # @dst: destination NUMA node.
2774 # @val: NUMA distance from source node to destination node.
2775 #       When a node is unreachable from another node, set the distance
2776 #       between them to 255.
2778 # Since: 2.10
2780 { 'struct': 'NumaDistOptions',
2781   'data': {
2782    'src': 'uint16',
2783    'dst': 'uint16',
2784    'val': 'uint8' }}
2787 # @NumaCpuOptions:
2789 # Option "-numa cpu" overrides default cpu to node mapping.
2790 # It accepts the same set of cpu properties as returned by
2791 # query-hotpluggable-cpus[].props, where node-id could be used to
2792 # override default node mapping.
2794 # Since: 2.10
2796 { 'struct': 'NumaCpuOptions',
2797    'base': 'CpuInstanceProperties',
2798    'data' : {} }
2801 # @HostMemPolicy:
2803 # Host memory policy types
2805 # @default: restore default policy, remove any nondefault policy
2807 # @preferred: set the preferred host nodes for allocation
2809 # @bind: a strict policy that restricts memory allocation to the
2810 #        host nodes specified
2812 # @interleave: memory allocations are interleaved across the set
2813 #              of host nodes specified
2815 # Since: 2.1
2817 { 'enum': 'HostMemPolicy',
2818   'data': [ 'default', 'preferred', 'bind', 'interleave' ] }
2821 # @Memdev:
2823 # Information about memory backend
2825 # @id: backend's ID if backend has 'id' property (since 2.9)
2827 # @size: memory backend size
2829 # @merge: enables or disables memory merge support
2831 # @dump: includes memory backend's memory in a core dump or not
2833 # @prealloc: enables or disables memory preallocation
2835 # @host-nodes: host nodes for its memory policy
2837 # @policy: memory policy of memory backend
2839 # Since: 2.1
2841 { 'struct': 'Memdev',
2842   'data': {
2843     '*id':        'str',
2844     'size':       'size',
2845     'merge':      'bool',
2846     'dump':       'bool',
2847     'prealloc':   'bool',
2848     'host-nodes': ['uint16'],
2849     'policy':     'HostMemPolicy' }}
2852 # @query-memdev:
2854 # Returns information for all memory backends.
2856 # Returns: a list of @Memdev.
2858 # Since: 2.1
2860 # Example:
2862 # -> { "execute": "query-memdev" }
2863 # <- { "return": [
2864 #        {
2865 #          "id": "mem1",
2866 #          "size": 536870912,
2867 #          "merge": false,
2868 #          "dump": true,
2869 #          "prealloc": false,
2870 #          "host-nodes": [0, 1],
2871 #          "policy": "bind"
2872 #        },
2873 #        {
2874 #          "size": 536870912,
2875 #          "merge": false,
2876 #          "dump": true,
2877 #          "prealloc": true,
2878 #          "host-nodes": [2, 3],
2879 #          "policy": "preferred"
2880 #        }
2881 #      ]
2882 #    }
2885 { 'command': 'query-memdev', 'returns': ['Memdev'], 'allow-preconfig': true }
2888 # @PCDIMMDeviceInfo:
2890 # PCDIMMDevice state information
2892 # @id: device's ID
2894 # @addr: physical address, where device is mapped
2896 # @size: size of memory that the device provides
2898 # @slot: slot number at which device is plugged in
2900 # @node: NUMA node number where device is plugged in
2902 # @memdev: memory backend linked with device
2904 # @hotplugged: true if device was hotplugged
2906 # @hotpluggable: true if device if could be added/removed while machine is running
2908 # Since: 2.1
2910 { 'struct': 'PCDIMMDeviceInfo',
2911   'data': { '*id': 'str',
2912             'addr': 'int',
2913             'size': 'int',
2914             'slot': 'int',
2915             'node': 'int',
2916             'memdev': 'str',
2917             'hotplugged': 'bool',
2918             'hotpluggable': 'bool'
2919           }
2923 # @MemoryDeviceInfo:
2925 # Union containing information about a memory device
2927 # Since: 2.1
2929 { 'union': 'MemoryDeviceInfo',
2930   'data': { 'dimm': 'PCDIMMDeviceInfo',
2931             'nvdimm': 'PCDIMMDeviceInfo'
2932           }
2936 # @query-memory-devices:
2938 # Lists available memory devices and their state
2940 # Since: 2.1
2942 # Example:
2944 # -> { "execute": "query-memory-devices" }
2945 # <- { "return": [ { "data":
2946 #                       { "addr": 5368709120,
2947 #                         "hotpluggable": true,
2948 #                         "hotplugged": true,
2949 #                         "id": "d1",
2950 #                         "memdev": "/objects/memX",
2951 #                         "node": 0,
2952 #                         "size": 1073741824,
2953 #                         "slot": 0},
2954 #                    "type": "dimm"
2955 #                  } ] }
2958 { 'command': 'query-memory-devices', 'returns': ['MemoryDeviceInfo'] }
2961 # @MEM_UNPLUG_ERROR:
2963 # Emitted when memory hot unplug error occurs.
2965 # @device: device name
2967 # @msg: Informative message
2969 # Since: 2.4
2971 # Example:
2973 # <- { "event": "MEM_UNPLUG_ERROR"
2974 #      "data": { "device": "dimm1",
2975 #                "msg": "acpi: device unplug for unsupported device"
2976 #      },
2977 #      "timestamp": { "seconds": 1265044230, "microseconds": 450486 } }
2980 { 'event': 'MEM_UNPLUG_ERROR',
2981   'data': { 'device': 'str', 'msg': 'str' } }
2984 # @ACPISlotType:
2986 # @DIMM: memory slot
2987 # @CPU: logical CPU slot (since 2.7)
2989 { 'enum': 'ACPISlotType', 'data': [ 'DIMM', 'CPU' ] }
2992 # @ACPIOSTInfo:
2994 # OSPM Status Indication for a device
2995 # For description of possible values of @source and @status fields
2996 # see "_OST (OSPM Status Indication)" chapter of ACPI5.0 spec.
2998 # @device: device ID associated with slot
3000 # @slot: slot ID, unique per slot of a given @slot-type
3002 # @slot-type: type of the slot
3004 # @source: an integer containing the source event
3006 # @status: an integer containing the status code
3008 # Since: 2.1
3010 { 'struct': 'ACPIOSTInfo',
3011   'data'  : { '*device': 'str',
3012               'slot': 'str',
3013               'slot-type': 'ACPISlotType',
3014               'source': 'int',
3015               'status': 'int' } }
3018 # @query-acpi-ospm-status:
3020 # Return a list of ACPIOSTInfo for devices that support status
3021 # reporting via ACPI _OST method.
3023 # Since: 2.1
3025 # Example:
3027 # -> { "execute": "query-acpi-ospm-status" }
3028 # <- { "return": [ { "device": "d1", "slot": "0", "slot-type": "DIMM", "source": 1, "status": 0},
3029 #                  { "slot": "1", "slot-type": "DIMM", "source": 0, "status": 0},
3030 #                  { "slot": "2", "slot-type": "DIMM", "source": 0, "status": 0},
3031 #                  { "slot": "3", "slot-type": "DIMM", "source": 0, "status": 0}
3032 #    ]}
3035 { 'command': 'query-acpi-ospm-status', 'returns': ['ACPIOSTInfo'] }
3038 # @ACPI_DEVICE_OST:
3040 # Emitted when guest executes ACPI _OST method.
3042 # @info: OSPM Status Indication
3044 # Since: 2.1
3046 # Example:
3048 # <- { "event": "ACPI_DEVICE_OST",
3049 #      "data": { "device": "d1", "slot": "0",
3050 #                "slot-type": "DIMM", "source": 1, "status": 0 } }
3053 { 'event': 'ACPI_DEVICE_OST',
3054      'data': { 'info': 'ACPIOSTInfo' } }
3057 # @rtc-reset-reinjection:
3059 # This command will reset the RTC interrupt reinjection backlog.
3060 # Can be used if another mechanism to synchronize guest time
3061 # is in effect, for example QEMU guest agent's guest-set-time
3062 # command.
3064 # Since: 2.1
3066 # Example:
3068 # -> { "execute": "rtc-reset-reinjection" }
3069 # <- { "return": {} }
3072 { 'command': 'rtc-reset-reinjection' }
3075 # @RTC_CHANGE:
3077 # Emitted when the guest changes the RTC time.
3079 # @offset: offset between base RTC clock (as specified by -rtc base), and
3080 #          new RTC clock value. Note that value will be different depending
3081 #          on clock chosen to drive RTC (specified by -rtc clock).
3083 # Note: This event is rate-limited.
3085 # Since: 0.13.0
3087 # Example:
3089 # <-   { "event": "RTC_CHANGE",
3090 #        "data": { "offset": 78 },
3091 #        "timestamp": { "seconds": 1267020223, "microseconds": 435656 } }
3094 { 'event': 'RTC_CHANGE',
3095   'data': { 'offset': 'int' } }
3098 # @ReplayMode:
3100 # Mode of the replay subsystem.
3102 # @none: normal execution mode. Replay or record are not enabled.
3104 # @record: record mode. All non-deterministic data is written into the
3105 #          replay log.
3107 # @play: replay mode. Non-deterministic data required for system execution
3108 #        is read from the log.
3110 # Since: 2.5
3112 { 'enum': 'ReplayMode',
3113   'data': [ 'none', 'record', 'play' ] }
3116 # @xen-load-devices-state:
3118 # Load the state of all devices from file. The RAM and the block devices
3119 # of the VM are not loaded by this command.
3121 # @filename: the file to load the state of the devices from as binary
3122 # data. See xen-save-devices-state.txt for a description of the binary
3123 # format.
3125 # Since: 2.7
3127 # Example:
3129 # -> { "execute": "xen-load-devices-state",
3130 #      "arguments": { "filename": "/tmp/resume" } }
3131 # <- { "return": {} }
3134 { 'command': 'xen-load-devices-state', 'data': {'filename': 'str'} }
3137 # @GICCapability:
3139 # The struct describes capability for a specific GIC (Generic
3140 # Interrupt Controller) version. These bits are not only decided by
3141 # QEMU/KVM software version, but also decided by the hardware that
3142 # the program is running upon.
3144 # @version:  version of GIC to be described. Currently, only 2 and 3
3145 #            are supported.
3147 # @emulated: whether current QEMU/hardware supports emulated GIC
3148 #            device in user space.
3150 # @kernel:   whether current QEMU/hardware supports hardware
3151 #            accelerated GIC device in kernel.
3153 # Since: 2.6
3155 { 'struct': 'GICCapability',
3156   'data': { 'version': 'int',
3157             'emulated': 'bool',
3158             'kernel': 'bool' } }
3161 # @query-gic-capabilities:
3163 # This command is ARM-only. It will return a list of GICCapability
3164 # objects that describe its capability bits.
3166 # Returns: a list of GICCapability objects.
3168 # Since: 2.6
3170 # Example:
3172 # -> { "execute": "query-gic-capabilities" }
3173 # <- { "return": [{ "version": 2, "emulated": true, "kernel": false },
3174 #                 { "version": 3, "emulated": false, "kernel": true } ] }
3177 { 'command': 'query-gic-capabilities', 'returns': ['GICCapability'] }
3180 # @CpuInstanceProperties:
3182 # List of properties to be used for hotplugging a CPU instance,
3183 # it should be passed by management with device_add command when
3184 # a CPU is being hotplugged.
3186 # @node-id: NUMA node ID the CPU belongs to
3187 # @socket-id: socket number within node/board the CPU belongs to
3188 # @core-id: core number within socket the CPU belongs to
3189 # @thread-id: thread number within core the CPU belongs to
3191 # Note: currently there are 4 properties that could be present
3192 # but management should be prepared to pass through other
3193 # properties with device_add command to allow for future
3194 # interface extension. This also requires the filed names to be kept in
3195 # sync with the properties passed to -device/device_add.
3197 # Since: 2.7
3199 { 'struct': 'CpuInstanceProperties',
3200   'data': { '*node-id': 'int',
3201             '*socket-id': 'int',
3202             '*core-id': 'int',
3203             '*thread-id': 'int'
3204   }
3208 # @HotpluggableCPU:
3210 # @type: CPU object type for usage with device_add command
3211 # @props: list of properties to be used for hotplugging CPU
3212 # @vcpus-count: number of logical VCPU threads @HotpluggableCPU provides
3213 # @qom-path: link to existing CPU object if CPU is present or
3214 #            omitted if CPU is not present.
3216 # Since: 2.7
3218 { 'struct': 'HotpluggableCPU',
3219   'data': { 'type': 'str',
3220             'vcpus-count': 'int',
3221             'props': 'CpuInstanceProperties',
3222             '*qom-path': 'str'
3223           }
3227 # @query-hotpluggable-cpus:
3229 # TODO: Better documentation; currently there is none.
3231 # Returns: a list of HotpluggableCPU objects.
3233 # Since: 2.7
3235 # Example:
3237 # For pseries machine type started with -smp 2,cores=2,maxcpus=4 -cpu POWER8:
3239 # -> { "execute": "query-hotpluggable-cpus" }
3240 # <- {"return": [
3241 #      { "props": { "core": 8 }, "type": "POWER8-spapr-cpu-core",
3242 #        "vcpus-count": 1 },
3243 #      { "props": { "core": 0 }, "type": "POWER8-spapr-cpu-core",
3244 #        "vcpus-count": 1, "qom-path": "/machine/unattached/device[0]"}
3245 #    ]}'
3247 # For pc machine type started with -smp 1,maxcpus=2:
3249 # -> { "execute": "query-hotpluggable-cpus" }
3250 # <- {"return": [
3251 #      {
3252 #         "type": "qemu64-x86_64-cpu", "vcpus-count": 1,
3253 #         "props": {"core-id": 0, "socket-id": 1, "thread-id": 0}
3254 #      },
3255 #      {
3256 #         "qom-path": "/machine/unattached/device[0]",
3257 #         "type": "qemu64-x86_64-cpu", "vcpus-count": 1,
3258 #         "props": {"core-id": 0, "socket-id": 0, "thread-id": 0}
3259 #      }
3260 #    ]}
3262 # For s390x-virtio-ccw machine type started with -smp 1,maxcpus=2 -cpu qemu
3263 # (Since: 2.11):
3265 # -> { "execute": "query-hotpluggable-cpus" }
3266 # <- {"return": [
3267 #      {
3268 #         "type": "qemu-s390x-cpu", "vcpus-count": 1,
3269 #         "props": { "core-id": 1 }
3270 #      },
3271 #      {
3272 #         "qom-path": "/machine/unattached/device[0]",
3273 #         "type": "qemu-s390x-cpu", "vcpus-count": 1,
3274 #         "props": { "core-id": 0 }
3275 #      }
3276 #    ]}
3279 { 'command': 'query-hotpluggable-cpus', 'returns': ['HotpluggableCPU'],
3280              'allow-preconfig': true }
3283 # @GuidInfo:
3285 # GUID information.
3287 # @guid: the globally unique identifier
3289 # Since: 2.9
3291 { 'struct': 'GuidInfo', 'data': {'guid': 'str'} }
3294 # @query-vm-generation-id:
3296 # Show Virtual Machine Generation ID
3298 # Since: 2.9
3300 { 'command': 'query-vm-generation-id', 'returns': 'GuidInfo' }
3304 # @SevState:
3306 # An enumeration of SEV state information used during @query-sev.
3308 # @uninit: The guest is uninitialized.
3310 # @launch-update: The guest is currently being launched; plaintext data and
3311 #                 register state is being imported.
3313 # @launch-secret: The guest is currently being launched; ciphertext data
3314 #                 is being imported.
3316 # @running: The guest is fully launched or migrated in.
3318 # @send-update: The guest is currently being migrated out to another machine.
3320 # @receive-update: The guest is currently being migrated from another machine.
3322 # Since: 2.12
3324 { 'enum': 'SevState',
3325   'data': ['uninit', 'launch-update', 'launch-secret', 'running',
3326            'send-update', 'receive-update' ] }
3329 # @SevInfo:
3331 # Information about Secure Encrypted Virtualization (SEV) support
3333 # @enabled: true if SEV is active
3335 # @api-major: SEV API major version
3337 # @api-minor: SEV API minor version
3339 # @build-id: SEV FW build id
3341 # @policy: SEV policy value
3343 # @state: SEV guest state
3345 # @handle: SEV firmware handle
3347 # Since: 2.12
3349 { 'struct': 'SevInfo',
3350     'data': { 'enabled': 'bool',
3351               'api-major': 'uint8',
3352               'api-minor' : 'uint8',
3353               'build-id' : 'uint8',
3354               'policy' : 'uint32',
3355               'state' : 'SevState',
3356               'handle' : 'uint32'
3357             }
3361 # @query-sev:
3363 # Returns information about SEV
3365 # Returns: @SevInfo
3367 # Since: 2.12
3369 # Example:
3371 # -> { "execute": "query-sev" }
3372 # <- { "return": { "enabled": true, "api-major" : 0, "api-minor" : 0,
3373 #                  "build-id" : 0, "policy" : 0, "state" : "running",
3374 #                  "handle" : 1 } }
3377 { 'command': 'query-sev', 'returns': 'SevInfo' }
3380 # @SevLaunchMeasureInfo:
3382 # SEV Guest Launch measurement information
3384 # @data: the measurement value encoded in base64
3386 # Since: 2.12
3389 { 'struct': 'SevLaunchMeasureInfo', 'data': {'data': 'str'} }
3392 # @query-sev-launch-measure:
3394 # Query the SEV guest launch information.
3396 # Returns: The @SevLaunchMeasureInfo for the guest
3398 # Since: 2.12
3400 # Example:
3402 # -> { "execute": "query-sev-launch-measure" }
3403 # <- { "return": { "data": "4l8LXeNlSPUDlXPJG5966/8%YZ" } }
3406 { 'command': 'query-sev-launch-measure', 'returns': 'SevLaunchMeasureInfo' }
3409 # @SevCapability:
3411 # The struct describes capability for a Secure Encrypted Virtualization
3412 # feature.
3414 # @pdh:  Platform Diffie-Hellman key (base64 encoded)
3416 # @cert-chain:  PDH certificate chain (base64 encoded)
3418 # @cbitpos: C-bit location in page table entry
3420 # @reduced-phys-bits: Number of physical Address bit reduction when SEV is
3421 #                     enabled
3423 # Since: 2.12
3425 { 'struct': 'SevCapability',
3426   'data': { 'pdh': 'str',
3427             'cert-chain': 'str',
3428             'cbitpos': 'int',
3429             'reduced-phys-bits': 'int'} }
3432 # @query-sev-capabilities:
3434 # This command is used to get the SEV capabilities, and is supported on AMD
3435 # X86 platforms only.
3437 # Returns: SevCapability objects.
3439 # Since: 2.12
3441 # Example:
3443 # -> { "execute": "query-sev-capabilities" }
3444 # <- { "return": { "pdh": "8CCDD8DDD", "cert-chain": "888CCCDDDEE",
3445 #                  "cbitpos": 47, "reduced-phys-bits": 5}}
3448 { 'command': 'query-sev-capabilities', 'returns': 'SevCapability' }
3451 # @set-numa-node:
3453 # Runtime equivalent of '-numa' CLI option, available at
3454 # preconfigure stage to configure numa mapping before initializing
3455 # machine.
3457 # Since 3.0
3459 { 'command': 'set-numa-node', 'boxed': true,
3460   'data': 'NumaOptions',
3461   'allow-preconfig': true