5 # This document describes all commands currently supported by QMP.
7 # Most of the time their usage is exactly the same as in the user Monitor, this
8 # means that any other document which also describe commands (the manpage,
9 # QEMU's manual, etc) can and should be consulted.
11 # QMP has two types of commands: regular and query commands. Regular commands
12 # usually change the Virtual Machine's state someway, while query commands just
13 # return information. The sections below are divided accordingly.
15 # It's important to observe that all communication examples are formatted in
16 # a reader-friendly way, so that they're easier to understand. However, in real
17 # protocol usage, they're emitted as a single line.
19 # Also, the following notation is used to denote data flow:
23 # | -> data issued by the Client
24 # | <- Server data response
26 # Please, refer to the QMP specification (docs/interop/qmp-spec.txt) for
27 # detailed information on the Server command and response formats.
29 # = Stability Considerations
31 # The current QMP command set (described in this file) may be useful for a
32 # number of use cases, however it's limited and several commands have bad
33 # defined semantics, specially with regard to command completion.
35 # These problems are going to be solved incrementally in the next QEMU releases
36 # and we're going to establish a deprecation policy for badly defined commands.
38 # If you're planning to adopt QMP, please observe the following:
40 # 1. The deprecation policy will take effect and be documented soon, please
41 # check the documentation of each used command as soon as a new release of
44 # 2. DO NOT rely on anything which is not explicit documented
46 # 3. Errors, in special, are not documented. Applications should NOT check
47 # for specific errors classes or data (it's strongly recommended to only
48 # check for the "error" key)
52 { 'pragma': { 'doc-required': true } }
54 # Whitelists to permit QAPI rule violations; think twice before you
57 # Commands allowed to return a non-dictionary:
58 'returns-whitelist': [
59 'human-monitor-command',
61 'query-migrate-cache-size',
65 'name-case-whitelist': [
66 'ACPISlotType', # DIMM, visible through query-acpi-ospm-status
67 'CpuInfoMIPS', # PC, visible through query-cpu
68 'CpuInfoTricore', # PC, visible through query-cpu
69 'QapiErrorClass', # all members, visible through errors
70 'UuidInfo', # UUID, visible through query-uuid
71 'X86CPURegister32', # all members, visible indirectly through qom-get
72 'q_obj_CpuInfo-base' # CPU, visible through query-cpu
75 # Documentation generated with qapi2texi.py is in source order, with
76 # included sub-schemas inserted at the first include directive
77 # (subsequent include directives have no effect). To get a sane and
78 # stable order, it's best to include each sub-schema just once, or
79 # include it first in qapi-schema.json.
81 { 'include': 'qapi/common.json' }
82 { 'include': 'qapi/sockets.json' }
83 { 'include': 'qapi/run-state.json' }
84 { 'include': 'qapi/crypto.json' }
85 { 'include': 'qapi/block.json' }
86 { 'include': 'qapi/char.json' }
87 { 'include': 'qapi/net.json' }
88 { 'include': 'qapi/rocker.json' }
89 { 'include': 'qapi/tpm.json' }
90 { 'include': 'qapi/ui.json' }
91 { 'include': 'qapi/migration.json' }
92 { 'include': 'qapi/transaction.json' }
93 { 'include': 'qapi/trace.json' }
94 { 'include': 'qapi/introspect.json' }
103 # Enable QMP capabilities.
109 # -> { "execute": "qmp_capabilities" }
110 # <- { "return": {} }
112 # Notes: This command is valid exactly when first connecting: it must be
113 # issued before any other command will be accepted, and will fail once the
114 # monitor is accepting other commands. (see qemu docs/interop/qmp-spec.txt)
119 { 'command': 'qmp_capabilities' }
124 # Policy for handling lost ticks in timer devices.
126 # @discard: throw away the missed tick(s) and continue with future injection
127 # normally. Guest time may be delayed, unless the OS has explicit
128 # handling of lost ticks
130 # @delay: continue to deliver ticks at the normal rate. Guest time will be
131 # delayed due to the late tick
133 # @merge: merge the missed tick(s) into one tick and inject. Guest time
134 # may be delayed, depending on how the OS reacts to the merging
137 # @slew: deliver ticks at a higher rate to catch up with the missed tick. The
138 # guest time should not be delayed once catchup is complete.
142 { 'enum': 'LostTickPolicy',
143 'data': ['discard', 'delay', 'merge', 'slew' ] }
148 # Allow client connections for VNC, Spice and socket based
149 # character devices to be passed in to QEMU via SCM_RIGHTS.
151 # @protocol: protocol name. Valid names are "vnc", "spice" or the
152 # name of a character device (eg. from -chardev id=XXXX)
154 # @fdname: file descriptor name previously passed via 'getfd' command
156 # @skipauth: whether to skip authentication. Only applies
157 # to "vnc" and "spice" protocols
159 # @tls: whether to perform TLS. Only applies to the "spice"
162 # Returns: nothing on success.
168 # -> { "execute": "add_client", "arguments": { "protocol": "vnc",
169 # "fdname": "myclient" } }
170 # <- { "return": {} }
173 { 'command': 'add_client',
174 'data': { 'protocol': 'str', 'fdname': 'str', '*skipauth': 'bool',
180 # Guest name information.
182 # @name: The name of the guest
186 { 'struct': 'NameInfo', 'data': {'*name': 'str'} }
191 # Return the name information of a guest.
193 # Returns: @NameInfo of the guest
199 # -> { "execute": "query-name" }
200 # <- { "return": { "name": "qemu-name" } }
203 { 'command': 'query-name', 'returns': 'NameInfo' }
208 # Information about support for KVM acceleration
210 # @enabled: true if KVM acceleration is active
212 # @present: true if KVM acceleration is built into this executable
216 { 'struct': 'KvmInfo', 'data': {'enabled': 'bool', 'present': 'bool'} }
221 # Returns information about KVM acceleration
229 # -> { "execute": "query-kvm" }
230 # <- { "return": { "enabled": true, "present": true } }
233 { 'command': 'query-kvm', 'returns': 'KvmInfo' }
238 # Guest UUID information (Universally Unique Identifier).
240 # @UUID: the UUID of the guest
244 # Notes: If no UUID was specified for the guest, a null UUID is returned.
246 { 'struct': 'UuidInfo', 'data': {'UUID': 'str'} }
251 # Query the guest UUID information.
253 # Returns: The @UuidInfo for the guest
259 # -> { "execute": "query-uuid" }
260 # <- { "return": { "UUID": "550e8400-e29b-41d4-a716-446655440000" } }
263 { 'command': 'query-uuid', 'returns': 'UuidInfo' }
268 # Information about a QMP event
270 # @name: The event name
274 { 'struct': 'EventInfo', 'data': {'name': 'str'} }
279 # Return a list of supported QMP events by this server
281 # Returns: A list of @EventInfo for all supported events
287 # -> { "execute": "query-events" }
299 # Note: This example has been shortened as the real response is too long.
302 { 'command': 'query-events', 'returns': ['EventInfo'] }
307 # An enumeration of cpu types that enable additional information during
312 { 'enum': 'CpuInfoArch',
313 'data': ['x86', 'sparc', 'ppc', 'mips', 'tricore', 'other' ] }
318 # Information about a virtual CPU
320 # @CPU: the index of the virtual CPU
322 # @current: this only exists for backwards compatibility and should be ignored
324 # @halted: true if the virtual CPU is in the halt state. Halt usually refers
325 # to a processor specific low power mode.
327 # @qom_path: path to the CPU object in the QOM tree (since 2.4)
329 # @thread_id: ID of the underlying host thread
331 # @props: properties describing to which node/socket/core/thread
332 # virtual CPU belongs to, provided if supported by board (since 2.10)
334 # @arch: architecture of the cpu, which determines which additional fields
335 # will be listed (since 2.6)
339 # Notes: @halted is a transient state that changes frequently. By the time the
340 # data is sent to the client, the guest may no longer be halted.
342 { 'union': 'CpuInfo',
343 'base': {'CPU': 'int', 'current': 'bool', 'halted': 'bool',
344 'qom_path': 'str', 'thread_id': 'int',
345 '*props': 'CpuInstanceProperties', 'arch': 'CpuInfoArch' },
346 'discriminator': 'arch',
347 'data': { 'x86': 'CpuInfoX86',
348 'sparc': 'CpuInfoSPARC',
350 'mips': 'CpuInfoMIPS',
351 'tricore': 'CpuInfoTricore',
352 'other': 'CpuInfoOther' } }
357 # Additional information about a virtual i386 or x86_64 CPU
359 # @pc: the 64-bit instruction pointer
363 { 'struct': 'CpuInfoX86', 'data': { 'pc': 'int' } }
368 # Additional information about a virtual SPARC CPU
370 # @pc: the PC component of the instruction pointer
372 # @npc: the NPC component of the instruction pointer
376 { 'struct': 'CpuInfoSPARC', 'data': { 'pc': 'int', 'npc': 'int' } }
381 # Additional information about a virtual PPC CPU
383 # @nip: the instruction pointer
387 { 'struct': 'CpuInfoPPC', 'data': { 'nip': 'int' } }
392 # Additional information about a virtual MIPS CPU
394 # @PC: the instruction pointer
398 { 'struct': 'CpuInfoMIPS', 'data': { 'PC': 'int' } }
403 # Additional information about a virtual Tricore CPU
405 # @PC: the instruction pointer
409 { 'struct': 'CpuInfoTricore', 'data': { 'PC': 'int' } }
414 # No additional information is available about the virtual CPU
419 { 'struct': 'CpuInfoOther', 'data': { } }
424 # Returns a list of information about each virtual CPU.
426 # Returns: a list of @CpuInfo for each virtual CPU
432 # -> { "execute": "query-cpus" }
438 # "qom_path":"/machine/unattached/device[0]",
447 # "qom_path":"/machine/unattached/device[2]",
456 { 'command': 'query-cpus', 'returns': ['CpuInfo'] }
461 # Information about an iothread
463 # @id: the identifier of the iothread
465 # @thread-id: ID of the underlying host thread
467 # @poll-max-ns: maximum polling time in ns, 0 means polling is disabled
470 # @poll-grow: how many ns will be added to polling time, 0 means that it's not
471 # configured (since 2.9)
473 # @poll-shrink: how many ns will be removed from polling time, 0 means that
474 # it's not configured (since 2.9)
478 { 'struct': 'IOThreadInfo',
479 'data': {'id': 'str',
481 'poll-max-ns': 'int',
483 'poll-shrink': 'int' } }
488 # Returns a list of information about each iothread.
490 # Note: this list excludes the QEMU main loop thread, which is not declared
491 # using the -object iothread command-line option. It is always the main thread
494 # Returns: a list of @IOThreadInfo for each iothread
500 # -> { "execute": "query-iothreads" }
514 { 'command': 'query-iothreads', 'returns': ['IOThreadInfo'] }
519 # Information about the guest balloon device.
521 # @actual: the number of bytes the balloon currently contains
526 { 'struct': 'BalloonInfo', 'data': {'actual': 'int' } }
531 # Return information about the balloon device.
533 # Returns: @BalloonInfo on success
535 # If the balloon driver is enabled but not functional because the KVM
536 # kernel module cannot support it, KvmMissingCap
538 # If no balloon device is present, DeviceNotActive
544 # -> { "execute": "query-balloon" }
546 # "actual": 1073741824,
551 { 'command': 'query-balloon', 'returns': 'BalloonInfo' }
556 # Emitted when the guest changes the actual BALLOON level. This value is
557 # equivalent to the @actual field return by the 'query-balloon' command
559 # @actual: actual level of the guest memory balloon in bytes
561 # Note: this event is rate-limited.
567 # <- { "event": "BALLOON_CHANGE",
568 # "data": { "actual": 944766976 },
569 # "timestamp": { "seconds": 1267020223, "microseconds": 435656 } }
572 { 'event': 'BALLOON_CHANGE',
573 'data': { 'actual': 'int' } }
578 # A PCI device memory region
580 # @base: the starting address (guest physical)
582 # @limit: the ending address (guest physical)
586 { 'struct': 'PciMemoryRange', 'data': {'base': 'int', 'limit': 'int'} }
591 # Information about a PCI device I/O region.
593 # @bar: the index of the Base Address Register for this region
595 # @type: 'io' if the region is a PIO region
596 # 'memory' if the region is a MMIO region
600 # @prefetch: if @type is 'memory', true if the memory is prefetchable
602 # @mem_type_64: if @type is 'memory', true if the BAR is 64-bit
606 { 'struct': 'PciMemoryRegion',
607 'data': {'bar': 'int', 'type': 'str', 'address': 'int', 'size': 'int',
608 '*prefetch': 'bool', '*mem_type_64': 'bool' } }
613 # Information about a bus of a PCI Bridge device
615 # @number: primary bus interface number. This should be the number of the
616 # bus the device resides on.
618 # @secondary: secondary bus interface number. This is the number of the
619 # main bus for the bridge
621 # @subordinate: This is the highest number bus that resides below the
624 # @io_range: The PIO range for all devices on this bridge
626 # @memory_range: The MMIO range for all devices on this bridge
628 # @prefetchable_range: The range of prefetchable MMIO for all devices on
633 { 'struct': 'PciBusInfo',
634 'data': {'number': 'int', 'secondary': 'int', 'subordinate': 'int',
635 'io_range': 'PciMemoryRange',
636 'memory_range': 'PciMemoryRange',
637 'prefetchable_range': 'PciMemoryRange' } }
642 # Information about a PCI Bridge device
644 # @bus: information about the bus the device resides on
646 # @devices: a list of @PciDeviceInfo for each device on this bridge
650 { 'struct': 'PciBridgeInfo',
651 'data': {'bus': 'PciBusInfo', '*devices': ['PciDeviceInfo']} }
656 # Information about the Class of a PCI device
658 # @desc: a string description of the device's class
660 # @class: the class code of the device
664 { 'struct': 'PciDeviceClass',
665 'data': {'*desc': 'str', 'class': 'int'} }
670 # Information about the Id of a PCI device
672 # @device: the PCI device id
674 # @vendor: the PCI vendor id
678 { 'struct': 'PciDeviceId',
679 'data': {'device': 'int', 'vendor': 'int'} }
684 # Information about a PCI device
686 # @bus: the bus number of the device
688 # @slot: the slot the device is located in
690 # @function: the function of the slot used by the device
692 # @class_info: the class of the device
694 # @id: the PCI device id
696 # @irq: if an IRQ is assigned to the device, the IRQ number
698 # @qdev_id: the device name of the PCI device
700 # @pci_bridge: if the device is a PCI bridge, the bridge information
702 # @regions: a list of the PCI I/O regions associated with the device
704 # Notes: the contents of @class_info.desc are not stable and should only be
705 # treated as informational.
709 { 'struct': 'PciDeviceInfo',
710 'data': {'bus': 'int', 'slot': 'int', 'function': 'int',
711 'class_info': 'PciDeviceClass', 'id': 'PciDeviceId',
712 '*irq': 'int', 'qdev_id': 'str', '*pci_bridge': 'PciBridgeInfo',
713 'regions': ['PciMemoryRegion']} }
718 # Information about a PCI bus
720 # @bus: the bus index
722 # @devices: a list of devices on this bus
726 { 'struct': 'PciInfo', 'data': {'bus': 'int', 'devices': ['PciDeviceInfo']} }
731 # Return information about the PCI bus topology of the guest.
733 # Returns: a list of @PciInfo for each PCI bus. Each bus is
734 # represented by a json-object, which has a key with a json-array of
735 # all PCI devices attached to it. Each device is represented by a
742 # -> { "execute": "query-pci" }
753 # "desc": "Host bridge"
769 # "desc": "ISA bridge"
785 # "desc": "IDE controller"
807 # "desc": "VGA controller"
817 # "mem_type_64": false,
820 # "address": 4026531840,
825 # "mem_type_64": false,
828 # "address": 4060086272,
833 # "mem_type_64": false,
848 # "desc": "RAM controller"
869 # Note: This example has been shortened as the real response is too long.
872 { 'command': 'query-pci', 'returns': ['PciInfo'] }
877 # This command will cause the QEMU process to exit gracefully. While every
878 # attempt is made to send the QMP response before terminating, this is not
879 # guaranteed. When using this interface, a premature EOF would not be
886 # -> { "execute": "quit" }
887 # <- { "return": {} }
889 { 'command': 'quit' }
894 # Stop all guest VCPU execution.
898 # Notes: This function will succeed even if the guest is already in the stopped
899 # state. In "inmigrate" state, it will ensure that the guest
900 # remains paused once migration finishes, as if the -S option was
901 # passed on the command line.
905 # -> { "execute": "stop" }
906 # <- { "return": {} }
909 { 'command': 'stop' }
914 # Performs a hard reset of a guest.
920 # -> { "execute": "system_reset" }
921 # <- { "return": {} }
924 { 'command': 'system_reset' }
929 # Requests that a guest perform a powerdown operation.
933 # Notes: A guest may or may not respond to this command. This command
934 # returning does not indicate that a guest has accepted the request or
935 # that it has shut down. Many guests will respond to this command by
936 # prompting the user in some way.
939 # -> { "execute": "system_powerdown" }
940 # <- { "return": {} }
943 { 'command': 'system_powerdown' }
948 # This command is a nop that is only provided for the purposes of compatibility.
952 # Notes: Do not use this command.
954 { 'command': 'cpu', 'data': {'index': 'int'} }
959 # Adds CPU with specified ID
961 # @id: ID of CPU to be created, valid values [0..max_cpus)
963 # Returns: Nothing on success
969 # -> { "execute": "cpu-add", "arguments": { "id": 2 } }
970 # <- { "return": {} }
973 { 'command': 'cpu-add', 'data': {'id': 'int'} }
978 # Save a portion of guest memory to a file.
980 # @val: the virtual address of the guest to start from
982 # @size: the size of memory region to save
984 # @filename: the file to save the memory to as binary data
986 # @cpu-index: the index of the virtual CPU to use for translating the
987 # virtual address (defaults to CPU 0)
989 # Returns: Nothing on success
993 # Notes: Errors were not reliably returned until 1.1
997 # -> { "execute": "memsave",
998 # "arguments": { "val": 10,
1000 # "filename": "/tmp/virtual-mem-dump" } }
1001 # <- { "return": {} }
1004 { 'command': 'memsave',
1005 'data': {'val': 'int', 'size': 'int', 'filename': 'str', '*cpu-index': 'int'} }
1010 # Save a portion of guest physical memory to a file.
1012 # @val: the physical address of the guest to start from
1014 # @size: the size of memory region to save
1016 # @filename: the file to save the memory to as binary data
1018 # Returns: Nothing on success
1022 # Notes: Errors were not reliably returned until 1.1
1026 # -> { "execute": "pmemsave",
1027 # "arguments": { "val": 10,
1029 # "filename": "/tmp/physical-mem-dump" } }
1030 # <- { "return": {} }
1033 { 'command': 'pmemsave',
1034 'data': {'val': 'int', 'size': 'int', 'filename': 'str'} }
1039 # Resume guest VCPU execution.
1043 # Returns: If successful, nothing
1045 # Notes: This command will succeed if the guest is currently running. It
1046 # will also succeed if the guest is in the "inmigrate" state; in
1047 # this case, the effect of the command is to make sure the guest
1048 # starts once migration finishes, removing the effect of the -S
1049 # command line option if it was passed.
1053 # -> { "execute": "cont" }
1054 # <- { "return": {} }
1057 { 'command': 'cont' }
1062 # Wakeup guest from suspend. Does nothing in case the guest isn't suspended.
1070 # -> { "execute": "system_wakeup" }
1071 # <- { "return": {} }
1074 { 'command': 'system_wakeup' }
1079 # Injects a Non-Maskable Interrupt into the default CPU (x86/s390) or all CPUs (ppc64).
1080 # The command fails when the guest doesn't support injecting.
1082 # Returns: If successful, nothing
1086 # Note: prior to 2.1, this command was only supported for x86 and s390 VMs
1090 # -> { "execute": "inject-nmi" }
1091 # <- { "return": {} }
1094 { 'command': 'inject-nmi' }
1099 # Request the balloon driver to change its balloon size.
1101 # @value: the target size of the balloon in bytes
1103 # Returns: Nothing on success
1104 # If the balloon driver is enabled but not functional because the KVM
1105 # kernel module cannot support it, KvmMissingCap
1106 # If no balloon device is present, DeviceNotActive
1108 # Notes: This command just issues a request to the guest. When it returns,
1109 # the balloon size may not have changed. A guest can change the balloon
1110 # size independent of this command.
1116 # -> { "execute": "balloon", "arguments": { "value": 536870912 } }
1117 # <- { "return": {} }
1120 { 'command': 'balloon', 'data': {'value': 'int'} }
1123 # @human-monitor-command:
1125 # Execute a command on the human monitor and return the output.
1127 # @command-line: the command to execute in the human monitor
1129 # @cpu-index: The CPU to use for commands that require an implicit CPU
1131 # Returns: the output of the command as a string
1135 # Notes: This command only exists as a stop-gap. Its use is highly
1136 # discouraged. The semantics of this command are not
1137 # guaranteed: this means that command names, arguments and
1138 # responses can change or be removed at ANY time. Applications
1139 # that rely on long term stability guarantees should NOT
1142 # Known limitations:
1144 # * This command is stateless, this means that commands that depend
1145 # on state information (such as getfd) might not work
1147 # * Commands that prompt the user for data don't currently work
1151 # -> { "execute": "human-monitor-command",
1152 # "arguments": { "command-line": "info kvm" } }
1153 # <- { "return": "kvm support: enabled\r\n" }
1156 { 'command': 'human-monitor-command',
1157 'data': {'command-line': 'str', '*cpu-index': 'int'},
1161 # @ObjectPropertyInfo:
1163 # @name: the name of the property
1165 # @type: the type of the property. This will typically come in one of four
1168 # 1) A primitive type such as 'u8', 'u16', 'bool', 'str', or 'double'.
1169 # These types are mapped to the appropriate JSON type.
1171 # 2) A child type in the form 'child<subtype>' where subtype is a qdev
1172 # device type name. Child properties create the composition tree.
1174 # 3) A link type in the form 'link<subtype>' where subtype is a qdev
1175 # device type name. Link properties form the device model graph.
1179 { 'struct': 'ObjectPropertyInfo',
1180 'data': { 'name': 'str', 'type': 'str' } }
1185 # This command will list any properties of a object given a path in the object
1188 # @path: the path within the object model. See @qom-get for a description of
1191 # Returns: a list of @ObjectPropertyInfo that describe the properties of the
1196 { 'command': 'qom-list',
1197 'data': { 'path': 'str' },
1198 'returns': [ 'ObjectPropertyInfo' ] }
1203 # This command will get a property from a object model path and return the
1206 # @path: The path within the object model. There are two forms of supported
1207 # paths--absolute and partial paths.
1209 # Absolute paths are derived from the root object and can follow child<>
1210 # or link<> properties. Since they can follow link<> properties, they
1211 # can be arbitrarily long. Absolute paths look like absolute filenames
1212 # and are prefixed with a leading slash.
1214 # Partial paths look like relative filenames. They do not begin
1215 # with a prefix. The matching rules for partial paths are subtle but
1216 # designed to make specifying objects easy. At each level of the
1217 # composition tree, the partial path is matched as an absolute path.
1218 # The first match is not returned. At least two matches are searched
1219 # for. A successful result is only returned if only one match is
1220 # found. If more than one match is found, a flag is return to
1221 # indicate that the match was ambiguous.
1223 # @property: The property name to read
1225 # Returns: The property value. The type depends on the property
1226 # type. child<> and link<> properties are returned as #str
1227 # pathnames. All integer property types (u8, u16, etc) are
1232 { 'command': 'qom-get',
1233 'data': { 'path': 'str', 'property': 'str' },
1239 # This command will set a property from a object model path.
1241 # @path: see @qom-get for a description of this parameter
1243 # @property: the property name to set
1245 # @value: a value who's type is appropriate for the property type. See @qom-get
1246 # for a description of type mapping.
1250 { 'command': 'qom-set',
1251 'data': { 'path': 'str', 'property': 'str', 'value': 'any' } }
1256 # This command is multiple commands multiplexed together.
1258 # @device: This is normally the name of a block device but it may also be 'vnc'.
1259 # when it's 'vnc', then sub command depends on @target
1261 # @target: If @device is a block device, then this is the new filename.
1262 # If @device is 'vnc', then if the value 'password' selects the vnc
1263 # change password command. Otherwise, this specifies a new server URI
1264 # address to listen to for VNC connections.
1266 # @arg: If @device is a block device, then this is an optional format to open
1268 # If @device is 'vnc' and @target is 'password', this is the new VNC
1269 # password to set. See change-vnc-password for additional notes.
1271 # Returns: Nothing on success.
1272 # If @device is not a valid block device, DeviceNotFound
1274 # Notes: This interface is deprecated, and it is strongly recommended that you
1275 # avoid using it. For changing block devices, use
1276 # blockdev-change-medium; for changing VNC parameters, use
1277 # change-vnc-password.
1283 # 1. Change a removable medium
1285 # -> { "execute": "change",
1286 # "arguments": { "device": "ide1-cd0",
1287 # "target": "/srv/images/Fedora-12-x86_64-DVD.iso" } }
1288 # <- { "return": {} }
1290 # 2. Change VNC password
1292 # -> { "execute": "change",
1293 # "arguments": { "device": "vnc", "target": "password",
1294 # "arg": "foobar1" } }
1295 # <- { "return": {} }
1298 { 'command': 'change',
1299 'data': {'device': 'str', 'target': 'str', '*arg': 'str'} }
1304 # This structure describes a search result from @qom-list-types
1306 # @name: the type name found in the search
1308 # @abstract: the type is abstract and can't be directly instantiated.
1309 # Omitted if false. (since 2.10)
1311 # @parent: Name of parent type, if any (since 2.10)
1315 { 'struct': 'ObjectTypeInfo',
1316 'data': { 'name': 'str', '*abstract': 'bool', '*parent': 'str' } }
1321 # This command will return a list of types given search parameters
1323 # @implements: if specified, only return types that implement this type name
1325 # @abstract: if true, include abstract types in the results
1327 # Returns: a list of @ObjectTypeInfo or an empty list if no results are found
1331 { 'command': 'qom-list-types',
1332 'data': { '*implements': 'str', '*abstract': 'bool' },
1333 'returns': [ 'ObjectTypeInfo' ] }
1336 # @DevicePropertyInfo:
1338 # Information about device properties.
1340 # @name: the name of the property
1341 # @type: the typename of the property
1342 # @description: if specified, the description of the property.
1347 { 'struct': 'DevicePropertyInfo',
1348 'data': { 'name': 'str', 'type': 'str', '*description': 'str' } }
1351 # @device-list-properties:
1353 # List properties associated with a device.
1355 # @typename: the type name of a device
1357 # Returns: a list of DevicePropertyInfo describing a devices properties
1361 { 'command': 'device-list-properties',
1362 'data': { 'typename': 'str'},
1363 'returns': [ 'DevicePropertyInfo' ] }
1366 # @xen-set-global-dirty-log:
1368 # Enable or disable the global dirty log mode.
1370 # @enable: true to enable, false to disable.
1378 # -> { "execute": "xen-set-global-dirty-log",
1379 # "arguments": { "enable": true } }
1380 # <- { "return": {} }
1383 { 'command': 'xen-set-global-dirty-log', 'data': { 'enable': 'bool' } }
1388 # @driver: the name of the new device's driver
1390 # @bus: the device's parent bus (device tree path)
1392 # @id: the device's ID, must be unique
1394 # Additional arguments depend on the type.
1399 # 1. For detailed information about this command, please refer to the
1400 # 'docs/qdev-device-use.txt' file.
1402 # 2. It's possible to list device properties by running QEMU with the
1403 # "-device DEVICE,help" command-line argument, where DEVICE is the
1408 # -> { "execute": "device_add",
1409 # "arguments": { "driver": "e1000", "id": "net1",
1411 # "mac": "52:54:00:12:34:56" } }
1412 # <- { "return": {} }
1414 # TODO: This command effectively bypasses QAPI completely due to its
1415 # "additional arguments" business. It shouldn't have been added to
1416 # the schema in this form. It should be qapified properly, or
1417 # replaced by a properly qapified command.
1421 { 'command': 'device_add',
1422 'data': {'driver': 'str', '*bus': 'str', '*id': 'str'},
1423 'gen': false } # so we can get the additional arguments
1428 # Remove a device from a guest
1430 # @id: the device's ID or QOM path
1432 # Returns: Nothing on success
1433 # If @id is not a valid device, DeviceNotFound
1435 # Notes: When this command completes, the device may not be removed from the
1436 # guest. Hot removal is an operation that requires guest cooperation.
1437 # This command merely requests that the guest begin the hot removal
1438 # process. Completion of the device removal process is signaled with a
1439 # DEVICE_DELETED event. Guest reset will automatically complete removal
1446 # -> { "execute": "device_del",
1447 # "arguments": { "id": "net1" } }
1448 # <- { "return": {} }
1450 # -> { "execute": "device_del",
1451 # "arguments": { "id": "/machine/peripheral-anon/device[0]" } }
1452 # <- { "return": {} }
1455 { 'command': 'device_del', 'data': {'id': 'str'} }
1460 # Emitted whenever the device removal completion is acknowledged by the guest.
1461 # At this point, it's safe to reuse the specified device ID. Device removal can
1462 # be initiated by the guest or by HMP/QMP commands.
1464 # @device: device name
1466 # @path: device path
1472 # <- { "event": "DEVICE_DELETED",
1473 # "data": { "device": "virtio-net-pci-0",
1474 # "path": "/machine/peripheral/virtio-net-pci-0" },
1475 # "timestamp": { "seconds": 1265044230, "microseconds": 450486 } }
1478 { 'event': 'DEVICE_DELETED',
1479 'data': { '*device': 'str', 'path': 'str' } }
1482 # @DumpGuestMemoryFormat:
1484 # An enumeration of guest-memory-dump's format.
1488 # @kdump-zlib: kdump-compressed format with zlib-compressed
1490 # @kdump-lzo: kdump-compressed format with lzo-compressed
1492 # @kdump-snappy: kdump-compressed format with snappy-compressed
1496 { 'enum': 'DumpGuestMemoryFormat',
1497 'data': [ 'elf', 'kdump-zlib', 'kdump-lzo', 'kdump-snappy' ] }
1500 # @dump-guest-memory:
1502 # Dump guest's memory to vmcore. It is a synchronous operation that can take
1503 # very long depending on the amount of guest memory.
1505 # @paging: if true, do paging to get guest's memory mapping. This allows
1506 # using gdb to process the core file.
1508 # IMPORTANT: this option can make QEMU allocate several gigabytes
1509 # of RAM. This can happen for a large guest, or a
1510 # malicious guest pretending to be large.
1512 # Also, paging=true has the following limitations:
1514 # 1. The guest may be in a catastrophic state or can have corrupted
1515 # memory, which cannot be trusted
1516 # 2. The guest can be in real-mode even if paging is enabled. For
1517 # example, the guest uses ACPI to sleep, and ACPI sleep state
1519 # 3. Currently only supported on i386 and x86_64.
1521 # @protocol: the filename or file descriptor of the vmcore. The supported
1524 # 1. file: the protocol starts with "file:", and the following
1525 # string is the file's path.
1526 # 2. fd: the protocol starts with "fd:", and the following string
1529 # @detach: if true, QMP will return immediately rather than
1530 # waiting for the dump to finish. The user can track progress
1531 # using "query-dump". (since 2.6).
1533 # @begin: if specified, the starting physical address.
1535 # @length: if specified, the memory size, in bytes. If you don't
1536 # want to dump all guest's memory, please specify the start @begin
1539 # @format: if specified, the format of guest memory dump. But non-elf
1540 # format is conflict with paging and filter, ie. @paging, @begin and
1541 # @length is not allowed to be specified with non-elf @format at the
1542 # same time (since 2.0)
1544 # Note: All boolean arguments default to false
1546 # Returns: nothing on success
1552 # -> { "execute": "dump-guest-memory",
1553 # "arguments": { "protocol": "fd:dump" } }
1554 # <- { "return": {} }
1557 { 'command': 'dump-guest-memory',
1558 'data': { 'paging': 'bool', 'protocol': 'str', '*detach': 'bool',
1559 '*begin': 'int', '*length': 'int',
1560 '*format': 'DumpGuestMemoryFormat'} }
1565 # Describe the status of a long-running background guest memory dump.
1567 # @none: no dump-guest-memory has started yet.
1569 # @active: there is one dump running in background.
1571 # @completed: the last dump has finished successfully.
1573 # @failed: the last dump has failed.
1577 { 'enum': 'DumpStatus',
1578 'data': [ 'none', 'active', 'completed', 'failed' ] }
1583 # The result format for 'query-dump'.
1585 # @status: enum of @DumpStatus, which shows current dump status
1587 # @completed: bytes written in latest dump (uncompressed)
1589 # @total: total bytes to be written in latest dump (uncompressed)
1593 { 'struct': 'DumpQueryResult',
1594 'data': { 'status': 'DumpStatus',
1601 # Query latest dump status.
1603 # Returns: A @DumpStatus object showing the dump status.
1609 # -> { "execute": "query-dump" }
1610 # <- { "return": { "status": "active", "completed": 1024000,
1611 # "total": 2048000 } }
1614 { 'command': 'query-dump', 'returns': 'DumpQueryResult' }
1619 # Emitted when background dump has completed
1621 # @result: DumpQueryResult type described in qapi-schema.json.
1623 # @error: human-readable error string that provides
1624 # hint on why dump failed. Only presents on failure. The
1625 # user should not try to interpret the error string.
1631 # { "event": "DUMP_COMPLETED",
1632 # "data": {"result": {"total": 1090650112, "status": "completed",
1633 # "completed": 1090650112} } }
1636 { 'event': 'DUMP_COMPLETED' ,
1637 'data': { 'result': 'DumpQueryResult', '*error': 'str' } }
1640 # @DumpGuestMemoryCapability:
1642 # A list of the available formats for dump-guest-memory
1646 { 'struct': 'DumpGuestMemoryCapability',
1648 'formats': ['DumpGuestMemoryFormat'] } }
1651 # @query-dump-guest-memory-capability:
1653 # Returns the available formats for dump-guest-memory
1655 # Returns: A @DumpGuestMemoryCapability object listing available formats for
1662 # -> { "execute": "query-dump-guest-memory-capability" }
1663 # <- { "return": { "formats":
1664 # ["elf", "kdump-zlib", "kdump-lzo", "kdump-snappy"] }
1667 { 'command': 'query-dump-guest-memory-capability',
1668 'returns': 'DumpGuestMemoryCapability' }
1673 # Dump guest's storage keys
1675 # @filename: the path to the file to dump to
1677 # This command is only supported on s390 architecture.
1683 # -> { "execute": "dump-skeys",
1684 # "arguments": { "filename": "/tmp/skeys" } }
1685 # <- { "return": {} }
1688 { 'command': 'dump-skeys',
1689 'data': { 'filename': 'str' } }
1694 # Create a QOM object.
1696 # @qom-type: the class name for the object to be created
1698 # @id: the name of the new object
1700 # @props: a dictionary of properties to be passed to the backend
1702 # Returns: Nothing on success
1703 # Error if @qom-type is not a valid class name
1709 # -> { "execute": "object-add",
1710 # "arguments": { "qom-type": "rng-random", "id": "rng1",
1711 # "props": { "filename": "/dev/hwrng" } } }
1712 # <- { "return": {} }
1715 { 'command': 'object-add',
1716 'data': {'qom-type': 'str', 'id': 'str', '*props': 'any'} }
1721 # Remove a QOM object.
1723 # @id: the name of the QOM object to remove
1725 # Returns: Nothing on success
1726 # Error if @id is not a valid id for a QOM object
1732 # -> { "execute": "object-del", "arguments": { "id": "rng1" } }
1733 # <- { "return": {} }
1736 { 'command': 'object-del', 'data': {'id': 'str'} }
1741 # Receive a file descriptor via SCM rights and assign it a name
1743 # @fdname: file descriptor name
1745 # Returns: Nothing on success
1749 # Notes: If @fdname already exists, the file descriptor assigned to
1750 # it will be closed and replaced by the received file
1753 # The 'closefd' command can be used to explicitly close the
1754 # file descriptor when it is no longer needed.
1758 # -> { "execute": "getfd", "arguments": { "fdname": "fd1" } }
1759 # <- { "return": {} }
1762 { 'command': 'getfd', 'data': {'fdname': 'str'} }
1767 # Close a file descriptor previously passed via SCM rights
1769 # @fdname: file descriptor name
1771 # Returns: Nothing on success
1777 # -> { "execute": "closefd", "arguments": { "fdname": "fd1" } }
1778 # <- { "return": {} }
1781 { 'command': 'closefd', 'data': {'fdname': 'str'} }
1786 # Information describing a machine.
1788 # @name: the name of the machine
1790 # @alias: an alias for the machine name
1792 # @is-default: whether the machine is default
1794 # @cpu-max: maximum number of CPUs supported by the machine type
1797 # @hotpluggable-cpus: cpu hotplug via -device is supported (since 2.7.0)
1801 { 'struct': 'MachineInfo',
1802 'data': { 'name': 'str', '*alias': 'str',
1803 '*is-default': 'bool', 'cpu-max': 'int',
1804 'hotpluggable-cpus': 'bool'} }
1809 # Return a list of supported machines
1811 # Returns: a list of MachineInfo
1815 { 'command': 'query-machines', 'returns': ['MachineInfo'] }
1818 # @CpuDefinitionInfo:
1820 # Virtual CPU definition.
1822 # @name: the name of the CPU definition
1824 # @migration-safe: whether a CPU definition can be safely used for
1825 # migration in combination with a QEMU compatibility machine
1826 # when migrating between different QMU versions and between
1827 # hosts with different sets of (hardware or software)
1828 # capabilities. If not provided, information is not available
1829 # and callers should not assume the CPU definition to be
1830 # migration-safe. (since 2.8)
1832 # @static: whether a CPU definition is static and will not change depending on
1833 # QEMU version, machine type, machine options and accelerator options.
1834 # A static model is always migration-safe. (since 2.8)
1836 # @unavailable-features: List of properties that prevent
1837 # the CPU model from running in the current
1839 # @typename: Type name that can be used as argument to @device-list-properties,
1840 # to introspect properties configurable using -cpu or -global.
1843 # @unavailable-features is a list of QOM property names that
1844 # represent CPU model attributes that prevent the CPU from running.
1845 # If the QOM property is read-only, that means there's no known
1846 # way to make the CPU model run in the current host. Implementations
1847 # that choose not to provide specific information return the
1848 # property name "type".
1849 # If the property is read-write, it means that it MAY be possible
1850 # to run the CPU model in the current host if that property is
1851 # changed. Management software can use it as hints to suggest or
1852 # choose an alternative for the user, or just to generate meaningful
1853 # error messages explaining why the CPU model can't be used.
1854 # If @unavailable-features is an empty list, the CPU model is
1855 # runnable using the current host and machine-type.
1856 # If @unavailable-features is not present, runnability
1857 # information for the CPU is not available.
1861 { 'struct': 'CpuDefinitionInfo',
1862 'data': { 'name': 'str', '*migration-safe': 'bool', 'static': 'bool',
1863 '*unavailable-features': [ 'str' ], 'typename': 'str' } }
1866 # @query-cpu-definitions:
1868 # Return a list of supported virtual CPU definitions
1870 # Returns: a list of CpuDefInfo
1874 { 'command': 'query-cpu-definitions', 'returns': ['CpuDefinitionInfo'] }
1879 # Virtual CPU model.
1881 # A CPU model consists of the name of a CPU definition, to which
1882 # delta changes are applied (e.g. features added/removed). Most magic values
1883 # that an architecture might require should be hidden behind the name.
1884 # However, if required, architectures can expose relevant properties.
1886 # @name: the name of the CPU definition the model is based on
1887 # @props: a dictionary of QOM properties to be applied
1891 { 'struct': 'CpuModelInfo',
1892 'data': { 'name': 'str',
1896 # @CpuModelExpansionType:
1898 # An enumeration of CPU model expansion types.
1900 # @static: Expand to a static CPU model, a combination of a static base
1901 # model name and property delta changes. As the static base model will
1902 # never change, the expanded CPU model will be the same, independant of
1903 # independent of QEMU version, machine type, machine options, and
1904 # accelerator options. Therefore, the resulting model can be used by
1905 # tooling without having to specify a compatibility machine - e.g. when
1906 # displaying the "host" model. static CPU models are migration-safe.
1908 # @full: Expand all properties. The produced model is not guaranteed to be
1909 # migration-safe, but allows tooling to get an insight and work with
1912 # Note: When a non-migration-safe CPU model is expanded in static mode, some
1913 # features enabled by the CPU model may be omitted, because they can't be
1914 # implemented by a static CPU model definition (e.g. cache info passthrough and
1915 # PMU passthrough in x86). If you need an accurate representation of the
1916 # features enabled by a non-migration-safe CPU model, use @full. If you need a
1917 # static representation that will keep ABI compatibility even when changing QEMU
1918 # version or machine-type, use @static (but keep in mind that some features may
1923 { 'enum': 'CpuModelExpansionType',
1924 'data': [ 'static', 'full' ] }
1928 # @CpuModelExpansionInfo:
1930 # The result of a cpu model expansion.
1932 # @model: the expanded CpuModelInfo.
1936 { 'struct': 'CpuModelExpansionInfo',
1937 'data': { 'model': 'CpuModelInfo' } }
1941 # @query-cpu-model-expansion:
1943 # Expands a given CPU model (or a combination of CPU model + additional options)
1944 # to different granularities, allowing tooling to get an understanding what a
1945 # specific CPU model looks like in QEMU under a certain configuration.
1947 # This interface can be used to query the "host" CPU model.
1949 # The data returned by this command may be affected by:
1951 # * QEMU version: CPU models may look different depending on the QEMU version.
1952 # (Except for CPU models reported as "static" in query-cpu-definitions.)
1953 # * machine-type: CPU model may look different depending on the machine-type.
1954 # (Except for CPU models reported as "static" in query-cpu-definitions.)
1955 # * machine options (including accelerator): in some architectures, CPU models
1956 # may look different depending on machine and accelerator options. (Except for
1957 # CPU models reported as "static" in query-cpu-definitions.)
1958 # * "-cpu" arguments and global properties: arguments to the -cpu option and
1959 # global properties may affect expansion of CPU models. Using
1960 # query-cpu-model-expansion while using these is not advised.
1962 # Some architectures may not support all expansion types. s390x supports
1963 # "full" and "static".
1965 # Returns: a CpuModelExpansionInfo. Returns an error if expanding CPU models is
1966 # not supported, if the model cannot be expanded, if the model contains
1967 # an unknown CPU definition name, unknown properties or properties
1968 # with a wrong type. Also returns an error if an expansion type is
1973 { 'command': 'query-cpu-model-expansion',
1974 'data': { 'type': 'CpuModelExpansionType',
1975 'model': 'CpuModelInfo' },
1976 'returns': 'CpuModelExpansionInfo' }
1979 # @CpuModelCompareResult:
1981 # An enumeration of CPU model comparation results. The result is usually
1982 # calculated using e.g. CPU features or CPU generations.
1984 # @incompatible: If model A is incompatible to model B, model A is not
1985 # guaranteed to run where model B runs and the other way around.
1987 # @identical: If model A is identical to model B, model A is guaranteed to run
1988 # where model B runs and the other way around.
1990 # @superset: If model A is a superset of model B, model B is guaranteed to run
1991 # where model A runs. There are no guarantees about the other way.
1993 # @subset: If model A is a subset of model B, model A is guaranteed to run
1994 # where model B runs. There are no guarantees about the other way.
1998 { 'enum': 'CpuModelCompareResult',
1999 'data': [ 'incompatible', 'identical', 'superset', 'subset' ] }
2002 # @CpuModelCompareInfo:
2004 # The result of a CPU model comparison.
2006 # @result: The result of the compare operation.
2007 # @responsible-properties: List of properties that led to the comparison result
2008 # not being identical.
2010 # @responsible-properties is a list of QOM property names that led to
2011 # both CPUs not being detected as identical. For identical models, this
2013 # If a QOM property is read-only, that means there's no known way to make the
2014 # CPU models identical. If the special property name "type" is included, the
2015 # models are by definition not identical and cannot be made identical.
2019 { 'struct': 'CpuModelCompareInfo',
2020 'data': {'result': 'CpuModelCompareResult',
2021 'responsible-properties': ['str']
2026 # @query-cpu-model-comparison:
2028 # Compares two CPU models, returning how they compare in a specific
2029 # configuration. The results indicates how both models compare regarding
2030 # runnability. This result can be used by tooling to make decisions if a
2031 # certain CPU model will run in a certain configuration or if a compatible
2032 # CPU model has to be created by baselining.
2034 # Usually, a CPU model is compared against the maximum possible CPU model
2035 # of a certain configuration (e.g. the "host" model for KVM). If that CPU
2036 # model is identical or a subset, it will run in that configuration.
2038 # The result returned by this command may be affected by:
2040 # * QEMU version: CPU models may look different depending on the QEMU version.
2041 # (Except for CPU models reported as "static" in query-cpu-definitions.)
2042 # * machine-type: CPU model may look different depending on the machine-type.
2043 # (Except for CPU models reported as "static" in query-cpu-definitions.)
2044 # * machine options (including accelerator): in some architectures, CPU models
2045 # may look different depending on machine and accelerator options. (Except for
2046 # CPU models reported as "static" in query-cpu-definitions.)
2047 # * "-cpu" arguments and global properties: arguments to the -cpu option and
2048 # global properties may affect expansion of CPU models. Using
2049 # query-cpu-model-expansion while using these is not advised.
2051 # Some architectures may not support comparing CPU models. s390x supports
2052 # comparing CPU models.
2054 # Returns: a CpuModelBaselineInfo. Returns an error if comparing CPU models is
2055 # not supported, if a model cannot be used, if a model contains
2056 # an unknown cpu definition name, unknown properties or properties
2061 { 'command': 'query-cpu-model-comparison',
2062 'data': { 'modela': 'CpuModelInfo', 'modelb': 'CpuModelInfo' },
2063 'returns': 'CpuModelCompareInfo' }
2066 # @CpuModelBaselineInfo:
2068 # The result of a CPU model baseline.
2070 # @model: the baselined CpuModelInfo.
2074 { 'struct': 'CpuModelBaselineInfo',
2075 'data': { 'model': 'CpuModelInfo' } }
2078 # @query-cpu-model-baseline:
2080 # Baseline two CPU models, creating a compatible third model. The created
2081 # model will always be a static, migration-safe CPU model (see "static"
2082 # CPU model expansion for details).
2084 # This interface can be used by tooling to create a compatible CPU model out
2085 # two CPU models. The created CPU model will be identical to or a subset of
2086 # both CPU models when comparing them. Therefore, the created CPU model is
2087 # guaranteed to run where the given CPU models run.
2089 # The result returned by this command may be affected by:
2091 # * QEMU version: CPU models may look different depending on the QEMU version.
2092 # (Except for CPU models reported as "static" in query-cpu-definitions.)
2093 # * machine-type: CPU model may look different depending on the machine-type.
2094 # (Except for CPU models reported as "static" in query-cpu-definitions.)
2095 # * machine options (including accelerator): in some architectures, CPU models
2096 # may look different depending on machine and accelerator options. (Except for
2097 # CPU models reported as "static" in query-cpu-definitions.)
2098 # * "-cpu" arguments and global properties: arguments to the -cpu option and
2099 # global properties may affect expansion of CPU models. Using
2100 # query-cpu-model-expansion while using these is not advised.
2102 # Some architectures may not support baselining CPU models. s390x supports
2103 # baselining CPU models.
2105 # Returns: a CpuModelBaselineInfo. Returns an error if baselining CPU models is
2106 # not supported, if a model cannot be used, if a model contains
2107 # an unknown cpu definition name, unknown properties or properties
2112 { 'command': 'query-cpu-model-baseline',
2113 'data': { 'modela': 'CpuModelInfo',
2114 'modelb': 'CpuModelInfo' },
2115 'returns': 'CpuModelBaselineInfo' }
2120 # Information about a file descriptor that was added to an fd set.
2122 # @fdset-id: The ID of the fd set that @fd was added to.
2124 # @fd: The file descriptor that was received via SCM rights and
2125 # added to the fd set.
2129 { 'struct': 'AddfdInfo', 'data': {'fdset-id': 'int', 'fd': 'int'} }
2134 # Add a file descriptor, that was passed via SCM rights, to an fd set.
2136 # @fdset-id: The ID of the fd set to add the file descriptor to.
2138 # @opaque: A free-form string that can be used to describe the fd.
2140 # Returns: @AddfdInfo on success
2142 # If file descriptor was not received, FdNotSupplied
2144 # If @fdset-id is a negative value, InvalidParameterValue
2146 # Notes: The list of fd sets is shared by all monitor connections.
2148 # If @fdset-id is not specified, a new fd set will be created.
2154 # -> { "execute": "add-fd", "arguments": { "fdset-id": 1 } }
2155 # <- { "return": { "fdset-id": 1, "fd": 3 } }
2158 { 'command': 'add-fd', 'data': {'*fdset-id': 'int', '*opaque': 'str'},
2159 'returns': 'AddfdInfo' }
2164 # Remove a file descriptor from an fd set.
2166 # @fdset-id: The ID of the fd set that the file descriptor belongs to.
2168 # @fd: The file descriptor that is to be removed.
2170 # Returns: Nothing on success
2171 # If @fdset-id or @fd is not found, FdNotFound
2175 # Notes: The list of fd sets is shared by all monitor connections.
2177 # If @fd is not specified, all file descriptors in @fdset-id
2182 # -> { "execute": "remove-fd", "arguments": { "fdset-id": 1, "fd": 3 } }
2183 # <- { "return": {} }
2186 { 'command': 'remove-fd', 'data': {'fdset-id': 'int', '*fd': 'int'} }
2191 # Information about a file descriptor that belongs to an fd set.
2193 # @fd: The file descriptor value.
2195 # @opaque: A free-form string that can be used to describe the fd.
2199 { 'struct': 'FdsetFdInfo',
2200 'data': {'fd': 'int', '*opaque': 'str'} }
2205 # Information about an fd set.
2207 # @fdset-id: The ID of the fd set.
2209 # @fds: A list of file descriptors that belong to this fd set.
2213 { 'struct': 'FdsetInfo',
2214 'data': {'fdset-id': 'int', 'fds': ['FdsetFdInfo']} }
2219 # Return information describing all fd sets.
2221 # Returns: A list of @FdsetInfo
2225 # Note: The list of fd sets is shared by all monitor connections.
2229 # -> { "execute": "query-fdsets" }
2235 # "opaque": "rdonly:/path/to/file"
2239 # "opaque": "rdwr:/path/to/file"
2259 { 'command': 'query-fdsets', 'returns': ['FdsetInfo'] }
2264 # Information describing the QEMU target.
2266 # @arch: the target architecture (eg "x86_64", "i386", etc)
2270 { 'struct': 'TargetInfo',
2271 'data': { 'arch': 'str' } }
2276 # Return information about the target for this QEMU
2278 # Returns: TargetInfo
2282 { 'command': 'query-target', 'returns': 'TargetInfo' }
2285 # @AcpiTableOptions:
2287 # Specify an ACPI table on the command line to load.
2289 # At most one of @file and @data can be specified. The list of files specified
2290 # by any one of them is loaded and concatenated in order. If both are omitted,
2293 # Other fields / optargs can be used to override fields of the generic ACPI
2294 # table header; refer to the ACPI specification 5.0, section 5.2.6 System
2295 # Description Table Header. If a header field is not overridden, then the
2296 # corresponding value from the concatenated blob is used (in case of @file), or
2297 # it is filled in with a hard-coded value (in case of @data).
2299 # String fields are copied into the matching ACPI member from lowest address
2300 # upwards, and silently truncated / NUL-padded to length.
2302 # @sig: table signature / identifier (4 bytes)
2304 # @rev: table revision number (dependent on signature, 1 byte)
2306 # @oem_id: OEM identifier (6 bytes)
2308 # @oem_table_id: OEM table identifier (8 bytes)
2310 # @oem_rev: OEM-supplied revision number (4 bytes)
2312 # @asl_compiler_id: identifier of the utility that created the table
2315 # @asl_compiler_rev: revision number of the utility that created the
2318 # @file: colon (:) separated list of pathnames to load and
2319 # concatenate as table data. The resultant binary blob is expected to
2320 # have an ACPI table header. At least one file is required. This field
2323 # @data: colon (:) separated list of pathnames to load and
2324 # concatenate as table data. The resultant binary blob must not have an
2325 # ACPI table header. At least one file is required. This field excludes
2330 { 'struct': 'AcpiTableOptions',
2335 '*oem_table_id': 'str',
2336 '*oem_rev': 'uint32',
2337 '*asl_compiler_id': 'str',
2338 '*asl_compiler_rev': 'uint32',
2343 # @CommandLineParameterType:
2345 # Possible types for an option parameter.
2347 # @string: accepts a character string
2349 # @boolean: accepts "on" or "off"
2351 # @number: accepts a number
2353 # @size: accepts a number followed by an optional suffix (K)ilo,
2354 # (M)ega, (G)iga, (T)era
2358 { 'enum': 'CommandLineParameterType',
2359 'data': ['string', 'boolean', 'number', 'size'] }
2362 # @CommandLineParameterInfo:
2364 # Details about a single parameter of a command line option.
2366 # @name: parameter name
2368 # @type: parameter @CommandLineParameterType
2370 # @help: human readable text string, not suitable for parsing.
2372 # @default: default value string (since 2.1)
2376 { 'struct': 'CommandLineParameterInfo',
2377 'data': { 'name': 'str',
2378 'type': 'CommandLineParameterType',
2380 '*default': 'str' } }
2383 # @CommandLineOptionInfo:
2385 # Details about a command line option, including its list of parameter details
2387 # @option: option name
2389 # @parameters: an array of @CommandLineParameterInfo
2393 { 'struct': 'CommandLineOptionInfo',
2394 'data': { 'option': 'str', 'parameters': ['CommandLineParameterInfo'] } }
2397 # @query-command-line-options:
2399 # Query command line option schema.
2401 # @option: option name
2403 # Returns: list of @CommandLineOptionInfo for all options (or for the given
2404 # @option). Returns an error if the given @option doesn't exist.
2410 # -> { "execute": "query-command-line-options",
2411 # "arguments": { "option": "option-rom" } }
2416 # "name": "romfile",
2420 # "name": "bootindex",
2424 # "option": "option-rom"
2430 {'command': 'query-command-line-options', 'data': { '*option': 'str' },
2431 'returns': ['CommandLineOptionInfo'] }
2434 # @X86CPURegister32:
2436 # A X86 32-bit register
2440 { 'enum': 'X86CPURegister32',
2441 'data': [ 'EAX', 'EBX', 'ECX', 'EDX', 'ESP', 'EBP', 'ESI', 'EDI' ] }
2444 # @X86CPUFeatureWordInfo:
2446 # Information about a X86 CPU feature word
2448 # @cpuid-input-eax: Input EAX value for CPUID instruction for that feature word
2450 # @cpuid-input-ecx: Input ECX value for CPUID instruction for that
2453 # @cpuid-register: Output register containing the feature bits
2455 # @features: value of output register, containing the feature bits
2459 { 'struct': 'X86CPUFeatureWordInfo',
2460 'data': { 'cpuid-input-eax': 'int',
2461 '*cpuid-input-ecx': 'int',
2462 'cpuid-register': 'X86CPURegister32',
2463 'features': 'int' } }
2466 # @DummyForceArrays:
2468 # Not used by QMP; hack to let us use X86CPUFeatureWordInfoList internally
2472 { 'struct': 'DummyForceArrays',
2473 'data': { 'unused': ['X86CPUFeatureWordInfo'] } }
2479 # @node: NUMA nodes configuration
2481 # @dist: NUMA distance configuration (since 2.10)
2483 # @cpu: property based CPU(s) to node mapping (Since: 2.10)
2487 { 'enum': 'NumaOptionsType',
2488 'data': [ 'node', 'dist', 'cpu' ] }
2493 # A discriminated record of NUMA options. (for OptsVisitor)
2497 { 'union': 'NumaOptions',
2498 'base': { 'type': 'NumaOptionsType' },
2499 'discriminator': 'type',
2501 'node': 'NumaNodeOptions',
2502 'dist': 'NumaDistOptions',
2503 'cpu': 'NumaCpuOptions' }}
2508 # Create a guest NUMA node. (for OptsVisitor)
2510 # @nodeid: NUMA node ID (increase by 1 from 0 if omitted)
2512 # @cpus: VCPUs belonging to this node (assign VCPUS round-robin
2515 # @mem: memory size of this node; mutually exclusive with @memdev.
2516 # Equally divide total memory among nodes if both @mem and @memdev are
2519 # @memdev: memory backend object. If specified for one node,
2520 # it must be specified for all nodes.
2524 { 'struct': 'NumaNodeOptions',
2526 '*nodeid': 'uint16',
2527 '*cpus': ['uint16'],
2534 # Set the distance between 2 NUMA nodes.
2536 # @src: source NUMA node.
2538 # @dst: destination NUMA node.
2540 # @val: NUMA distance from source node to destination node.
2541 # When a node is unreachable from another node, set the distance
2542 # between them to 255.
2546 { 'struct': 'NumaDistOptions',
2555 # Option "-numa cpu" overrides default cpu to node mapping.
2556 # It accepts the same set of cpu properties as returned by
2557 # query-hotpluggable-cpus[].props, where node-id could be used to
2558 # override default node mapping.
2562 { 'struct': 'NumaCpuOptions',
2563 'base': 'CpuInstanceProperties',
2569 # Host memory policy types
2571 # @default: restore default policy, remove any nondefault policy
2573 # @preferred: set the preferred host nodes for allocation
2575 # @bind: a strict policy that restricts memory allocation to the
2576 # host nodes specified
2578 # @interleave: memory allocations are interleaved across the set
2579 # of host nodes specified
2583 { 'enum': 'HostMemPolicy',
2584 'data': [ 'default', 'preferred', 'bind', 'interleave' ] }
2589 # Information about memory backend
2591 # @id: backend's ID if backend has 'id' property (since 2.9)
2593 # @size: memory backend size
2595 # @merge: enables or disables memory merge support
2597 # @dump: includes memory backend's memory in a core dump or not
2599 # @prealloc: enables or disables memory preallocation
2601 # @host-nodes: host nodes for its memory policy
2603 # @policy: memory policy of memory backend
2607 { 'struct': 'Memdev',
2614 'host-nodes': ['uint16'],
2615 'policy': 'HostMemPolicy' }}
2620 # Returns information for all memory backends.
2622 # Returns: a list of @Memdev.
2628 # -> { "execute": "query-memdev" }
2632 # "size": 536870912,
2635 # "prealloc": false,
2636 # "host-nodes": [0, 1],
2640 # "size": 536870912,
2644 # "host-nodes": [2, 3],
2645 # "policy": "preferred"
2651 { 'command': 'query-memdev', 'returns': ['Memdev'] }
2654 # @PCDIMMDeviceInfo:
2656 # PCDIMMDevice state information
2660 # @addr: physical address, where device is mapped
2662 # @size: size of memory that the device provides
2664 # @slot: slot number at which device is plugged in
2666 # @node: NUMA node number where device is plugged in
2668 # @memdev: memory backend linked with device
2670 # @hotplugged: true if device was hotplugged
2672 # @hotpluggable: true if device if could be added/removed while machine is running
2676 { 'struct': 'PCDIMMDeviceInfo',
2677 'data': { '*id': 'str',
2683 'hotplugged': 'bool',
2684 'hotpluggable': 'bool'
2689 # @MemoryDeviceInfo:
2691 # Union containing information about a memory device
2695 { 'union': 'MemoryDeviceInfo', 'data': {'dimm': 'PCDIMMDeviceInfo'} }
2698 # @query-memory-devices:
2700 # Lists available memory devices and their state
2706 # -> { "execute": "query-memory-devices" }
2707 # <- { "return": [ { "data":
2708 # { "addr": 5368709120,
2709 # "hotpluggable": true,
2710 # "hotplugged": true,
2712 # "memdev": "/objects/memX",
2714 # "size": 1073741824,
2720 { 'command': 'query-memory-devices', 'returns': ['MemoryDeviceInfo'] }
2723 # @MEM_UNPLUG_ERROR:
2725 # Emitted when memory hot unplug error occurs.
2727 # @device: device name
2729 # @msg: Informative message
2735 # <- { "event": "MEM_UNPLUG_ERROR"
2736 # "data": { "device": "dimm1",
2737 # "msg": "acpi: device unplug for unsupported device"
2739 # "timestamp": { "seconds": 1265044230, "microseconds": 450486 } }
2742 { 'event': 'MEM_UNPLUG_ERROR',
2743 'data': { 'device': 'str', 'msg': 'str' } }
2748 # @DIMM: memory slot
2749 # @CPU: logical CPU slot (since 2.7)
2751 { 'enum': 'ACPISlotType', 'data': [ 'DIMM', 'CPU' ] }
2756 # OSPM Status Indication for a device
2757 # For description of possible values of @source and @status fields
2758 # see "_OST (OSPM Status Indication)" chapter of ACPI5.0 spec.
2760 # @device: device ID associated with slot
2762 # @slot: slot ID, unique per slot of a given @slot-type
2764 # @slot-type: type of the slot
2766 # @source: an integer containing the source event
2768 # @status: an integer containing the status code
2772 { 'struct': 'ACPIOSTInfo',
2773 'data' : { '*device': 'str',
2775 'slot-type': 'ACPISlotType',
2780 # @query-acpi-ospm-status:
2782 # Return a list of ACPIOSTInfo for devices that support status
2783 # reporting via ACPI _OST method.
2789 # -> { "execute": "query-acpi-ospm-status" }
2790 # <- { "return": [ { "device": "d1", "slot": "0", "slot-type": "DIMM", "source": 1, "status": 0},
2791 # { "slot": "1", "slot-type": "DIMM", "source": 0, "status": 0},
2792 # { "slot": "2", "slot-type": "DIMM", "source": 0, "status": 0},
2793 # { "slot": "3", "slot-type": "DIMM", "source": 0, "status": 0}
2797 { 'command': 'query-acpi-ospm-status', 'returns': ['ACPIOSTInfo'] }
2802 # Emitted when guest executes ACPI _OST method.
2804 # @info: ACPIOSTInfo type as described in qapi-schema.json
2810 # <- { "event": "ACPI_DEVICE_OST",
2811 # "data": { "device": "d1", "slot": "0",
2812 # "slot-type": "DIMM", "source": 1, "status": 0 } }
2815 { 'event': 'ACPI_DEVICE_OST',
2816 'data': { 'info': 'ACPIOSTInfo' } }
2821 # An enumeration of the I/O operation types
2823 # @read: read operation
2825 # @write: write operation
2829 { 'enum': 'IoOperationType',
2830 'data': [ 'read', 'write' ] }
2833 # @rtc-reset-reinjection:
2835 # This command will reset the RTC interrupt reinjection backlog.
2836 # Can be used if another mechanism to synchronize guest time
2837 # is in effect, for example QEMU guest agent's guest-set-time
2844 # -> { "execute": "rtc-reset-reinjection" }
2845 # <- { "return": {} }
2848 { 'command': 'rtc-reset-reinjection' }
2853 # Emitted when the guest changes the RTC time.
2855 # @offset: offset between base RTC clock (as specified by -rtc base), and
2856 # new RTC clock value
2858 # Note: This event is rate-limited.
2864 # <- { "event": "RTC_CHANGE",
2865 # "data": { "offset": 78 },
2866 # "timestamp": { "seconds": 1267020223, "microseconds": 435656 } }
2869 { 'event': 'RTC_CHANGE',
2870 'data': { 'offset': 'int' } }
2875 # Mode of the replay subsystem.
2877 # @none: normal execution mode. Replay or record are not enabled.
2879 # @record: record mode. All non-deterministic data is written into the
2882 # @play: replay mode. Non-deterministic data required for system execution
2883 # is read from the log.
2887 { 'enum': 'ReplayMode',
2888 'data': [ 'none', 'record', 'play' ] }
2891 # @xen-load-devices-state:
2893 # Load the state of all devices from file. The RAM and the block devices
2894 # of the VM are not loaded by this command.
2896 # @filename: the file to load the state of the devices from as binary
2897 # data. See xen-save-devices-state.txt for a description of the binary
2904 # -> { "execute": "xen-load-devices-state",
2905 # "arguments": { "filename": "/tmp/resume" } }
2906 # <- { "return": {} }
2909 { 'command': 'xen-load-devices-state', 'data': {'filename': 'str'} }
2914 # The struct describes capability for a specific GIC (Generic
2915 # Interrupt Controller) version. These bits are not only decided by
2916 # QEMU/KVM software version, but also decided by the hardware that
2917 # the program is running upon.
2919 # @version: version of GIC to be described. Currently, only 2 and 3
2922 # @emulated: whether current QEMU/hardware supports emulated GIC
2923 # device in user space.
2925 # @kernel: whether current QEMU/hardware supports hardware
2926 # accelerated GIC device in kernel.
2930 { 'struct': 'GICCapability',
2931 'data': { 'version': 'int',
2933 'kernel': 'bool' } }
2936 # @query-gic-capabilities:
2938 # This command is ARM-only. It will return a list of GICCapability
2939 # objects that describe its capability bits.
2941 # Returns: a list of GICCapability objects.
2947 # -> { "execute": "query-gic-capabilities" }
2948 # <- { "return": [{ "version": 2, "emulated": true, "kernel": false },
2949 # { "version": 3, "emulated": false, "kernel": true } ] }
2952 { 'command': 'query-gic-capabilities', 'returns': ['GICCapability'] }
2955 # @CpuInstanceProperties:
2957 # List of properties to be used for hotplugging a CPU instance,
2958 # it should be passed by management with device_add command when
2959 # a CPU is being hotplugged.
2961 # @node-id: NUMA node ID the CPU belongs to
2962 # @socket-id: socket number within node/board the CPU belongs to
2963 # @core-id: core number within socket the CPU belongs to
2964 # @thread-id: thread number within core the CPU belongs to
2966 # Note: currently there are 4 properties that could be present
2967 # but management should be prepared to pass through other
2968 # properties with device_add command to allow for future
2969 # interface extension. This also requires the filed names to be kept in
2970 # sync with the properties passed to -device/device_add.
2974 { 'struct': 'CpuInstanceProperties',
2975 'data': { '*node-id': 'int',
2976 '*socket-id': 'int',
2985 # @type: CPU object type for usage with device_add command
2986 # @props: list of properties to be used for hotplugging CPU
2987 # @vcpus-count: number of logical VCPU threads @HotpluggableCPU provides
2988 # @qom-path: link to existing CPU object if CPU is present or
2989 # omitted if CPU is not present.
2993 { 'struct': 'HotpluggableCPU',
2994 'data': { 'type': 'str',
2995 'vcpus-count': 'int',
2996 'props': 'CpuInstanceProperties',
3002 # @query-hotpluggable-cpus:
3004 # Returns: a list of HotpluggableCPU objects.
3010 # For pseries machine type started with -smp 2,cores=2,maxcpus=4 -cpu POWER8:
3012 # -> { "execute": "query-hotpluggable-cpus" }
3014 # { "props": { "core": 8 }, "type": "POWER8-spapr-cpu-core",
3015 # "vcpus-count": 1 },
3016 # { "props": { "core": 0 }, "type": "POWER8-spapr-cpu-core",
3017 # "vcpus-count": 1, "qom-path": "/machine/unattached/device[0]"}
3020 # For pc machine type started with -smp 1,maxcpus=2:
3022 # -> { "execute": "query-hotpluggable-cpus" }
3025 # "type": "qemu64-x86_64-cpu", "vcpus-count": 1,
3026 # "props": {"core-id": 0, "socket-id": 1, "thread-id": 0}
3029 # "qom-path": "/machine/unattached/device[0]",
3030 # "type": "qemu64-x86_64-cpu", "vcpus-count": 1,
3031 # "props": {"core-id": 0, "socket-id": 0, "thread-id": 0}
3036 { 'command': 'query-hotpluggable-cpus', 'returns': ['HotpluggableCPU'] }
3043 # @guid: the globally unique identifier
3047 { 'struct': 'GuidInfo', 'data': {'guid': 'str'} }
3050 # @query-vm-generation-id:
3052 # Show Virtual Machine Generation ID
3056 { 'command': 'query-vm-generation-id', 'returns': 'GuidInfo' }