qmp: add set-numa-node command
[qemu/armbru.git] / qapi / misc.json
blob02bb295c13338b18e919d073206d62870fd5f265
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' }
123 # @CommandInfo:
125 # Information about a QMP command
127 # @name: The command name
129 # Since: 0.14.0
131 { 'struct': 'CommandInfo', 'data': {'name': 'str'} }
134 # @query-commands:
136 # Return a list of supported QMP commands by this server
138 # Returns: A list of @CommandInfo for all supported commands
140 # Since: 0.14.0
142 # Example:
144 # -> { "execute": "query-commands" }
145 # <- {
146 #      "return":[
147 #         {
148 #            "name":"query-balloon"
149 #         },
150 #         {
151 #            "name":"system_powerdown"
152 #         }
153 #      ]
154 #    }
156 # Note: This example has been shortened as the real response is too long.
159 { 'command': 'query-commands', 'returns': ['CommandInfo'],
160   'allow-preconfig': true }
163 # @LostTickPolicy:
165 # Policy for handling lost ticks in timer devices.
167 # @discard: throw away the missed tick(s) and continue with future injection
168 #           normally.  Guest time may be delayed, unless the OS has explicit
169 #           handling of lost ticks
171 # @delay: continue to deliver ticks at the normal rate.  Guest time will be
172 #         delayed due to the late tick
174 # @merge: merge the missed tick(s) into one tick and inject.  Guest time
175 #         may be delayed, depending on how the OS reacts to the merging
176 #         of ticks
178 # @slew: deliver ticks at a higher rate to catch up with the missed tick. The
179 #        guest time should not be delayed once catchup is complete.
181 # Since: 2.0
183 { 'enum': 'LostTickPolicy',
184   'data': ['discard', 'delay', 'merge', 'slew' ] }
187 # @add_client:
189 # Allow client connections for VNC, Spice and socket based
190 # character devices to be passed in to QEMU via SCM_RIGHTS.
192 # @protocol: protocol name. Valid names are "vnc", "spice" or the
193 #            name of a character device (eg. from -chardev id=XXXX)
195 # @fdname: file descriptor name previously passed via 'getfd' command
197 # @skipauth: whether to skip authentication. Only applies
198 #            to "vnc" and "spice" protocols
200 # @tls: whether to perform TLS. Only applies to the "spice"
201 #       protocol
203 # Returns: nothing on success.
205 # Since: 0.14.0
207 # Example:
209 # -> { "execute": "add_client", "arguments": { "protocol": "vnc",
210 #                                              "fdname": "myclient" } }
211 # <- { "return": {} }
214 { 'command': 'add_client',
215   'data': { 'protocol': 'str', 'fdname': 'str', '*skipauth': 'bool',
216             '*tls': 'bool' } }
219 # @NameInfo:
221 # Guest name information.
223 # @name: The name of the guest
225 # Since: 0.14.0
227 { 'struct': 'NameInfo', 'data': {'*name': 'str'} }
230 # @query-name:
232 # Return the name information of a guest.
234 # Returns: @NameInfo of the guest
236 # Since: 0.14.0
238 # Example:
240 # -> { "execute": "query-name" }
241 # <- { "return": { "name": "qemu-name" } }
244 { 'command': 'query-name', 'returns': 'NameInfo' }
247 # @KvmInfo:
249 # Information about support for KVM acceleration
251 # @enabled: true if KVM acceleration is active
253 # @present: true if KVM acceleration is built into this executable
255 # Since: 0.14.0
257 { 'struct': 'KvmInfo', 'data': {'enabled': 'bool', 'present': 'bool'} }
260 # @query-kvm:
262 # Returns information about KVM acceleration
264 # Returns: @KvmInfo
266 # Since: 0.14.0
268 # Example:
270 # -> { "execute": "query-kvm" }
271 # <- { "return": { "enabled": true, "present": true } }
274 { 'command': 'query-kvm', 'returns': 'KvmInfo' }
277 # @UuidInfo:
279 # Guest UUID information (Universally Unique Identifier).
281 # @UUID: the UUID of the guest
283 # Since: 0.14.0
285 # Notes: If no UUID was specified for the guest, a null UUID is returned.
287 { 'struct': 'UuidInfo', 'data': {'UUID': 'str'} }
290 # @query-uuid:
292 # Query the guest UUID information.
294 # Returns: The @UuidInfo for the guest
296 # Since: 0.14.0
298 # Example:
300 # -> { "execute": "query-uuid" }
301 # <- { "return": { "UUID": "550e8400-e29b-41d4-a716-446655440000" } }
304 { 'command': 'query-uuid', 'returns': 'UuidInfo' }
307 # @EventInfo:
309 # Information about a QMP event
311 # @name: The event name
313 # Since: 1.2.0
315 { 'struct': 'EventInfo', 'data': {'name': 'str'} }
318 # @query-events:
320 # Return a list of supported QMP events by this server
322 # Returns: A list of @EventInfo for all supported events
324 # Since: 1.2.0
326 # Example:
328 # -> { "execute": "query-events" }
329 # <- {
330 #      "return": [
331 #          {
332 #             "name":"SHUTDOWN"
333 #          },
334 #          {
335 #             "name":"RESET"
336 #          }
337 #       ]
338 #    }
340 # Note: This example has been shortened as the real response is too long.
343 { 'command': 'query-events', 'returns': ['EventInfo'] }
346 # @CpuInfoArch:
348 # An enumeration of cpu types that enable additional information during
349 # @query-cpus and @query-cpus-fast.
351 # @s390: since 2.12
353 # @riscv: since 2.12
355 # Since: 2.6
357 { 'enum': 'CpuInfoArch',
358   'data': ['x86', 'sparc', 'ppc', 'mips', 'tricore', 's390', 'riscv', 'other' ] }
361 # @CpuInfo:
363 # Information about a virtual CPU
365 # @CPU: the index of the virtual CPU
367 # @current: this only exists for backwards compatibility and should be ignored
369 # @halted: true if the virtual CPU is in the halt state.  Halt usually refers
370 #          to a processor specific low power mode.
372 # @qom_path: path to the CPU object in the QOM tree (since 2.4)
374 # @thread_id: ID of the underlying host thread
376 # @props: properties describing to which node/socket/core/thread
377 #         virtual CPU belongs to, provided if supported by board (since 2.10)
379 # @arch: architecture of the cpu, which determines which additional fields
380 #        will be listed (since 2.6)
382 # Since: 0.14.0
384 # Notes: @halted is a transient state that changes frequently.  By the time the
385 #        data is sent to the client, the guest may no longer be halted.
387 { 'union': 'CpuInfo',
388   'base': {'CPU': 'int', 'current': 'bool', 'halted': 'bool',
389            'qom_path': 'str', 'thread_id': 'int',
390            '*props': 'CpuInstanceProperties', 'arch': 'CpuInfoArch' },
391   'discriminator': 'arch',
392   'data': { 'x86': 'CpuInfoX86',
393             'sparc': 'CpuInfoSPARC',
394             'ppc': 'CpuInfoPPC',
395             'mips': 'CpuInfoMIPS',
396             'tricore': 'CpuInfoTricore',
397             's390': 'CpuInfoS390',
398             'riscv': 'CpuInfoRISCV',
399             'other': 'CpuInfoOther' } }
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 # @CpuInfoOther:
472 # No additional information is available about the virtual CPU
474 # Since: 2.6
477 { 'struct': 'CpuInfoOther', 'data': { } }
480 # @CpuS390State:
482 # An enumeration of cpu states that can be assumed by a virtual
483 # S390 CPU
485 # Since: 2.12
487 { 'enum': 'CpuS390State',
488   'prefix': 'S390_CPU_STATE',
489   'data': [ 'uninitialized', 'stopped', 'check-stop', 'operating', 'load' ] }
492 # @CpuInfoS390:
494 # Additional information about a virtual S390 CPU
496 # @cpu-state: the virtual CPU's state
498 # Since: 2.12
500 { 'struct': 'CpuInfoS390', 'data': { 'cpu-state': 'CpuS390State' } }
503 # @query-cpus:
505 # Returns a list of information about each virtual CPU.
507 # This command causes vCPU threads to exit to userspace, which causes
508 # a small interruption to guest CPU execution. This will have a negative
509 # impact on realtime guests and other latency sensitive guest workloads.
510 # It is recommended to use @query-cpus-fast instead of this command to
511 # avoid the vCPU interruption.
513 # Returns: a list of @CpuInfo for each virtual CPU
515 # Since: 0.14.0
517 # Example:
519 # -> { "execute": "query-cpus" }
520 # <- { "return": [
521 #          {
522 #             "CPU":0,
523 #             "current":true,
524 #             "halted":false,
525 #             "qom_path":"/machine/unattached/device[0]",
526 #             "arch":"x86",
527 #             "pc":3227107138,
528 #             "thread_id":3134
529 #          },
530 #          {
531 #             "CPU":1,
532 #             "current":false,
533 #             "halted":true,
534 #             "qom_path":"/machine/unattached/device[2]",
535 #             "arch":"x86",
536 #             "pc":7108165,
537 #             "thread_id":3135
538 #          }
539 #       ]
540 #    }
542 # Notes: This interface is deprecated (since 2.12.0), and it is strongly
543 #        recommended that you avoid using it. Use @query-cpus-fast to
544 #        obtain information about virtual CPUs.
547 { 'command': 'query-cpus', 'returns': ['CpuInfo'] }
550 # @CpuInfoFast:
552 # Information about a virtual CPU
554 # @cpu-index: index of the virtual CPU
556 # @qom-path: path to the CPU object in the QOM tree
558 # @thread-id: ID of the underlying host thread
560 # @props: properties describing to which node/socket/core/thread
561 #         virtual CPU belongs to, provided if supported by board
563 # @arch: base architecture of the cpu; deprecated since 3.0.0 in favor
564 #        of @target
566 # @target: the QEMU system emulation target, which determines which
567 #          additional fields will be listed (since 3.0)
569 # Since: 2.12
572 { 'union'         : 'CpuInfoFast',
573   'base'          : { 'cpu-index'    : 'int',
574                       'qom-path'     : 'str',
575                       'thread-id'    : 'int',
576                       '*props'       : 'CpuInstanceProperties',
577                       'arch'         : 'CpuInfoArch',
578                       'target'       : 'SysEmuTarget' },
579   'discriminator' : 'target',
580   'data'          : { 'aarch64'      : 'CpuInfoOther',
581                       'alpha'        : 'CpuInfoOther',
582                       'arm'          : 'CpuInfoOther',
583                       'cris'         : 'CpuInfoOther',
584                       'hppa'         : 'CpuInfoOther',
585                       'i386'         : 'CpuInfoOther',
586                       'lm32'         : 'CpuInfoOther',
587                       'm68k'         : 'CpuInfoOther',
588                       'microblaze'   : 'CpuInfoOther',
589                       'microblazeel' : 'CpuInfoOther',
590                       'mips'         : 'CpuInfoOther',
591                       'mips64'       : 'CpuInfoOther',
592                       'mips64el'     : 'CpuInfoOther',
593                       'mipsel'       : 'CpuInfoOther',
594                       'moxie'        : 'CpuInfoOther',
595                       'nios2'        : 'CpuInfoOther',
596                       'or1k'         : 'CpuInfoOther',
597                       'ppc'          : 'CpuInfoOther',
598                       'ppc64'        : 'CpuInfoOther',
599                       'ppcemb'       : 'CpuInfoOther',
600                       'riscv32'      : 'CpuInfoOther',
601                       'riscv64'      : 'CpuInfoOther',
602                       's390x'        : 'CpuInfoS390',
603                       'sh4'          : 'CpuInfoOther',
604                       'sh4eb'        : 'CpuInfoOther',
605                       'sparc'        : 'CpuInfoOther',
606                       'sparc64'      : 'CpuInfoOther',
607                       'tricore'      : 'CpuInfoOther',
608                       'unicore32'    : 'CpuInfoOther',
609                       'x86_64'       : 'CpuInfoOther',
610                       'xtensa'       : 'CpuInfoOther',
611                       'xtensaeb'     : 'CpuInfoOther' } }
614 # @query-cpus-fast:
616 # Returns information about all virtual CPUs. This command does not
617 # incur a performance penalty and should be used in production
618 # instead of query-cpus.
620 # Returns: list of @CpuInfoFast
622 # Since: 2.12
624 # Example:
626 # -> { "execute": "query-cpus-fast" }
627 # <- { "return": [
628 #         {
629 #             "thread-id": 25627,
630 #             "props": {
631 #                 "core-id": 0,
632 #                 "thread-id": 0,
633 #                 "socket-id": 0
634 #             },
635 #             "qom-path": "/machine/unattached/device[0]",
636 #             "arch":"x86",
637 #             "target":"x86_64",
638 #             "cpu-index": 0
639 #         },
640 #         {
641 #             "thread-id": 25628,
642 #             "props": {
643 #                 "core-id": 0,
644 #                 "thread-id": 0,
645 #                 "socket-id": 1
646 #             },
647 #             "qom-path": "/machine/unattached/device[2]",
648 #             "arch":"x86",
649 #             "target":"x86_64",
650 #             "cpu-index": 1
651 #         }
652 #     ]
653 # }
655 { 'command': 'query-cpus-fast', 'returns': [ 'CpuInfoFast' ] }
658 # @IOThreadInfo:
660 # Information about an iothread
662 # @id: the identifier of the iothread
664 # @thread-id: ID of the underlying host thread
666 # @poll-max-ns: maximum polling time in ns, 0 means polling is disabled
667 #               (since 2.9)
669 # @poll-grow: how many ns will be added to polling time, 0 means that it's not
670 #             configured (since 2.9)
672 # @poll-shrink: how many ns will be removed from polling time, 0 means that
673 #               it's not configured (since 2.9)
675 # Since: 2.0
677 { 'struct': 'IOThreadInfo',
678   'data': {'id': 'str',
679            'thread-id': 'int',
680            'poll-max-ns': 'int',
681            'poll-grow': 'int',
682            'poll-shrink': 'int' } }
685 # @query-iothreads:
687 # Returns a list of information about each iothread.
689 # Note: this list excludes the QEMU main loop thread, which is not declared
690 # using the -object iothread command-line option.  It is always the main thread
691 # of the process.
693 # Returns: a list of @IOThreadInfo for each iothread
695 # Since: 2.0
697 # Example:
699 # -> { "execute": "query-iothreads" }
700 # <- { "return": [
701 #          {
702 #             "id":"iothread0",
703 #             "thread-id":3134
704 #          },
705 #          {
706 #             "id":"iothread1",
707 #             "thread-id":3135
708 #          }
709 #       ]
710 #    }
713 { 'command': 'query-iothreads', 'returns': ['IOThreadInfo'] }
716 # @BalloonInfo:
718 # Information about the guest balloon device.
720 # @actual: the number of bytes the balloon currently contains
722 # Since: 0.14.0
725 { 'struct': 'BalloonInfo', 'data': {'actual': 'int' } }
728 # @query-balloon:
730 # Return information about the balloon device.
732 # Returns: @BalloonInfo on success
734 #          If the balloon driver is enabled but not functional because the KVM
735 #          kernel module cannot support it, KvmMissingCap
737 #          If no balloon device is present, DeviceNotActive
739 # Since: 0.14.0
741 # Example:
743 # -> { "execute": "query-balloon" }
744 # <- { "return": {
745 #          "actual": 1073741824,
746 #       }
747 #    }
750 { 'command': 'query-balloon', 'returns': 'BalloonInfo' }
753 # @BALLOON_CHANGE:
755 # Emitted when the guest changes the actual BALLOON level. This value is
756 # equivalent to the @actual field return by the 'query-balloon' command
758 # @actual: actual level of the guest memory balloon in bytes
760 # Note: this event is rate-limited.
762 # Since: 1.2
764 # Example:
766 # <- { "event": "BALLOON_CHANGE",
767 #      "data": { "actual": 944766976 },
768 #      "timestamp": { "seconds": 1267020223, "microseconds": 435656 } }
771 { 'event': 'BALLOON_CHANGE',
772   'data': { 'actual': 'int' } }
775 # @PciMemoryRange:
777 # A PCI device memory region
779 # @base: the starting address (guest physical)
781 # @limit: the ending address (guest physical)
783 # Since: 0.14.0
785 { 'struct': 'PciMemoryRange', 'data': {'base': 'int', 'limit': 'int'} }
788 # @PciMemoryRegion:
790 # Information about a PCI device I/O region.
792 # @bar: the index of the Base Address Register for this region
794 # @type: 'io' if the region is a PIO region
795 #        'memory' if the region is a MMIO region
797 # @size: memory size
799 # @prefetch: if @type is 'memory', true if the memory is prefetchable
801 # @mem_type_64: if @type is 'memory', true if the BAR is 64-bit
803 # Since: 0.14.0
805 { 'struct': 'PciMemoryRegion',
806   'data': {'bar': 'int', 'type': 'str', 'address': 'int', 'size': 'int',
807            '*prefetch': 'bool', '*mem_type_64': 'bool' } }
810 # @PciBusInfo:
812 # Information about a bus of a PCI Bridge device
814 # @number: primary bus interface number.  This should be the number of the
815 #          bus the device resides on.
817 # @secondary: secondary bus interface number.  This is the number of the
818 #             main bus for the bridge
820 # @subordinate: This is the highest number bus that resides below the
821 #               bridge.
823 # @io_range: The PIO range for all devices on this bridge
825 # @memory_range: The MMIO range for all devices on this bridge
827 # @prefetchable_range: The range of prefetchable MMIO for all devices on
828 #                      this bridge
830 # Since: 2.4
832 { 'struct': 'PciBusInfo',
833   'data': {'number': 'int', 'secondary': 'int', 'subordinate': 'int',
834            'io_range': 'PciMemoryRange',
835            'memory_range': 'PciMemoryRange',
836            'prefetchable_range': 'PciMemoryRange' } }
839 # @PciBridgeInfo:
841 # Information about a PCI Bridge device
843 # @bus: information about the bus the device resides on
845 # @devices: a list of @PciDeviceInfo for each device on this bridge
847 # Since: 0.14.0
849 { 'struct': 'PciBridgeInfo',
850   'data': {'bus': 'PciBusInfo', '*devices': ['PciDeviceInfo']} }
853 # @PciDeviceClass:
855 # Information about the Class of a PCI device
857 # @desc: a string description of the device's class
859 # @class: the class code of the device
861 # Since: 2.4
863 { 'struct': 'PciDeviceClass',
864   'data': {'*desc': 'str', 'class': 'int'} }
867 # @PciDeviceId:
869 # Information about the Id of a PCI device
871 # @device: the PCI device id
873 # @vendor: the PCI vendor id
875 # Since: 2.4
877 { 'struct': 'PciDeviceId',
878   'data': {'device': 'int', 'vendor': 'int'} }
881 # @PciDeviceInfo:
883 # Information about a PCI device
885 # @bus: the bus number of the device
887 # @slot: the slot the device is located in
889 # @function: the function of the slot used by the device
891 # @class_info: the class of the device
893 # @id: the PCI device id
895 # @irq: if an IRQ is assigned to the device, the IRQ number
897 # @qdev_id: the device name of the PCI device
899 # @pci_bridge: if the device is a PCI bridge, the bridge information
901 # @regions: a list of the PCI I/O regions associated with the device
903 # Notes: the contents of @class_info.desc are not stable and should only be
904 #        treated as informational.
906 # Since: 0.14.0
908 { 'struct': 'PciDeviceInfo',
909   'data': {'bus': 'int', 'slot': 'int', 'function': 'int',
910            'class_info': 'PciDeviceClass', 'id': 'PciDeviceId',
911            '*irq': 'int', 'qdev_id': 'str', '*pci_bridge': 'PciBridgeInfo',
912            'regions': ['PciMemoryRegion']} }
915 # @PciInfo:
917 # Information about a PCI bus
919 # @bus: the bus index
921 # @devices: a list of devices on this bus
923 # Since: 0.14.0
925 { 'struct': 'PciInfo', 'data': {'bus': 'int', 'devices': ['PciDeviceInfo']} }
928 # @query-pci:
930 # Return information about the PCI bus topology of the guest.
932 # Returns: a list of @PciInfo for each PCI bus. Each bus is
933 # represented by a json-object, which has a key with a json-array of
934 # all PCI devices attached to it. Each device is represented by a
935 # json-object.
937 # Since: 0.14.0
939 # Example:
941 # -> { "execute": "query-pci" }
942 # <- { "return": [
943 #          {
944 #             "bus": 0,
945 #             "devices": [
946 #                {
947 #                   "bus": 0,
948 #                   "qdev_id": "",
949 #                   "slot": 0,
950 #                   "class_info": {
951 #                      "class": 1536,
952 #                      "desc": "Host bridge"
953 #                   },
954 #                   "id": {
955 #                      "device": 32902,
956 #                      "vendor": 4663
957 #                   },
958 #                   "function": 0,
959 #                   "regions": [
960 #                   ]
961 #                },
962 #                {
963 #                   "bus": 0,
964 #                   "qdev_id": "",
965 #                   "slot": 1,
966 #                   "class_info": {
967 #                      "class": 1537,
968 #                      "desc": "ISA bridge"
969 #                   },
970 #                   "id": {
971 #                      "device": 32902,
972 #                      "vendor": 28672
973 #                   },
974 #                   "function": 0,
975 #                   "regions": [
976 #                   ]
977 #                },
978 #                {
979 #                   "bus": 0,
980 #                   "qdev_id": "",
981 #                   "slot": 1,
982 #                   "class_info": {
983 #                      "class": 257,
984 #                      "desc": "IDE controller"
985 #                   },
986 #                   "id": {
987 #                      "device": 32902,
988 #                      "vendor": 28688
989 #                   },
990 #                   "function": 1,
991 #                   "regions": [
992 #                      {
993 #                         "bar": 4,
994 #                         "size": 16,
995 #                         "address": 49152,
996 #                         "type": "io"
997 #                      }
998 #                   ]
999 #                },
1000 #                {
1001 #                   "bus": 0,
1002 #                   "qdev_id": "",
1003 #                   "slot": 2,
1004 #                   "class_info": {
1005 #                      "class": 768,
1006 #                      "desc": "VGA controller"
1007 #                   },
1008 #                   "id": {
1009 #                      "device": 4115,
1010 #                      "vendor": 184
1011 #                   },
1012 #                   "function": 0,
1013 #                   "regions": [
1014 #                      {
1015 #                         "prefetch": true,
1016 #                         "mem_type_64": false,
1017 #                         "bar": 0,
1018 #                         "size": 33554432,
1019 #                         "address": 4026531840,
1020 #                         "type": "memory"
1021 #                      },
1022 #                      {
1023 #                         "prefetch": false,
1024 #                         "mem_type_64": false,
1025 #                         "bar": 1,
1026 #                         "size": 4096,
1027 #                         "address": 4060086272,
1028 #                         "type": "memory"
1029 #                      },
1030 #                      {
1031 #                         "prefetch": false,
1032 #                         "mem_type_64": false,
1033 #                         "bar": 6,
1034 #                         "size": 65536,
1035 #                         "address": -1,
1036 #                         "type": "memory"
1037 #                      }
1038 #                   ]
1039 #                },
1040 #                {
1041 #                   "bus": 0,
1042 #                   "qdev_id": "",
1043 #                   "irq": 11,
1044 #                   "slot": 4,
1045 #                   "class_info": {
1046 #                      "class": 1280,
1047 #                      "desc": "RAM controller"
1048 #                   },
1049 #                   "id": {
1050 #                      "device": 6900,
1051 #                      "vendor": 4098
1052 #                   },
1053 #                   "function": 0,
1054 #                   "regions": [
1055 #                      {
1056 #                         "bar": 0,
1057 #                         "size": 32,
1058 #                         "address": 49280,
1059 #                         "type": "io"
1060 #                      }
1061 #                   ]
1062 #                }
1063 #             ]
1064 #          }
1065 #       ]
1066 #    }
1068 # Note: This example has been shortened as the real response is too long.
1071 { 'command': 'query-pci', 'returns': ['PciInfo'] }
1074 # @quit:
1076 # This command will cause the QEMU process to exit gracefully.  While every
1077 # attempt is made to send the QMP response before terminating, this is not
1078 # guaranteed.  When using this interface, a premature EOF would not be
1079 # unexpected.
1081 # Since: 0.14.0
1083 # Example:
1085 # -> { "execute": "quit" }
1086 # <- { "return": {} }
1088 { 'command': 'quit' }
1091 # @stop:
1093 # Stop all guest VCPU execution.
1095 # Since:  0.14.0
1097 # Notes:  This function will succeed even if the guest is already in the stopped
1098 #         state.  In "inmigrate" state, it will ensure that the guest
1099 #         remains paused once migration finishes, as if the -S option was
1100 #         passed on the command line.
1102 # Example:
1104 # -> { "execute": "stop" }
1105 # <- { "return": {} }
1108 { 'command': 'stop' }
1111 # @system_reset:
1113 # Performs a hard reset of a guest.
1115 # Since: 0.14.0
1117 # Example:
1119 # -> { "execute": "system_reset" }
1120 # <- { "return": {} }
1123 { 'command': 'system_reset' }
1126 # @system_powerdown:
1128 # Requests that a guest perform a powerdown operation.
1130 # Since: 0.14.0
1132 # Notes: A guest may or may not respond to this command.  This command
1133 #        returning does not indicate that a guest has accepted the request or
1134 #        that it has shut down.  Many guests will respond to this command by
1135 #        prompting the user in some way.
1136 # Example:
1138 # -> { "execute": "system_powerdown" }
1139 # <- { "return": {} }
1142 { 'command': 'system_powerdown' }
1145 # @cpu-add:
1147 # Adds CPU with specified ID
1149 # @id: ID of CPU to be created, valid values [0..max_cpus)
1151 # Returns: Nothing on success
1153 # Since: 1.5
1155 # Example:
1157 # -> { "execute": "cpu-add", "arguments": { "id": 2 } }
1158 # <- { "return": {} }
1161 { 'command': 'cpu-add', 'data': {'id': 'int'} }
1164 # @memsave:
1166 # Save a portion of guest memory to a file.
1168 # @val: the virtual address of the guest to start from
1170 # @size: the size of memory region to save
1172 # @filename: the file to save the memory to as binary data
1174 # @cpu-index: the index of the virtual CPU to use for translating the
1175 #                       virtual address (defaults to CPU 0)
1177 # Returns: Nothing on success
1179 # Since: 0.14.0
1181 # Notes: Errors were not reliably returned until 1.1
1183 # Example:
1185 # -> { "execute": "memsave",
1186 #      "arguments": { "val": 10,
1187 #                     "size": 100,
1188 #                     "filename": "/tmp/virtual-mem-dump" } }
1189 # <- { "return": {} }
1192 { 'command': 'memsave',
1193   'data': {'val': 'int', 'size': 'int', 'filename': 'str', '*cpu-index': 'int'} }
1196 # @pmemsave:
1198 # Save a portion of guest physical memory to a file.
1200 # @val: the physical address of the guest to start from
1202 # @size: the size of memory region to save
1204 # @filename: the file to save the memory to as binary data
1206 # Returns: Nothing on success
1208 # Since: 0.14.0
1210 # Notes: Errors were not reliably returned until 1.1
1212 # Example:
1214 # -> { "execute": "pmemsave",
1215 #      "arguments": { "val": 10,
1216 #                     "size": 100,
1217 #                     "filename": "/tmp/physical-mem-dump" } }
1218 # <- { "return": {} }
1221 { 'command': 'pmemsave',
1222   'data': {'val': 'int', 'size': 'int', 'filename': 'str'} }
1225 # @cont:
1227 # Resume guest VCPU execution.
1229 # Since:  0.14.0
1231 # Returns:  If successful, nothing
1233 # Notes:  This command will succeed if the guest is currently running.  It
1234 #         will also succeed if the guest is in the "inmigrate" state; in
1235 #         this case, the effect of the command is to make sure the guest
1236 #         starts once migration finishes, removing the effect of the -S
1237 #         command line option if it was passed.
1239 # Example:
1241 # -> { "execute": "cont" }
1242 # <- { "return": {} }
1245 { 'command': 'cont' }
1248 # @exit-preconfig:
1250 # Exit from "preconfig" state
1252 # This command makes QEMU exit the preconfig state and proceed with
1253 # VM initialization using configuration data provided on the command line
1254 # and via the QMP monitor during the preconfig state. The command is only
1255 # available during the preconfig state (i.e. when the --preconfig command
1256 # line option was in use).
1258 # Since 3.0
1260 # Returns: nothing
1262 # Example:
1264 # -> { "execute": "exit-preconfig" }
1265 # <- { "return": {} }
1268 { 'command': 'exit-preconfig', 'allow-preconfig': true }
1271 # @system_wakeup:
1273 # Wakeup guest from suspend.  Does nothing in case the guest isn't suspended.
1275 # Since:  1.1
1277 # Returns:  nothing.
1279 # Example:
1281 # -> { "execute": "system_wakeup" }
1282 # <- { "return": {} }
1285 { 'command': 'system_wakeup' }
1288 # @inject-nmi:
1290 # Injects a Non-Maskable Interrupt into the default CPU (x86/s390) or all CPUs (ppc64).
1291 # The command fails when the guest doesn't support injecting.
1293 # Returns:  If successful, nothing
1295 # Since:  0.14.0
1297 # Note: prior to 2.1, this command was only supported for x86 and s390 VMs
1299 # Example:
1301 # -> { "execute": "inject-nmi" }
1302 # <- { "return": {} }
1305 { 'command': 'inject-nmi' }
1308 # @balloon:
1310 # Request the balloon driver to change its balloon size.
1312 # @value: the target size of the balloon in bytes
1314 # Returns: Nothing on success
1315 #          If the balloon driver is enabled but not functional because the KVM
1316 #            kernel module cannot support it, KvmMissingCap
1317 #          If no balloon device is present, DeviceNotActive
1319 # Notes: This command just issues a request to the guest.  When it returns,
1320 #        the balloon size may not have changed.  A guest can change the balloon
1321 #        size independent of this command.
1323 # Since: 0.14.0
1325 # Example:
1327 # -> { "execute": "balloon", "arguments": { "value": 536870912 } }
1328 # <- { "return": {} }
1331 { 'command': 'balloon', 'data': {'value': 'int'} }
1334 # @human-monitor-command:
1336 # Execute a command on the human monitor and return the output.
1338 # @command-line: the command to execute in the human monitor
1340 # @cpu-index: The CPU to use for commands that require an implicit CPU
1342 # Returns: the output of the command as a string
1344 # Since: 0.14.0
1346 # Notes: This command only exists as a stop-gap.  Its use is highly
1347 #        discouraged.  The semantics of this command are not
1348 #        guaranteed: this means that command names, arguments and
1349 #        responses can change or be removed at ANY time.  Applications
1350 #        that rely on long term stability guarantees should NOT
1351 #        use this command.
1353 #        Known limitations:
1355 #        * This command is stateless, this means that commands that depend
1356 #          on state information (such as getfd) might not work
1358 #        * Commands that prompt the user for data don't currently work
1360 # Example:
1362 # -> { "execute": "human-monitor-command",
1363 #      "arguments": { "command-line": "info kvm" } }
1364 # <- { "return": "kvm support: enabled\r\n" }
1367 { 'command': 'human-monitor-command',
1368   'data': {'command-line': 'str', '*cpu-index': 'int'},
1369   'returns': 'str' }
1372 # @ObjectPropertyInfo:
1374 # @name: the name of the property
1376 # @type: the type of the property.  This will typically come in one of four
1377 #        forms:
1379 #        1) A primitive type such as 'u8', 'u16', 'bool', 'str', or 'double'.
1380 #           These types are mapped to the appropriate JSON type.
1382 #        2) A child type in the form 'child<subtype>' where subtype is a qdev
1383 #           device type name.  Child properties create the composition tree.
1385 #        3) A link type in the form 'link<subtype>' where subtype is a qdev
1386 #           device type name.  Link properties form the device model graph.
1388 # @description: if specified, the description of the property.
1390 # Since: 1.2
1392 { 'struct': 'ObjectPropertyInfo',
1393   'data': { 'name': 'str', 'type': 'str', '*description': 'str' } }
1396 # @qom-list:
1398 # This command will list any properties of a object given a path in the object
1399 # model.
1401 # @path: the path within the object model.  See @qom-get for a description of
1402 #        this parameter.
1404 # Returns: a list of @ObjectPropertyInfo that describe the properties of the
1405 #          object.
1407 # Since: 1.2
1409 { 'command': 'qom-list',
1410   'data': { 'path': 'str' },
1411   'returns': [ 'ObjectPropertyInfo' ] }
1414 # @qom-get:
1416 # This command will get a property from a object model path and return the
1417 # value.
1419 # @path: The path within the object model.  There are two forms of supported
1420 #        paths--absolute and partial paths.
1422 #        Absolute paths are derived from the root object and can follow child<>
1423 #        or link<> properties.  Since they can follow link<> properties, they
1424 #        can be arbitrarily long.  Absolute paths look like absolute filenames
1425 #        and are prefixed  with a leading slash.
1427 #        Partial paths look like relative filenames.  They do not begin
1428 #        with a prefix.  The matching rules for partial paths are subtle but
1429 #        designed to make specifying objects easy.  At each level of the
1430 #        composition tree, the partial path is matched as an absolute path.
1431 #        The first match is not returned.  At least two matches are searched
1432 #        for.  A successful result is only returned if only one match is
1433 #        found.  If more than one match is found, a flag is return to
1434 #        indicate that the match was ambiguous.
1436 # @property: The property name to read
1438 # Returns: The property value.  The type depends on the property
1439 #          type. child<> and link<> properties are returned as #str
1440 #          pathnames.  All integer property types (u8, u16, etc) are
1441 #          returned as #int.
1443 # Since: 1.2
1445 { 'command': 'qom-get',
1446   'data': { 'path': 'str', 'property': 'str' },
1447   'returns': 'any' }
1450 # @qom-set:
1452 # This command will set a property from a object model path.
1454 # @path: see @qom-get for a description of this parameter
1456 # @property: the property name to set
1458 # @value: a value who's type is appropriate for the property type.  See @qom-get
1459 #         for a description of type mapping.
1461 # Since: 1.2
1463 { 'command': 'qom-set',
1464   'data': { 'path': 'str', 'property': 'str', 'value': 'any' } }
1467 # @change:
1469 # This command is multiple commands multiplexed together.
1471 # @device: This is normally the name of a block device but it may also be 'vnc'.
1472 #          when it's 'vnc', then sub command depends on @target
1474 # @target: If @device is a block device, then this is the new filename.
1475 #          If @device is 'vnc', then if the value 'password' selects the vnc
1476 #          change password command.   Otherwise, this specifies a new server URI
1477 #          address to listen to for VNC connections.
1479 # @arg:    If @device is a block device, then this is an optional format to open
1480 #          the device with.
1481 #          If @device is 'vnc' and @target is 'password', this is the new VNC
1482 #          password to set.  See change-vnc-password for additional notes.
1484 # Returns: Nothing on success.
1485 #          If @device is not a valid block device, DeviceNotFound
1487 # Notes:  This interface is deprecated, and it is strongly recommended that you
1488 #         avoid using it.  For changing block devices, use
1489 #         blockdev-change-medium; for changing VNC parameters, use
1490 #         change-vnc-password.
1492 # Since: 0.14.0
1494 # Example:
1496 # 1. Change a removable medium
1498 # -> { "execute": "change",
1499 #      "arguments": { "device": "ide1-cd0",
1500 #                     "target": "/srv/images/Fedora-12-x86_64-DVD.iso" } }
1501 # <- { "return": {} }
1503 # 2. Change VNC password
1505 # -> { "execute": "change",
1506 #      "arguments": { "device": "vnc", "target": "password",
1507 #                     "arg": "foobar1" } }
1508 # <- { "return": {} }
1511 { 'command': 'change',
1512   'data': {'device': 'str', 'target': 'str', '*arg': 'str'} }
1515 # @ObjectTypeInfo:
1517 # This structure describes a search result from @qom-list-types
1519 # @name: the type name found in the search
1521 # @abstract: the type is abstract and can't be directly instantiated.
1522 #            Omitted if false. (since 2.10)
1524 # @parent: Name of parent type, if any (since 2.10)
1526 # Since: 1.1
1528 { 'struct': 'ObjectTypeInfo',
1529   'data': { 'name': 'str', '*abstract': 'bool', '*parent': 'str' } }
1532 # @qom-list-types:
1534 # This command will return a list of types given search parameters
1536 # @implements: if specified, only return types that implement this type name
1538 # @abstract: if true, include abstract types in the results
1540 # Returns: a list of @ObjectTypeInfo or an empty list if no results are found
1542 # Since: 1.1
1544 { 'command': 'qom-list-types',
1545   'data': { '*implements': 'str', '*abstract': 'bool' },
1546   'returns': [ 'ObjectTypeInfo' ] }
1549 # @device-list-properties:
1551 # List properties associated with a device.
1553 # @typename: the type name of a device
1555 # Returns: a list of ObjectPropertyInfo describing a devices properties
1557 # Since: 1.2
1559 { 'command': 'device-list-properties',
1560   'data': { 'typename': 'str'},
1561   'returns': [ 'ObjectPropertyInfo' ] }
1564 # @qom-list-properties:
1566 # List properties associated with a QOM object.
1568 # @typename: the type name of an object
1570 # Returns: a list of ObjectPropertyInfo describing object properties
1572 # Since: 2.12
1574 { 'command': 'qom-list-properties',
1575   'data': { 'typename': 'str'},
1576   'returns': [ 'ObjectPropertyInfo' ] }
1579 # @xen-set-global-dirty-log:
1581 # Enable or disable the global dirty log mode.
1583 # @enable: true to enable, false to disable.
1585 # Returns: nothing
1587 # Since: 1.3
1589 # Example:
1591 # -> { "execute": "xen-set-global-dirty-log",
1592 #      "arguments": { "enable": true } }
1593 # <- { "return": {} }
1596 { 'command': 'xen-set-global-dirty-log', 'data': { 'enable': 'bool' } }
1599 # @device_add:
1601 # @driver: the name of the new device's driver
1603 # @bus: the device's parent bus (device tree path)
1605 # @id: the device's ID, must be unique
1607 # Additional arguments depend on the type.
1609 # Add a device.
1611 # Notes:
1612 # 1. For detailed information about this command, please refer to the
1613 #    'docs/qdev-device-use.txt' file.
1615 # 2. It's possible to list device properties by running QEMU with the
1616 #    "-device DEVICE,help" command-line argument, where DEVICE is the
1617 #    device's name
1619 # Example:
1621 # -> { "execute": "device_add",
1622 #      "arguments": { "driver": "e1000", "id": "net1",
1623 #                     "bus": "pci.0",
1624 #                     "mac": "52:54:00:12:34:56" } }
1625 # <- { "return": {} }
1627 # TODO: This command effectively bypasses QAPI completely due to its
1628 # "additional arguments" business.  It shouldn't have been added to
1629 # the schema in this form.  It should be qapified properly, or
1630 # replaced by a properly qapified command.
1632 # Since: 0.13
1634 { 'command': 'device_add',
1635   'data': {'driver': 'str', '*bus': 'str', '*id': 'str'},
1636   'gen': false } # so we can get the additional arguments
1639 # @device_del:
1641 # Remove a device from a guest
1643 # @id: the device's ID or QOM path
1645 # Returns: Nothing on success
1646 #          If @id is not a valid device, DeviceNotFound
1648 # Notes: When this command completes, the device may not be removed from the
1649 #        guest.  Hot removal is an operation that requires guest cooperation.
1650 #        This command merely requests that the guest begin the hot removal
1651 #        process.  Completion of the device removal process is signaled with a
1652 #        DEVICE_DELETED event. Guest reset will automatically complete removal
1653 #        for all devices.
1655 # Since: 0.14.0
1657 # Example:
1659 # -> { "execute": "device_del",
1660 #      "arguments": { "id": "net1" } }
1661 # <- { "return": {} }
1663 # -> { "execute": "device_del",
1664 #      "arguments": { "id": "/machine/peripheral-anon/device[0]" } }
1665 # <- { "return": {} }
1668 { 'command': 'device_del', 'data': {'id': 'str'} }
1671 # @DEVICE_DELETED:
1673 # Emitted whenever the device removal completion is acknowledged by the guest.
1674 # At this point, it's safe to reuse the specified device ID. Device removal can
1675 # be initiated by the guest or by HMP/QMP commands.
1677 # @device: device name
1679 # @path: device path
1681 # Since: 1.5
1683 # Example:
1685 # <- { "event": "DEVICE_DELETED",
1686 #      "data": { "device": "virtio-net-pci-0",
1687 #                "path": "/machine/peripheral/virtio-net-pci-0" },
1688 #      "timestamp": { "seconds": 1265044230, "microseconds": 450486 } }
1691 { 'event': 'DEVICE_DELETED',
1692   'data': { '*device': 'str', 'path': 'str' } }
1695 # @DumpGuestMemoryFormat:
1697 # An enumeration of guest-memory-dump's format.
1699 # @elf: elf format
1701 # @kdump-zlib: kdump-compressed format with zlib-compressed
1703 # @kdump-lzo: kdump-compressed format with lzo-compressed
1705 # @kdump-snappy: kdump-compressed format with snappy-compressed
1707 # Since: 2.0
1709 { 'enum': 'DumpGuestMemoryFormat',
1710   'data': [ 'elf', 'kdump-zlib', 'kdump-lzo', 'kdump-snappy' ] }
1713 # @dump-guest-memory:
1715 # Dump guest's memory to vmcore. It is a synchronous operation that can take
1716 # very long depending on the amount of guest memory.
1718 # @paging: if true, do paging to get guest's memory mapping. This allows
1719 #          using gdb to process the core file.
1721 #          IMPORTANT: this option can make QEMU allocate several gigabytes
1722 #                     of RAM. This can happen for a large guest, or a
1723 #                     malicious guest pretending to be large.
1725 #          Also, paging=true has the following limitations:
1727 #             1. The guest may be in a catastrophic state or can have corrupted
1728 #                memory, which cannot be trusted
1729 #             2. The guest can be in real-mode even if paging is enabled. For
1730 #                example, the guest uses ACPI to sleep, and ACPI sleep state
1731 #                goes in real-mode
1732 #             3. Currently only supported on i386 and x86_64.
1734 # @protocol: the filename or file descriptor of the vmcore. The supported
1735 #            protocols are:
1737 #            1. file: the protocol starts with "file:", and the following
1738 #               string is the file's path.
1739 #            2. fd: the protocol starts with "fd:", and the following string
1740 #               is the fd's name.
1742 # @detach: if true, QMP will return immediately rather than
1743 #          waiting for the dump to finish. The user can track progress
1744 #          using "query-dump". (since 2.6).
1746 # @begin: if specified, the starting physical address.
1748 # @length: if specified, the memory size, in bytes. If you don't
1749 #          want to dump all guest's memory, please specify the start @begin
1750 #          and @length
1752 # @format: if specified, the format of guest memory dump. But non-elf
1753 #          format is conflict with paging and filter, ie. @paging, @begin and
1754 #          @length is not allowed to be specified with non-elf @format at the
1755 #          same time (since 2.0)
1757 # Note: All boolean arguments default to false
1759 # Returns: nothing on success
1761 # Since: 1.2
1763 # Example:
1765 # -> { "execute": "dump-guest-memory",
1766 #      "arguments": { "protocol": "fd:dump" } }
1767 # <- { "return": {} }
1770 { 'command': 'dump-guest-memory',
1771   'data': { 'paging': 'bool', 'protocol': 'str', '*detach': 'bool',
1772             '*begin': 'int', '*length': 'int',
1773             '*format': 'DumpGuestMemoryFormat'} }
1776 # @DumpStatus:
1778 # Describe the status of a long-running background guest memory dump.
1780 # @none: no dump-guest-memory has started yet.
1782 # @active: there is one dump running in background.
1784 # @completed: the last dump has finished successfully.
1786 # @failed: the last dump has failed.
1788 # Since: 2.6
1790 { 'enum': 'DumpStatus',
1791   'data': [ 'none', 'active', 'completed', 'failed' ] }
1794 # @DumpQueryResult:
1796 # The result format for 'query-dump'.
1798 # @status: enum of @DumpStatus, which shows current dump status
1800 # @completed: bytes written in latest dump (uncompressed)
1802 # @total: total bytes to be written in latest dump (uncompressed)
1804 # Since: 2.6
1806 { 'struct': 'DumpQueryResult',
1807   'data': { 'status': 'DumpStatus',
1808             'completed': 'int',
1809             'total': 'int' } }
1812 # @query-dump:
1814 # Query latest dump status.
1816 # Returns: A @DumpStatus object showing the dump status.
1818 # Since: 2.6
1820 # Example:
1822 # -> { "execute": "query-dump" }
1823 # <- { "return": { "status": "active", "completed": 1024000,
1824 #                  "total": 2048000 } }
1827 { 'command': 'query-dump', 'returns': 'DumpQueryResult' }
1830 # @DUMP_COMPLETED:
1832 # Emitted when background dump has completed
1834 # @result: final dump status
1836 # @error: human-readable error string that provides
1837 #         hint on why dump failed. Only presents on failure. The
1838 #         user should not try to interpret the error string.
1840 # Since: 2.6
1842 # Example:
1844 # { "event": "DUMP_COMPLETED",
1845 #   "data": {"result": {"total": 1090650112, "status": "completed",
1846 #                       "completed": 1090650112} } }
1849 { 'event': 'DUMP_COMPLETED' ,
1850   'data': { 'result': 'DumpQueryResult', '*error': 'str' } }
1853 # @DumpGuestMemoryCapability:
1855 # A list of the available formats for dump-guest-memory
1857 # Since: 2.0
1859 { 'struct': 'DumpGuestMemoryCapability',
1860   'data': {
1861       'formats': ['DumpGuestMemoryFormat'] } }
1864 # @query-dump-guest-memory-capability:
1866 # Returns the available formats for dump-guest-memory
1868 # Returns:  A @DumpGuestMemoryCapability object listing available formats for
1869 #           dump-guest-memory
1871 # Since: 2.0
1873 # Example:
1875 # -> { "execute": "query-dump-guest-memory-capability" }
1876 # <- { "return": { "formats":
1877 #                  ["elf", "kdump-zlib", "kdump-lzo", "kdump-snappy"] }
1880 { 'command': 'query-dump-guest-memory-capability',
1881   'returns': 'DumpGuestMemoryCapability' }
1884 # @dump-skeys:
1886 # Dump guest's storage keys
1888 # @filename: the path to the file to dump to
1890 # This command is only supported on s390 architecture.
1892 # Since: 2.5
1894 # Example:
1896 # -> { "execute": "dump-skeys",
1897 #      "arguments": { "filename": "/tmp/skeys" } }
1898 # <- { "return": {} }
1901 { 'command': 'dump-skeys',
1902   'data': { 'filename': 'str' } }
1905 # @object-add:
1907 # Create a QOM object.
1909 # @qom-type: the class name for the object to be created
1911 # @id: the name of the new object
1913 # @props: a dictionary of properties to be passed to the backend
1915 # Returns: Nothing on success
1916 #          Error if @qom-type is not a valid class name
1918 # Since: 2.0
1920 # Example:
1922 # -> { "execute": "object-add",
1923 #      "arguments": { "qom-type": "rng-random", "id": "rng1",
1924 #                     "props": { "filename": "/dev/hwrng" } } }
1925 # <- { "return": {} }
1928 { 'command': 'object-add',
1929   'data': {'qom-type': 'str', 'id': 'str', '*props': 'any'} }
1932 # @object-del:
1934 # Remove a QOM object.
1936 # @id: the name of the QOM object to remove
1938 # Returns: Nothing on success
1939 #          Error if @id is not a valid id for a QOM object
1941 # Since: 2.0
1943 # Example:
1945 # -> { "execute": "object-del", "arguments": { "id": "rng1" } }
1946 # <- { "return": {} }
1949 { 'command': 'object-del', 'data': {'id': 'str'} }
1952 # @getfd:
1954 # Receive a file descriptor via SCM rights and assign it a name
1956 # @fdname: file descriptor name
1958 # Returns: Nothing on success
1960 # Since: 0.14.0
1962 # Notes: If @fdname already exists, the file descriptor assigned to
1963 #        it will be closed and replaced by the received file
1964 #        descriptor.
1966 #        The 'closefd' command can be used to explicitly close the
1967 #        file descriptor when it is no longer needed.
1969 # Example:
1971 # -> { "execute": "getfd", "arguments": { "fdname": "fd1" } }
1972 # <- { "return": {} }
1975 { 'command': 'getfd', 'data': {'fdname': 'str'} }
1978 # @closefd:
1980 # Close a file descriptor previously passed via SCM rights
1982 # @fdname: file descriptor name
1984 # Returns: Nothing on success
1986 # Since: 0.14.0
1988 # Example:
1990 # -> { "execute": "closefd", "arguments": { "fdname": "fd1" } }
1991 # <- { "return": {} }
1994 { 'command': 'closefd', 'data': {'fdname': 'str'} }
1997 # @MachineInfo:
1999 # Information describing a machine.
2001 # @name: the name of the machine
2003 # @alias: an alias for the machine name
2005 # @is-default: whether the machine is default
2007 # @cpu-max: maximum number of CPUs supported by the machine type
2008 #           (since 1.5.0)
2010 # @hotpluggable-cpus: cpu hotplug via -device is supported (since 2.7.0)
2012 # Since: 1.2.0
2014 { 'struct': 'MachineInfo',
2015   'data': { 'name': 'str', '*alias': 'str',
2016             '*is-default': 'bool', 'cpu-max': 'int',
2017             'hotpluggable-cpus': 'bool'} }
2020 # @query-machines:
2022 # Return a list of supported machines
2024 # Returns: a list of MachineInfo
2026 # Since: 1.2.0
2028 { 'command': 'query-machines', 'returns': ['MachineInfo'] }
2031 # @CpuDefinitionInfo:
2033 # Virtual CPU definition.
2035 # @name: the name of the CPU definition
2037 # @migration-safe: whether a CPU definition can be safely used for
2038 #                  migration in combination with a QEMU compatibility machine
2039 #                  when migrating between different QMU versions and between
2040 #                  hosts with different sets of (hardware or software)
2041 #                  capabilities. If not provided, information is not available
2042 #                  and callers should not assume the CPU definition to be
2043 #                  migration-safe. (since 2.8)
2045 # @static: whether a CPU definition is static and will not change depending on
2046 #          QEMU version, machine type, machine options and accelerator options.
2047 #          A static model is always migration-safe. (since 2.8)
2049 # @unavailable-features: List of properties that prevent
2050 #                        the CPU model from running in the current
2051 #                        host. (since 2.8)
2052 # @typename: Type name that can be used as argument to @device-list-properties,
2053 #            to introspect properties configurable using -cpu or -global.
2054 #            (since 2.9)
2056 # @unavailable-features is a list of QOM property names that
2057 # represent CPU model attributes that prevent the CPU from running.
2058 # If the QOM property is read-only, that means there's no known
2059 # way to make the CPU model run in the current host. Implementations
2060 # that choose not to provide specific information return the
2061 # property name "type".
2062 # If the property is read-write, it means that it MAY be possible
2063 # to run the CPU model in the current host if that property is
2064 # changed. Management software can use it as hints to suggest or
2065 # choose an alternative for the user, or just to generate meaningful
2066 # error messages explaining why the CPU model can't be used.
2067 # If @unavailable-features is an empty list, the CPU model is
2068 # runnable using the current host and machine-type.
2069 # If @unavailable-features is not present, runnability
2070 # information for the CPU is not available.
2072 # Since: 1.2.0
2074 { 'struct': 'CpuDefinitionInfo',
2075   'data': { 'name': 'str', '*migration-safe': 'bool', 'static': 'bool',
2076             '*unavailable-features': [ 'str' ], 'typename': 'str' } }
2079 # @MemoryInfo:
2081 # Actual memory information in bytes.
2083 # @base-memory: size of "base" memory specified with command line
2084 #               option -m.
2086 # @plugged-memory: size of memory that can be hot-unplugged. This field
2087 #                  is omitted if target doesn't support memory hotplug
2088 #                  (i.e. CONFIG_MEM_HOTPLUG not defined on build time).
2090 # Since: 2.11.0
2092 { 'struct': 'MemoryInfo',
2093   'data'  : { 'base-memory': 'size', '*plugged-memory': 'size' } }
2096 # @query-memory-size-summary:
2098 # Return the amount of initially allocated and present hotpluggable (if
2099 # enabled) memory in bytes.
2101 # Example:
2103 # -> { "execute": "query-memory-size-summary" }
2104 # <- { "return": { "base-memory": 4294967296, "plugged-memory": 0 } }
2106 # Since: 2.11.0
2108 { 'command': 'query-memory-size-summary', 'returns': 'MemoryInfo' }
2111 # @query-cpu-definitions:
2113 # Return a list of supported virtual CPU definitions
2115 # Returns: a list of CpuDefInfo
2117 # Since: 1.2.0
2119 { 'command': 'query-cpu-definitions', 'returns': ['CpuDefinitionInfo'] }
2122 # @CpuModelInfo:
2124 # Virtual CPU model.
2126 # A CPU model consists of the name of a CPU definition, to which
2127 # delta changes are applied (e.g. features added/removed). Most magic values
2128 # that an architecture might require should be hidden behind the name.
2129 # However, if required, architectures can expose relevant properties.
2131 # @name: the name of the CPU definition the model is based on
2132 # @props: a dictionary of QOM properties to be applied
2134 # Since: 2.8.0
2136 { 'struct': 'CpuModelInfo',
2137   'data': { 'name': 'str',
2138             '*props': 'any' } }
2141 # @CpuModelExpansionType:
2143 # An enumeration of CPU model expansion types.
2145 # @static: Expand to a static CPU model, a combination of a static base
2146 #          model name and property delta changes. As the static base model will
2147 #          never change, the expanded CPU model will be the same, independent of
2148 #          independent of QEMU version, machine type, machine options, and
2149 #          accelerator options. Therefore, the resulting model can be used by
2150 #          tooling without having to specify a compatibility machine - e.g. when
2151 #          displaying the "host" model. static CPU models are migration-safe.
2153 # @full: Expand all properties. The produced model is not guaranteed to be
2154 #        migration-safe, but allows tooling to get an insight and work with
2155 #        model details.
2157 # Note: When a non-migration-safe CPU model is expanded in static mode, some
2158 # features enabled by the CPU model may be omitted, because they can't be
2159 # implemented by a static CPU model definition (e.g. cache info passthrough and
2160 # PMU passthrough in x86). If you need an accurate representation of the
2161 # features enabled by a non-migration-safe CPU model, use @full. If you need a
2162 # static representation that will keep ABI compatibility even when changing QEMU
2163 # version or machine-type, use @static (but keep in mind that some features may
2164 # be omitted).
2166 # Since: 2.8.0
2168 { 'enum': 'CpuModelExpansionType',
2169   'data': [ 'static', 'full' ] }
2173 # @CpuModelExpansionInfo:
2175 # The result of a cpu model expansion.
2177 # @model: the expanded CpuModelInfo.
2179 # Since: 2.8.0
2181 { 'struct': 'CpuModelExpansionInfo',
2182   'data': { 'model': 'CpuModelInfo' } }
2186 # @query-cpu-model-expansion:
2188 # Expands a given CPU model (or a combination of CPU model + additional options)
2189 # to different granularities, allowing tooling to get an understanding what a
2190 # specific CPU model looks like in QEMU under a certain configuration.
2192 # This interface can be used to query the "host" CPU model.
2194 # The data returned by this command may be affected by:
2196 # * QEMU version: CPU models may look different depending on the QEMU version.
2197 #   (Except for CPU models reported as "static" in query-cpu-definitions.)
2198 # * machine-type: CPU model  may look different depending on the machine-type.
2199 #   (Except for CPU models reported as "static" in query-cpu-definitions.)
2200 # * machine options (including accelerator): in some architectures, CPU models
2201 #   may look different depending on machine and accelerator options. (Except for
2202 #   CPU models reported as "static" in query-cpu-definitions.)
2203 # * "-cpu" arguments and global properties: arguments to the -cpu option and
2204 #   global properties may affect expansion of CPU models. Using
2205 #   query-cpu-model-expansion while using these is not advised.
2207 # Some architectures may not support all expansion types. s390x supports
2208 # "full" and "static".
2210 # Returns: a CpuModelExpansionInfo. Returns an error if expanding CPU models is
2211 #          not supported, if the model cannot be expanded, if the model contains
2212 #          an unknown CPU definition name, unknown properties or properties
2213 #          with a wrong type. Also returns an error if an expansion type is
2214 #          not supported.
2216 # Since: 2.8.0
2218 { 'command': 'query-cpu-model-expansion',
2219   'data': { 'type': 'CpuModelExpansionType',
2220             'model': 'CpuModelInfo' },
2221   'returns': 'CpuModelExpansionInfo' }
2224 # @CpuModelCompareResult:
2226 # An enumeration of CPU model comparison results. The result is usually
2227 # calculated using e.g. CPU features or CPU generations.
2229 # @incompatible: If model A is incompatible to model B, model A is not
2230 #                guaranteed to run where model B runs and the other way around.
2232 # @identical: If model A is identical to model B, model A is guaranteed to run
2233 #             where model B runs and the other way around.
2235 # @superset: If model A is a superset of model B, model B is guaranteed to run
2236 #            where model A runs. There are no guarantees about the other way.
2238 # @subset: If model A is a subset of model B, model A is guaranteed to run
2239 #          where model B runs. There are no guarantees about the other way.
2241 # Since: 2.8.0
2243 { 'enum': 'CpuModelCompareResult',
2244   'data': [ 'incompatible', 'identical', 'superset', 'subset' ] }
2247 # @CpuModelCompareInfo:
2249 # The result of a CPU model comparison.
2251 # @result: The result of the compare operation.
2252 # @responsible-properties: List of properties that led to the comparison result
2253 #                          not being identical.
2255 # @responsible-properties is a list of QOM property names that led to
2256 # both CPUs not being detected as identical. For identical models, this
2257 # list is empty.
2258 # If a QOM property is read-only, that means there's no known way to make the
2259 # CPU models identical. If the special property name "type" is included, the
2260 # models are by definition not identical and cannot be made identical.
2262 # Since: 2.8.0
2264 { 'struct': 'CpuModelCompareInfo',
2265   'data': {'result': 'CpuModelCompareResult',
2266            'responsible-properties': ['str']
2267           }
2271 # @query-cpu-model-comparison:
2273 # Compares two CPU models, returning how they compare in a specific
2274 # configuration. The results indicates how both models compare regarding
2275 # runnability. This result can be used by tooling to make decisions if a
2276 # certain CPU model will run in a certain configuration or if a compatible
2277 # CPU model has to be created by baselining.
2279 # Usually, a CPU model is compared against the maximum possible CPU model
2280 # of a certain configuration (e.g. the "host" model for KVM). If that CPU
2281 # model is identical or a subset, it will run in that configuration.
2283 # The result returned by this command may be affected by:
2285 # * QEMU version: CPU models may look different depending on the QEMU version.
2286 #   (Except for CPU models reported as "static" in query-cpu-definitions.)
2287 # * machine-type: CPU model may look different depending on the machine-type.
2288 #   (Except for CPU models reported as "static" in query-cpu-definitions.)
2289 # * machine options (including accelerator): in some architectures, CPU models
2290 #   may look different depending on machine and accelerator options. (Except for
2291 #   CPU models reported as "static" in query-cpu-definitions.)
2292 # * "-cpu" arguments and global properties: arguments to the -cpu option and
2293 #   global properties may affect expansion of CPU models. Using
2294 #   query-cpu-model-expansion while using these is not advised.
2296 # Some architectures may not support comparing CPU models. s390x supports
2297 # comparing CPU models.
2299 # Returns: a CpuModelBaselineInfo. Returns an error if comparing CPU models is
2300 #          not supported, if a model cannot be used, if a model contains
2301 #          an unknown cpu definition name, unknown properties or properties
2302 #          with wrong types.
2304 # Since: 2.8.0
2306 { 'command': 'query-cpu-model-comparison',
2307   'data': { 'modela': 'CpuModelInfo', 'modelb': 'CpuModelInfo' },
2308   'returns': 'CpuModelCompareInfo' }
2311 # @CpuModelBaselineInfo:
2313 # The result of a CPU model baseline.
2315 # @model: the baselined CpuModelInfo.
2317 # Since: 2.8.0
2319 { 'struct': 'CpuModelBaselineInfo',
2320   'data': { 'model': 'CpuModelInfo' } }
2323 # @query-cpu-model-baseline:
2325 # Baseline two CPU models, creating a compatible third model. The created
2326 # model will always be a static, migration-safe CPU model (see "static"
2327 # CPU model expansion for details).
2329 # This interface can be used by tooling to create a compatible CPU model out
2330 # two CPU models. The created CPU model will be identical to or a subset of
2331 # both CPU models when comparing them. Therefore, the created CPU model is
2332 # guaranteed to run where the given CPU models run.
2334 # The result returned by this command may be affected by:
2336 # * QEMU version: CPU models may look different depending on the QEMU version.
2337 #   (Except for CPU models reported as "static" in query-cpu-definitions.)
2338 # * machine-type: CPU model may look different depending on the machine-type.
2339 #   (Except for CPU models reported as "static" in query-cpu-definitions.)
2340 # * machine options (including accelerator): in some architectures, CPU models
2341 #   may look different depending on machine and accelerator options. (Except for
2342 #   CPU models reported as "static" in query-cpu-definitions.)
2343 # * "-cpu" arguments and global properties: arguments to the -cpu option and
2344 #   global properties may affect expansion of CPU models. Using
2345 #   query-cpu-model-expansion while using these is not advised.
2347 # Some architectures may not support baselining CPU models. s390x supports
2348 # baselining CPU models.
2350 # Returns: a CpuModelBaselineInfo. Returns an error if baselining CPU models is
2351 #          not supported, if a model cannot be used, if a model contains
2352 #          an unknown cpu definition name, unknown properties or properties
2353 #          with wrong types.
2355 # Since: 2.8.0
2357 { 'command': 'query-cpu-model-baseline',
2358   'data': { 'modela': 'CpuModelInfo',
2359             'modelb': 'CpuModelInfo' },
2360   'returns': 'CpuModelBaselineInfo' }
2363 # @AddfdInfo:
2365 # Information about a file descriptor that was added to an fd set.
2367 # @fdset-id: The ID of the fd set that @fd was added to.
2369 # @fd: The file descriptor that was received via SCM rights and
2370 #      added to the fd set.
2372 # Since: 1.2.0
2374 { 'struct': 'AddfdInfo', 'data': {'fdset-id': 'int', 'fd': 'int'} }
2377 # @add-fd:
2379 # Add a file descriptor, that was passed via SCM rights, to an fd set.
2381 # @fdset-id: The ID of the fd set to add the file descriptor to.
2383 # @opaque: A free-form string that can be used to describe the fd.
2385 # Returns: @AddfdInfo on success
2387 #          If file descriptor was not received, FdNotSupplied
2389 #          If @fdset-id is a negative value, InvalidParameterValue
2391 # Notes: The list of fd sets is shared by all monitor connections.
2393 #        If @fdset-id is not specified, a new fd set will be created.
2395 # Since: 1.2.0
2397 # Example:
2399 # -> { "execute": "add-fd", "arguments": { "fdset-id": 1 } }
2400 # <- { "return": { "fdset-id": 1, "fd": 3 } }
2403 { 'command': 'add-fd', 'data': {'*fdset-id': 'int', '*opaque': 'str'},
2404   'returns': 'AddfdInfo' }
2407 # @remove-fd:
2409 # Remove a file descriptor from an fd set.
2411 # @fdset-id: The ID of the fd set that the file descriptor belongs to.
2413 # @fd: The file descriptor that is to be removed.
2415 # Returns: Nothing on success
2416 #          If @fdset-id or @fd is not found, FdNotFound
2418 # Since: 1.2.0
2420 # Notes: The list of fd sets is shared by all monitor connections.
2422 #        If @fd is not specified, all file descriptors in @fdset-id
2423 #        will be removed.
2425 # Example:
2427 # -> { "execute": "remove-fd", "arguments": { "fdset-id": 1, "fd": 3 } }
2428 # <- { "return": {} }
2431 { 'command': 'remove-fd', 'data': {'fdset-id': 'int', '*fd': 'int'} }
2434 # @FdsetFdInfo:
2436 # Information about a file descriptor that belongs to an fd set.
2438 # @fd: The file descriptor value.
2440 # @opaque: A free-form string that can be used to describe the fd.
2442 # Since: 1.2.0
2444 { 'struct': 'FdsetFdInfo',
2445   'data': {'fd': 'int', '*opaque': 'str'} }
2448 # @FdsetInfo:
2450 # Information about an fd set.
2452 # @fdset-id: The ID of the fd set.
2454 # @fds: A list of file descriptors that belong to this fd set.
2456 # Since: 1.2.0
2458 { 'struct': 'FdsetInfo',
2459   'data': {'fdset-id': 'int', 'fds': ['FdsetFdInfo']} }
2462 # @query-fdsets:
2464 # Return information describing all fd sets.
2466 # Returns: A list of @FdsetInfo
2468 # Since: 1.2.0
2470 # Note: The list of fd sets is shared by all monitor connections.
2472 # Example:
2474 # -> { "execute": "query-fdsets" }
2475 # <- { "return": [
2476 #        {
2477 #          "fds": [
2478 #            {
2479 #              "fd": 30,
2480 #              "opaque": "rdonly:/path/to/file"
2481 #            },
2482 #            {
2483 #              "fd": 24,
2484 #              "opaque": "rdwr:/path/to/file"
2485 #            }
2486 #          ],
2487 #          "fdset-id": 1
2488 #        },
2489 #        {
2490 #          "fds": [
2491 #            {
2492 #              "fd": 28
2493 #            },
2494 #            {
2495 #              "fd": 29
2496 #            }
2497 #          ],
2498 #          "fdset-id": 0
2499 #        }
2500 #      ]
2501 #    }
2504 { 'command': 'query-fdsets', 'returns': ['FdsetInfo'] }
2507 # @TargetInfo:
2509 # Information describing the QEMU target.
2511 # @arch: the target architecture
2513 # Since: 1.2.0
2515 { 'struct': 'TargetInfo',
2516   'data': { 'arch': 'SysEmuTarget' } }
2519 # @query-target:
2521 # Return information about the target for this QEMU
2523 # Returns: TargetInfo
2525 # Since: 1.2.0
2527 { 'command': 'query-target', 'returns': 'TargetInfo' }
2530 # @AcpiTableOptions:
2532 # Specify an ACPI table on the command line to load.
2534 # At most one of @file and @data can be specified. The list of files specified
2535 # by any one of them is loaded and concatenated in order. If both are omitted,
2536 # @data is implied.
2538 # Other fields / optargs can be used to override fields of the generic ACPI
2539 # table header; refer to the ACPI specification 5.0, section 5.2.6 System
2540 # Description Table Header. If a header field is not overridden, then the
2541 # corresponding value from the concatenated blob is used (in case of @file), or
2542 # it is filled in with a hard-coded value (in case of @data).
2544 # String fields are copied into the matching ACPI member from lowest address
2545 # upwards, and silently truncated / NUL-padded to length.
2547 # @sig: table signature / identifier (4 bytes)
2549 # @rev: table revision number (dependent on signature, 1 byte)
2551 # @oem_id: OEM identifier (6 bytes)
2553 # @oem_table_id: OEM table identifier (8 bytes)
2555 # @oem_rev: OEM-supplied revision number (4 bytes)
2557 # @asl_compiler_id: identifier of the utility that created the table
2558 #                   (4 bytes)
2560 # @asl_compiler_rev: revision number of the utility that created the
2561 #                    table (4 bytes)
2563 # @file: colon (:) separated list of pathnames to load and
2564 #        concatenate as table data. The resultant binary blob is expected to
2565 #        have an ACPI table header. At least one file is required. This field
2566 #        excludes @data.
2568 # @data: colon (:) separated list of pathnames to load and
2569 #        concatenate as table data. The resultant binary blob must not have an
2570 #        ACPI table header. At least one file is required. This field excludes
2571 #        @file.
2573 # Since: 1.5
2575 { 'struct': 'AcpiTableOptions',
2576   'data': {
2577     '*sig':               'str',
2578     '*rev':               'uint8',
2579     '*oem_id':            'str',
2580     '*oem_table_id':      'str',
2581     '*oem_rev':           'uint32',
2582     '*asl_compiler_id':   'str',
2583     '*asl_compiler_rev':  'uint32',
2584     '*file':              'str',
2585     '*data':              'str' }}
2588 # @CommandLineParameterType:
2590 # Possible types for an option parameter.
2592 # @string: accepts a character string
2594 # @boolean: accepts "on" or "off"
2596 # @number: accepts a number
2598 # @size: accepts a number followed by an optional suffix (K)ilo,
2599 #        (M)ega, (G)iga, (T)era
2601 # Since: 1.5
2603 { 'enum': 'CommandLineParameterType',
2604   'data': ['string', 'boolean', 'number', 'size'] }
2607 # @CommandLineParameterInfo:
2609 # Details about a single parameter of a command line option.
2611 # @name: parameter name
2613 # @type: parameter @CommandLineParameterType
2615 # @help: human readable text string, not suitable for parsing.
2617 # @default: default value string (since 2.1)
2619 # Since: 1.5
2621 { 'struct': 'CommandLineParameterInfo',
2622   'data': { 'name': 'str',
2623             'type': 'CommandLineParameterType',
2624             '*help': 'str',
2625             '*default': 'str' } }
2628 # @CommandLineOptionInfo:
2630 # Details about a command line option, including its list of parameter details
2632 # @option: option name
2634 # @parameters: an array of @CommandLineParameterInfo
2636 # Since: 1.5
2638 { 'struct': 'CommandLineOptionInfo',
2639   'data': { 'option': 'str', 'parameters': ['CommandLineParameterInfo'] } }
2642 # @query-command-line-options:
2644 # Query command line option schema.
2646 # @option: option name
2648 # Returns: list of @CommandLineOptionInfo for all options (or for the given
2649 #          @option).  Returns an error if the given @option doesn't exist.
2651 # Since: 1.5
2653 # Example:
2655 # -> { "execute": "query-command-line-options",
2656 #      "arguments": { "option": "option-rom" } }
2657 # <- { "return": [
2658 #         {
2659 #             "parameters": [
2660 #                 {
2661 #                     "name": "romfile",
2662 #                     "type": "string"
2663 #                 },
2664 #                 {
2665 #                     "name": "bootindex",
2666 #                     "type": "number"
2667 #                 }
2668 #             ],
2669 #             "option": "option-rom"
2670 #         }
2671 #      ]
2672 #    }
2675 {'command': 'query-command-line-options', 'data': { '*option': 'str' },
2676  'returns': ['CommandLineOptionInfo'],
2677  'allow-preconfig': true }
2680 # @X86CPURegister32:
2682 # A X86 32-bit register
2684 # Since: 1.5
2686 { 'enum': 'X86CPURegister32',
2687   'data': [ 'EAX', 'EBX', 'ECX', 'EDX', 'ESP', 'EBP', 'ESI', 'EDI' ] }
2690 # @X86CPUFeatureWordInfo:
2692 # Information about a X86 CPU feature word
2694 # @cpuid-input-eax: Input EAX value for CPUID instruction for that feature word
2696 # @cpuid-input-ecx: Input ECX value for CPUID instruction for that
2697 #                   feature word
2699 # @cpuid-register: Output register containing the feature bits
2701 # @features: value of output register, containing the feature bits
2703 # Since: 1.5
2705 { 'struct': 'X86CPUFeatureWordInfo',
2706   'data': { 'cpuid-input-eax': 'int',
2707             '*cpuid-input-ecx': 'int',
2708             'cpuid-register': 'X86CPURegister32',
2709             'features': 'int' } }
2712 # @DummyForceArrays:
2714 # Not used by QMP; hack to let us use X86CPUFeatureWordInfoList internally
2716 # Since: 2.5
2718 { 'struct': 'DummyForceArrays',
2719   'data': { 'unused': ['X86CPUFeatureWordInfo'] } }
2723 # @NumaOptionsType:
2725 # @node: NUMA nodes configuration
2727 # @dist: NUMA distance configuration (since 2.10)
2729 # @cpu: property based CPU(s) to node mapping (Since: 2.10)
2731 # Since: 2.1
2733 { 'enum': 'NumaOptionsType',
2734   'data': [ 'node', 'dist', 'cpu' ] }
2737 # @NumaOptions:
2739 # A discriminated record of NUMA options. (for OptsVisitor)
2741 # Since: 2.1
2743 { 'union': 'NumaOptions',
2744   'base': { 'type': 'NumaOptionsType' },
2745   'discriminator': 'type',
2746   'data': {
2747     'node': 'NumaNodeOptions',
2748     'dist': 'NumaDistOptions',
2749     'cpu': 'NumaCpuOptions' }}
2752 # @NumaNodeOptions:
2754 # Create a guest NUMA node. (for OptsVisitor)
2756 # @nodeid: NUMA node ID (increase by 1 from 0 if omitted)
2758 # @cpus: VCPUs belonging to this node (assign VCPUS round-robin
2759 #         if omitted)
2761 # @mem: memory size of this node; mutually exclusive with @memdev.
2762 #       Equally divide total memory among nodes if both @mem and @memdev are
2763 #       omitted.
2765 # @memdev: memory backend object.  If specified for one node,
2766 #          it must be specified for all nodes.
2768 # Since: 2.1
2770 { 'struct': 'NumaNodeOptions',
2771   'data': {
2772    '*nodeid': 'uint16',
2773    '*cpus':   ['uint16'],
2774    '*mem':    'size',
2775    '*memdev': 'str' }}
2778 # @NumaDistOptions:
2780 # Set the distance between 2 NUMA nodes.
2782 # @src: source NUMA node.
2784 # @dst: destination NUMA node.
2786 # @val: NUMA distance from source node to destination node.
2787 #       When a node is unreachable from another node, set the distance
2788 #       between them to 255.
2790 # Since: 2.10
2792 { 'struct': 'NumaDistOptions',
2793   'data': {
2794    'src': 'uint16',
2795    'dst': 'uint16',
2796    'val': 'uint8' }}
2799 # @NumaCpuOptions:
2801 # Option "-numa cpu" overrides default cpu to node mapping.
2802 # It accepts the same set of cpu properties as returned by
2803 # query-hotpluggable-cpus[].props, where node-id could be used to
2804 # override default node mapping.
2806 # Since: 2.10
2808 { 'struct': 'NumaCpuOptions',
2809    'base': 'CpuInstanceProperties',
2810    'data' : {} }
2813 # @HostMemPolicy:
2815 # Host memory policy types
2817 # @default: restore default policy, remove any nondefault policy
2819 # @preferred: set the preferred host nodes for allocation
2821 # @bind: a strict policy that restricts memory allocation to the
2822 #        host nodes specified
2824 # @interleave: memory allocations are interleaved across the set
2825 #              of host nodes specified
2827 # Since: 2.1
2829 { 'enum': 'HostMemPolicy',
2830   'data': [ 'default', 'preferred', 'bind', 'interleave' ] }
2833 # @Memdev:
2835 # Information about memory backend
2837 # @id: backend's ID if backend has 'id' property (since 2.9)
2839 # @size: memory backend size
2841 # @merge: enables or disables memory merge support
2843 # @dump: includes memory backend's memory in a core dump or not
2845 # @prealloc: enables or disables memory preallocation
2847 # @host-nodes: host nodes for its memory policy
2849 # @policy: memory policy of memory backend
2851 # Since: 2.1
2853 { 'struct': 'Memdev',
2854   'data': {
2855     '*id':        'str',
2856     'size':       'size',
2857     'merge':      'bool',
2858     'dump':       'bool',
2859     'prealloc':   'bool',
2860     'host-nodes': ['uint16'],
2861     'policy':     'HostMemPolicy' }}
2864 # @query-memdev:
2866 # Returns information for all memory backends.
2868 # Returns: a list of @Memdev.
2870 # Since: 2.1
2872 # Example:
2874 # -> { "execute": "query-memdev" }
2875 # <- { "return": [
2876 #        {
2877 #          "id": "mem1",
2878 #          "size": 536870912,
2879 #          "merge": false,
2880 #          "dump": true,
2881 #          "prealloc": false,
2882 #          "host-nodes": [0, 1],
2883 #          "policy": "bind"
2884 #        },
2885 #        {
2886 #          "size": 536870912,
2887 #          "merge": false,
2888 #          "dump": true,
2889 #          "prealloc": true,
2890 #          "host-nodes": [2, 3],
2891 #          "policy": "preferred"
2892 #        }
2893 #      ]
2894 #    }
2897 { 'command': 'query-memdev', 'returns': ['Memdev'] }
2900 # @PCDIMMDeviceInfo:
2902 # PCDIMMDevice state information
2904 # @id: device's ID
2906 # @addr: physical address, where device is mapped
2908 # @size: size of memory that the device provides
2910 # @slot: slot number at which device is plugged in
2912 # @node: NUMA node number where device is plugged in
2914 # @memdev: memory backend linked with device
2916 # @hotplugged: true if device was hotplugged
2918 # @hotpluggable: true if device if could be added/removed while machine is running
2920 # Since: 2.1
2922 { 'struct': 'PCDIMMDeviceInfo',
2923   'data': { '*id': 'str',
2924             'addr': 'int',
2925             'size': 'int',
2926             'slot': 'int',
2927             'node': 'int',
2928             'memdev': 'str',
2929             'hotplugged': 'bool',
2930             'hotpluggable': 'bool'
2931           }
2935 # @MemoryDeviceInfo:
2937 # Union containing information about a memory device
2939 # Since: 2.1
2941 { 'union': 'MemoryDeviceInfo',
2942   'data': { 'dimm': 'PCDIMMDeviceInfo',
2943             'nvdimm': 'PCDIMMDeviceInfo'
2944           }
2948 # @query-memory-devices:
2950 # Lists available memory devices and their state
2952 # Since: 2.1
2954 # Example:
2956 # -> { "execute": "query-memory-devices" }
2957 # <- { "return": [ { "data":
2958 #                       { "addr": 5368709120,
2959 #                         "hotpluggable": true,
2960 #                         "hotplugged": true,
2961 #                         "id": "d1",
2962 #                         "memdev": "/objects/memX",
2963 #                         "node": 0,
2964 #                         "size": 1073741824,
2965 #                         "slot": 0},
2966 #                    "type": "dimm"
2967 #                  } ] }
2970 { 'command': 'query-memory-devices', 'returns': ['MemoryDeviceInfo'] }
2973 # @MEM_UNPLUG_ERROR:
2975 # Emitted when memory hot unplug error occurs.
2977 # @device: device name
2979 # @msg: Informative message
2981 # Since: 2.4
2983 # Example:
2985 # <- { "event": "MEM_UNPLUG_ERROR"
2986 #      "data": { "device": "dimm1",
2987 #                "msg": "acpi: device unplug for unsupported device"
2988 #      },
2989 #      "timestamp": { "seconds": 1265044230, "microseconds": 450486 } }
2992 { 'event': 'MEM_UNPLUG_ERROR',
2993   'data': { 'device': 'str', 'msg': 'str' } }
2996 # @ACPISlotType:
2998 # @DIMM: memory slot
2999 # @CPU: logical CPU slot (since 2.7)
3001 { 'enum': 'ACPISlotType', 'data': [ 'DIMM', 'CPU' ] }
3004 # @ACPIOSTInfo:
3006 # OSPM Status Indication for a device
3007 # For description of possible values of @source and @status fields
3008 # see "_OST (OSPM Status Indication)" chapter of ACPI5.0 spec.
3010 # @device: device ID associated with slot
3012 # @slot: slot ID, unique per slot of a given @slot-type
3014 # @slot-type: type of the slot
3016 # @source: an integer containing the source event
3018 # @status: an integer containing the status code
3020 # Since: 2.1
3022 { 'struct': 'ACPIOSTInfo',
3023   'data'  : { '*device': 'str',
3024               'slot': 'str',
3025               'slot-type': 'ACPISlotType',
3026               'source': 'int',
3027               'status': 'int' } }
3030 # @query-acpi-ospm-status:
3032 # Return a list of ACPIOSTInfo for devices that support status
3033 # reporting via ACPI _OST method.
3035 # Since: 2.1
3037 # Example:
3039 # -> { "execute": "query-acpi-ospm-status" }
3040 # <- { "return": [ { "device": "d1", "slot": "0", "slot-type": "DIMM", "source": 1, "status": 0},
3041 #                  { "slot": "1", "slot-type": "DIMM", "source": 0, "status": 0},
3042 #                  { "slot": "2", "slot-type": "DIMM", "source": 0, "status": 0},
3043 #                  { "slot": "3", "slot-type": "DIMM", "source": 0, "status": 0}
3044 #    ]}
3047 { 'command': 'query-acpi-ospm-status', 'returns': ['ACPIOSTInfo'] }
3050 # @ACPI_DEVICE_OST:
3052 # Emitted when guest executes ACPI _OST method.
3054 # @info: OSPM Status Indication
3056 # Since: 2.1
3058 # Example:
3060 # <- { "event": "ACPI_DEVICE_OST",
3061 #      "data": { "device": "d1", "slot": "0",
3062 #                "slot-type": "DIMM", "source": 1, "status": 0 } }
3065 { 'event': 'ACPI_DEVICE_OST',
3066      'data': { 'info': 'ACPIOSTInfo' } }
3069 # @rtc-reset-reinjection:
3071 # This command will reset the RTC interrupt reinjection backlog.
3072 # Can be used if another mechanism to synchronize guest time
3073 # is in effect, for example QEMU guest agent's guest-set-time
3074 # command.
3076 # Since: 2.1
3078 # Example:
3080 # -> { "execute": "rtc-reset-reinjection" }
3081 # <- { "return": {} }
3084 { 'command': 'rtc-reset-reinjection' }
3087 # @RTC_CHANGE:
3089 # Emitted when the guest changes the RTC time.
3091 # @offset: offset between base RTC clock (as specified by -rtc base), and
3092 #          new RTC clock value
3094 # Note: This event is rate-limited.
3096 # Since: 0.13.0
3098 # Example:
3100 # <-   { "event": "RTC_CHANGE",
3101 #        "data": { "offset": 78 },
3102 #        "timestamp": { "seconds": 1267020223, "microseconds": 435656 } }
3105 { 'event': 'RTC_CHANGE',
3106   'data': { 'offset': 'int' } }
3109 # @ReplayMode:
3111 # Mode of the replay subsystem.
3113 # @none: normal execution mode. Replay or record are not enabled.
3115 # @record: record mode. All non-deterministic data is written into the
3116 #          replay log.
3118 # @play: replay mode. Non-deterministic data required for system execution
3119 #        is read from the log.
3121 # Since: 2.5
3123 { 'enum': 'ReplayMode',
3124   'data': [ 'none', 'record', 'play' ] }
3127 # @xen-load-devices-state:
3129 # Load the state of all devices from file. The RAM and the block devices
3130 # of the VM are not loaded by this command.
3132 # @filename: the file to load the state of the devices from as binary
3133 # data. See xen-save-devices-state.txt for a description of the binary
3134 # format.
3136 # Since: 2.7
3138 # Example:
3140 # -> { "execute": "xen-load-devices-state",
3141 #      "arguments": { "filename": "/tmp/resume" } }
3142 # <- { "return": {} }
3145 { 'command': 'xen-load-devices-state', 'data': {'filename': 'str'} }
3148 # @GICCapability:
3150 # The struct describes capability for a specific GIC (Generic
3151 # Interrupt Controller) version. These bits are not only decided by
3152 # QEMU/KVM software version, but also decided by the hardware that
3153 # the program is running upon.
3155 # @version:  version of GIC to be described. Currently, only 2 and 3
3156 #            are supported.
3158 # @emulated: whether current QEMU/hardware supports emulated GIC
3159 #            device in user space.
3161 # @kernel:   whether current QEMU/hardware supports hardware
3162 #            accelerated GIC device in kernel.
3164 # Since: 2.6
3166 { 'struct': 'GICCapability',
3167   'data': { 'version': 'int',
3168             'emulated': 'bool',
3169             'kernel': 'bool' } }
3172 # @query-gic-capabilities:
3174 # This command is ARM-only. It will return a list of GICCapability
3175 # objects that describe its capability bits.
3177 # Returns: a list of GICCapability objects.
3179 # Since: 2.6
3181 # Example:
3183 # -> { "execute": "query-gic-capabilities" }
3184 # <- { "return": [{ "version": 2, "emulated": true, "kernel": false },
3185 #                 { "version": 3, "emulated": false, "kernel": true } ] }
3188 { 'command': 'query-gic-capabilities', 'returns': ['GICCapability'] }
3191 # @CpuInstanceProperties:
3193 # List of properties to be used for hotplugging a CPU instance,
3194 # it should be passed by management with device_add command when
3195 # a CPU is being hotplugged.
3197 # @node-id: NUMA node ID the CPU belongs to
3198 # @socket-id: socket number within node/board the CPU belongs to
3199 # @core-id: core number within socket the CPU belongs to
3200 # @thread-id: thread number within core the CPU belongs to
3202 # Note: currently there are 4 properties that could be present
3203 # but management should be prepared to pass through other
3204 # properties with device_add command to allow for future
3205 # interface extension. This also requires the filed names to be kept in
3206 # sync with the properties passed to -device/device_add.
3208 # Since: 2.7
3210 { 'struct': 'CpuInstanceProperties',
3211   'data': { '*node-id': 'int',
3212             '*socket-id': 'int',
3213             '*core-id': 'int',
3214             '*thread-id': 'int'
3215   }
3219 # @HotpluggableCPU:
3221 # @type: CPU object type for usage with device_add command
3222 # @props: list of properties to be used for hotplugging CPU
3223 # @vcpus-count: number of logical VCPU threads @HotpluggableCPU provides
3224 # @qom-path: link to existing CPU object if CPU is present or
3225 #            omitted if CPU is not present.
3227 # Since: 2.7
3229 { 'struct': 'HotpluggableCPU',
3230   'data': { 'type': 'str',
3231             'vcpus-count': 'int',
3232             'props': 'CpuInstanceProperties',
3233             '*qom-path': 'str'
3234           }
3238 # @query-hotpluggable-cpus:
3240 # Returns: a list of HotpluggableCPU objects.
3242 # Since: 2.7
3244 # Example:
3246 # For pseries machine type started with -smp 2,cores=2,maxcpus=4 -cpu POWER8:
3248 # -> { "execute": "query-hotpluggable-cpus" }
3249 # <- {"return": [
3250 #      { "props": { "core": 8 }, "type": "POWER8-spapr-cpu-core",
3251 #        "vcpus-count": 1 },
3252 #      { "props": { "core": 0 }, "type": "POWER8-spapr-cpu-core",
3253 #        "vcpus-count": 1, "qom-path": "/machine/unattached/device[0]"}
3254 #    ]}'
3256 # For pc machine type started with -smp 1,maxcpus=2:
3258 # -> { "execute": "query-hotpluggable-cpus" }
3259 # <- {"return": [
3260 #      {
3261 #         "type": "qemu64-x86_64-cpu", "vcpus-count": 1,
3262 #         "props": {"core-id": 0, "socket-id": 1, "thread-id": 0}
3263 #      },
3264 #      {
3265 #         "qom-path": "/machine/unattached/device[0]",
3266 #         "type": "qemu64-x86_64-cpu", "vcpus-count": 1,
3267 #         "props": {"core-id": 0, "socket-id": 0, "thread-id": 0}
3268 #      }
3269 #    ]}
3271 # For s390x-virtio-ccw machine type started with -smp 1,maxcpus=2 -cpu qemu
3272 # (Since: 2.11):
3274 # -> { "execute": "query-hotpluggable-cpus" }
3275 # <- {"return": [
3276 #      {
3277 #         "type": "qemu-s390x-cpu", "vcpus-count": 1,
3278 #         "props": { "core-id": 1 }
3279 #      },
3280 #      {
3281 #         "qom-path": "/machine/unattached/device[0]",
3282 #         "type": "qemu-s390x-cpu", "vcpus-count": 1,
3283 #         "props": { "core-id": 0 }
3284 #      }
3285 #    ]}
3288 { 'command': 'query-hotpluggable-cpus', 'returns': ['HotpluggableCPU'],
3289              'allow-preconfig': true }
3292 # @GuidInfo:
3294 # GUID information.
3296 # @guid: the globally unique identifier
3298 # Since: 2.9
3300 { 'struct': 'GuidInfo', 'data': {'guid': 'str'} }
3303 # @query-vm-generation-id:
3305 # Show Virtual Machine Generation ID
3307 # Since: 2.9
3309 { 'command': 'query-vm-generation-id', 'returns': 'GuidInfo' }
3313 # @SevState:
3315 # An enumeration of SEV state information used during @query-sev.
3317 # @uninit: The guest is uninitialized.
3319 # @launch-update: The guest is currently being launched; plaintext data and
3320 #                 register state is being imported.
3322 # @launch-secret: The guest is currently being launched; ciphertext data
3323 #                 is being imported.
3325 # @running: The guest is fully launched or migrated in.
3327 # @send-update: The guest is currently being migrated out to another machine.
3329 # @receive-update: The guest is currently being migrated from another machine.
3331 # Since: 2.12
3333 { 'enum': 'SevState',
3334   'data': ['uninit', 'launch-update', 'launch-secret', 'running',
3335            'send-update', 'receive-update' ] }
3338 # @SevInfo:
3340 # Information about Secure Encrypted Virtualization (SEV) support
3342 # @enabled: true if SEV is active
3344 # @api-major: SEV API major version
3346 # @api-minor: SEV API minor version
3348 # @build-id: SEV FW build id
3350 # @policy: SEV policy value
3352 # @state: SEV guest state
3354 # @handle: SEV firmware handle
3356 # Since: 2.12
3358 { 'struct': 'SevInfo',
3359     'data': { 'enabled': 'bool',
3360               'api-major': 'uint8',
3361               'api-minor' : 'uint8',
3362               'build-id' : 'uint8',
3363               'policy' : 'uint32',
3364               'state' : 'SevState',
3365               'handle' : 'uint32'
3366             }
3370 # @query-sev:
3372 # Returns information about SEV
3374 # Returns: @SevInfo
3376 # Since: 2.12
3378 # Example:
3380 # -> { "execute": "query-sev" }
3381 # <- { "return": { "enabled": true, "api-major" : 0, "api-minor" : 0,
3382 #                  "build-id" : 0, "policy" : 0, "state" : "running",
3383 #                  "handle" : 1 } }
3386 { 'command': 'query-sev', 'returns': 'SevInfo' }
3389 # @SevLaunchMeasureInfo:
3391 # SEV Guest Launch measurement information
3393 # @data: the measurement value encoded in base64
3395 # Since: 2.12
3398 { 'struct': 'SevLaunchMeasureInfo', 'data': {'data': 'str'} }
3401 # @query-sev-launch-measure:
3403 # Query the SEV guest launch information.
3405 # Returns: The @SevLaunchMeasureInfo for the guest
3407 # Since: 2.12
3409 # Example:
3411 # -> { "execute": "query-sev-launch-measure" }
3412 # <- { "return": { "data": "4l8LXeNlSPUDlXPJG5966/8%YZ" } }
3415 { 'command': 'query-sev-launch-measure', 'returns': 'SevLaunchMeasureInfo' }
3418 # @SevCapability:
3420 # The struct describes capability for a Secure Encrypted Virtualization
3421 # feature.
3423 # @pdh:  Platform Diffie-Hellman key (base64 encoded)
3425 # @cert-chain:  PDH certificate chain (base64 encoded)
3427 # @cbitpos: C-bit location in page table entry
3429 # @reduced-phys-bits: Number of physical Address bit reduction when SEV is
3430 #                     enabled
3432 # Since: 2.12
3434 { 'struct': 'SevCapability',
3435   'data': { 'pdh': 'str',
3436             'cert-chain': 'str',
3437             'cbitpos': 'int',
3438             'reduced-phys-bits': 'int'} }
3441 # @query-sev-capabilities:
3443 # This command is used to get the SEV capabilities, and is supported on AMD
3444 # X86 platforms only.
3446 # Returns: SevCapability objects.
3448 # Since: 2.12
3450 # Example:
3452 # -> { "execute": "query-sev-capabilities" }
3453 # <- { "return": { "pdh": "8CCDD8DDD", "cert-chain": "888CCCDDDEE",
3454 #                  "cbitpos": 47, "reduced-phys-bits": 5}}
3457 { 'command': 'query-sev-capabilities', 'returns': 'SevCapability' }
3460 # @CommandDropReason:
3462 # Reasons that caused one command to be dropped.
3464 # @queue-full: the command queue is full. This can only occur when
3465 #              the client sends a new non-oob command before the
3466 #              response to the previous non-oob command has been
3467 #              received.
3469 # Since: 2.12
3471 { 'enum': 'CommandDropReason',
3472   'data': [ 'queue-full' ] }
3475 # @COMMAND_DROPPED:
3477 # Emitted when a command is dropped due to some reason.  Commands can
3478 # only be dropped when the oob capability is enabled.
3480 # @id: The dropped command's "id" field.
3482 # @reason: The reason why the command is dropped.
3484 # Since: 2.12
3486 # Example:
3488 # { "event": "COMMAND_DROPPED",
3489 #   "data": {"result": {"id": "libvirt-102",
3490 #                       "reason": "queue-full" } } }
3493 { 'event': 'COMMAND_DROPPED' ,
3494   'data': { 'id': 'any', 'reason': 'CommandDropReason' } }
3497 # @x-oob-test:
3499 # Test OOB functionality.  When sending this command with lock=true,
3500 # it'll try to hang the dispatcher.  When sending it with lock=false,
3501 # it'll try to notify the locked thread to continue.  Note: it should
3502 # only be used by QMP test program rather than anything else.
3504 # Since: 2.12
3506 # Example:
3508 # { "execute": "x-oob-test",
3509 #   "arguments": { "lock": true } }
3511 { 'command': 'x-oob-test', 'data' : { 'lock': 'bool' },
3512   'allow-oob': true }
3515 # @set-numa-node:
3517 # Runtime equivalent of '-numa' CLI option, available at
3518 # preconfigure stage to configure numa mapping before initializing
3519 # machine.
3521 # Since 3.0
3523 { 'command': 'set-numa-node', 'boxed': true,
3524   'data': 'NumaOptions',
3525   'allow-preconfig': true