11 # Enable QMP capabilities.
17 # -> { "execute": "qmp_capabilities" }
20 # Notes: This command is valid exactly when first connecting: it must be
21 # issued before any other command will be accepted, and will fail once the
22 # monitor is accepting other commands. (see qemu docs/interop/qmp-spec.txt)
27 { 'command': 'qmp_capabilities' }
32 # A three-part version number.
34 # @major: The major version number.
36 # @minor: The minor version number.
38 # @micro: The micro version number.
42 { 'struct': 'VersionTriple',
43 'data': {'major': 'int', 'minor': 'int', 'micro': 'int'} }
49 # A description of QEMU's version.
51 # @qemu: The version of QEMU. By current convention, a micro
52 # version of 50 signifies a development branch. A micro version
53 # greater than or equal to 90 signifies a release candidate for
54 # the next minor version. A micro version of less than 50
55 # signifies a stable release.
57 # @package: QEMU will always set this field to an empty string. Downstream
58 # versions of QEMU should set this to a non-empty string. The
59 # exact format depends on the downstream however it highly
60 # recommended that a unique name is used.
64 { 'struct': 'VersionInfo',
65 'data': {'qemu': 'VersionTriple', 'package': 'str'} }
70 # Returns the current version of QEMU.
72 # Returns: A @VersionInfo object describing the current version of QEMU.
78 # -> { "execute": "query-version" }
91 { 'command': 'query-version', 'returns': 'VersionInfo' }
96 # Information about a QMP command
98 # @name: The command name
102 { 'struct': 'CommandInfo', 'data': {'name': 'str'} }
107 # Return a list of supported QMP commands by this server
109 # Returns: A list of @CommandInfo for all supported commands
115 # -> { "execute": "query-commands" }
119 # "name":"query-balloon"
122 # "name":"system_powerdown"
127 # Note: This example has been shortened as the real response is too long.
130 { 'command': 'query-commands', 'returns': ['CommandInfo'] }
135 # Policy for handling lost ticks in timer devices.
137 # @discard: throw away the missed tick(s) and continue with future injection
138 # normally. Guest time may be delayed, unless the OS has explicit
139 # handling of lost ticks
141 # @delay: continue to deliver ticks at the normal rate. Guest time will be
142 # delayed due to the late tick
144 # @merge: merge the missed tick(s) into one tick and inject. Guest time
145 # may be delayed, depending on how the OS reacts to the merging
148 # @slew: deliver ticks at a higher rate to catch up with the missed tick. The
149 # guest time should not be delayed once catchup is complete.
153 { 'enum': 'LostTickPolicy',
154 'data': ['discard', 'delay', 'merge', 'slew' ] }
159 # Allow client connections for VNC, Spice and socket based
160 # character devices to be passed in to QEMU via SCM_RIGHTS.
162 # @protocol: protocol name. Valid names are "vnc", "spice" or the
163 # name of a character device (eg. from -chardev id=XXXX)
165 # @fdname: file descriptor name previously passed via 'getfd' command
167 # @skipauth: whether to skip authentication. Only applies
168 # to "vnc" and "spice" protocols
170 # @tls: whether to perform TLS. Only applies to the "spice"
173 # Returns: nothing on success.
179 # -> { "execute": "add_client", "arguments": { "protocol": "vnc",
180 # "fdname": "myclient" } }
181 # <- { "return": {} }
184 { 'command': 'add_client',
185 'data': { 'protocol': 'str', 'fdname': 'str', '*skipauth': 'bool',
191 # Guest name information.
193 # @name: The name of the guest
197 { 'struct': 'NameInfo', 'data': {'*name': 'str'} }
202 # Return the name information of a guest.
204 # Returns: @NameInfo of the guest
210 # -> { "execute": "query-name" }
211 # <- { "return": { "name": "qemu-name" } }
214 { 'command': 'query-name', 'returns': 'NameInfo' }
219 # Information about support for KVM acceleration
221 # @enabled: true if KVM acceleration is active
223 # @present: true if KVM acceleration is built into this executable
227 { 'struct': 'KvmInfo', 'data': {'enabled': 'bool', 'present': 'bool'} }
232 # Returns information about KVM acceleration
240 # -> { "execute": "query-kvm" }
241 # <- { "return": { "enabled": true, "present": true } }
244 { 'command': 'query-kvm', 'returns': 'KvmInfo' }
249 # Guest UUID information (Universally Unique Identifier).
251 # @UUID: the UUID of the guest
255 # Notes: If no UUID was specified for the guest, a null UUID is returned.
257 { 'struct': 'UuidInfo', 'data': {'UUID': 'str'} }
262 # Query the guest UUID information.
264 # Returns: The @UuidInfo for the guest
270 # -> { "execute": "query-uuid" }
271 # <- { "return": { "UUID": "550e8400-e29b-41d4-a716-446655440000" } }
274 { 'command': 'query-uuid', 'returns': 'UuidInfo' }
279 # Information about a QMP event
281 # @name: The event name
285 { 'struct': 'EventInfo', 'data': {'name': 'str'} }
290 # Return a list of supported QMP events by this server
292 # Returns: A list of @EventInfo for all supported events
298 # -> { "execute": "query-events" }
310 # Note: This example has been shortened as the real response is too long.
313 { 'command': 'query-events', 'returns': ['EventInfo'] }
318 # An enumeration of cpu types that enable additional information during
319 # @query-cpus and @query-cpus-fast.
325 { 'enum': 'CpuInfoArch',
326 'data': ['x86', 'sparc', 'ppc', 'mips', 'tricore', 's390', 'other' ] }
331 # Information about a virtual CPU
333 # @CPU: the index of the virtual CPU
335 # @current: this only exists for backwards compatibility and should be ignored
337 # @halted: true if the virtual CPU is in the halt state. Halt usually refers
338 # to a processor specific low power mode.
340 # @qom_path: path to the CPU object in the QOM tree (since 2.4)
342 # @thread_id: ID of the underlying host thread
344 # @props: properties describing to which node/socket/core/thread
345 # virtual CPU belongs to, provided if supported by board (since 2.10)
347 # @arch: architecture of the cpu, which determines which additional fields
348 # will be listed (since 2.6)
352 # Notes: @halted is a transient state that changes frequently. By the time the
353 # data is sent to the client, the guest may no longer be halted.
355 { 'union': 'CpuInfo',
356 'base': {'CPU': 'int', 'current': 'bool', 'halted': 'bool',
357 'qom_path': 'str', 'thread_id': 'int',
358 '*props': 'CpuInstanceProperties', 'arch': 'CpuInfoArch' },
359 'discriminator': 'arch',
360 'data': { 'x86': 'CpuInfoX86',
361 'sparc': 'CpuInfoSPARC',
363 'mips': 'CpuInfoMIPS',
364 'tricore': 'CpuInfoTricore',
365 's390': 'CpuInfoS390',
366 'other': 'CpuInfoOther' } }
371 # Additional information about a virtual i386 or x86_64 CPU
373 # @pc: the 64-bit instruction pointer
377 { 'struct': 'CpuInfoX86', 'data': { 'pc': 'int' } }
382 # Additional information about a virtual SPARC CPU
384 # @pc: the PC component of the instruction pointer
386 # @npc: the NPC component of the instruction pointer
390 { 'struct': 'CpuInfoSPARC', 'data': { 'pc': 'int', 'npc': 'int' } }
395 # Additional information about a virtual PPC CPU
397 # @nip: the instruction pointer
401 { 'struct': 'CpuInfoPPC', 'data': { 'nip': 'int' } }
406 # Additional information about a virtual MIPS CPU
408 # @PC: the instruction pointer
412 { 'struct': 'CpuInfoMIPS', 'data': { 'PC': 'int' } }
417 # Additional information about a virtual Tricore CPU
419 # @PC: the instruction pointer
423 { 'struct': 'CpuInfoTricore', 'data': { 'PC': 'int' } }
428 # No additional information is available about the virtual CPU
433 { 'struct': 'CpuInfoOther', 'data': { } }
438 # An enumeration of cpu states that can be assumed by a virtual
443 { 'enum': 'CpuS390State',
444 'prefix': 'S390_CPU_STATE',
445 'data': [ 'uninitialized', 'stopped', 'check-stop', 'operating', 'load' ] }
450 # Additional information about a virtual S390 CPU
452 # @cpu-state: the virtual CPU's state
456 { 'struct': 'CpuInfoS390', 'data': { 'cpu-state': 'CpuS390State' } }
461 # Returns a list of information about each virtual CPU.
463 # This command causes vCPU threads to exit to userspace, which causes
464 # a small interruption to guest CPU execution. This will have a negative
465 # impact on realtime guests and other latency sensitive guest workloads.
466 # It is recommended to use @query-cpus-fast instead of this command to
467 # avoid the vCPU interruption.
469 # Returns: a list of @CpuInfo for each virtual CPU
475 # -> { "execute": "query-cpus" }
481 # "qom_path":"/machine/unattached/device[0]",
490 # "qom_path":"/machine/unattached/device[2]",
498 # Notes: This interface is deprecated (since 2.12.0), and it is strongly
499 # recommended that you avoid using it. Use @query-cpus-fast to
500 # obtain information about virtual CPUs.
503 { 'command': 'query-cpus', 'returns': ['CpuInfo'] }
508 # Information about a virtual CPU
510 # @cpu-index: index of the virtual CPU
512 # @qom-path: path to the CPU object in the QOM tree
514 # @thread-id: ID of the underlying host thread
516 # @props: properties describing to which node/socket/core/thread
517 # virtual CPU belongs to, provided if supported by board
519 # @arch: architecture of the cpu, which determines which additional fields
525 { 'union': 'CpuInfoFast',
526 'base': {'cpu-index': 'int', 'qom-path': 'str',
527 'thread-id': 'int', '*props': 'CpuInstanceProperties',
528 'arch': 'CpuInfoArch' },
529 'discriminator': 'arch',
530 'data': { 'x86': 'CpuInfoOther',
531 'sparc': 'CpuInfoOther',
532 'ppc': 'CpuInfoOther',
533 'mips': 'CpuInfoOther',
534 'tricore': 'CpuInfoOther',
535 's390': 'CpuInfoS390',
536 'other': 'CpuInfoOther' } }
541 # Returns information about all virtual CPUs. This command does not
542 # incur a performance penalty and should be used in production
543 # instead of query-cpus.
545 # Returns: list of @CpuInfoFast
551 # -> { "execute": "query-cpus-fast" }
554 # "thread-id": 25627,
560 # "qom-path": "/machine/unattached/device[0]",
565 # "thread-id": 25628,
571 # "qom-path": "/machine/unattached/device[2]",
578 { 'command': 'query-cpus-fast', 'returns': [ 'CpuInfoFast' ] }
583 # Information about an iothread
585 # @id: the identifier of the iothread
587 # @thread-id: ID of the underlying host thread
589 # @poll-max-ns: maximum polling time in ns, 0 means polling is disabled
592 # @poll-grow: how many ns will be added to polling time, 0 means that it's not
593 # configured (since 2.9)
595 # @poll-shrink: how many ns will be removed from polling time, 0 means that
596 # it's not configured (since 2.9)
600 { 'struct': 'IOThreadInfo',
601 'data': {'id': 'str',
603 'poll-max-ns': 'int',
605 'poll-shrink': 'int' } }
610 # Returns a list of information about each iothread.
612 # Note: this list excludes the QEMU main loop thread, which is not declared
613 # using the -object iothread command-line option. It is always the main thread
616 # Returns: a list of @IOThreadInfo for each iothread
622 # -> { "execute": "query-iothreads" }
636 { 'command': 'query-iothreads', 'returns': ['IOThreadInfo'] }
641 # Information about the guest balloon device.
643 # @actual: the number of bytes the balloon currently contains
648 { 'struct': 'BalloonInfo', 'data': {'actual': 'int' } }
653 # Return information about the balloon device.
655 # Returns: @BalloonInfo on success
657 # If the balloon driver is enabled but not functional because the KVM
658 # kernel module cannot support it, KvmMissingCap
660 # If no balloon device is present, DeviceNotActive
666 # -> { "execute": "query-balloon" }
668 # "actual": 1073741824,
673 { 'command': 'query-balloon', 'returns': 'BalloonInfo' }
678 # Emitted when the guest changes the actual BALLOON level. This value is
679 # equivalent to the @actual field return by the 'query-balloon' command
681 # @actual: actual level of the guest memory balloon in bytes
683 # Note: this event is rate-limited.
689 # <- { "event": "BALLOON_CHANGE",
690 # "data": { "actual": 944766976 },
691 # "timestamp": { "seconds": 1267020223, "microseconds": 435656 } }
694 { 'event': 'BALLOON_CHANGE',
695 'data': { 'actual': 'int' } }
700 # A PCI device memory region
702 # @base: the starting address (guest physical)
704 # @limit: the ending address (guest physical)
708 { 'struct': 'PciMemoryRange', 'data': {'base': 'int', 'limit': 'int'} }
713 # Information about a PCI device I/O region.
715 # @bar: the index of the Base Address Register for this region
717 # @type: 'io' if the region is a PIO region
718 # 'memory' if the region is a MMIO region
722 # @prefetch: if @type is 'memory', true if the memory is prefetchable
724 # @mem_type_64: if @type is 'memory', true if the BAR is 64-bit
728 { 'struct': 'PciMemoryRegion',
729 'data': {'bar': 'int', 'type': 'str', 'address': 'int', 'size': 'int',
730 '*prefetch': 'bool', '*mem_type_64': 'bool' } }
735 # Information about a bus of a PCI Bridge device
737 # @number: primary bus interface number. This should be the number of the
738 # bus the device resides on.
740 # @secondary: secondary bus interface number. This is the number of the
741 # main bus for the bridge
743 # @subordinate: This is the highest number bus that resides below the
746 # @io_range: The PIO range for all devices on this bridge
748 # @memory_range: The MMIO range for all devices on this bridge
750 # @prefetchable_range: The range of prefetchable MMIO for all devices on
755 { 'struct': 'PciBusInfo',
756 'data': {'number': 'int', 'secondary': 'int', 'subordinate': 'int',
757 'io_range': 'PciMemoryRange',
758 'memory_range': 'PciMemoryRange',
759 'prefetchable_range': 'PciMemoryRange' } }
764 # Information about a PCI Bridge device
766 # @bus: information about the bus the device resides on
768 # @devices: a list of @PciDeviceInfo for each device on this bridge
772 { 'struct': 'PciBridgeInfo',
773 'data': {'bus': 'PciBusInfo', '*devices': ['PciDeviceInfo']} }
778 # Information about the Class of a PCI device
780 # @desc: a string description of the device's class
782 # @class: the class code of the device
786 { 'struct': 'PciDeviceClass',
787 'data': {'*desc': 'str', 'class': 'int'} }
792 # Information about the Id of a PCI device
794 # @device: the PCI device id
796 # @vendor: the PCI vendor id
800 { 'struct': 'PciDeviceId',
801 'data': {'device': 'int', 'vendor': 'int'} }
806 # Information about a PCI device
808 # @bus: the bus number of the device
810 # @slot: the slot the device is located in
812 # @function: the function of the slot used by the device
814 # @class_info: the class of the device
816 # @id: the PCI device id
818 # @irq: if an IRQ is assigned to the device, the IRQ number
820 # @qdev_id: the device name of the PCI device
822 # @pci_bridge: if the device is a PCI bridge, the bridge information
824 # @regions: a list of the PCI I/O regions associated with the device
826 # Notes: the contents of @class_info.desc are not stable and should only be
827 # treated as informational.
831 { 'struct': 'PciDeviceInfo',
832 'data': {'bus': 'int', 'slot': 'int', 'function': 'int',
833 'class_info': 'PciDeviceClass', 'id': 'PciDeviceId',
834 '*irq': 'int', 'qdev_id': 'str', '*pci_bridge': 'PciBridgeInfo',
835 'regions': ['PciMemoryRegion']} }
840 # Information about a PCI bus
842 # @bus: the bus index
844 # @devices: a list of devices on this bus
848 { 'struct': 'PciInfo', 'data': {'bus': 'int', 'devices': ['PciDeviceInfo']} }
853 # Return information about the PCI bus topology of the guest.
855 # Returns: a list of @PciInfo for each PCI bus. Each bus is
856 # represented by a json-object, which has a key with a json-array of
857 # all PCI devices attached to it. Each device is represented by a
864 # -> { "execute": "query-pci" }
875 # "desc": "Host bridge"
891 # "desc": "ISA bridge"
907 # "desc": "IDE controller"
929 # "desc": "VGA controller"
939 # "mem_type_64": false,
942 # "address": 4026531840,
947 # "mem_type_64": false,
950 # "address": 4060086272,
955 # "mem_type_64": false,
970 # "desc": "RAM controller"
991 # Note: This example has been shortened as the real response is too long.
994 { 'command': 'query-pci', 'returns': ['PciInfo'] }
999 # This command will cause the QEMU process to exit gracefully. While every
1000 # attempt is made to send the QMP response before terminating, this is not
1001 # guaranteed. When using this interface, a premature EOF would not be
1008 # -> { "execute": "quit" }
1009 # <- { "return": {} }
1011 { 'command': 'quit' }
1016 # Stop all guest VCPU execution.
1020 # Notes: This function will succeed even if the guest is already in the stopped
1021 # state. In "inmigrate" state, it will ensure that the guest
1022 # remains paused once migration finishes, as if the -S option was
1023 # passed on the command line.
1027 # -> { "execute": "stop" }
1028 # <- { "return": {} }
1031 { 'command': 'stop' }
1036 # Performs a hard reset of a guest.
1042 # -> { "execute": "system_reset" }
1043 # <- { "return": {} }
1046 { 'command': 'system_reset' }
1049 # @system_powerdown:
1051 # Requests that a guest perform a powerdown operation.
1055 # Notes: A guest may or may not respond to this command. This command
1056 # returning does not indicate that a guest has accepted the request or
1057 # that it has shut down. Many guests will respond to this command by
1058 # prompting the user in some way.
1061 # -> { "execute": "system_powerdown" }
1062 # <- { "return": {} }
1065 { 'command': 'system_powerdown' }
1070 # Adds CPU with specified ID
1072 # @id: ID of CPU to be created, valid values [0..max_cpus)
1074 # Returns: Nothing on success
1080 # -> { "execute": "cpu-add", "arguments": { "id": 2 } }
1081 # <- { "return": {} }
1084 { 'command': 'cpu-add', 'data': {'id': 'int'} }
1089 # Save a portion of guest memory to a file.
1091 # @val: the virtual address of the guest to start from
1093 # @size: the size of memory region to save
1095 # @filename: the file to save the memory to as binary data
1097 # @cpu-index: the index of the virtual CPU to use for translating the
1098 # virtual address (defaults to CPU 0)
1100 # Returns: Nothing on success
1104 # Notes: Errors were not reliably returned until 1.1
1108 # -> { "execute": "memsave",
1109 # "arguments": { "val": 10,
1111 # "filename": "/tmp/virtual-mem-dump" } }
1112 # <- { "return": {} }
1115 { 'command': 'memsave',
1116 'data': {'val': 'int', 'size': 'int', 'filename': 'str', '*cpu-index': 'int'} }
1121 # Save a portion of guest physical memory to a file.
1123 # @val: the physical address of the guest to start from
1125 # @size: the size of memory region to save
1127 # @filename: the file to save the memory to as binary data
1129 # Returns: Nothing on success
1133 # Notes: Errors were not reliably returned until 1.1
1137 # -> { "execute": "pmemsave",
1138 # "arguments": { "val": 10,
1140 # "filename": "/tmp/physical-mem-dump" } }
1141 # <- { "return": {} }
1144 { 'command': 'pmemsave',
1145 'data': {'val': 'int', 'size': 'int', 'filename': 'str'} }
1150 # Resume guest VCPU execution.
1154 # Returns: If successful, nothing
1156 # Notes: This command will succeed if the guest is currently running. It
1157 # will also succeed if the guest is in the "inmigrate" state; in
1158 # this case, the effect of the command is to make sure the guest
1159 # starts once migration finishes, removing the effect of the -S
1160 # command line option if it was passed.
1164 # -> { "execute": "cont" }
1165 # <- { "return": {} }
1168 { 'command': 'cont' }
1173 # Wakeup guest from suspend. Does nothing in case the guest isn't suspended.
1181 # -> { "execute": "system_wakeup" }
1182 # <- { "return": {} }
1185 { 'command': 'system_wakeup' }
1190 # Injects a Non-Maskable Interrupt into the default CPU (x86/s390) or all CPUs (ppc64).
1191 # The command fails when the guest doesn't support injecting.
1193 # Returns: If successful, nothing
1197 # Note: prior to 2.1, this command was only supported for x86 and s390 VMs
1201 # -> { "execute": "inject-nmi" }
1202 # <- { "return": {} }
1205 { 'command': 'inject-nmi' }
1210 # Request the balloon driver to change its balloon size.
1212 # @value: the target size of the balloon in bytes
1214 # Returns: Nothing on success
1215 # If the balloon driver is enabled but not functional because the KVM
1216 # kernel module cannot support it, KvmMissingCap
1217 # If no balloon device is present, DeviceNotActive
1219 # Notes: This command just issues a request to the guest. When it returns,
1220 # the balloon size may not have changed. A guest can change the balloon
1221 # size independent of this command.
1227 # -> { "execute": "balloon", "arguments": { "value": 536870912 } }
1228 # <- { "return": {} }
1231 { 'command': 'balloon', 'data': {'value': 'int'} }
1234 # @human-monitor-command:
1236 # Execute a command on the human monitor and return the output.
1238 # @command-line: the command to execute in the human monitor
1240 # @cpu-index: The CPU to use for commands that require an implicit CPU
1242 # Returns: the output of the command as a string
1246 # Notes: This command only exists as a stop-gap. Its use is highly
1247 # discouraged. The semantics of this command are not
1248 # guaranteed: this means that command names, arguments and
1249 # responses can change or be removed at ANY time. Applications
1250 # that rely on long term stability guarantees should NOT
1253 # Known limitations:
1255 # * This command is stateless, this means that commands that depend
1256 # on state information (such as getfd) might not work
1258 # * Commands that prompt the user for data don't currently work
1262 # -> { "execute": "human-monitor-command",
1263 # "arguments": { "command-line": "info kvm" } }
1264 # <- { "return": "kvm support: enabled\r\n" }
1267 { 'command': 'human-monitor-command',
1268 'data': {'command-line': 'str', '*cpu-index': 'int'},
1272 # @ObjectPropertyInfo:
1274 # @name: the name of the property
1276 # @type: the type of the property. This will typically come in one of four
1279 # 1) A primitive type such as 'u8', 'u16', 'bool', 'str', or 'double'.
1280 # These types are mapped to the appropriate JSON type.
1282 # 2) A child type in the form 'child<subtype>' where subtype is a qdev
1283 # device type name. Child properties create the composition tree.
1285 # 3) A link type in the form 'link<subtype>' where subtype is a qdev
1286 # device type name. Link properties form the device model graph.
1290 { 'struct': 'ObjectPropertyInfo',
1291 'data': { 'name': 'str', 'type': 'str' } }
1296 # This command will list any properties of a object given a path in the object
1299 # @path: the path within the object model. See @qom-get for a description of
1302 # Returns: a list of @ObjectPropertyInfo that describe the properties of the
1307 { 'command': 'qom-list',
1308 'data': { 'path': 'str' },
1309 'returns': [ 'ObjectPropertyInfo' ] }
1314 # This command will get a property from a object model path and return the
1317 # @path: The path within the object model. There are two forms of supported
1318 # paths--absolute and partial paths.
1320 # Absolute paths are derived from the root object and can follow child<>
1321 # or link<> properties. Since they can follow link<> properties, they
1322 # can be arbitrarily long. Absolute paths look like absolute filenames
1323 # and are prefixed with a leading slash.
1325 # Partial paths look like relative filenames. They do not begin
1326 # with a prefix. The matching rules for partial paths are subtle but
1327 # designed to make specifying objects easy. At each level of the
1328 # composition tree, the partial path is matched as an absolute path.
1329 # The first match is not returned. At least two matches are searched
1330 # for. A successful result is only returned if only one match is
1331 # found. If more than one match is found, a flag is return to
1332 # indicate that the match was ambiguous.
1334 # @property: The property name to read
1336 # Returns: The property value. The type depends on the property
1337 # type. child<> and link<> properties are returned as #str
1338 # pathnames. All integer property types (u8, u16, etc) are
1343 { 'command': 'qom-get',
1344 'data': { 'path': 'str', 'property': 'str' },
1350 # This command will set a property from a object model path.
1352 # @path: see @qom-get for a description of this parameter
1354 # @property: the property name to set
1356 # @value: a value who's type is appropriate for the property type. See @qom-get
1357 # for a description of type mapping.
1361 { 'command': 'qom-set',
1362 'data': { 'path': 'str', 'property': 'str', 'value': 'any' } }
1367 # This command is multiple commands multiplexed together.
1369 # @device: This is normally the name of a block device but it may also be 'vnc'.
1370 # when it's 'vnc', then sub command depends on @target
1372 # @target: If @device is a block device, then this is the new filename.
1373 # If @device is 'vnc', then if the value 'password' selects the vnc
1374 # change password command. Otherwise, this specifies a new server URI
1375 # address to listen to for VNC connections.
1377 # @arg: If @device is a block device, then this is an optional format to open
1379 # If @device is 'vnc' and @target is 'password', this is the new VNC
1380 # password to set. See change-vnc-password for additional notes.
1382 # Returns: Nothing on success.
1383 # If @device is not a valid block device, DeviceNotFound
1385 # Notes: This interface is deprecated, and it is strongly recommended that you
1386 # avoid using it. For changing block devices, use
1387 # blockdev-change-medium; for changing VNC parameters, use
1388 # change-vnc-password.
1394 # 1. Change a removable medium
1396 # -> { "execute": "change",
1397 # "arguments": { "device": "ide1-cd0",
1398 # "target": "/srv/images/Fedora-12-x86_64-DVD.iso" } }
1399 # <- { "return": {} }
1401 # 2. Change VNC password
1403 # -> { "execute": "change",
1404 # "arguments": { "device": "vnc", "target": "password",
1405 # "arg": "foobar1" } }
1406 # <- { "return": {} }
1409 { 'command': 'change',
1410 'data': {'device': 'str', 'target': 'str', '*arg': 'str'} }
1415 # This structure describes a search result from @qom-list-types
1417 # @name: the type name found in the search
1419 # @abstract: the type is abstract and can't be directly instantiated.
1420 # Omitted if false. (since 2.10)
1422 # @parent: Name of parent type, if any (since 2.10)
1426 { 'struct': 'ObjectTypeInfo',
1427 'data': { 'name': 'str', '*abstract': 'bool', '*parent': 'str' } }
1432 # This command will return a list of types given search parameters
1434 # @implements: if specified, only return types that implement this type name
1436 # @abstract: if true, include abstract types in the results
1438 # Returns: a list of @ObjectTypeInfo or an empty list if no results are found
1442 { 'command': 'qom-list-types',
1443 'data': { '*implements': 'str', '*abstract': 'bool' },
1444 'returns': [ 'ObjectTypeInfo' ] }
1447 # @DevicePropertyInfo:
1449 # Information about device properties.
1451 # @name: the name of the property
1452 # @type: the typename of the property
1453 # @description: if specified, the description of the property.
1458 { 'struct': 'DevicePropertyInfo',
1459 'data': { 'name': 'str', 'type': 'str', '*description': 'str' } }
1462 # @device-list-properties:
1464 # List properties associated with a device.
1466 # @typename: the type name of a device
1468 # Returns: a list of DevicePropertyInfo describing a devices properties
1472 { 'command': 'device-list-properties',
1473 'data': { 'typename': 'str'},
1474 'returns': [ 'DevicePropertyInfo' ] }
1477 # @xen-set-global-dirty-log:
1479 # Enable or disable the global dirty log mode.
1481 # @enable: true to enable, false to disable.
1489 # -> { "execute": "xen-set-global-dirty-log",
1490 # "arguments": { "enable": true } }
1491 # <- { "return": {} }
1494 { 'command': 'xen-set-global-dirty-log', 'data': { 'enable': 'bool' } }
1499 # @driver: the name of the new device's driver
1501 # @bus: the device's parent bus (device tree path)
1503 # @id: the device's ID, must be unique
1505 # Additional arguments depend on the type.
1510 # 1. For detailed information about this command, please refer to the
1511 # 'docs/qdev-device-use.txt' file.
1513 # 2. It's possible to list device properties by running QEMU with the
1514 # "-device DEVICE,help" command-line argument, where DEVICE is the
1519 # -> { "execute": "device_add",
1520 # "arguments": { "driver": "e1000", "id": "net1",
1522 # "mac": "52:54:00:12:34:56" } }
1523 # <- { "return": {} }
1525 # TODO: This command effectively bypasses QAPI completely due to its
1526 # "additional arguments" business. It shouldn't have been added to
1527 # the schema in this form. It should be qapified properly, or
1528 # replaced by a properly qapified command.
1532 { 'command': 'device_add',
1533 'data': {'driver': 'str', '*bus': 'str', '*id': 'str'},
1534 'gen': false } # so we can get the additional arguments
1539 # Remove a device from a guest
1541 # @id: the device's ID or QOM path
1543 # Returns: Nothing on success
1544 # If @id is not a valid device, DeviceNotFound
1546 # Notes: When this command completes, the device may not be removed from the
1547 # guest. Hot removal is an operation that requires guest cooperation.
1548 # This command merely requests that the guest begin the hot removal
1549 # process. Completion of the device removal process is signaled with a
1550 # DEVICE_DELETED event. Guest reset will automatically complete removal
1557 # -> { "execute": "device_del",
1558 # "arguments": { "id": "net1" } }
1559 # <- { "return": {} }
1561 # -> { "execute": "device_del",
1562 # "arguments": { "id": "/machine/peripheral-anon/device[0]" } }
1563 # <- { "return": {} }
1566 { 'command': 'device_del', 'data': {'id': 'str'} }
1571 # Emitted whenever the device removal completion is acknowledged by the guest.
1572 # At this point, it's safe to reuse the specified device ID. Device removal can
1573 # be initiated by the guest or by HMP/QMP commands.
1575 # @device: device name
1577 # @path: device path
1583 # <- { "event": "DEVICE_DELETED",
1584 # "data": { "device": "virtio-net-pci-0",
1585 # "path": "/machine/peripheral/virtio-net-pci-0" },
1586 # "timestamp": { "seconds": 1265044230, "microseconds": 450486 } }
1589 { 'event': 'DEVICE_DELETED',
1590 'data': { '*device': 'str', 'path': 'str' } }
1593 # @DumpGuestMemoryFormat:
1595 # An enumeration of guest-memory-dump's format.
1599 # @kdump-zlib: kdump-compressed format with zlib-compressed
1601 # @kdump-lzo: kdump-compressed format with lzo-compressed
1603 # @kdump-snappy: kdump-compressed format with snappy-compressed
1607 { 'enum': 'DumpGuestMemoryFormat',
1608 'data': [ 'elf', 'kdump-zlib', 'kdump-lzo', 'kdump-snappy' ] }
1611 # @dump-guest-memory:
1613 # Dump guest's memory to vmcore. It is a synchronous operation that can take
1614 # very long depending on the amount of guest memory.
1616 # @paging: if true, do paging to get guest's memory mapping. This allows
1617 # using gdb to process the core file.
1619 # IMPORTANT: this option can make QEMU allocate several gigabytes
1620 # of RAM. This can happen for a large guest, or a
1621 # malicious guest pretending to be large.
1623 # Also, paging=true has the following limitations:
1625 # 1. The guest may be in a catastrophic state or can have corrupted
1626 # memory, which cannot be trusted
1627 # 2. The guest can be in real-mode even if paging is enabled. For
1628 # example, the guest uses ACPI to sleep, and ACPI sleep state
1630 # 3. Currently only supported on i386 and x86_64.
1632 # @protocol: the filename or file descriptor of the vmcore. The supported
1635 # 1. file: the protocol starts with "file:", and the following
1636 # string is the file's path.
1637 # 2. fd: the protocol starts with "fd:", and the following string
1640 # @detach: if true, QMP will return immediately rather than
1641 # waiting for the dump to finish. The user can track progress
1642 # using "query-dump". (since 2.6).
1644 # @begin: if specified, the starting physical address.
1646 # @length: if specified, the memory size, in bytes. If you don't
1647 # want to dump all guest's memory, please specify the start @begin
1650 # @format: if specified, the format of guest memory dump. But non-elf
1651 # format is conflict with paging and filter, ie. @paging, @begin and
1652 # @length is not allowed to be specified with non-elf @format at the
1653 # same time (since 2.0)
1655 # Note: All boolean arguments default to false
1657 # Returns: nothing on success
1663 # -> { "execute": "dump-guest-memory",
1664 # "arguments": { "protocol": "fd:dump" } }
1665 # <- { "return": {} }
1668 { 'command': 'dump-guest-memory',
1669 'data': { 'paging': 'bool', 'protocol': 'str', '*detach': 'bool',
1670 '*begin': 'int', '*length': 'int',
1671 '*format': 'DumpGuestMemoryFormat'} }
1676 # Describe the status of a long-running background guest memory dump.
1678 # @none: no dump-guest-memory has started yet.
1680 # @active: there is one dump running in background.
1682 # @completed: the last dump has finished successfully.
1684 # @failed: the last dump has failed.
1688 { 'enum': 'DumpStatus',
1689 'data': [ 'none', 'active', 'completed', 'failed' ] }
1694 # The result format for 'query-dump'.
1696 # @status: enum of @DumpStatus, which shows current dump status
1698 # @completed: bytes written in latest dump (uncompressed)
1700 # @total: total bytes to be written in latest dump (uncompressed)
1704 { 'struct': 'DumpQueryResult',
1705 'data': { 'status': 'DumpStatus',
1712 # Query latest dump status.
1714 # Returns: A @DumpStatus object showing the dump status.
1720 # -> { "execute": "query-dump" }
1721 # <- { "return": { "status": "active", "completed": 1024000,
1722 # "total": 2048000 } }
1725 { 'command': 'query-dump', 'returns': 'DumpQueryResult' }
1730 # Emitted when background dump has completed
1732 # @result: final dump status
1734 # @error: human-readable error string that provides
1735 # hint on why dump failed. Only presents on failure. The
1736 # user should not try to interpret the error string.
1742 # { "event": "DUMP_COMPLETED",
1743 # "data": {"result": {"total": 1090650112, "status": "completed",
1744 # "completed": 1090650112} } }
1747 { 'event': 'DUMP_COMPLETED' ,
1748 'data': { 'result': 'DumpQueryResult', '*error': 'str' } }
1751 # @DumpGuestMemoryCapability:
1753 # A list of the available formats for dump-guest-memory
1757 { 'struct': 'DumpGuestMemoryCapability',
1759 'formats': ['DumpGuestMemoryFormat'] } }
1762 # @query-dump-guest-memory-capability:
1764 # Returns the available formats for dump-guest-memory
1766 # Returns: A @DumpGuestMemoryCapability object listing available formats for
1773 # -> { "execute": "query-dump-guest-memory-capability" }
1774 # <- { "return": { "formats":
1775 # ["elf", "kdump-zlib", "kdump-lzo", "kdump-snappy"] }
1778 { 'command': 'query-dump-guest-memory-capability',
1779 'returns': 'DumpGuestMemoryCapability' }
1784 # Dump guest's storage keys
1786 # @filename: the path to the file to dump to
1788 # This command is only supported on s390 architecture.
1794 # -> { "execute": "dump-skeys",
1795 # "arguments": { "filename": "/tmp/skeys" } }
1796 # <- { "return": {} }
1799 { 'command': 'dump-skeys',
1800 'data': { 'filename': 'str' } }
1805 # Create a QOM object.
1807 # @qom-type: the class name for the object to be created
1809 # @id: the name of the new object
1811 # @props: a dictionary of properties to be passed to the backend
1813 # Returns: Nothing on success
1814 # Error if @qom-type is not a valid class name
1820 # -> { "execute": "object-add",
1821 # "arguments": { "qom-type": "rng-random", "id": "rng1",
1822 # "props": { "filename": "/dev/hwrng" } } }
1823 # <- { "return": {} }
1826 { 'command': 'object-add',
1827 'data': {'qom-type': 'str', 'id': 'str', '*props': 'any'} }
1832 # Remove a QOM object.
1834 # @id: the name of the QOM object to remove
1836 # Returns: Nothing on success
1837 # Error if @id is not a valid id for a QOM object
1843 # -> { "execute": "object-del", "arguments": { "id": "rng1" } }
1844 # <- { "return": {} }
1847 { 'command': 'object-del', 'data': {'id': 'str'} }
1852 # Receive a file descriptor via SCM rights and assign it a name
1854 # @fdname: file descriptor name
1856 # Returns: Nothing on success
1860 # Notes: If @fdname already exists, the file descriptor assigned to
1861 # it will be closed and replaced by the received file
1864 # The 'closefd' command can be used to explicitly close the
1865 # file descriptor when it is no longer needed.
1869 # -> { "execute": "getfd", "arguments": { "fdname": "fd1" } }
1870 # <- { "return": {} }
1873 { 'command': 'getfd', 'data': {'fdname': 'str'} }
1878 # Close a file descriptor previously passed via SCM rights
1880 # @fdname: file descriptor name
1882 # Returns: Nothing on success
1888 # -> { "execute": "closefd", "arguments": { "fdname": "fd1" } }
1889 # <- { "return": {} }
1892 { 'command': 'closefd', 'data': {'fdname': 'str'} }
1897 # Information describing a machine.
1899 # @name: the name of the machine
1901 # @alias: an alias for the machine name
1903 # @is-default: whether the machine is default
1905 # @cpu-max: maximum number of CPUs supported by the machine type
1908 # @hotpluggable-cpus: cpu hotplug via -device is supported (since 2.7.0)
1912 { 'struct': 'MachineInfo',
1913 'data': { 'name': 'str', '*alias': 'str',
1914 '*is-default': 'bool', 'cpu-max': 'int',
1915 'hotpluggable-cpus': 'bool'} }
1920 # Return a list of supported machines
1922 # Returns: a list of MachineInfo
1926 { 'command': 'query-machines', 'returns': ['MachineInfo'] }
1929 # @CpuDefinitionInfo:
1931 # Virtual CPU definition.
1933 # @name: the name of the CPU definition
1935 # @migration-safe: whether a CPU definition can be safely used for
1936 # migration in combination with a QEMU compatibility machine
1937 # when migrating between different QMU versions and between
1938 # hosts with different sets of (hardware or software)
1939 # capabilities. If not provided, information is not available
1940 # and callers should not assume the CPU definition to be
1941 # migration-safe. (since 2.8)
1943 # @static: whether a CPU definition is static and will not change depending on
1944 # QEMU version, machine type, machine options and accelerator options.
1945 # A static model is always migration-safe. (since 2.8)
1947 # @unavailable-features: List of properties that prevent
1948 # the CPU model from running in the current
1950 # @typename: Type name that can be used as argument to @device-list-properties,
1951 # to introspect properties configurable using -cpu or -global.
1954 # @unavailable-features is a list of QOM property names that
1955 # represent CPU model attributes that prevent the CPU from running.
1956 # If the QOM property is read-only, that means there's no known
1957 # way to make the CPU model run in the current host. Implementations
1958 # that choose not to provide specific information return the
1959 # property name "type".
1960 # If the property is read-write, it means that it MAY be possible
1961 # to run the CPU model in the current host if that property is
1962 # changed. Management software can use it as hints to suggest or
1963 # choose an alternative for the user, or just to generate meaningful
1964 # error messages explaining why the CPU model can't be used.
1965 # If @unavailable-features is an empty list, the CPU model is
1966 # runnable using the current host and machine-type.
1967 # If @unavailable-features is not present, runnability
1968 # information for the CPU is not available.
1972 { 'struct': 'CpuDefinitionInfo',
1973 'data': { 'name': 'str', '*migration-safe': 'bool', 'static': 'bool',
1974 '*unavailable-features': [ 'str' ], 'typename': 'str' } }
1979 # Actual memory information in bytes.
1981 # @base-memory: size of "base" memory specified with command line
1984 # @plugged-memory: size of memory that can be hot-unplugged. This field
1985 # is omitted if target doesn't support memory hotplug
1986 # (i.e. CONFIG_MEM_HOTPLUG not defined on build time).
1990 { 'struct': 'MemoryInfo',
1991 'data' : { 'base-memory': 'size', '*plugged-memory': 'size' } }
1994 # @query-memory-size-summary:
1996 # Return the amount of initially allocated and present hotpluggable (if
1997 # enabled) memory in bytes.
2001 # -> { "execute": "query-memory-size-summary" }
2002 # <- { "return": { "base-memory": 4294967296, "plugged-memory": 0 } }
2006 { 'command': 'query-memory-size-summary', 'returns': 'MemoryInfo' }
2009 # @query-cpu-definitions:
2011 # Return a list of supported virtual CPU definitions
2013 # Returns: a list of CpuDefInfo
2017 { 'command': 'query-cpu-definitions', 'returns': ['CpuDefinitionInfo'] }
2022 # Virtual CPU model.
2024 # A CPU model consists of the name of a CPU definition, to which
2025 # delta changes are applied (e.g. features added/removed). Most magic values
2026 # that an architecture might require should be hidden behind the name.
2027 # However, if required, architectures can expose relevant properties.
2029 # @name: the name of the CPU definition the model is based on
2030 # @props: a dictionary of QOM properties to be applied
2034 { 'struct': 'CpuModelInfo',
2035 'data': { 'name': 'str',
2039 # @CpuModelExpansionType:
2041 # An enumeration of CPU model expansion types.
2043 # @static: Expand to a static CPU model, a combination of a static base
2044 # model name and property delta changes. As the static base model will
2045 # never change, the expanded CPU model will be the same, independent of
2046 # independent of QEMU version, machine type, machine options, and
2047 # accelerator options. Therefore, the resulting model can be used by
2048 # tooling without having to specify a compatibility machine - e.g. when
2049 # displaying the "host" model. static CPU models are migration-safe.
2051 # @full: Expand all properties. The produced model is not guaranteed to be
2052 # migration-safe, but allows tooling to get an insight and work with
2055 # Note: When a non-migration-safe CPU model is expanded in static mode, some
2056 # features enabled by the CPU model may be omitted, because they can't be
2057 # implemented by a static CPU model definition (e.g. cache info passthrough and
2058 # PMU passthrough in x86). If you need an accurate representation of the
2059 # features enabled by a non-migration-safe CPU model, use @full. If you need a
2060 # static representation that will keep ABI compatibility even when changing QEMU
2061 # version or machine-type, use @static (but keep in mind that some features may
2066 { 'enum': 'CpuModelExpansionType',
2067 'data': [ 'static', 'full' ] }
2071 # @CpuModelExpansionInfo:
2073 # The result of a cpu model expansion.
2075 # @model: the expanded CpuModelInfo.
2079 { 'struct': 'CpuModelExpansionInfo',
2080 'data': { 'model': 'CpuModelInfo' } }
2084 # @query-cpu-model-expansion:
2086 # Expands a given CPU model (or a combination of CPU model + additional options)
2087 # to different granularities, allowing tooling to get an understanding what a
2088 # specific CPU model looks like in QEMU under a certain configuration.
2090 # This interface can be used to query the "host" CPU model.
2092 # The data returned by this command may be affected by:
2094 # * QEMU version: CPU models may look different depending on the QEMU version.
2095 # (Except for CPU models reported as "static" in query-cpu-definitions.)
2096 # * machine-type: CPU model may look different depending on the machine-type.
2097 # (Except for CPU models reported as "static" in query-cpu-definitions.)
2098 # * machine options (including accelerator): in some architectures, CPU models
2099 # may look different depending on machine and accelerator options. (Except for
2100 # CPU models reported as "static" in query-cpu-definitions.)
2101 # * "-cpu" arguments and global properties: arguments to the -cpu option and
2102 # global properties may affect expansion of CPU models. Using
2103 # query-cpu-model-expansion while using these is not advised.
2105 # Some architectures may not support all expansion types. s390x supports
2106 # "full" and "static".
2108 # Returns: a CpuModelExpansionInfo. Returns an error if expanding CPU models is
2109 # not supported, if the model cannot be expanded, if the model contains
2110 # an unknown CPU definition name, unknown properties or properties
2111 # with a wrong type. Also returns an error if an expansion type is
2116 { 'command': 'query-cpu-model-expansion',
2117 'data': { 'type': 'CpuModelExpansionType',
2118 'model': 'CpuModelInfo' },
2119 'returns': 'CpuModelExpansionInfo' }
2122 # @CpuModelCompareResult:
2124 # An enumeration of CPU model comparison results. The result is usually
2125 # calculated using e.g. CPU features or CPU generations.
2127 # @incompatible: If model A is incompatible to model B, model A is not
2128 # guaranteed to run where model B runs and the other way around.
2130 # @identical: If model A is identical to model B, model A is guaranteed to run
2131 # where model B runs and the other way around.
2133 # @superset: If model A is a superset of model B, model B is guaranteed to run
2134 # where model A runs. There are no guarantees about the other way.
2136 # @subset: If model A is a subset of model B, model A is guaranteed to run
2137 # where model B runs. There are no guarantees about the other way.
2141 { 'enum': 'CpuModelCompareResult',
2142 'data': [ 'incompatible', 'identical', 'superset', 'subset' ] }
2145 # @CpuModelCompareInfo:
2147 # The result of a CPU model comparison.
2149 # @result: The result of the compare operation.
2150 # @responsible-properties: List of properties that led to the comparison result
2151 # not being identical.
2153 # @responsible-properties is a list of QOM property names that led to
2154 # both CPUs not being detected as identical. For identical models, this
2156 # If a QOM property is read-only, that means there's no known way to make the
2157 # CPU models identical. If the special property name "type" is included, the
2158 # models are by definition not identical and cannot be made identical.
2162 { 'struct': 'CpuModelCompareInfo',
2163 'data': {'result': 'CpuModelCompareResult',
2164 'responsible-properties': ['str']
2169 # @query-cpu-model-comparison:
2171 # Compares two CPU models, returning how they compare in a specific
2172 # configuration. The results indicates how both models compare regarding
2173 # runnability. This result can be used by tooling to make decisions if a
2174 # certain CPU model will run in a certain configuration or if a compatible
2175 # CPU model has to be created by baselining.
2177 # Usually, a CPU model is compared against the maximum possible CPU model
2178 # of a certain configuration (e.g. the "host" model for KVM). If that CPU
2179 # model is identical or a subset, it will run in that configuration.
2181 # The result returned by this command may be affected by:
2183 # * QEMU version: CPU models may look different depending on the QEMU version.
2184 # (Except for CPU models reported as "static" in query-cpu-definitions.)
2185 # * machine-type: CPU model may look different depending on the machine-type.
2186 # (Except for CPU models reported as "static" in query-cpu-definitions.)
2187 # * machine options (including accelerator): in some architectures, CPU models
2188 # may look different depending on machine and accelerator options. (Except for
2189 # CPU models reported as "static" in query-cpu-definitions.)
2190 # * "-cpu" arguments and global properties: arguments to the -cpu option and
2191 # global properties may affect expansion of CPU models. Using
2192 # query-cpu-model-expansion while using these is not advised.
2194 # Some architectures may not support comparing CPU models. s390x supports
2195 # comparing CPU models.
2197 # Returns: a CpuModelBaselineInfo. Returns an error if comparing CPU models is
2198 # not supported, if a model cannot be used, if a model contains
2199 # an unknown cpu definition name, unknown properties or properties
2204 { 'command': 'query-cpu-model-comparison',
2205 'data': { 'modela': 'CpuModelInfo', 'modelb': 'CpuModelInfo' },
2206 'returns': 'CpuModelCompareInfo' }
2209 # @CpuModelBaselineInfo:
2211 # The result of a CPU model baseline.
2213 # @model: the baselined CpuModelInfo.
2217 { 'struct': 'CpuModelBaselineInfo',
2218 'data': { 'model': 'CpuModelInfo' } }
2221 # @query-cpu-model-baseline:
2223 # Baseline two CPU models, creating a compatible third model. The created
2224 # model will always be a static, migration-safe CPU model (see "static"
2225 # CPU model expansion for details).
2227 # This interface can be used by tooling to create a compatible CPU model out
2228 # two CPU models. The created CPU model will be identical to or a subset of
2229 # both CPU models when comparing them. Therefore, the created CPU model is
2230 # guaranteed to run where the given CPU models run.
2232 # The result returned by this command may be affected by:
2234 # * QEMU version: CPU models may look different depending on the QEMU version.
2235 # (Except for CPU models reported as "static" in query-cpu-definitions.)
2236 # * machine-type: CPU model may look different depending on the machine-type.
2237 # (Except for CPU models reported as "static" in query-cpu-definitions.)
2238 # * machine options (including accelerator): in some architectures, CPU models
2239 # may look different depending on machine and accelerator options. (Except for
2240 # CPU models reported as "static" in query-cpu-definitions.)
2241 # * "-cpu" arguments and global properties: arguments to the -cpu option and
2242 # global properties may affect expansion of CPU models. Using
2243 # query-cpu-model-expansion while using these is not advised.
2245 # Some architectures may not support baselining CPU models. s390x supports
2246 # baselining CPU models.
2248 # Returns: a CpuModelBaselineInfo. Returns an error if baselining CPU models is
2249 # not supported, if a model cannot be used, if a model contains
2250 # an unknown cpu definition name, unknown properties or properties
2255 { 'command': 'query-cpu-model-baseline',
2256 'data': { 'modela': 'CpuModelInfo',
2257 'modelb': 'CpuModelInfo' },
2258 'returns': 'CpuModelBaselineInfo' }
2263 # Information about a file descriptor that was added to an fd set.
2265 # @fdset-id: The ID of the fd set that @fd was added to.
2267 # @fd: The file descriptor that was received via SCM rights and
2268 # added to the fd set.
2272 { 'struct': 'AddfdInfo', 'data': {'fdset-id': 'int', 'fd': 'int'} }
2277 # Add a file descriptor, that was passed via SCM rights, to an fd set.
2279 # @fdset-id: The ID of the fd set to add the file descriptor to.
2281 # @opaque: A free-form string that can be used to describe the fd.
2283 # Returns: @AddfdInfo on success
2285 # If file descriptor was not received, FdNotSupplied
2287 # If @fdset-id is a negative value, InvalidParameterValue
2289 # Notes: The list of fd sets is shared by all monitor connections.
2291 # If @fdset-id is not specified, a new fd set will be created.
2297 # -> { "execute": "add-fd", "arguments": { "fdset-id": 1 } }
2298 # <- { "return": { "fdset-id": 1, "fd": 3 } }
2301 { 'command': 'add-fd', 'data': {'*fdset-id': 'int', '*opaque': 'str'},
2302 'returns': 'AddfdInfo' }
2307 # Remove a file descriptor from an fd set.
2309 # @fdset-id: The ID of the fd set that the file descriptor belongs to.
2311 # @fd: The file descriptor that is to be removed.
2313 # Returns: Nothing on success
2314 # If @fdset-id or @fd is not found, FdNotFound
2318 # Notes: The list of fd sets is shared by all monitor connections.
2320 # If @fd is not specified, all file descriptors in @fdset-id
2325 # -> { "execute": "remove-fd", "arguments": { "fdset-id": 1, "fd": 3 } }
2326 # <- { "return": {} }
2329 { 'command': 'remove-fd', 'data': {'fdset-id': 'int', '*fd': 'int'} }
2334 # Information about a file descriptor that belongs to an fd set.
2336 # @fd: The file descriptor value.
2338 # @opaque: A free-form string that can be used to describe the fd.
2342 { 'struct': 'FdsetFdInfo',
2343 'data': {'fd': 'int', '*opaque': 'str'} }
2348 # Information about an fd set.
2350 # @fdset-id: The ID of the fd set.
2352 # @fds: A list of file descriptors that belong to this fd set.
2356 { 'struct': 'FdsetInfo',
2357 'data': {'fdset-id': 'int', 'fds': ['FdsetFdInfo']} }
2362 # Return information describing all fd sets.
2364 # Returns: A list of @FdsetInfo
2368 # Note: The list of fd sets is shared by all monitor connections.
2372 # -> { "execute": "query-fdsets" }
2378 # "opaque": "rdonly:/path/to/file"
2382 # "opaque": "rdwr:/path/to/file"
2402 { 'command': 'query-fdsets', 'returns': ['FdsetInfo'] }
2407 # Information describing the QEMU target.
2409 # @arch: the target architecture (eg "x86_64", "i386", etc)
2413 { 'struct': 'TargetInfo',
2414 'data': { 'arch': 'str' } }
2419 # Return information about the target for this QEMU
2421 # Returns: TargetInfo
2425 { 'command': 'query-target', 'returns': 'TargetInfo' }
2428 # @AcpiTableOptions:
2430 # Specify an ACPI table on the command line to load.
2432 # At most one of @file and @data can be specified. The list of files specified
2433 # by any one of them is loaded and concatenated in order. If both are omitted,
2436 # Other fields / optargs can be used to override fields of the generic ACPI
2437 # table header; refer to the ACPI specification 5.0, section 5.2.6 System
2438 # Description Table Header. If a header field is not overridden, then the
2439 # corresponding value from the concatenated blob is used (in case of @file), or
2440 # it is filled in with a hard-coded value (in case of @data).
2442 # String fields are copied into the matching ACPI member from lowest address
2443 # upwards, and silently truncated / NUL-padded to length.
2445 # @sig: table signature / identifier (4 bytes)
2447 # @rev: table revision number (dependent on signature, 1 byte)
2449 # @oem_id: OEM identifier (6 bytes)
2451 # @oem_table_id: OEM table identifier (8 bytes)
2453 # @oem_rev: OEM-supplied revision number (4 bytes)
2455 # @asl_compiler_id: identifier of the utility that created the table
2458 # @asl_compiler_rev: revision number of the utility that created the
2461 # @file: colon (:) separated list of pathnames to load and
2462 # concatenate as table data. The resultant binary blob is expected to
2463 # have an ACPI table header. At least one file is required. This field
2466 # @data: colon (:) separated list of pathnames to load and
2467 # concatenate as table data. The resultant binary blob must not have an
2468 # ACPI table header. At least one file is required. This field excludes
2473 { 'struct': 'AcpiTableOptions',
2478 '*oem_table_id': 'str',
2479 '*oem_rev': 'uint32',
2480 '*asl_compiler_id': 'str',
2481 '*asl_compiler_rev': 'uint32',
2486 # @CommandLineParameterType:
2488 # Possible types for an option parameter.
2490 # @string: accepts a character string
2492 # @boolean: accepts "on" or "off"
2494 # @number: accepts a number
2496 # @size: accepts a number followed by an optional suffix (K)ilo,
2497 # (M)ega, (G)iga, (T)era
2501 { 'enum': 'CommandLineParameterType',
2502 'data': ['string', 'boolean', 'number', 'size'] }
2505 # @CommandLineParameterInfo:
2507 # Details about a single parameter of a command line option.
2509 # @name: parameter name
2511 # @type: parameter @CommandLineParameterType
2513 # @help: human readable text string, not suitable for parsing.
2515 # @default: default value string (since 2.1)
2519 { 'struct': 'CommandLineParameterInfo',
2520 'data': { 'name': 'str',
2521 'type': 'CommandLineParameterType',
2523 '*default': 'str' } }
2526 # @CommandLineOptionInfo:
2528 # Details about a command line option, including its list of parameter details
2530 # @option: option name
2532 # @parameters: an array of @CommandLineParameterInfo
2536 { 'struct': 'CommandLineOptionInfo',
2537 'data': { 'option': 'str', 'parameters': ['CommandLineParameterInfo'] } }
2540 # @query-command-line-options:
2542 # Query command line option schema.
2544 # @option: option name
2546 # Returns: list of @CommandLineOptionInfo for all options (or for the given
2547 # @option). Returns an error if the given @option doesn't exist.
2553 # -> { "execute": "query-command-line-options",
2554 # "arguments": { "option": "option-rom" } }
2559 # "name": "romfile",
2563 # "name": "bootindex",
2567 # "option": "option-rom"
2573 {'command': 'query-command-line-options', 'data': { '*option': 'str' },
2574 'returns': ['CommandLineOptionInfo'] }
2577 # @X86CPURegister32:
2579 # A X86 32-bit register
2583 { 'enum': 'X86CPURegister32',
2584 'data': [ 'EAX', 'EBX', 'ECX', 'EDX', 'ESP', 'EBP', 'ESI', 'EDI' ] }
2587 # @X86CPUFeatureWordInfo:
2589 # Information about a X86 CPU feature word
2591 # @cpuid-input-eax: Input EAX value for CPUID instruction for that feature word
2593 # @cpuid-input-ecx: Input ECX value for CPUID instruction for that
2596 # @cpuid-register: Output register containing the feature bits
2598 # @features: value of output register, containing the feature bits
2602 { 'struct': 'X86CPUFeatureWordInfo',
2603 'data': { 'cpuid-input-eax': 'int',
2604 '*cpuid-input-ecx': 'int',
2605 'cpuid-register': 'X86CPURegister32',
2606 'features': 'int' } }
2609 # @DummyForceArrays:
2611 # Not used by QMP; hack to let us use X86CPUFeatureWordInfoList internally
2615 { 'struct': 'DummyForceArrays',
2616 'data': { 'unused': ['X86CPUFeatureWordInfo'] } }
2622 # @node: NUMA nodes configuration
2624 # @dist: NUMA distance configuration (since 2.10)
2626 # @cpu: property based CPU(s) to node mapping (Since: 2.10)
2630 { 'enum': 'NumaOptionsType',
2631 'data': [ 'node', 'dist', 'cpu' ] }
2636 # A discriminated record of NUMA options. (for OptsVisitor)
2640 { 'union': 'NumaOptions',
2641 'base': { 'type': 'NumaOptionsType' },
2642 'discriminator': 'type',
2644 'node': 'NumaNodeOptions',
2645 'dist': 'NumaDistOptions',
2646 'cpu': 'NumaCpuOptions' }}
2651 # Create a guest NUMA node. (for OptsVisitor)
2653 # @nodeid: NUMA node ID (increase by 1 from 0 if omitted)
2655 # @cpus: VCPUs belonging to this node (assign VCPUS round-robin
2658 # @mem: memory size of this node; mutually exclusive with @memdev.
2659 # Equally divide total memory among nodes if both @mem and @memdev are
2662 # @memdev: memory backend object. If specified for one node,
2663 # it must be specified for all nodes.
2667 { 'struct': 'NumaNodeOptions',
2669 '*nodeid': 'uint16',
2670 '*cpus': ['uint16'],
2677 # Set the distance between 2 NUMA nodes.
2679 # @src: source NUMA node.
2681 # @dst: destination NUMA node.
2683 # @val: NUMA distance from source node to destination node.
2684 # When a node is unreachable from another node, set the distance
2685 # between them to 255.
2689 { 'struct': 'NumaDistOptions',
2698 # Option "-numa cpu" overrides default cpu to node mapping.
2699 # It accepts the same set of cpu properties as returned by
2700 # query-hotpluggable-cpus[].props, where node-id could be used to
2701 # override default node mapping.
2705 { 'struct': 'NumaCpuOptions',
2706 'base': 'CpuInstanceProperties',
2712 # Host memory policy types
2714 # @default: restore default policy, remove any nondefault policy
2716 # @preferred: set the preferred host nodes for allocation
2718 # @bind: a strict policy that restricts memory allocation to the
2719 # host nodes specified
2721 # @interleave: memory allocations are interleaved across the set
2722 # of host nodes specified
2726 { 'enum': 'HostMemPolicy',
2727 'data': [ 'default', 'preferred', 'bind', 'interleave' ] }
2732 # Information about memory backend
2734 # @id: backend's ID if backend has 'id' property (since 2.9)
2736 # @size: memory backend size
2738 # @merge: enables or disables memory merge support
2740 # @dump: includes memory backend's memory in a core dump or not
2742 # @prealloc: enables or disables memory preallocation
2744 # @host-nodes: host nodes for its memory policy
2746 # @policy: memory policy of memory backend
2750 { 'struct': 'Memdev',
2757 'host-nodes': ['uint16'],
2758 'policy': 'HostMemPolicy' }}
2763 # Returns information for all memory backends.
2765 # Returns: a list of @Memdev.
2771 # -> { "execute": "query-memdev" }
2775 # "size": 536870912,
2778 # "prealloc": false,
2779 # "host-nodes": [0, 1],
2783 # "size": 536870912,
2787 # "host-nodes": [2, 3],
2788 # "policy": "preferred"
2794 { 'command': 'query-memdev', 'returns': ['Memdev'] }
2797 # @PCDIMMDeviceInfo:
2799 # PCDIMMDevice state information
2803 # @addr: physical address, where device is mapped
2805 # @size: size of memory that the device provides
2807 # @slot: slot number at which device is plugged in
2809 # @node: NUMA node number where device is plugged in
2811 # @memdev: memory backend linked with device
2813 # @hotplugged: true if device was hotplugged
2815 # @hotpluggable: true if device if could be added/removed while machine is running
2819 { 'struct': 'PCDIMMDeviceInfo',
2820 'data': { '*id': 'str',
2826 'hotplugged': 'bool',
2827 'hotpluggable': 'bool'
2832 # @MemoryDeviceInfo:
2834 # Union containing information about a memory device
2838 { 'union': 'MemoryDeviceInfo', 'data': {'dimm': 'PCDIMMDeviceInfo'} }
2841 # @query-memory-devices:
2843 # Lists available memory devices and their state
2849 # -> { "execute": "query-memory-devices" }
2850 # <- { "return": [ { "data":
2851 # { "addr": 5368709120,
2852 # "hotpluggable": true,
2853 # "hotplugged": true,
2855 # "memdev": "/objects/memX",
2857 # "size": 1073741824,
2863 { 'command': 'query-memory-devices', 'returns': ['MemoryDeviceInfo'] }
2866 # @MEM_UNPLUG_ERROR:
2868 # Emitted when memory hot unplug error occurs.
2870 # @device: device name
2872 # @msg: Informative message
2878 # <- { "event": "MEM_UNPLUG_ERROR"
2879 # "data": { "device": "dimm1",
2880 # "msg": "acpi: device unplug for unsupported device"
2882 # "timestamp": { "seconds": 1265044230, "microseconds": 450486 } }
2885 { 'event': 'MEM_UNPLUG_ERROR',
2886 'data': { 'device': 'str', 'msg': 'str' } }
2891 # @DIMM: memory slot
2892 # @CPU: logical CPU slot (since 2.7)
2894 { 'enum': 'ACPISlotType', 'data': [ 'DIMM', 'CPU' ] }
2899 # OSPM Status Indication for a device
2900 # For description of possible values of @source and @status fields
2901 # see "_OST (OSPM Status Indication)" chapter of ACPI5.0 spec.
2903 # @device: device ID associated with slot
2905 # @slot: slot ID, unique per slot of a given @slot-type
2907 # @slot-type: type of the slot
2909 # @source: an integer containing the source event
2911 # @status: an integer containing the status code
2915 { 'struct': 'ACPIOSTInfo',
2916 'data' : { '*device': 'str',
2918 'slot-type': 'ACPISlotType',
2923 # @query-acpi-ospm-status:
2925 # Return a list of ACPIOSTInfo for devices that support status
2926 # reporting via ACPI _OST method.
2932 # -> { "execute": "query-acpi-ospm-status" }
2933 # <- { "return": [ { "device": "d1", "slot": "0", "slot-type": "DIMM", "source": 1, "status": 0},
2934 # { "slot": "1", "slot-type": "DIMM", "source": 0, "status": 0},
2935 # { "slot": "2", "slot-type": "DIMM", "source": 0, "status": 0},
2936 # { "slot": "3", "slot-type": "DIMM", "source": 0, "status": 0}
2940 { 'command': 'query-acpi-ospm-status', 'returns': ['ACPIOSTInfo'] }
2945 # Emitted when guest executes ACPI _OST method.
2947 # @info: OSPM Status Indication
2953 # <- { "event": "ACPI_DEVICE_OST",
2954 # "data": { "device": "d1", "slot": "0",
2955 # "slot-type": "DIMM", "source": 1, "status": 0 } }
2958 { 'event': 'ACPI_DEVICE_OST',
2959 'data': { 'info': 'ACPIOSTInfo' } }
2962 # @rtc-reset-reinjection:
2964 # This command will reset the RTC interrupt reinjection backlog.
2965 # Can be used if another mechanism to synchronize guest time
2966 # is in effect, for example QEMU guest agent's guest-set-time
2973 # -> { "execute": "rtc-reset-reinjection" }
2974 # <- { "return": {} }
2977 { 'command': 'rtc-reset-reinjection' }
2982 # Emitted when the guest changes the RTC time.
2984 # @offset: offset between base RTC clock (as specified by -rtc base), and
2985 # new RTC clock value
2987 # Note: This event is rate-limited.
2993 # <- { "event": "RTC_CHANGE",
2994 # "data": { "offset": 78 },
2995 # "timestamp": { "seconds": 1267020223, "microseconds": 435656 } }
2998 { 'event': 'RTC_CHANGE',
2999 'data': { 'offset': 'int' } }
3004 # Mode of the replay subsystem.
3006 # @none: normal execution mode. Replay or record are not enabled.
3008 # @record: record mode. All non-deterministic data is written into the
3011 # @play: replay mode. Non-deterministic data required for system execution
3012 # is read from the log.
3016 { 'enum': 'ReplayMode',
3017 'data': [ 'none', 'record', 'play' ] }
3020 # @xen-load-devices-state:
3022 # Load the state of all devices from file. The RAM and the block devices
3023 # of the VM are not loaded by this command.
3025 # @filename: the file to load the state of the devices from as binary
3026 # data. See xen-save-devices-state.txt for a description of the binary
3033 # -> { "execute": "xen-load-devices-state",
3034 # "arguments": { "filename": "/tmp/resume" } }
3035 # <- { "return": {} }
3038 { 'command': 'xen-load-devices-state', 'data': {'filename': 'str'} }
3043 # The struct describes capability for a specific GIC (Generic
3044 # Interrupt Controller) version. These bits are not only decided by
3045 # QEMU/KVM software version, but also decided by the hardware that
3046 # the program is running upon.
3048 # @version: version of GIC to be described. Currently, only 2 and 3
3051 # @emulated: whether current QEMU/hardware supports emulated GIC
3052 # device in user space.
3054 # @kernel: whether current QEMU/hardware supports hardware
3055 # accelerated GIC device in kernel.
3059 { 'struct': 'GICCapability',
3060 'data': { 'version': 'int',
3062 'kernel': 'bool' } }
3065 # @query-gic-capabilities:
3067 # This command is ARM-only. It will return a list of GICCapability
3068 # objects that describe its capability bits.
3070 # Returns: a list of GICCapability objects.
3076 # -> { "execute": "query-gic-capabilities" }
3077 # <- { "return": [{ "version": 2, "emulated": true, "kernel": false },
3078 # { "version": 3, "emulated": false, "kernel": true } ] }
3081 { 'command': 'query-gic-capabilities', 'returns': ['GICCapability'] }
3084 # @CpuInstanceProperties:
3086 # List of properties to be used for hotplugging a CPU instance,
3087 # it should be passed by management with device_add command when
3088 # a CPU is being hotplugged.
3090 # @node-id: NUMA node ID the CPU belongs to
3091 # @socket-id: socket number within node/board the CPU belongs to
3092 # @core-id: core number within socket the CPU belongs to
3093 # @thread-id: thread number within core the CPU belongs to
3095 # Note: currently there are 4 properties that could be present
3096 # but management should be prepared to pass through other
3097 # properties with device_add command to allow for future
3098 # interface extension. This also requires the filed names to be kept in
3099 # sync with the properties passed to -device/device_add.
3103 { 'struct': 'CpuInstanceProperties',
3104 'data': { '*node-id': 'int',
3105 '*socket-id': 'int',
3114 # @type: CPU object type for usage with device_add command
3115 # @props: list of properties to be used for hotplugging CPU
3116 # @vcpus-count: number of logical VCPU threads @HotpluggableCPU provides
3117 # @qom-path: link to existing CPU object if CPU is present or
3118 # omitted if CPU is not present.
3122 { 'struct': 'HotpluggableCPU',
3123 'data': { 'type': 'str',
3124 'vcpus-count': 'int',
3125 'props': 'CpuInstanceProperties',
3131 # @query-hotpluggable-cpus:
3133 # Returns: a list of HotpluggableCPU objects.
3139 # For pseries machine type started with -smp 2,cores=2,maxcpus=4 -cpu POWER8:
3141 # -> { "execute": "query-hotpluggable-cpus" }
3143 # { "props": { "core": 8 }, "type": "POWER8-spapr-cpu-core",
3144 # "vcpus-count": 1 },
3145 # { "props": { "core": 0 }, "type": "POWER8-spapr-cpu-core",
3146 # "vcpus-count": 1, "qom-path": "/machine/unattached/device[0]"}
3149 # For pc machine type started with -smp 1,maxcpus=2:
3151 # -> { "execute": "query-hotpluggable-cpus" }
3154 # "type": "qemu64-x86_64-cpu", "vcpus-count": 1,
3155 # "props": {"core-id": 0, "socket-id": 1, "thread-id": 0}
3158 # "qom-path": "/machine/unattached/device[0]",
3159 # "type": "qemu64-x86_64-cpu", "vcpus-count": 1,
3160 # "props": {"core-id": 0, "socket-id": 0, "thread-id": 0}
3164 # For s390x-virtio-ccw machine type started with -smp 1,maxcpus=2 -cpu qemu
3167 # -> { "execute": "query-hotpluggable-cpus" }
3170 # "type": "qemu-s390x-cpu", "vcpus-count": 1,
3171 # "props": { "core-id": 1 }
3174 # "qom-path": "/machine/unattached/device[0]",
3175 # "type": "qemu-s390x-cpu", "vcpus-count": 1,
3176 # "props": { "core-id": 0 }
3181 { 'command': 'query-hotpluggable-cpus', 'returns': ['HotpluggableCPU'] }
3188 # @guid: the globally unique identifier
3192 { 'struct': 'GuidInfo', 'data': {'guid': 'str'} }
3195 # @query-vm-generation-id:
3197 # Show Virtual Machine Generation ID
3201 { 'command': 'query-vm-generation-id', 'returns': 'GuidInfo' }