cpu-exec: fix exception_index handling
[qemu/ar7.git] / qapi / misc.json
blobbcd5d10778ab5687b97c8ba30e144b9a29ceb5db
1 # -*- Mode: Python -*-
4 ##
5 # = Miscellanea
6 ##
8 ##
9 # @qmp_capabilities:
11 # Enable QMP capabilities.
13 # Arguments: None.
15 # Example:
17 # -> { "execute": "qmp_capabilities" }
18 # <- { "return": {} }
20 # Notes: This command is valid exactly when first connecting: it must be
21 # issued before any other command will be accepted, and will fail once the
22 # monitor is accepting other commands. (see qemu docs/interop/qmp-spec.txt)
24 # Since: 0.13
27 { 'command': 'qmp_capabilities' }
30 # @VersionTriple:
32 # A three-part version number.
34 # @major:  The major version number.
36 # @minor:  The minor version number.
38 # @micro:  The micro version number.
40 # Since: 2.4
42 { 'struct': 'VersionTriple',
43   'data': {'major': 'int', 'minor': 'int', 'micro': 'int'} }
47 # @VersionInfo:
49 # A description of QEMU's version.
51 # @qemu:        The version of QEMU.  By current convention, a micro
52 #               version of 50 signifies a development branch.  A micro version
53 #               greater than or equal to 90 signifies a release candidate for
54 #               the next minor version.  A micro version of less than 50
55 #               signifies a stable release.
57 # @package:     QEMU will always set this field to an empty string.  Downstream
58 #               versions of QEMU should set this to a non-empty string.  The
59 #               exact format depends on the downstream however it highly
60 #               recommended that a unique name is used.
62 # Since: 0.14.0
64 { 'struct': 'VersionInfo',
65   'data': {'qemu': 'VersionTriple', 'package': 'str'} }
68 # @query-version:
70 # Returns the current version of QEMU.
72 # Returns:  A @VersionInfo object describing the current version of QEMU.
74 # Since: 0.14.0
76 # Example:
78 # -> { "execute": "query-version" }
79 # <- {
80 #       "return":{
81 #          "qemu":{
82 #             "major":0,
83 #             "minor":11,
84 #             "micro":5
85 #          },
86 #          "package":""
87 #       }
88 #    }
91 { 'command': 'query-version', 'returns': 'VersionInfo' }
94 # @CommandInfo:
96 # Information about a QMP command
98 # @name: The command name
100 # Since: 0.14.0
102 { 'struct': 'CommandInfo', 'data': {'name': 'str'} }
105 # @query-commands:
107 # Return a list of supported QMP commands by this server
109 # Returns: A list of @CommandInfo for all supported commands
111 # Since: 0.14.0
113 # Example:
115 # -> { "execute": "query-commands" }
116 # <- {
117 #      "return":[
118 #         {
119 #            "name":"query-balloon"
120 #         },
121 #         {
122 #            "name":"system_powerdown"
123 #         }
124 #      ]
125 #    }
127 # Note: This example has been shortened as the real response is too long.
130 { 'command': 'query-commands', 'returns': ['CommandInfo'] }
133 # @LostTickPolicy:
135 # Policy for handling lost ticks in timer devices.
137 # @discard: throw away the missed tick(s) and continue with future injection
138 #           normally.  Guest time may be delayed, unless the OS has explicit
139 #           handling of lost ticks
141 # @delay: continue to deliver ticks at the normal rate.  Guest time will be
142 #         delayed due to the late tick
144 # @merge: merge the missed tick(s) into one tick and inject.  Guest time
145 #         may be delayed, depending on how the OS reacts to the merging
146 #         of ticks
148 # @slew: deliver ticks at a higher rate to catch up with the missed tick. The
149 #        guest time should not be delayed once catchup is complete.
151 # Since: 2.0
153 { 'enum': 'LostTickPolicy',
154   'data': ['discard', 'delay', 'merge', 'slew' ] }
157 # @add_client:
159 # Allow client connections for VNC, Spice and socket based
160 # character devices to be passed in to QEMU via SCM_RIGHTS.
162 # @protocol: protocol name. Valid names are "vnc", "spice" or the
163 #            name of a character device (eg. from -chardev id=XXXX)
165 # @fdname: file descriptor name previously passed via 'getfd' command
167 # @skipauth: whether to skip authentication. Only applies
168 #            to "vnc" and "spice" protocols
170 # @tls: whether to perform TLS. Only applies to the "spice"
171 #       protocol
173 # Returns: nothing on success.
175 # Since: 0.14.0
177 # Example:
179 # -> { "execute": "add_client", "arguments": { "protocol": "vnc",
180 #                                              "fdname": "myclient" } }
181 # <- { "return": {} }
184 { 'command': 'add_client',
185   'data': { 'protocol': 'str', 'fdname': 'str', '*skipauth': 'bool',
186             '*tls': 'bool' } }
189 # @NameInfo:
191 # Guest name information.
193 # @name: The name of the guest
195 # Since: 0.14.0
197 { 'struct': 'NameInfo', 'data': {'*name': 'str'} }
200 # @query-name:
202 # Return the name information of a guest.
204 # Returns: @NameInfo of the guest
206 # Since: 0.14.0
208 # Example:
210 # -> { "execute": "query-name" }
211 # <- { "return": { "name": "qemu-name" } }
214 { 'command': 'query-name', 'returns': 'NameInfo' }
217 # @KvmInfo:
219 # Information about support for KVM acceleration
221 # @enabled: true if KVM acceleration is active
223 # @present: true if KVM acceleration is built into this executable
225 # Since: 0.14.0
227 { 'struct': 'KvmInfo', 'data': {'enabled': 'bool', 'present': 'bool'} }
230 # @query-kvm:
232 # Returns information about KVM acceleration
234 # Returns: @KvmInfo
236 # Since: 0.14.0
238 # Example:
240 # -> { "execute": "query-kvm" }
241 # <- { "return": { "enabled": true, "present": true } }
244 { 'command': 'query-kvm', 'returns': 'KvmInfo' }
247 # @UuidInfo:
249 # Guest UUID information (Universally Unique Identifier).
251 # @UUID: the UUID of the guest
253 # Since: 0.14.0
255 # Notes: If no UUID was specified for the guest, a null UUID is returned.
257 { 'struct': 'UuidInfo', 'data': {'UUID': 'str'} }
260 # @query-uuid:
262 # Query the guest UUID information.
264 # Returns: The @UuidInfo for the guest
266 # Since: 0.14.0
268 # Example:
270 # -> { "execute": "query-uuid" }
271 # <- { "return": { "UUID": "550e8400-e29b-41d4-a716-446655440000" } }
274 { 'command': 'query-uuid', 'returns': 'UuidInfo' }
277 # @EventInfo:
279 # Information about a QMP event
281 # @name: The event name
283 # Since: 1.2.0
285 { 'struct': 'EventInfo', 'data': {'name': 'str'} }
288 # @query-events:
290 # Return a list of supported QMP events by this server
292 # Returns: A list of @EventInfo for all supported events
294 # Since: 1.2.0
296 # Example:
298 # -> { "execute": "query-events" }
299 # <- {
300 #      "return": [
301 #          {
302 #             "name":"SHUTDOWN"
303 #          },
304 #          {
305 #             "name":"RESET"
306 #          }
307 #       ]
308 #    }
310 # Note: This example has been shortened as the real response is too long.
313 { 'command': 'query-events', 'returns': ['EventInfo'] }
316 # @CpuInfoArch:
318 # An enumeration of cpu types that enable additional information during
319 # @query-cpus and @query-cpus-fast.
321 # @s390: since 2.12
323 # @riscv: since 2.12
325 # Since: 2.6
327 { 'enum': 'CpuInfoArch',
328   'data': ['x86', 'sparc', 'ppc', 'mips', 'tricore', 's390', 'riscv', 'other' ] }
331 # @CpuInfo:
333 # Information about a virtual CPU
335 # @CPU: the index of the virtual CPU
337 # @current: this only exists for backwards compatibility and should be ignored
339 # @halted: true if the virtual CPU is in the halt state.  Halt usually refers
340 #          to a processor specific low power mode.
342 # @qom_path: path to the CPU object in the QOM tree (since 2.4)
344 # @thread_id: ID of the underlying host thread
346 # @props: properties describing to which node/socket/core/thread
347 #         virtual CPU belongs to, provided if supported by board (since 2.10)
349 # @arch: architecture of the cpu, which determines which additional fields
350 #        will be listed (since 2.6)
352 # Since: 0.14.0
354 # Notes: @halted is a transient state that changes frequently.  By the time the
355 #        data is sent to the client, the guest may no longer be halted.
357 { 'union': 'CpuInfo',
358   'base': {'CPU': 'int', 'current': 'bool', 'halted': 'bool',
359            'qom_path': 'str', 'thread_id': 'int',
360            '*props': 'CpuInstanceProperties', 'arch': 'CpuInfoArch' },
361   'discriminator': 'arch',
362   'data': { 'x86': 'CpuInfoX86',
363             'sparc': 'CpuInfoSPARC',
364             'ppc': 'CpuInfoPPC',
365             'mips': 'CpuInfoMIPS',
366             'tricore': 'CpuInfoTricore',
367             's390': 'CpuInfoS390',
368             'riscv': 'CpuInfoRISCV',
369             'other': 'CpuInfoOther' } }
372 # @CpuInfoX86:
374 # Additional information about a virtual i386 or x86_64 CPU
376 # @pc: the 64-bit instruction pointer
378 # Since: 2.6
380 { 'struct': 'CpuInfoX86', 'data': { 'pc': 'int' } }
383 # @CpuInfoSPARC:
385 # Additional information about a virtual SPARC CPU
387 # @pc: the PC component of the instruction pointer
389 # @npc: the NPC component of the instruction pointer
391 # Since: 2.6
393 { 'struct': 'CpuInfoSPARC', 'data': { 'pc': 'int', 'npc': 'int' } }
396 # @CpuInfoPPC:
398 # Additional information about a virtual PPC CPU
400 # @nip: the instruction pointer
402 # Since: 2.6
404 { 'struct': 'CpuInfoPPC', 'data': { 'nip': 'int' } }
407 # @CpuInfoMIPS:
409 # Additional information about a virtual MIPS CPU
411 # @PC: the instruction pointer
413 # Since: 2.6
415 { 'struct': 'CpuInfoMIPS', 'data': { 'PC': 'int' } }
418 # @CpuInfoTricore:
420 # Additional information about a virtual Tricore CPU
422 # @PC: the instruction pointer
424 # Since: 2.6
426 { 'struct': 'CpuInfoTricore', 'data': { 'PC': 'int' } }
429 # @CpuInfoRISCV:
431 # Additional information about a virtual RISCV CPU
433 # @pc: the instruction pointer
435 # Since 2.12
437 { 'struct': 'CpuInfoRISCV', 'data': { 'pc': 'int' } }
440 # @CpuInfoOther:
442 # No additional information is available about the virtual CPU
444 # Since: 2.6
447 { 'struct': 'CpuInfoOther', 'data': { } }
450 # @CpuS390State:
452 # An enumeration of cpu states that can be assumed by a virtual
453 # S390 CPU
455 # Since: 2.12
457 { 'enum': 'CpuS390State',
458   'prefix': 'S390_CPU_STATE',
459   'data': [ 'uninitialized', 'stopped', 'check-stop', 'operating', 'load' ] }
462 # @CpuInfoS390:
464 # Additional information about a virtual S390 CPU
466 # @cpu-state: the virtual CPU's state
468 # Since: 2.12
470 { 'struct': 'CpuInfoS390', 'data': { 'cpu-state': 'CpuS390State' } }
473 # @query-cpus:
475 # Returns a list of information about each virtual CPU.
477 # This command causes vCPU threads to exit to userspace, which causes
478 # a small interruption to guest CPU execution. This will have a negative
479 # impact on realtime guests and other latency sensitive guest workloads.
480 # It is recommended to use @query-cpus-fast instead of this command to
481 # avoid the vCPU interruption.
483 # Returns: a list of @CpuInfo for each virtual CPU
485 # Since: 0.14.0
487 # Example:
489 # -> { "execute": "query-cpus" }
490 # <- { "return": [
491 #          {
492 #             "CPU":0,
493 #             "current":true,
494 #             "halted":false,
495 #             "qom_path":"/machine/unattached/device[0]",
496 #             "arch":"x86",
497 #             "pc":3227107138,
498 #             "thread_id":3134
499 #          },
500 #          {
501 #             "CPU":1,
502 #             "current":false,
503 #             "halted":true,
504 #             "qom_path":"/machine/unattached/device[2]",
505 #             "arch":"x86",
506 #             "pc":7108165,
507 #             "thread_id":3135
508 #          }
509 #       ]
510 #    }
512 # Notes: This interface is deprecated (since 2.12.0), and it is strongly
513 #        recommended that you avoid using it. Use @query-cpus-fast to
514 #        obtain information about virtual CPUs.
517 { 'command': 'query-cpus', 'returns': ['CpuInfo'] }
520 # @CpuInfoFast:
522 # Information about a virtual CPU
524 # @cpu-index: index of the virtual CPU
526 # @qom-path: path to the CPU object in the QOM tree
528 # @thread-id: ID of the underlying host thread
530 # @props: properties describing to which node/socket/core/thread
531 #         virtual CPU belongs to, provided if supported by board
533 # @arch: architecture of the cpu, which determines which additional fields
534 #        will be listed
536 # Since: 2.12
539 { 'union': 'CpuInfoFast',
540   'base': {'cpu-index': 'int', 'qom-path': 'str',
541            'thread-id': 'int', '*props': 'CpuInstanceProperties',
542            'arch': 'CpuInfoArch' },
543   'discriminator': 'arch',
544   'data': { 'x86': 'CpuInfoOther',
545             'sparc': 'CpuInfoOther',
546             'ppc': 'CpuInfoOther',
547             'mips': 'CpuInfoOther',
548             'tricore': 'CpuInfoOther',
549             's390': 'CpuInfoS390',
550             'riscv': 'CpuInfoRISCV',
551             'other': 'CpuInfoOther' } }
554 # @query-cpus-fast:
556 # Returns information about all virtual CPUs. This command does not
557 # incur a performance penalty and should be used in production
558 # instead of query-cpus.
560 # Returns: list of @CpuInfoFast
562 # Since: 2.12
564 # Example:
566 # -> { "execute": "query-cpus-fast" }
567 # <- { "return": [
568 #         {
569 #             "thread-id": 25627,
570 #             "props": {
571 #                 "core-id": 0,
572 #                 "thread-id": 0,
573 #                 "socket-id": 0
574 #             },
575 #             "qom-path": "/machine/unattached/device[0]",
576 #             "arch":"x86",
577 #             "cpu-index": 0
578 #         },
579 #         {
580 #             "thread-id": 25628,
581 #             "props": {
582 #                 "core-id": 0,
583 #                 "thread-id": 0,
584 #                 "socket-id": 1
585 #             },
586 #             "qom-path": "/machine/unattached/device[2]",
587 #             "arch":"x86",
588 #             "cpu-index": 1
589 #         }
590 #     ]
591 # }
593 { 'command': 'query-cpus-fast', 'returns': [ 'CpuInfoFast' ] }
596 # @IOThreadInfo:
598 # Information about an iothread
600 # @id: the identifier of the iothread
602 # @thread-id: ID of the underlying host thread
604 # @poll-max-ns: maximum polling time in ns, 0 means polling is disabled
605 #               (since 2.9)
607 # @poll-grow: how many ns will be added to polling time, 0 means that it's not
608 #             configured (since 2.9)
610 # @poll-shrink: how many ns will be removed from polling time, 0 means that
611 #               it's not configured (since 2.9)
613 # Since: 2.0
615 { 'struct': 'IOThreadInfo',
616   'data': {'id': 'str',
617            'thread-id': 'int',
618            'poll-max-ns': 'int',
619            'poll-grow': 'int',
620            'poll-shrink': 'int' } }
623 # @query-iothreads:
625 # Returns a list of information about each iothread.
627 # Note: this list excludes the QEMU main loop thread, which is not declared
628 # using the -object iothread command-line option.  It is always the main thread
629 # of the process.
631 # Returns: a list of @IOThreadInfo for each iothread
633 # Since: 2.0
635 # Example:
637 # -> { "execute": "query-iothreads" }
638 # <- { "return": [
639 #          {
640 #             "id":"iothread0",
641 #             "thread-id":3134
642 #          },
643 #          {
644 #             "id":"iothread1",
645 #             "thread-id":3135
646 #          }
647 #       ]
648 #    }
651 { 'command': 'query-iothreads', 'returns': ['IOThreadInfo'] }
654 # @BalloonInfo:
656 # Information about the guest balloon device.
658 # @actual: the number of bytes the balloon currently contains
660 # Since: 0.14.0
663 { 'struct': 'BalloonInfo', 'data': {'actual': 'int' } }
666 # @query-balloon:
668 # Return information about the balloon device.
670 # Returns: @BalloonInfo on success
672 #          If the balloon driver is enabled but not functional because the KVM
673 #          kernel module cannot support it, KvmMissingCap
675 #          If no balloon device is present, DeviceNotActive
677 # Since: 0.14.0
679 # Example:
681 # -> { "execute": "query-balloon" }
682 # <- { "return": {
683 #          "actual": 1073741824,
684 #       }
685 #    }
688 { 'command': 'query-balloon', 'returns': 'BalloonInfo' }
691 # @BALLOON_CHANGE:
693 # Emitted when the guest changes the actual BALLOON level. This value is
694 # equivalent to the @actual field return by the 'query-balloon' command
696 # @actual: actual level of the guest memory balloon in bytes
698 # Note: this event is rate-limited.
700 # Since: 1.2
702 # Example:
704 # <- { "event": "BALLOON_CHANGE",
705 #      "data": { "actual": 944766976 },
706 #      "timestamp": { "seconds": 1267020223, "microseconds": 435656 } }
709 { 'event': 'BALLOON_CHANGE',
710   'data': { 'actual': 'int' } }
713 # @PciMemoryRange:
715 # A PCI device memory region
717 # @base: the starting address (guest physical)
719 # @limit: the ending address (guest physical)
721 # Since: 0.14.0
723 { 'struct': 'PciMemoryRange', 'data': {'base': 'int', 'limit': 'int'} }
726 # @PciMemoryRegion:
728 # Information about a PCI device I/O region.
730 # @bar: the index of the Base Address Register for this region
732 # @type: 'io' if the region is a PIO region
733 #        'memory' if the region is a MMIO region
735 # @size: memory size
737 # @prefetch: if @type is 'memory', true if the memory is prefetchable
739 # @mem_type_64: if @type is 'memory', true if the BAR is 64-bit
741 # Since: 0.14.0
743 { 'struct': 'PciMemoryRegion',
744   'data': {'bar': 'int', 'type': 'str', 'address': 'int', 'size': 'int',
745            '*prefetch': 'bool', '*mem_type_64': 'bool' } }
748 # @PciBusInfo:
750 # Information about a bus of a PCI Bridge device
752 # @number: primary bus interface number.  This should be the number of the
753 #          bus the device resides on.
755 # @secondary: secondary bus interface number.  This is the number of the
756 #             main bus for the bridge
758 # @subordinate: This is the highest number bus that resides below the
759 #               bridge.
761 # @io_range: The PIO range for all devices on this bridge
763 # @memory_range: The MMIO range for all devices on this bridge
765 # @prefetchable_range: The range of prefetchable MMIO for all devices on
766 #                      this bridge
768 # Since: 2.4
770 { 'struct': 'PciBusInfo',
771   'data': {'number': 'int', 'secondary': 'int', 'subordinate': 'int',
772            'io_range': 'PciMemoryRange',
773            'memory_range': 'PciMemoryRange',
774            'prefetchable_range': 'PciMemoryRange' } }
777 # @PciBridgeInfo:
779 # Information about a PCI Bridge device
781 # @bus: information about the bus the device resides on
783 # @devices: a list of @PciDeviceInfo for each device on this bridge
785 # Since: 0.14.0
787 { 'struct': 'PciBridgeInfo',
788   'data': {'bus': 'PciBusInfo', '*devices': ['PciDeviceInfo']} }
791 # @PciDeviceClass:
793 # Information about the Class of a PCI device
795 # @desc: a string description of the device's class
797 # @class: the class code of the device
799 # Since: 2.4
801 { 'struct': 'PciDeviceClass',
802   'data': {'*desc': 'str', 'class': 'int'} }
805 # @PciDeviceId:
807 # Information about the Id of a PCI device
809 # @device: the PCI device id
811 # @vendor: the PCI vendor id
813 # Since: 2.4
815 { 'struct': 'PciDeviceId',
816   'data': {'device': 'int', 'vendor': 'int'} }
819 # @PciDeviceInfo:
821 # Information about a PCI device
823 # @bus: the bus number of the device
825 # @slot: the slot the device is located in
827 # @function: the function of the slot used by the device
829 # @class_info: the class of the device
831 # @id: the PCI device id
833 # @irq: if an IRQ is assigned to the device, the IRQ number
835 # @qdev_id: the device name of the PCI device
837 # @pci_bridge: if the device is a PCI bridge, the bridge information
839 # @regions: a list of the PCI I/O regions associated with the device
841 # Notes: the contents of @class_info.desc are not stable and should only be
842 #        treated as informational.
844 # Since: 0.14.0
846 { 'struct': 'PciDeviceInfo',
847   'data': {'bus': 'int', 'slot': 'int', 'function': 'int',
848            'class_info': 'PciDeviceClass', 'id': 'PciDeviceId',
849            '*irq': 'int', 'qdev_id': 'str', '*pci_bridge': 'PciBridgeInfo',
850            'regions': ['PciMemoryRegion']} }
853 # @PciInfo:
855 # Information about a PCI bus
857 # @bus: the bus index
859 # @devices: a list of devices on this bus
861 # Since: 0.14.0
863 { 'struct': 'PciInfo', 'data': {'bus': 'int', 'devices': ['PciDeviceInfo']} }
866 # @query-pci:
868 # Return information about the PCI bus topology of the guest.
870 # Returns: a list of @PciInfo for each PCI bus. Each bus is
871 # represented by a json-object, which has a key with a json-array of
872 # all PCI devices attached to it. Each device is represented by a
873 # json-object.
875 # Since: 0.14.0
877 # Example:
879 # -> { "execute": "query-pci" }
880 # <- { "return": [
881 #          {
882 #             "bus": 0,
883 #             "devices": [
884 #                {
885 #                   "bus": 0,
886 #                   "qdev_id": "",
887 #                   "slot": 0,
888 #                   "class_info": {
889 #                      "class": 1536,
890 #                      "desc": "Host bridge"
891 #                   },
892 #                   "id": {
893 #                      "device": 32902,
894 #                      "vendor": 4663
895 #                   },
896 #                   "function": 0,
897 #                   "regions": [
898 #                   ]
899 #                },
900 #                {
901 #                   "bus": 0,
902 #                   "qdev_id": "",
903 #                   "slot": 1,
904 #                   "class_info": {
905 #                      "class": 1537,
906 #                      "desc": "ISA bridge"
907 #                   },
908 #                   "id": {
909 #                      "device": 32902,
910 #                      "vendor": 28672
911 #                   },
912 #                   "function": 0,
913 #                   "regions": [
914 #                   ]
915 #                },
916 #                {
917 #                   "bus": 0,
918 #                   "qdev_id": "",
919 #                   "slot": 1,
920 #                   "class_info": {
921 #                      "class": 257,
922 #                      "desc": "IDE controller"
923 #                   },
924 #                   "id": {
925 #                      "device": 32902,
926 #                      "vendor": 28688
927 #                   },
928 #                   "function": 1,
929 #                   "regions": [
930 #                      {
931 #                         "bar": 4,
932 #                         "size": 16,
933 #                         "address": 49152,
934 #                         "type": "io"
935 #                      }
936 #                   ]
937 #                },
938 #                {
939 #                   "bus": 0,
940 #                   "qdev_id": "",
941 #                   "slot": 2,
942 #                   "class_info": {
943 #                      "class": 768,
944 #                      "desc": "VGA controller"
945 #                   },
946 #                   "id": {
947 #                      "device": 4115,
948 #                      "vendor": 184
949 #                   },
950 #                   "function": 0,
951 #                   "regions": [
952 #                      {
953 #                         "prefetch": true,
954 #                         "mem_type_64": false,
955 #                         "bar": 0,
956 #                         "size": 33554432,
957 #                         "address": 4026531840,
958 #                         "type": "memory"
959 #                      },
960 #                      {
961 #                         "prefetch": false,
962 #                         "mem_type_64": false,
963 #                         "bar": 1,
964 #                         "size": 4096,
965 #                         "address": 4060086272,
966 #                         "type": "memory"
967 #                      },
968 #                      {
969 #                         "prefetch": false,
970 #                         "mem_type_64": false,
971 #                         "bar": 6,
972 #                         "size": 65536,
973 #                         "address": -1,
974 #                         "type": "memory"
975 #                      }
976 #                   ]
977 #                },
978 #                {
979 #                   "bus": 0,
980 #                   "qdev_id": "",
981 #                   "irq": 11,
982 #                   "slot": 4,
983 #                   "class_info": {
984 #                      "class": 1280,
985 #                      "desc": "RAM controller"
986 #                   },
987 #                   "id": {
988 #                      "device": 6900,
989 #                      "vendor": 4098
990 #                   },
991 #                   "function": 0,
992 #                   "regions": [
993 #                      {
994 #                         "bar": 0,
995 #                         "size": 32,
996 #                         "address": 49280,
997 #                         "type": "io"
998 #                      }
999 #                   ]
1000 #                }
1001 #             ]
1002 #          }
1003 #       ]
1004 #    }
1006 # Note: This example has been shortened as the real response is too long.
1009 { 'command': 'query-pci', 'returns': ['PciInfo'] }
1012 # @quit:
1014 # This command will cause the QEMU process to exit gracefully.  While every
1015 # attempt is made to send the QMP response before terminating, this is not
1016 # guaranteed.  When using this interface, a premature EOF would not be
1017 # unexpected.
1019 # Since: 0.14.0
1021 # Example:
1023 # -> { "execute": "quit" }
1024 # <- { "return": {} }
1026 { 'command': 'quit' }
1029 # @stop:
1031 # Stop all guest VCPU execution.
1033 # Since:  0.14.0
1035 # Notes:  This function will succeed even if the guest is already in the stopped
1036 #         state.  In "inmigrate" state, it will ensure that the guest
1037 #         remains paused once migration finishes, as if the -S option was
1038 #         passed on the command line.
1040 # Example:
1042 # -> { "execute": "stop" }
1043 # <- { "return": {} }
1046 { 'command': 'stop' }
1049 # @system_reset:
1051 # Performs a hard reset of a guest.
1053 # Since: 0.14.0
1055 # Example:
1057 # -> { "execute": "system_reset" }
1058 # <- { "return": {} }
1061 { 'command': 'system_reset' }
1064 # @system_powerdown:
1066 # Requests that a guest perform a powerdown operation.
1068 # Since: 0.14.0
1070 # Notes: A guest may or may not respond to this command.  This command
1071 #        returning does not indicate that a guest has accepted the request or
1072 #        that it has shut down.  Many guests will respond to this command by
1073 #        prompting the user in some way.
1074 # Example:
1076 # -> { "execute": "system_powerdown" }
1077 # <- { "return": {} }
1080 { 'command': 'system_powerdown' }
1083 # @cpu-add:
1085 # Adds CPU with specified ID
1087 # @id: ID of CPU to be created, valid values [0..max_cpus)
1089 # Returns: Nothing on success
1091 # Since: 1.5
1093 # Example:
1095 # -> { "execute": "cpu-add", "arguments": { "id": 2 } }
1096 # <- { "return": {} }
1099 { 'command': 'cpu-add', 'data': {'id': 'int'} }
1102 # @memsave:
1104 # Save a portion of guest memory to a file.
1106 # @val: the virtual address of the guest to start from
1108 # @size: the size of memory region to save
1110 # @filename: the file to save the memory to as binary data
1112 # @cpu-index: the index of the virtual CPU to use for translating the
1113 #                       virtual address (defaults to CPU 0)
1115 # Returns: Nothing on success
1117 # Since: 0.14.0
1119 # Notes: Errors were not reliably returned until 1.1
1121 # Example:
1123 # -> { "execute": "memsave",
1124 #      "arguments": { "val": 10,
1125 #                     "size": 100,
1126 #                     "filename": "/tmp/virtual-mem-dump" } }
1127 # <- { "return": {} }
1130 { 'command': 'memsave',
1131   'data': {'val': 'int', 'size': 'int', 'filename': 'str', '*cpu-index': 'int'} }
1134 # @pmemsave:
1136 # Save a portion of guest physical memory to a file.
1138 # @val: the physical address of the guest to start from
1140 # @size: the size of memory region to save
1142 # @filename: the file to save the memory to as binary data
1144 # Returns: Nothing on success
1146 # Since: 0.14.0
1148 # Notes: Errors were not reliably returned until 1.1
1150 # Example:
1152 # -> { "execute": "pmemsave",
1153 #      "arguments": { "val": 10,
1154 #                     "size": 100,
1155 #                     "filename": "/tmp/physical-mem-dump" } }
1156 # <- { "return": {} }
1159 { 'command': 'pmemsave',
1160   'data': {'val': 'int', 'size': 'int', 'filename': 'str'} }
1163 # @cont:
1165 # Resume guest VCPU execution.
1167 # Since:  0.14.0
1169 # Returns:  If successful, nothing
1171 # Notes:  This command will succeed if the guest is currently running.  It
1172 #         will also succeed if the guest is in the "inmigrate" state; in
1173 #         this case, the effect of the command is to make sure the guest
1174 #         starts once migration finishes, removing the effect of the -S
1175 #         command line option if it was passed.
1177 # Example:
1179 # -> { "execute": "cont" }
1180 # <- { "return": {} }
1183 { 'command': 'cont' }
1186 # @system_wakeup:
1188 # Wakeup guest from suspend.  Does nothing in case the guest isn't suspended.
1190 # Since:  1.1
1192 # Returns:  nothing.
1194 # Example:
1196 # -> { "execute": "system_wakeup" }
1197 # <- { "return": {} }
1200 { 'command': 'system_wakeup' }
1203 # @inject-nmi:
1205 # Injects a Non-Maskable Interrupt into the default CPU (x86/s390) or all CPUs (ppc64).
1206 # The command fails when the guest doesn't support injecting.
1208 # Returns:  If successful, nothing
1210 # Since:  0.14.0
1212 # Note: prior to 2.1, this command was only supported for x86 and s390 VMs
1214 # Example:
1216 # -> { "execute": "inject-nmi" }
1217 # <- { "return": {} }
1220 { 'command': 'inject-nmi' }
1223 # @balloon:
1225 # Request the balloon driver to change its balloon size.
1227 # @value: the target size of the balloon in bytes
1229 # Returns: Nothing on success
1230 #          If the balloon driver is enabled but not functional because the KVM
1231 #            kernel module cannot support it, KvmMissingCap
1232 #          If no balloon device is present, DeviceNotActive
1234 # Notes: This command just issues a request to the guest.  When it returns,
1235 #        the balloon size may not have changed.  A guest can change the balloon
1236 #        size independent of this command.
1238 # Since: 0.14.0
1240 # Example:
1242 # -> { "execute": "balloon", "arguments": { "value": 536870912 } }
1243 # <- { "return": {} }
1246 { 'command': 'balloon', 'data': {'value': 'int'} }
1249 # @human-monitor-command:
1251 # Execute a command on the human monitor and return the output.
1253 # @command-line: the command to execute in the human monitor
1255 # @cpu-index: The CPU to use for commands that require an implicit CPU
1257 # Returns: the output of the command as a string
1259 # Since: 0.14.0
1261 # Notes: This command only exists as a stop-gap.  Its use is highly
1262 #        discouraged.  The semantics of this command are not
1263 #        guaranteed: this means that command names, arguments and
1264 #        responses can change or be removed at ANY time.  Applications
1265 #        that rely on long term stability guarantees should NOT
1266 #        use this command.
1268 #        Known limitations:
1270 #        * This command is stateless, this means that commands that depend
1271 #          on state information (such as getfd) might not work
1273 #        * Commands that prompt the user for data don't currently work
1275 # Example:
1277 # -> { "execute": "human-monitor-command",
1278 #      "arguments": { "command-line": "info kvm" } }
1279 # <- { "return": "kvm support: enabled\r\n" }
1282 { 'command': 'human-monitor-command',
1283   'data': {'command-line': 'str', '*cpu-index': 'int'},
1284   'returns': 'str' }
1287 # @ObjectPropertyInfo:
1289 # @name: the name of the property
1291 # @type: the type of the property.  This will typically come in one of four
1292 #        forms:
1294 #        1) A primitive type such as 'u8', 'u16', 'bool', 'str', or 'double'.
1295 #           These types are mapped to the appropriate JSON type.
1297 #        2) A child type in the form 'child<subtype>' where subtype is a qdev
1298 #           device type name.  Child properties create the composition tree.
1300 #        3) A link type in the form 'link<subtype>' where subtype is a qdev
1301 #           device type name.  Link properties form the device model graph.
1303 # @description: if specified, the description of the property.
1305 # Since: 1.2
1307 { 'struct': 'ObjectPropertyInfo',
1308   'data': { 'name': 'str', 'type': 'str', '*description': 'str' } }
1311 # @qom-list:
1313 # This command will list any properties of a object given a path in the object
1314 # model.
1316 # @path: the path within the object model.  See @qom-get for a description of
1317 #        this parameter.
1319 # Returns: a list of @ObjectPropertyInfo that describe the properties of the
1320 #          object.
1322 # Since: 1.2
1324 { 'command': 'qom-list',
1325   'data': { 'path': 'str' },
1326   'returns': [ 'ObjectPropertyInfo' ] }
1329 # @qom-get:
1331 # This command will get a property from a object model path and return the
1332 # value.
1334 # @path: The path within the object model.  There are two forms of supported
1335 #        paths--absolute and partial paths.
1337 #        Absolute paths are derived from the root object and can follow child<>
1338 #        or link<> properties.  Since they can follow link<> properties, they
1339 #        can be arbitrarily long.  Absolute paths look like absolute filenames
1340 #        and are prefixed  with a leading slash.
1342 #        Partial paths look like relative filenames.  They do not begin
1343 #        with a prefix.  The matching rules for partial paths are subtle but
1344 #        designed to make specifying objects easy.  At each level of the
1345 #        composition tree, the partial path is matched as an absolute path.
1346 #        The first match is not returned.  At least two matches are searched
1347 #        for.  A successful result is only returned if only one match is
1348 #        found.  If more than one match is found, a flag is return to
1349 #        indicate that the match was ambiguous.
1351 # @property: The property name to read
1353 # Returns: The property value.  The type depends on the property
1354 #          type. child<> and link<> properties are returned as #str
1355 #          pathnames.  All integer property types (u8, u16, etc) are
1356 #          returned as #int.
1358 # Since: 1.2
1360 { 'command': 'qom-get',
1361   'data': { 'path': 'str', 'property': 'str' },
1362   'returns': 'any' }
1365 # @qom-set:
1367 # This command will set a property from a object model path.
1369 # @path: see @qom-get for a description of this parameter
1371 # @property: the property name to set
1373 # @value: a value who's type is appropriate for the property type.  See @qom-get
1374 #         for a description of type mapping.
1376 # Since: 1.2
1378 { 'command': 'qom-set',
1379   'data': { 'path': 'str', 'property': 'str', 'value': 'any' } }
1382 # @change:
1384 # This command is multiple commands multiplexed together.
1386 # @device: This is normally the name of a block device but it may also be 'vnc'.
1387 #          when it's 'vnc', then sub command depends on @target
1389 # @target: If @device is a block device, then this is the new filename.
1390 #          If @device is 'vnc', then if the value 'password' selects the vnc
1391 #          change password command.   Otherwise, this specifies a new server URI
1392 #          address to listen to for VNC connections.
1394 # @arg:    If @device is a block device, then this is an optional format to open
1395 #          the device with.
1396 #          If @device is 'vnc' and @target is 'password', this is the new VNC
1397 #          password to set.  See change-vnc-password for additional notes.
1399 # Returns: Nothing on success.
1400 #          If @device is not a valid block device, DeviceNotFound
1402 # Notes:  This interface is deprecated, and it is strongly recommended that you
1403 #         avoid using it.  For changing block devices, use
1404 #         blockdev-change-medium; for changing VNC parameters, use
1405 #         change-vnc-password.
1407 # Since: 0.14.0
1409 # Example:
1411 # 1. Change a removable medium
1413 # -> { "execute": "change",
1414 #      "arguments": { "device": "ide1-cd0",
1415 #                     "target": "/srv/images/Fedora-12-x86_64-DVD.iso" } }
1416 # <- { "return": {} }
1418 # 2. Change VNC password
1420 # -> { "execute": "change",
1421 #      "arguments": { "device": "vnc", "target": "password",
1422 #                     "arg": "foobar1" } }
1423 # <- { "return": {} }
1426 { 'command': 'change',
1427   'data': {'device': 'str', 'target': 'str', '*arg': 'str'} }
1430 # @ObjectTypeInfo:
1432 # This structure describes a search result from @qom-list-types
1434 # @name: the type name found in the search
1436 # @abstract: the type is abstract and can't be directly instantiated.
1437 #            Omitted if false. (since 2.10)
1439 # @parent: Name of parent type, if any (since 2.10)
1441 # Since: 1.1
1443 { 'struct': 'ObjectTypeInfo',
1444   'data': { 'name': 'str', '*abstract': 'bool', '*parent': 'str' } }
1447 # @qom-list-types:
1449 # This command will return a list of types given search parameters
1451 # @implements: if specified, only return types that implement this type name
1453 # @abstract: if true, include abstract types in the results
1455 # Returns: a list of @ObjectTypeInfo or an empty list if no results are found
1457 # Since: 1.1
1459 { 'command': 'qom-list-types',
1460   'data': { '*implements': 'str', '*abstract': 'bool' },
1461   'returns': [ 'ObjectTypeInfo' ] }
1464 # @device-list-properties:
1466 # List properties associated with a device.
1468 # @typename: the type name of a device
1470 # Returns: a list of ObjectPropertyInfo describing a devices properties
1472 # Since: 1.2
1474 { 'command': 'device-list-properties',
1475   'data': { 'typename': 'str'},
1476   'returns': [ 'ObjectPropertyInfo' ] }
1479 # @qom-list-properties:
1481 # List properties associated with a QOM object.
1483 # @typename: the type name of an object
1485 # Returns: a list of ObjectPropertyInfo describing object properties
1487 # Since: 2.12
1489 { 'command': 'qom-list-properties',
1490   'data': { 'typename': 'str'},
1491   'returns': [ 'ObjectPropertyInfo' ] }
1494 # @xen-set-global-dirty-log:
1496 # Enable or disable the global dirty log mode.
1498 # @enable: true to enable, false to disable.
1500 # Returns: nothing
1502 # Since: 1.3
1504 # Example:
1506 # -> { "execute": "xen-set-global-dirty-log",
1507 #      "arguments": { "enable": true } }
1508 # <- { "return": {} }
1511 { 'command': 'xen-set-global-dirty-log', 'data': { 'enable': 'bool' } }
1514 # @device_add:
1516 # @driver: the name of the new device's driver
1518 # @bus: the device's parent bus (device tree path)
1520 # @id: the device's ID, must be unique
1522 # Additional arguments depend on the type.
1524 # Add a device.
1526 # Notes:
1527 # 1. For detailed information about this command, please refer to the
1528 #    'docs/qdev-device-use.txt' file.
1530 # 2. It's possible to list device properties by running QEMU with the
1531 #    "-device DEVICE,help" command-line argument, where DEVICE is the
1532 #    device's name
1534 # Example:
1536 # -> { "execute": "device_add",
1537 #      "arguments": { "driver": "e1000", "id": "net1",
1538 #                     "bus": "pci.0",
1539 #                     "mac": "52:54:00:12:34:56" } }
1540 # <- { "return": {} }
1542 # TODO: This command effectively bypasses QAPI completely due to its
1543 # "additional arguments" business.  It shouldn't have been added to
1544 # the schema in this form.  It should be qapified properly, or
1545 # replaced by a properly qapified command.
1547 # Since: 0.13
1549 { 'command': 'device_add',
1550   'data': {'driver': 'str', '*bus': 'str', '*id': 'str'},
1551   'gen': false } # so we can get the additional arguments
1554 # @device_del:
1556 # Remove a device from a guest
1558 # @id: the device's ID or QOM path
1560 # Returns: Nothing on success
1561 #          If @id is not a valid device, DeviceNotFound
1563 # Notes: When this command completes, the device may not be removed from the
1564 #        guest.  Hot removal is an operation that requires guest cooperation.
1565 #        This command merely requests that the guest begin the hot removal
1566 #        process.  Completion of the device removal process is signaled with a
1567 #        DEVICE_DELETED event. Guest reset will automatically complete removal
1568 #        for all devices.
1570 # Since: 0.14.0
1572 # Example:
1574 # -> { "execute": "device_del",
1575 #      "arguments": { "id": "net1" } }
1576 # <- { "return": {} }
1578 # -> { "execute": "device_del",
1579 #      "arguments": { "id": "/machine/peripheral-anon/device[0]" } }
1580 # <- { "return": {} }
1583 { 'command': 'device_del', 'data': {'id': 'str'} }
1586 # @DEVICE_DELETED:
1588 # Emitted whenever the device removal completion is acknowledged by the guest.
1589 # At this point, it's safe to reuse the specified device ID. Device removal can
1590 # be initiated by the guest or by HMP/QMP commands.
1592 # @device: device name
1594 # @path: device path
1596 # Since: 1.5
1598 # Example:
1600 # <- { "event": "DEVICE_DELETED",
1601 #      "data": { "device": "virtio-net-pci-0",
1602 #                "path": "/machine/peripheral/virtio-net-pci-0" },
1603 #      "timestamp": { "seconds": 1265044230, "microseconds": 450486 } }
1606 { 'event': 'DEVICE_DELETED',
1607   'data': { '*device': 'str', 'path': 'str' } }
1610 # @DumpGuestMemoryFormat:
1612 # An enumeration of guest-memory-dump's format.
1614 # @elf: elf format
1616 # @kdump-zlib: kdump-compressed format with zlib-compressed
1618 # @kdump-lzo: kdump-compressed format with lzo-compressed
1620 # @kdump-snappy: kdump-compressed format with snappy-compressed
1622 # Since: 2.0
1624 { 'enum': 'DumpGuestMemoryFormat',
1625   'data': [ 'elf', 'kdump-zlib', 'kdump-lzo', 'kdump-snappy' ] }
1628 # @dump-guest-memory:
1630 # Dump guest's memory to vmcore. It is a synchronous operation that can take
1631 # very long depending on the amount of guest memory.
1633 # @paging: if true, do paging to get guest's memory mapping. This allows
1634 #          using gdb to process the core file.
1636 #          IMPORTANT: this option can make QEMU allocate several gigabytes
1637 #                     of RAM. This can happen for a large guest, or a
1638 #                     malicious guest pretending to be large.
1640 #          Also, paging=true has the following limitations:
1642 #             1. The guest may be in a catastrophic state or can have corrupted
1643 #                memory, which cannot be trusted
1644 #             2. The guest can be in real-mode even if paging is enabled. For
1645 #                example, the guest uses ACPI to sleep, and ACPI sleep state
1646 #                goes in real-mode
1647 #             3. Currently only supported on i386 and x86_64.
1649 # @protocol: the filename or file descriptor of the vmcore. The supported
1650 #            protocols are:
1652 #            1. file: the protocol starts with "file:", and the following
1653 #               string is the file's path.
1654 #            2. fd: the protocol starts with "fd:", and the following string
1655 #               is the fd's name.
1657 # @detach: if true, QMP will return immediately rather than
1658 #          waiting for the dump to finish. The user can track progress
1659 #          using "query-dump". (since 2.6).
1661 # @begin: if specified, the starting physical address.
1663 # @length: if specified, the memory size, in bytes. If you don't
1664 #          want to dump all guest's memory, please specify the start @begin
1665 #          and @length
1667 # @format: if specified, the format of guest memory dump. But non-elf
1668 #          format is conflict with paging and filter, ie. @paging, @begin and
1669 #          @length is not allowed to be specified with non-elf @format at the
1670 #          same time (since 2.0)
1672 # Note: All boolean arguments default to false
1674 # Returns: nothing on success
1676 # Since: 1.2
1678 # Example:
1680 # -> { "execute": "dump-guest-memory",
1681 #      "arguments": { "protocol": "fd:dump" } }
1682 # <- { "return": {} }
1685 { 'command': 'dump-guest-memory',
1686   'data': { 'paging': 'bool', 'protocol': 'str', '*detach': 'bool',
1687             '*begin': 'int', '*length': 'int',
1688             '*format': 'DumpGuestMemoryFormat'} }
1691 # @DumpStatus:
1693 # Describe the status of a long-running background guest memory dump.
1695 # @none: no dump-guest-memory has started yet.
1697 # @active: there is one dump running in background.
1699 # @completed: the last dump has finished successfully.
1701 # @failed: the last dump has failed.
1703 # Since: 2.6
1705 { 'enum': 'DumpStatus',
1706   'data': [ 'none', 'active', 'completed', 'failed' ] }
1709 # @DumpQueryResult:
1711 # The result format for 'query-dump'.
1713 # @status: enum of @DumpStatus, which shows current dump status
1715 # @completed: bytes written in latest dump (uncompressed)
1717 # @total: total bytes to be written in latest dump (uncompressed)
1719 # Since: 2.6
1721 { 'struct': 'DumpQueryResult',
1722   'data': { 'status': 'DumpStatus',
1723             'completed': 'int',
1724             'total': 'int' } }
1727 # @query-dump:
1729 # Query latest dump status.
1731 # Returns: A @DumpStatus object showing the dump status.
1733 # Since: 2.6
1735 # Example:
1737 # -> { "execute": "query-dump" }
1738 # <- { "return": { "status": "active", "completed": 1024000,
1739 #                  "total": 2048000 } }
1742 { 'command': 'query-dump', 'returns': 'DumpQueryResult' }
1745 # @DUMP_COMPLETED:
1747 # Emitted when background dump has completed
1749 # @result: final dump status
1751 # @error: human-readable error string that provides
1752 #         hint on why dump failed. Only presents on failure. The
1753 #         user should not try to interpret the error string.
1755 # Since: 2.6
1757 # Example:
1759 # { "event": "DUMP_COMPLETED",
1760 #   "data": {"result": {"total": 1090650112, "status": "completed",
1761 #                       "completed": 1090650112} } }
1764 { 'event': 'DUMP_COMPLETED' ,
1765   'data': { 'result': 'DumpQueryResult', '*error': 'str' } }
1768 # @DumpGuestMemoryCapability:
1770 # A list of the available formats for dump-guest-memory
1772 # Since: 2.0
1774 { 'struct': 'DumpGuestMemoryCapability',
1775   'data': {
1776       'formats': ['DumpGuestMemoryFormat'] } }
1779 # @query-dump-guest-memory-capability:
1781 # Returns the available formats for dump-guest-memory
1783 # Returns:  A @DumpGuestMemoryCapability object listing available formats for
1784 #           dump-guest-memory
1786 # Since: 2.0
1788 # Example:
1790 # -> { "execute": "query-dump-guest-memory-capability" }
1791 # <- { "return": { "formats":
1792 #                  ["elf", "kdump-zlib", "kdump-lzo", "kdump-snappy"] }
1795 { 'command': 'query-dump-guest-memory-capability',
1796   'returns': 'DumpGuestMemoryCapability' }
1799 # @dump-skeys:
1801 # Dump guest's storage keys
1803 # @filename: the path to the file to dump to
1805 # This command is only supported on s390 architecture.
1807 # Since: 2.5
1809 # Example:
1811 # -> { "execute": "dump-skeys",
1812 #      "arguments": { "filename": "/tmp/skeys" } }
1813 # <- { "return": {} }
1816 { 'command': 'dump-skeys',
1817   'data': { 'filename': 'str' } }
1820 # @object-add:
1822 # Create a QOM object.
1824 # @qom-type: the class name for the object to be created
1826 # @id: the name of the new object
1828 # @props: a dictionary of properties to be passed to the backend
1830 # Returns: Nothing on success
1831 #          Error if @qom-type is not a valid class name
1833 # Since: 2.0
1835 # Example:
1837 # -> { "execute": "object-add",
1838 #      "arguments": { "qom-type": "rng-random", "id": "rng1",
1839 #                     "props": { "filename": "/dev/hwrng" } } }
1840 # <- { "return": {} }
1843 { 'command': 'object-add',
1844   'data': {'qom-type': 'str', 'id': 'str', '*props': 'any'} }
1847 # @object-del:
1849 # Remove a QOM object.
1851 # @id: the name of the QOM object to remove
1853 # Returns: Nothing on success
1854 #          Error if @id is not a valid id for a QOM object
1856 # Since: 2.0
1858 # Example:
1860 # -> { "execute": "object-del", "arguments": { "id": "rng1" } }
1861 # <- { "return": {} }
1864 { 'command': 'object-del', 'data': {'id': 'str'} }
1867 # @getfd:
1869 # Receive a file descriptor via SCM rights and assign it a name
1871 # @fdname: file descriptor name
1873 # Returns: Nothing on success
1875 # Since: 0.14.0
1877 # Notes: If @fdname already exists, the file descriptor assigned to
1878 #        it will be closed and replaced by the received file
1879 #        descriptor.
1881 #        The 'closefd' command can be used to explicitly close the
1882 #        file descriptor when it is no longer needed.
1884 # Example:
1886 # -> { "execute": "getfd", "arguments": { "fdname": "fd1" } }
1887 # <- { "return": {} }
1890 { 'command': 'getfd', 'data': {'fdname': 'str'} }
1893 # @closefd:
1895 # Close a file descriptor previously passed via SCM rights
1897 # @fdname: file descriptor name
1899 # Returns: Nothing on success
1901 # Since: 0.14.0
1903 # Example:
1905 # -> { "execute": "closefd", "arguments": { "fdname": "fd1" } }
1906 # <- { "return": {} }
1909 { 'command': 'closefd', 'data': {'fdname': 'str'} }
1912 # @MachineInfo:
1914 # Information describing a machine.
1916 # @name: the name of the machine
1918 # @alias: an alias for the machine name
1920 # @is-default: whether the machine is default
1922 # @cpu-max: maximum number of CPUs supported by the machine type
1923 #           (since 1.5.0)
1925 # @hotpluggable-cpus: cpu hotplug via -device is supported (since 2.7.0)
1927 # Since: 1.2.0
1929 { 'struct': 'MachineInfo',
1930   'data': { 'name': 'str', '*alias': 'str',
1931             '*is-default': 'bool', 'cpu-max': 'int',
1932             'hotpluggable-cpus': 'bool'} }
1935 # @query-machines:
1937 # Return a list of supported machines
1939 # Returns: a list of MachineInfo
1941 # Since: 1.2.0
1943 { 'command': 'query-machines', 'returns': ['MachineInfo'] }
1946 # @CpuDefinitionInfo:
1948 # Virtual CPU definition.
1950 # @name: the name of the CPU definition
1952 # @migration-safe: whether a CPU definition can be safely used for
1953 #                  migration in combination with a QEMU compatibility machine
1954 #                  when migrating between different QMU versions and between
1955 #                  hosts with different sets of (hardware or software)
1956 #                  capabilities. If not provided, information is not available
1957 #                  and callers should not assume the CPU definition to be
1958 #                  migration-safe. (since 2.8)
1960 # @static: whether a CPU definition is static and will not change depending on
1961 #          QEMU version, machine type, machine options and accelerator options.
1962 #          A static model is always migration-safe. (since 2.8)
1964 # @unavailable-features: List of properties that prevent
1965 #                        the CPU model from running in the current
1966 #                        host. (since 2.8)
1967 # @typename: Type name that can be used as argument to @device-list-properties,
1968 #            to introspect properties configurable using -cpu or -global.
1969 #            (since 2.9)
1971 # @unavailable-features is a list of QOM property names that
1972 # represent CPU model attributes that prevent the CPU from running.
1973 # If the QOM property is read-only, that means there's no known
1974 # way to make the CPU model run in the current host. Implementations
1975 # that choose not to provide specific information return the
1976 # property name "type".
1977 # If the property is read-write, it means that it MAY be possible
1978 # to run the CPU model in the current host if that property is
1979 # changed. Management software can use it as hints to suggest or
1980 # choose an alternative for the user, or just to generate meaningful
1981 # error messages explaining why the CPU model can't be used.
1982 # If @unavailable-features is an empty list, the CPU model is
1983 # runnable using the current host and machine-type.
1984 # If @unavailable-features is not present, runnability
1985 # information for the CPU is not available.
1987 # Since: 1.2.0
1989 { 'struct': 'CpuDefinitionInfo',
1990   'data': { 'name': 'str', '*migration-safe': 'bool', 'static': 'bool',
1991             '*unavailable-features': [ 'str' ], 'typename': 'str' } }
1994 # @MemoryInfo:
1996 # Actual memory information in bytes.
1998 # @base-memory: size of "base" memory specified with command line
1999 #               option -m.
2001 # @plugged-memory: size of memory that can be hot-unplugged. This field
2002 #                  is omitted if target doesn't support memory hotplug
2003 #                  (i.e. CONFIG_MEM_HOTPLUG not defined on build time).
2005 # Since: 2.11.0
2007 { 'struct': 'MemoryInfo',
2008   'data'  : { 'base-memory': 'size', '*plugged-memory': 'size' } }
2011 # @query-memory-size-summary:
2013 # Return the amount of initially allocated and present hotpluggable (if
2014 # enabled) memory in bytes.
2016 # Example:
2018 # -> { "execute": "query-memory-size-summary" }
2019 # <- { "return": { "base-memory": 4294967296, "plugged-memory": 0 } }
2021 # Since: 2.11.0
2023 { 'command': 'query-memory-size-summary', 'returns': 'MemoryInfo' }
2026 # @query-cpu-definitions:
2028 # Return a list of supported virtual CPU definitions
2030 # Returns: a list of CpuDefInfo
2032 # Since: 1.2.0
2034 { 'command': 'query-cpu-definitions', 'returns': ['CpuDefinitionInfo'] }
2037 # @CpuModelInfo:
2039 # Virtual CPU model.
2041 # A CPU model consists of the name of a CPU definition, to which
2042 # delta changes are applied (e.g. features added/removed). Most magic values
2043 # that an architecture might require should be hidden behind the name.
2044 # However, if required, architectures can expose relevant properties.
2046 # @name: the name of the CPU definition the model is based on
2047 # @props: a dictionary of QOM properties to be applied
2049 # Since: 2.8.0
2051 { 'struct': 'CpuModelInfo',
2052   'data': { 'name': 'str',
2053             '*props': 'any' } }
2056 # @CpuModelExpansionType:
2058 # An enumeration of CPU model expansion types.
2060 # @static: Expand to a static CPU model, a combination of a static base
2061 #          model name and property delta changes. As the static base model will
2062 #          never change, the expanded CPU model will be the same, independent of
2063 #          independent of QEMU version, machine type, machine options, and
2064 #          accelerator options. Therefore, the resulting model can be used by
2065 #          tooling without having to specify a compatibility machine - e.g. when
2066 #          displaying the "host" model. static CPU models are migration-safe.
2068 # @full: Expand all properties. The produced model is not guaranteed to be
2069 #        migration-safe, but allows tooling to get an insight and work with
2070 #        model details.
2072 # Note: When a non-migration-safe CPU model is expanded in static mode, some
2073 # features enabled by the CPU model may be omitted, because they can't be
2074 # implemented by a static CPU model definition (e.g. cache info passthrough and
2075 # PMU passthrough in x86). If you need an accurate representation of the
2076 # features enabled by a non-migration-safe CPU model, use @full. If you need a
2077 # static representation that will keep ABI compatibility even when changing QEMU
2078 # version or machine-type, use @static (but keep in mind that some features may
2079 # be omitted).
2081 # Since: 2.8.0
2083 { 'enum': 'CpuModelExpansionType',
2084   'data': [ 'static', 'full' ] }
2088 # @CpuModelExpansionInfo:
2090 # The result of a cpu model expansion.
2092 # @model: the expanded CpuModelInfo.
2094 # Since: 2.8.0
2096 { 'struct': 'CpuModelExpansionInfo',
2097   'data': { 'model': 'CpuModelInfo' } }
2101 # @query-cpu-model-expansion:
2103 # Expands a given CPU model (or a combination of CPU model + additional options)
2104 # to different granularities, allowing tooling to get an understanding what a
2105 # specific CPU model looks like in QEMU under a certain configuration.
2107 # This interface can be used to query the "host" CPU model.
2109 # The data returned by this command may be affected by:
2111 # * QEMU version: CPU models may look different depending on the QEMU version.
2112 #   (Except for CPU models reported as "static" in query-cpu-definitions.)
2113 # * machine-type: CPU model  may look different depending on the machine-type.
2114 #   (Except for CPU models reported as "static" in query-cpu-definitions.)
2115 # * machine options (including accelerator): in some architectures, CPU models
2116 #   may look different depending on machine and accelerator options. (Except for
2117 #   CPU models reported as "static" in query-cpu-definitions.)
2118 # * "-cpu" arguments and global properties: arguments to the -cpu option and
2119 #   global properties may affect expansion of CPU models. Using
2120 #   query-cpu-model-expansion while using these is not advised.
2122 # Some architectures may not support all expansion types. s390x supports
2123 # "full" and "static".
2125 # Returns: a CpuModelExpansionInfo. Returns an error if expanding CPU models is
2126 #          not supported, if the model cannot be expanded, if the model contains
2127 #          an unknown CPU definition name, unknown properties or properties
2128 #          with a wrong type. Also returns an error if an expansion type is
2129 #          not supported.
2131 # Since: 2.8.0
2133 { 'command': 'query-cpu-model-expansion',
2134   'data': { 'type': 'CpuModelExpansionType',
2135             'model': 'CpuModelInfo' },
2136   'returns': 'CpuModelExpansionInfo' }
2139 # @CpuModelCompareResult:
2141 # An enumeration of CPU model comparison results. The result is usually
2142 # calculated using e.g. CPU features or CPU generations.
2144 # @incompatible: If model A is incompatible to model B, model A is not
2145 #                guaranteed to run where model B runs and the other way around.
2147 # @identical: If model A is identical to model B, model A is guaranteed to run
2148 #             where model B runs and the other way around.
2150 # @superset: If model A is a superset of model B, model B is guaranteed to run
2151 #            where model A runs. There are no guarantees about the other way.
2153 # @subset: If model A is a subset of model B, model A is guaranteed to run
2154 #          where model B runs. There are no guarantees about the other way.
2156 # Since: 2.8.0
2158 { 'enum': 'CpuModelCompareResult',
2159   'data': [ 'incompatible', 'identical', 'superset', 'subset' ] }
2162 # @CpuModelCompareInfo:
2164 # The result of a CPU model comparison.
2166 # @result: The result of the compare operation.
2167 # @responsible-properties: List of properties that led to the comparison result
2168 #                          not being identical.
2170 # @responsible-properties is a list of QOM property names that led to
2171 # both CPUs not being detected as identical. For identical models, this
2172 # list is empty.
2173 # If a QOM property is read-only, that means there's no known way to make the
2174 # CPU models identical. If the special property name "type" is included, the
2175 # models are by definition not identical and cannot be made identical.
2177 # Since: 2.8.0
2179 { 'struct': 'CpuModelCompareInfo',
2180   'data': {'result': 'CpuModelCompareResult',
2181            'responsible-properties': ['str']
2182           }
2186 # @query-cpu-model-comparison:
2188 # Compares two CPU models, returning how they compare in a specific
2189 # configuration. The results indicates how both models compare regarding
2190 # runnability. This result can be used by tooling to make decisions if a
2191 # certain CPU model will run in a certain configuration or if a compatible
2192 # CPU model has to be created by baselining.
2194 # Usually, a CPU model is compared against the maximum possible CPU model
2195 # of a certain configuration (e.g. the "host" model for KVM). If that CPU
2196 # model is identical or a subset, it will run in that configuration.
2198 # The result returned by this command may be affected by:
2200 # * QEMU version: CPU models may look different depending on the QEMU version.
2201 #   (Except for CPU models reported as "static" in query-cpu-definitions.)
2202 # * machine-type: CPU model may look different depending on the machine-type.
2203 #   (Except for CPU models reported as "static" in query-cpu-definitions.)
2204 # * machine options (including accelerator): in some architectures, CPU models
2205 #   may look different depending on machine and accelerator options. (Except for
2206 #   CPU models reported as "static" in query-cpu-definitions.)
2207 # * "-cpu" arguments and global properties: arguments to the -cpu option and
2208 #   global properties may affect expansion of CPU models. Using
2209 #   query-cpu-model-expansion while using these is not advised.
2211 # Some architectures may not support comparing CPU models. s390x supports
2212 # comparing CPU models.
2214 # Returns: a CpuModelBaselineInfo. Returns an error if comparing CPU models is
2215 #          not supported, if a model cannot be used, if a model contains
2216 #          an unknown cpu definition name, unknown properties or properties
2217 #          with wrong types.
2219 # Since: 2.8.0
2221 { 'command': 'query-cpu-model-comparison',
2222   'data': { 'modela': 'CpuModelInfo', 'modelb': 'CpuModelInfo' },
2223   'returns': 'CpuModelCompareInfo' }
2226 # @CpuModelBaselineInfo:
2228 # The result of a CPU model baseline.
2230 # @model: the baselined CpuModelInfo.
2232 # Since: 2.8.0
2234 { 'struct': 'CpuModelBaselineInfo',
2235   'data': { 'model': 'CpuModelInfo' } }
2238 # @query-cpu-model-baseline:
2240 # Baseline two CPU models, creating a compatible third model. The created
2241 # model will always be a static, migration-safe CPU model (see "static"
2242 # CPU model expansion for details).
2244 # This interface can be used by tooling to create a compatible CPU model out
2245 # two CPU models. The created CPU model will be identical to or a subset of
2246 # both CPU models when comparing them. Therefore, the created CPU model is
2247 # guaranteed to run where the given CPU models run.
2249 # The result returned by this command may be affected by:
2251 # * QEMU version: CPU models may look different depending on the QEMU version.
2252 #   (Except for CPU models reported as "static" in query-cpu-definitions.)
2253 # * machine-type: CPU model may look different depending on the machine-type.
2254 #   (Except for CPU models reported as "static" in query-cpu-definitions.)
2255 # * machine options (including accelerator): in some architectures, CPU models
2256 #   may look different depending on machine and accelerator options. (Except for
2257 #   CPU models reported as "static" in query-cpu-definitions.)
2258 # * "-cpu" arguments and global properties: arguments to the -cpu option and
2259 #   global properties may affect expansion of CPU models. Using
2260 #   query-cpu-model-expansion while using these is not advised.
2262 # Some architectures may not support baselining CPU models. s390x supports
2263 # baselining CPU models.
2265 # Returns: a CpuModelBaselineInfo. Returns an error if baselining CPU models is
2266 #          not supported, if a model cannot be used, if a model contains
2267 #          an unknown cpu definition name, unknown properties or properties
2268 #          with wrong types.
2270 # Since: 2.8.0
2272 { 'command': 'query-cpu-model-baseline',
2273   'data': { 'modela': 'CpuModelInfo',
2274             'modelb': 'CpuModelInfo' },
2275   'returns': 'CpuModelBaselineInfo' }
2278 # @AddfdInfo:
2280 # Information about a file descriptor that was added to an fd set.
2282 # @fdset-id: The ID of the fd set that @fd was added to.
2284 # @fd: The file descriptor that was received via SCM rights and
2285 #      added to the fd set.
2287 # Since: 1.2.0
2289 { 'struct': 'AddfdInfo', 'data': {'fdset-id': 'int', 'fd': 'int'} }
2292 # @add-fd:
2294 # Add a file descriptor, that was passed via SCM rights, to an fd set.
2296 # @fdset-id: The ID of the fd set to add the file descriptor to.
2298 # @opaque: A free-form string that can be used to describe the fd.
2300 # Returns: @AddfdInfo on success
2302 #          If file descriptor was not received, FdNotSupplied
2304 #          If @fdset-id is a negative value, InvalidParameterValue
2306 # Notes: The list of fd sets is shared by all monitor connections.
2308 #        If @fdset-id is not specified, a new fd set will be created.
2310 # Since: 1.2.0
2312 # Example:
2314 # -> { "execute": "add-fd", "arguments": { "fdset-id": 1 } }
2315 # <- { "return": { "fdset-id": 1, "fd": 3 } }
2318 { 'command': 'add-fd', 'data': {'*fdset-id': 'int', '*opaque': 'str'},
2319   'returns': 'AddfdInfo' }
2322 # @remove-fd:
2324 # Remove a file descriptor from an fd set.
2326 # @fdset-id: The ID of the fd set that the file descriptor belongs to.
2328 # @fd: The file descriptor that is to be removed.
2330 # Returns: Nothing on success
2331 #          If @fdset-id or @fd is not found, FdNotFound
2333 # Since: 1.2.0
2335 # Notes: The list of fd sets is shared by all monitor connections.
2337 #        If @fd is not specified, all file descriptors in @fdset-id
2338 #        will be removed.
2340 # Example:
2342 # -> { "execute": "remove-fd", "arguments": { "fdset-id": 1, "fd": 3 } }
2343 # <- { "return": {} }
2346 { 'command': 'remove-fd', 'data': {'fdset-id': 'int', '*fd': 'int'} }
2349 # @FdsetFdInfo:
2351 # Information about a file descriptor that belongs to an fd set.
2353 # @fd: The file descriptor value.
2355 # @opaque: A free-form string that can be used to describe the fd.
2357 # Since: 1.2.0
2359 { 'struct': 'FdsetFdInfo',
2360   'data': {'fd': 'int', '*opaque': 'str'} }
2363 # @FdsetInfo:
2365 # Information about an fd set.
2367 # @fdset-id: The ID of the fd set.
2369 # @fds: A list of file descriptors that belong to this fd set.
2371 # Since: 1.2.0
2373 { 'struct': 'FdsetInfo',
2374   'data': {'fdset-id': 'int', 'fds': ['FdsetFdInfo']} }
2377 # @query-fdsets:
2379 # Return information describing all fd sets.
2381 # Returns: A list of @FdsetInfo
2383 # Since: 1.2.0
2385 # Note: The list of fd sets is shared by all monitor connections.
2387 # Example:
2389 # -> { "execute": "query-fdsets" }
2390 # <- { "return": [
2391 #        {
2392 #          "fds": [
2393 #            {
2394 #              "fd": 30,
2395 #              "opaque": "rdonly:/path/to/file"
2396 #            },
2397 #            {
2398 #              "fd": 24,
2399 #              "opaque": "rdwr:/path/to/file"
2400 #            }
2401 #          ],
2402 #          "fdset-id": 1
2403 #        },
2404 #        {
2405 #          "fds": [
2406 #            {
2407 #              "fd": 28
2408 #            },
2409 #            {
2410 #              "fd": 29
2411 #            }
2412 #          ],
2413 #          "fdset-id": 0
2414 #        }
2415 #      ]
2416 #    }
2419 { 'command': 'query-fdsets', 'returns': ['FdsetInfo'] }
2422 # @TargetInfo:
2424 # Information describing the QEMU target.
2426 # @arch: the target architecture (eg "x86_64", "i386", etc)
2428 # Since: 1.2.0
2430 { 'struct': 'TargetInfo',
2431   'data': { 'arch': 'str' } }
2434 # @query-target:
2436 # Return information about the target for this QEMU
2438 # Returns: TargetInfo
2440 # Since: 1.2.0
2442 { 'command': 'query-target', 'returns': 'TargetInfo' }
2445 # @AcpiTableOptions:
2447 # Specify an ACPI table on the command line to load.
2449 # At most one of @file and @data can be specified. The list of files specified
2450 # by any one of them is loaded and concatenated in order. If both are omitted,
2451 # @data is implied.
2453 # Other fields / optargs can be used to override fields of the generic ACPI
2454 # table header; refer to the ACPI specification 5.0, section 5.2.6 System
2455 # Description Table Header. If a header field is not overridden, then the
2456 # corresponding value from the concatenated blob is used (in case of @file), or
2457 # it is filled in with a hard-coded value (in case of @data).
2459 # String fields are copied into the matching ACPI member from lowest address
2460 # upwards, and silently truncated / NUL-padded to length.
2462 # @sig: table signature / identifier (4 bytes)
2464 # @rev: table revision number (dependent on signature, 1 byte)
2466 # @oem_id: OEM identifier (6 bytes)
2468 # @oem_table_id: OEM table identifier (8 bytes)
2470 # @oem_rev: OEM-supplied revision number (4 bytes)
2472 # @asl_compiler_id: identifier of the utility that created the table
2473 #                   (4 bytes)
2475 # @asl_compiler_rev: revision number of the utility that created the
2476 #                    table (4 bytes)
2478 # @file: colon (:) separated list of pathnames to load and
2479 #        concatenate as table data. The resultant binary blob is expected to
2480 #        have an ACPI table header. At least one file is required. This field
2481 #        excludes @data.
2483 # @data: colon (:) separated list of pathnames to load and
2484 #        concatenate as table data. The resultant binary blob must not have an
2485 #        ACPI table header. At least one file is required. This field excludes
2486 #        @file.
2488 # Since: 1.5
2490 { 'struct': 'AcpiTableOptions',
2491   'data': {
2492     '*sig':               'str',
2493     '*rev':               'uint8',
2494     '*oem_id':            'str',
2495     '*oem_table_id':      'str',
2496     '*oem_rev':           'uint32',
2497     '*asl_compiler_id':   'str',
2498     '*asl_compiler_rev':  'uint32',
2499     '*file':              'str',
2500     '*data':              'str' }}
2503 # @CommandLineParameterType:
2505 # Possible types for an option parameter.
2507 # @string: accepts a character string
2509 # @boolean: accepts "on" or "off"
2511 # @number: accepts a number
2513 # @size: accepts a number followed by an optional suffix (K)ilo,
2514 #        (M)ega, (G)iga, (T)era
2516 # Since: 1.5
2518 { 'enum': 'CommandLineParameterType',
2519   'data': ['string', 'boolean', 'number', 'size'] }
2522 # @CommandLineParameterInfo:
2524 # Details about a single parameter of a command line option.
2526 # @name: parameter name
2528 # @type: parameter @CommandLineParameterType
2530 # @help: human readable text string, not suitable for parsing.
2532 # @default: default value string (since 2.1)
2534 # Since: 1.5
2536 { 'struct': 'CommandLineParameterInfo',
2537   'data': { 'name': 'str',
2538             'type': 'CommandLineParameterType',
2539             '*help': 'str',
2540             '*default': 'str' } }
2543 # @CommandLineOptionInfo:
2545 # Details about a command line option, including its list of parameter details
2547 # @option: option name
2549 # @parameters: an array of @CommandLineParameterInfo
2551 # Since: 1.5
2553 { 'struct': 'CommandLineOptionInfo',
2554   'data': { 'option': 'str', 'parameters': ['CommandLineParameterInfo'] } }
2557 # @query-command-line-options:
2559 # Query command line option schema.
2561 # @option: option name
2563 # Returns: list of @CommandLineOptionInfo for all options (or for the given
2564 #          @option).  Returns an error if the given @option doesn't exist.
2566 # Since: 1.5
2568 # Example:
2570 # -> { "execute": "query-command-line-options",
2571 #      "arguments": { "option": "option-rom" } }
2572 # <- { "return": [
2573 #         {
2574 #             "parameters": [
2575 #                 {
2576 #                     "name": "romfile",
2577 #                     "type": "string"
2578 #                 },
2579 #                 {
2580 #                     "name": "bootindex",
2581 #                     "type": "number"
2582 #                 }
2583 #             ],
2584 #             "option": "option-rom"
2585 #         }
2586 #      ]
2587 #    }
2590 {'command': 'query-command-line-options', 'data': { '*option': 'str' },
2591  'returns': ['CommandLineOptionInfo'] }
2594 # @X86CPURegister32:
2596 # A X86 32-bit register
2598 # Since: 1.5
2600 { 'enum': 'X86CPURegister32',
2601   'data': [ 'EAX', 'EBX', 'ECX', 'EDX', 'ESP', 'EBP', 'ESI', 'EDI' ] }
2604 # @X86CPUFeatureWordInfo:
2606 # Information about a X86 CPU feature word
2608 # @cpuid-input-eax: Input EAX value for CPUID instruction for that feature word
2610 # @cpuid-input-ecx: Input ECX value for CPUID instruction for that
2611 #                   feature word
2613 # @cpuid-register: Output register containing the feature bits
2615 # @features: value of output register, containing the feature bits
2617 # Since: 1.5
2619 { 'struct': 'X86CPUFeatureWordInfo',
2620   'data': { 'cpuid-input-eax': 'int',
2621             '*cpuid-input-ecx': 'int',
2622             'cpuid-register': 'X86CPURegister32',
2623             'features': 'int' } }
2626 # @DummyForceArrays:
2628 # Not used by QMP; hack to let us use X86CPUFeatureWordInfoList internally
2630 # Since: 2.5
2632 { 'struct': 'DummyForceArrays',
2633   'data': { 'unused': ['X86CPUFeatureWordInfo'] } }
2637 # @NumaOptionsType:
2639 # @node: NUMA nodes configuration
2641 # @dist: NUMA distance configuration (since 2.10)
2643 # @cpu: property based CPU(s) to node mapping (Since: 2.10)
2645 # Since: 2.1
2647 { 'enum': 'NumaOptionsType',
2648   'data': [ 'node', 'dist', 'cpu' ] }
2651 # @NumaOptions:
2653 # A discriminated record of NUMA options. (for OptsVisitor)
2655 # Since: 2.1
2657 { 'union': 'NumaOptions',
2658   'base': { 'type': 'NumaOptionsType' },
2659   'discriminator': 'type',
2660   'data': {
2661     'node': 'NumaNodeOptions',
2662     'dist': 'NumaDistOptions',
2663     'cpu': 'NumaCpuOptions' }}
2666 # @NumaNodeOptions:
2668 # Create a guest NUMA node. (for OptsVisitor)
2670 # @nodeid: NUMA node ID (increase by 1 from 0 if omitted)
2672 # @cpus: VCPUs belonging to this node (assign VCPUS round-robin
2673 #         if omitted)
2675 # @mem: memory size of this node; mutually exclusive with @memdev.
2676 #       Equally divide total memory among nodes if both @mem and @memdev are
2677 #       omitted.
2679 # @memdev: memory backend object.  If specified for one node,
2680 #          it must be specified for all nodes.
2682 # Since: 2.1
2684 { 'struct': 'NumaNodeOptions',
2685   'data': {
2686    '*nodeid': 'uint16',
2687    '*cpus':   ['uint16'],
2688    '*mem':    'size',
2689    '*memdev': 'str' }}
2692 # @NumaDistOptions:
2694 # Set the distance between 2 NUMA nodes.
2696 # @src: source NUMA node.
2698 # @dst: destination NUMA node.
2700 # @val: NUMA distance from source node to destination node.
2701 #       When a node is unreachable from another node, set the distance
2702 #       between them to 255.
2704 # Since: 2.10
2706 { 'struct': 'NumaDistOptions',
2707   'data': {
2708    'src': 'uint16',
2709    'dst': 'uint16',
2710    'val': 'uint8' }}
2713 # @NumaCpuOptions:
2715 # Option "-numa cpu" overrides default cpu to node mapping.
2716 # It accepts the same set of cpu properties as returned by
2717 # query-hotpluggable-cpus[].props, where node-id could be used to
2718 # override default node mapping.
2720 # Since: 2.10
2722 { 'struct': 'NumaCpuOptions',
2723    'base': 'CpuInstanceProperties',
2724    'data' : {} }
2727 # @HostMemPolicy:
2729 # Host memory policy types
2731 # @default: restore default policy, remove any nondefault policy
2733 # @preferred: set the preferred host nodes for allocation
2735 # @bind: a strict policy that restricts memory allocation to the
2736 #        host nodes specified
2738 # @interleave: memory allocations are interleaved across the set
2739 #              of host nodes specified
2741 # Since: 2.1
2743 { 'enum': 'HostMemPolicy',
2744   'data': [ 'default', 'preferred', 'bind', 'interleave' ] }
2747 # @Memdev:
2749 # Information about memory backend
2751 # @id: backend's ID if backend has 'id' property (since 2.9)
2753 # @size: memory backend size
2755 # @merge: enables or disables memory merge support
2757 # @dump: includes memory backend's memory in a core dump or not
2759 # @prealloc: enables or disables memory preallocation
2761 # @host-nodes: host nodes for its memory policy
2763 # @policy: memory policy of memory backend
2765 # Since: 2.1
2767 { 'struct': 'Memdev',
2768   'data': {
2769     '*id':        'str',
2770     'size':       'size',
2771     'merge':      'bool',
2772     'dump':       'bool',
2773     'prealloc':   'bool',
2774     'host-nodes': ['uint16'],
2775     'policy':     'HostMemPolicy' }}
2778 # @query-memdev:
2780 # Returns information for all memory backends.
2782 # Returns: a list of @Memdev.
2784 # Since: 2.1
2786 # Example:
2788 # -> { "execute": "query-memdev" }
2789 # <- { "return": [
2790 #        {
2791 #          "id": "mem1",
2792 #          "size": 536870912,
2793 #          "merge": false,
2794 #          "dump": true,
2795 #          "prealloc": false,
2796 #          "host-nodes": [0, 1],
2797 #          "policy": "bind"
2798 #        },
2799 #        {
2800 #          "size": 536870912,
2801 #          "merge": false,
2802 #          "dump": true,
2803 #          "prealloc": true,
2804 #          "host-nodes": [2, 3],
2805 #          "policy": "preferred"
2806 #        }
2807 #      ]
2808 #    }
2811 { 'command': 'query-memdev', 'returns': ['Memdev'] }
2814 # @PCDIMMDeviceInfo:
2816 # PCDIMMDevice state information
2818 # @id: device's ID
2820 # @addr: physical address, where device is mapped
2822 # @size: size of memory that the device provides
2824 # @slot: slot number at which device is plugged in
2826 # @node: NUMA node number where device is plugged in
2828 # @memdev: memory backend linked with device
2830 # @hotplugged: true if device was hotplugged
2832 # @hotpluggable: true if device if could be added/removed while machine is running
2834 # Since: 2.1
2836 { 'struct': 'PCDIMMDeviceInfo',
2837   'data': { '*id': 'str',
2838             'addr': 'int',
2839             'size': 'int',
2840             'slot': 'int',
2841             'node': 'int',
2842             'memdev': 'str',
2843             'hotplugged': 'bool',
2844             'hotpluggable': 'bool'
2845           }
2849 # @MemoryDeviceInfo:
2851 # Union containing information about a memory device
2853 # Since: 2.1
2855 { 'union': 'MemoryDeviceInfo', 'data': {'dimm': 'PCDIMMDeviceInfo'} }
2858 # @query-memory-devices:
2860 # Lists available memory devices and their state
2862 # Since: 2.1
2864 # Example:
2866 # -> { "execute": "query-memory-devices" }
2867 # <- { "return": [ { "data":
2868 #                       { "addr": 5368709120,
2869 #                         "hotpluggable": true,
2870 #                         "hotplugged": true,
2871 #                         "id": "d1",
2872 #                         "memdev": "/objects/memX",
2873 #                         "node": 0,
2874 #                         "size": 1073741824,
2875 #                         "slot": 0},
2876 #                    "type": "dimm"
2877 #                  } ] }
2880 { 'command': 'query-memory-devices', 'returns': ['MemoryDeviceInfo'] }
2883 # @MEM_UNPLUG_ERROR:
2885 # Emitted when memory hot unplug error occurs.
2887 # @device: device name
2889 # @msg: Informative message
2891 # Since: 2.4
2893 # Example:
2895 # <- { "event": "MEM_UNPLUG_ERROR"
2896 #      "data": { "device": "dimm1",
2897 #                "msg": "acpi: device unplug for unsupported device"
2898 #      },
2899 #      "timestamp": { "seconds": 1265044230, "microseconds": 450486 } }
2902 { 'event': 'MEM_UNPLUG_ERROR',
2903   'data': { 'device': 'str', 'msg': 'str' } }
2906 # @ACPISlotType:
2908 # @DIMM: memory slot
2909 # @CPU: logical CPU slot (since 2.7)
2911 { 'enum': 'ACPISlotType', 'data': [ 'DIMM', 'CPU' ] }
2914 # @ACPIOSTInfo:
2916 # OSPM Status Indication for a device
2917 # For description of possible values of @source and @status fields
2918 # see "_OST (OSPM Status Indication)" chapter of ACPI5.0 spec.
2920 # @device: device ID associated with slot
2922 # @slot: slot ID, unique per slot of a given @slot-type
2924 # @slot-type: type of the slot
2926 # @source: an integer containing the source event
2928 # @status: an integer containing the status code
2930 # Since: 2.1
2932 { 'struct': 'ACPIOSTInfo',
2933   'data'  : { '*device': 'str',
2934               'slot': 'str',
2935               'slot-type': 'ACPISlotType',
2936               'source': 'int',
2937               'status': 'int' } }
2940 # @query-acpi-ospm-status:
2942 # Return a list of ACPIOSTInfo for devices that support status
2943 # reporting via ACPI _OST method.
2945 # Since: 2.1
2947 # Example:
2949 # -> { "execute": "query-acpi-ospm-status" }
2950 # <- { "return": [ { "device": "d1", "slot": "0", "slot-type": "DIMM", "source": 1, "status": 0},
2951 #                  { "slot": "1", "slot-type": "DIMM", "source": 0, "status": 0},
2952 #                  { "slot": "2", "slot-type": "DIMM", "source": 0, "status": 0},
2953 #                  { "slot": "3", "slot-type": "DIMM", "source": 0, "status": 0}
2954 #    ]}
2957 { 'command': 'query-acpi-ospm-status', 'returns': ['ACPIOSTInfo'] }
2960 # @ACPI_DEVICE_OST:
2962 # Emitted when guest executes ACPI _OST method.
2964 # @info: OSPM Status Indication
2966 # Since: 2.1
2968 # Example:
2970 # <- { "event": "ACPI_DEVICE_OST",
2971 #      "data": { "device": "d1", "slot": "0",
2972 #                "slot-type": "DIMM", "source": 1, "status": 0 } }
2975 { 'event': 'ACPI_DEVICE_OST',
2976      'data': { 'info': 'ACPIOSTInfo' } }
2979 # @rtc-reset-reinjection:
2981 # This command will reset the RTC interrupt reinjection backlog.
2982 # Can be used if another mechanism to synchronize guest time
2983 # is in effect, for example QEMU guest agent's guest-set-time
2984 # command.
2986 # Since: 2.1
2988 # Example:
2990 # -> { "execute": "rtc-reset-reinjection" }
2991 # <- { "return": {} }
2994 { 'command': 'rtc-reset-reinjection' }
2997 # @RTC_CHANGE:
2999 # Emitted when the guest changes the RTC time.
3001 # @offset: offset between base RTC clock (as specified by -rtc base), and
3002 #          new RTC clock value
3004 # Note: This event is rate-limited.
3006 # Since: 0.13.0
3008 # Example:
3010 # <-   { "event": "RTC_CHANGE",
3011 #        "data": { "offset": 78 },
3012 #        "timestamp": { "seconds": 1267020223, "microseconds": 435656 } }
3015 { 'event': 'RTC_CHANGE',
3016   'data': { 'offset': 'int' } }
3019 # @ReplayMode:
3021 # Mode of the replay subsystem.
3023 # @none: normal execution mode. Replay or record are not enabled.
3025 # @record: record mode. All non-deterministic data is written into the
3026 #          replay log.
3028 # @play: replay mode. Non-deterministic data required for system execution
3029 #        is read from the log.
3031 # Since: 2.5
3033 { 'enum': 'ReplayMode',
3034   'data': [ 'none', 'record', 'play' ] }
3037 # @xen-load-devices-state:
3039 # Load the state of all devices from file. The RAM and the block devices
3040 # of the VM are not loaded by this command.
3042 # @filename: the file to load the state of the devices from as binary
3043 # data. See xen-save-devices-state.txt for a description of the binary
3044 # format.
3046 # Since: 2.7
3048 # Example:
3050 # -> { "execute": "xen-load-devices-state",
3051 #      "arguments": { "filename": "/tmp/resume" } }
3052 # <- { "return": {} }
3055 { 'command': 'xen-load-devices-state', 'data': {'filename': 'str'} }
3058 # @GICCapability:
3060 # The struct describes capability for a specific GIC (Generic
3061 # Interrupt Controller) version. These bits are not only decided by
3062 # QEMU/KVM software version, but also decided by the hardware that
3063 # the program is running upon.
3065 # @version:  version of GIC to be described. Currently, only 2 and 3
3066 #            are supported.
3068 # @emulated: whether current QEMU/hardware supports emulated GIC
3069 #            device in user space.
3071 # @kernel:   whether current QEMU/hardware supports hardware
3072 #            accelerated GIC device in kernel.
3074 # Since: 2.6
3076 { 'struct': 'GICCapability',
3077   'data': { 'version': 'int',
3078             'emulated': 'bool',
3079             'kernel': 'bool' } }
3082 # @query-gic-capabilities:
3084 # This command is ARM-only. It will return a list of GICCapability
3085 # objects that describe its capability bits.
3087 # Returns: a list of GICCapability objects.
3089 # Since: 2.6
3091 # Example:
3093 # -> { "execute": "query-gic-capabilities" }
3094 # <- { "return": [{ "version": 2, "emulated": true, "kernel": false },
3095 #                 { "version": 3, "emulated": false, "kernel": true } ] }
3098 { 'command': 'query-gic-capabilities', 'returns': ['GICCapability'] }
3101 # @CpuInstanceProperties:
3103 # List of properties to be used for hotplugging a CPU instance,
3104 # it should be passed by management with device_add command when
3105 # a CPU is being hotplugged.
3107 # @node-id: NUMA node ID the CPU belongs to
3108 # @socket-id: socket number within node/board the CPU belongs to
3109 # @core-id: core number within socket the CPU belongs to
3110 # @thread-id: thread number within core the CPU belongs to
3112 # Note: currently there are 4 properties that could be present
3113 # but management should be prepared to pass through other
3114 # properties with device_add command to allow for future
3115 # interface extension. This also requires the filed names to be kept in
3116 # sync with the properties passed to -device/device_add.
3118 # Since: 2.7
3120 { 'struct': 'CpuInstanceProperties',
3121   'data': { '*node-id': 'int',
3122             '*socket-id': 'int',
3123             '*core-id': 'int',
3124             '*thread-id': 'int'
3125   }
3129 # @HotpluggableCPU:
3131 # @type: CPU object type for usage with device_add command
3132 # @props: list of properties to be used for hotplugging CPU
3133 # @vcpus-count: number of logical VCPU threads @HotpluggableCPU provides
3134 # @qom-path: link to existing CPU object if CPU is present or
3135 #            omitted if CPU is not present.
3137 # Since: 2.7
3139 { 'struct': 'HotpluggableCPU',
3140   'data': { 'type': 'str',
3141             'vcpus-count': 'int',
3142             'props': 'CpuInstanceProperties',
3143             '*qom-path': 'str'
3144           }
3148 # @query-hotpluggable-cpus:
3150 # Returns: a list of HotpluggableCPU objects.
3152 # Since: 2.7
3154 # Example:
3156 # For pseries machine type started with -smp 2,cores=2,maxcpus=4 -cpu POWER8:
3158 # -> { "execute": "query-hotpluggable-cpus" }
3159 # <- {"return": [
3160 #      { "props": { "core": 8 }, "type": "POWER8-spapr-cpu-core",
3161 #        "vcpus-count": 1 },
3162 #      { "props": { "core": 0 }, "type": "POWER8-spapr-cpu-core",
3163 #        "vcpus-count": 1, "qom-path": "/machine/unattached/device[0]"}
3164 #    ]}'
3166 # For pc machine type started with -smp 1,maxcpus=2:
3168 # -> { "execute": "query-hotpluggable-cpus" }
3169 # <- {"return": [
3170 #      {
3171 #         "type": "qemu64-x86_64-cpu", "vcpus-count": 1,
3172 #         "props": {"core-id": 0, "socket-id": 1, "thread-id": 0}
3173 #      },
3174 #      {
3175 #         "qom-path": "/machine/unattached/device[0]",
3176 #         "type": "qemu64-x86_64-cpu", "vcpus-count": 1,
3177 #         "props": {"core-id": 0, "socket-id": 0, "thread-id": 0}
3178 #      }
3179 #    ]}
3181 # For s390x-virtio-ccw machine type started with -smp 1,maxcpus=2 -cpu qemu
3182 # (Since: 2.11):
3184 # -> { "execute": "query-hotpluggable-cpus" }
3185 # <- {"return": [
3186 #      {
3187 #         "type": "qemu-s390x-cpu", "vcpus-count": 1,
3188 #         "props": { "core-id": 1 }
3189 #      },
3190 #      {
3191 #         "qom-path": "/machine/unattached/device[0]",
3192 #         "type": "qemu-s390x-cpu", "vcpus-count": 1,
3193 #         "props": { "core-id": 0 }
3194 #      }
3195 #    ]}
3198 { 'command': 'query-hotpluggable-cpus', 'returns': ['HotpluggableCPU'] }
3201 # @GuidInfo:
3203 # GUID information.
3205 # @guid: the globally unique identifier
3207 # Since: 2.9
3209 { 'struct': 'GuidInfo', 'data': {'guid': 'str'} }
3212 # @query-vm-generation-id:
3214 # Show Virtual Machine Generation ID
3216 # Since: 2.9
3218 { 'command': 'query-vm-generation-id', 'returns': 'GuidInfo' }