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/ui.json' }
90 { 'include': 'qapi/migration.json' }
91 { 'include': 'qapi/transaction.json' }
92 { 'include': 'qapi/event.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 # A PCI device memory region
558 # @base: the starting address (guest physical)
560 # @limit: the ending address (guest physical)
564 { 'struct': 'PciMemoryRange', 'data': {'base': 'int', 'limit': 'int'} }
569 # Information about a PCI device I/O region.
571 # @bar: the index of the Base Address Register for this region
573 # @type: 'io' if the region is a PIO region
574 # 'memory' if the region is a MMIO region
578 # @prefetch: if @type is 'memory', true if the memory is prefetchable
580 # @mem_type_64: if @type is 'memory', true if the BAR is 64-bit
584 { 'struct': 'PciMemoryRegion',
585 'data': {'bar': 'int', 'type': 'str', 'address': 'int', 'size': 'int',
586 '*prefetch': 'bool', '*mem_type_64': 'bool' } }
591 # Information about a bus of a PCI Bridge device
593 # @number: primary bus interface number. This should be the number of the
594 # bus the device resides on.
596 # @secondary: secondary bus interface number. This is the number of the
597 # main bus for the bridge
599 # @subordinate: This is the highest number bus that resides below the
602 # @io_range: The PIO range for all devices on this bridge
604 # @memory_range: The MMIO range for all devices on this bridge
606 # @prefetchable_range: The range of prefetchable MMIO for all devices on
611 { 'struct': 'PciBusInfo',
612 'data': {'number': 'int', 'secondary': 'int', 'subordinate': 'int',
613 'io_range': 'PciMemoryRange',
614 'memory_range': 'PciMemoryRange',
615 'prefetchable_range': 'PciMemoryRange' } }
620 # Information about a PCI Bridge device
622 # @bus: information about the bus the device resides on
624 # @devices: a list of @PciDeviceInfo for each device on this bridge
628 { 'struct': 'PciBridgeInfo',
629 'data': {'bus': 'PciBusInfo', '*devices': ['PciDeviceInfo']} }
634 # Information about the Class of a PCI device
636 # @desc: a string description of the device's class
638 # @class: the class code of the device
642 { 'struct': 'PciDeviceClass',
643 'data': {'*desc': 'str', 'class': 'int'} }
648 # Information about the Id of a PCI device
650 # @device: the PCI device id
652 # @vendor: the PCI vendor id
656 { 'struct': 'PciDeviceId',
657 'data': {'device': 'int', 'vendor': 'int'} }
662 # Information about a PCI device
664 # @bus: the bus number of the device
666 # @slot: the slot the device is located in
668 # @function: the function of the slot used by the device
670 # @class_info: the class of the device
672 # @id: the PCI device id
674 # @irq: if an IRQ is assigned to the device, the IRQ number
676 # @qdev_id: the device name of the PCI device
678 # @pci_bridge: if the device is a PCI bridge, the bridge information
680 # @regions: a list of the PCI I/O regions associated with the device
682 # Notes: the contents of @class_info.desc are not stable and should only be
683 # treated as informational.
687 { 'struct': 'PciDeviceInfo',
688 'data': {'bus': 'int', 'slot': 'int', 'function': 'int',
689 'class_info': 'PciDeviceClass', 'id': 'PciDeviceId',
690 '*irq': 'int', 'qdev_id': 'str', '*pci_bridge': 'PciBridgeInfo',
691 'regions': ['PciMemoryRegion']} }
696 # Information about a PCI bus
698 # @bus: the bus index
700 # @devices: a list of devices on this bus
704 { 'struct': 'PciInfo', 'data': {'bus': 'int', 'devices': ['PciDeviceInfo']} }
709 # Return information about the PCI bus topology of the guest.
711 # Returns: a list of @PciInfo for each PCI bus. Each bus is
712 # represented by a json-object, which has a key with a json-array of
713 # all PCI devices attached to it. Each device is represented by a
720 # -> { "execute": "query-pci" }
731 # "desc": "Host bridge"
747 # "desc": "ISA bridge"
763 # "desc": "IDE controller"
785 # "desc": "VGA controller"
795 # "mem_type_64": false,
798 # "address": 4026531840,
803 # "mem_type_64": false,
806 # "address": 4060086272,
811 # "mem_type_64": false,
826 # "desc": "RAM controller"
847 # Note: This example has been shortened as the real response is too long.
850 { 'command': 'query-pci', 'returns': ['PciInfo'] }
855 # This command will cause the QEMU process to exit gracefully. While every
856 # attempt is made to send the QMP response before terminating, this is not
857 # guaranteed. When using this interface, a premature EOF would not be
864 # -> { "execute": "quit" }
865 # <- { "return": {} }
867 { 'command': 'quit' }
872 # Stop all guest VCPU execution.
876 # Notes: This function will succeed even if the guest is already in the stopped
877 # state. In "inmigrate" state, it will ensure that the guest
878 # remains paused once migration finishes, as if the -S option was
879 # passed on the command line.
883 # -> { "execute": "stop" }
884 # <- { "return": {} }
887 { 'command': 'stop' }
892 # Performs a hard reset of a guest.
898 # -> { "execute": "system_reset" }
899 # <- { "return": {} }
902 { 'command': 'system_reset' }
907 # Requests that a guest perform a powerdown operation.
911 # Notes: A guest may or may not respond to this command. This command
912 # returning does not indicate that a guest has accepted the request or
913 # that it has shut down. Many guests will respond to this command by
914 # prompting the user in some way.
917 # -> { "execute": "system_powerdown" }
918 # <- { "return": {} }
921 { 'command': 'system_powerdown' }
926 # This command is a nop that is only provided for the purposes of compatibility.
930 # Notes: Do not use this command.
932 { 'command': 'cpu', 'data': {'index': 'int'} }
937 # Adds CPU with specified ID
939 # @id: ID of CPU to be created, valid values [0..max_cpus)
941 # Returns: Nothing on success
947 # -> { "execute": "cpu-add", "arguments": { "id": 2 } }
948 # <- { "return": {} }
951 { 'command': 'cpu-add', 'data': {'id': 'int'} }
956 # Save a portion of guest memory to a file.
958 # @val: the virtual address of the guest to start from
960 # @size: the size of memory region to save
962 # @filename: the file to save the memory to as binary data
964 # @cpu-index: the index of the virtual CPU to use for translating the
965 # virtual address (defaults to CPU 0)
967 # Returns: Nothing on success
971 # Notes: Errors were not reliably returned until 1.1
975 # -> { "execute": "memsave",
976 # "arguments": { "val": 10,
978 # "filename": "/tmp/virtual-mem-dump" } }
979 # <- { "return": {} }
982 { 'command': 'memsave',
983 'data': {'val': 'int', 'size': 'int', 'filename': 'str', '*cpu-index': 'int'} }
988 # Save a portion of guest physical memory to a file.
990 # @val: the physical address of the guest to start from
992 # @size: the size of memory region to save
994 # @filename: the file to save the memory to as binary data
996 # Returns: Nothing on success
1000 # Notes: Errors were not reliably returned until 1.1
1004 # -> { "execute": "pmemsave",
1005 # "arguments": { "val": 10,
1007 # "filename": "/tmp/physical-mem-dump" } }
1008 # <- { "return": {} }
1011 { 'command': 'pmemsave',
1012 'data': {'val': 'int', 'size': 'int', 'filename': 'str'} }
1017 # Resume guest VCPU execution.
1021 # Returns: If successful, nothing
1023 # Notes: This command will succeed if the guest is currently running. It
1024 # will also succeed if the guest is in the "inmigrate" state; in
1025 # this case, the effect of the command is to make sure the guest
1026 # starts once migration finishes, removing the effect of the -S
1027 # command line option if it was passed.
1031 # -> { "execute": "cont" }
1032 # <- { "return": {} }
1035 { 'command': 'cont' }
1040 # Wakeup guest from suspend. Does nothing in case the guest isn't suspended.
1048 # -> { "execute": "system_wakeup" }
1049 # <- { "return": {} }
1052 { 'command': 'system_wakeup' }
1057 # Injects a Non-Maskable Interrupt into the default CPU (x86/s390) or all CPUs (ppc64).
1058 # The command fails when the guest doesn't support injecting.
1060 # Returns: If successful, nothing
1064 # Note: prior to 2.1, this command was only supported for x86 and s390 VMs
1068 # -> { "execute": "inject-nmi" }
1069 # <- { "return": {} }
1072 { 'command': 'inject-nmi' }
1077 # Request the balloon driver to change its balloon size.
1079 # @value: the target size of the balloon in bytes
1081 # Returns: Nothing on success
1082 # If the balloon driver is enabled but not functional because the KVM
1083 # kernel module cannot support it, KvmMissingCap
1084 # If no balloon device is present, DeviceNotActive
1086 # Notes: This command just issues a request to the guest. When it returns,
1087 # the balloon size may not have changed. A guest can change the balloon
1088 # size independent of this command.
1094 # -> { "execute": "balloon", "arguments": { "value": 536870912 } }
1095 # <- { "return": {} }
1098 { 'command': 'balloon', 'data': {'value': 'int'} }
1101 # @human-monitor-command:
1103 # Execute a command on the human monitor and return the output.
1105 # @command-line: the command to execute in the human monitor
1107 # @cpu-index: The CPU to use for commands that require an implicit CPU
1109 # Returns: the output of the command as a string
1113 # Notes: This command only exists as a stop-gap. Its use is highly
1114 # discouraged. The semantics of this command are not
1115 # guaranteed: this means that command names, arguments and
1116 # responses can change or be removed at ANY time. Applications
1117 # that rely on long term stability guarantees should NOT
1120 # Known limitations:
1122 # * This command is stateless, this means that commands that depend
1123 # on state information (such as getfd) might not work
1125 # * Commands that prompt the user for data don't currently work
1129 # -> { "execute": "human-monitor-command",
1130 # "arguments": { "command-line": "info kvm" } }
1131 # <- { "return": "kvm support: enabled\r\n" }
1134 { 'command': 'human-monitor-command',
1135 'data': {'command-line': 'str', '*cpu-index': 'int'},
1139 # @ObjectPropertyInfo:
1141 # @name: the name of the property
1143 # @type: the type of the property. This will typically come in one of four
1146 # 1) A primitive type such as 'u8', 'u16', 'bool', 'str', or 'double'.
1147 # These types are mapped to the appropriate JSON type.
1149 # 2) A child type in the form 'child<subtype>' where subtype is a qdev
1150 # device type name. Child properties create the composition tree.
1152 # 3) A link type in the form 'link<subtype>' where subtype is a qdev
1153 # device type name. Link properties form the device model graph.
1157 { 'struct': 'ObjectPropertyInfo',
1158 'data': { 'name': 'str', 'type': 'str' } }
1163 # This command will list any properties of a object given a path in the object
1166 # @path: the path within the object model. See @qom-get for a description of
1169 # Returns: a list of @ObjectPropertyInfo that describe the properties of the
1174 { 'command': 'qom-list',
1175 'data': { 'path': 'str' },
1176 'returns': [ 'ObjectPropertyInfo' ] }
1181 # This command will get a property from a object model path and return the
1184 # @path: The path within the object model. There are two forms of supported
1185 # paths--absolute and partial paths.
1187 # Absolute paths are derived from the root object and can follow child<>
1188 # or link<> properties. Since they can follow link<> properties, they
1189 # can be arbitrarily long. Absolute paths look like absolute filenames
1190 # and are prefixed with a leading slash.
1192 # Partial paths look like relative filenames. They do not begin
1193 # with a prefix. The matching rules for partial paths are subtle but
1194 # designed to make specifying objects easy. At each level of the
1195 # composition tree, the partial path is matched as an absolute path.
1196 # The first match is not returned. At least two matches are searched
1197 # for. A successful result is only returned if only one match is
1198 # found. If more than one match is found, a flag is return to
1199 # indicate that the match was ambiguous.
1201 # @property: The property name to read
1203 # Returns: The property value. The type depends on the property
1204 # type. child<> and link<> properties are returned as #str
1205 # pathnames. All integer property types (u8, u16, etc) are
1210 { 'command': 'qom-get',
1211 'data': { 'path': 'str', 'property': 'str' },
1217 # This command will set a property from a object model path.
1219 # @path: see @qom-get for a description of this parameter
1221 # @property: the property name to set
1223 # @value: a value who's type is appropriate for the property type. See @qom-get
1224 # for a description of type mapping.
1228 { 'command': 'qom-set',
1229 'data': { 'path': 'str', 'property': 'str', 'value': 'any' } }
1234 # This command is multiple commands multiplexed together.
1236 # @device: This is normally the name of a block device but it may also be 'vnc'.
1237 # when it's 'vnc', then sub command depends on @target
1239 # @target: If @device is a block device, then this is the new filename.
1240 # If @device is 'vnc', then if the value 'password' selects the vnc
1241 # change password command. Otherwise, this specifies a new server URI
1242 # address to listen to for VNC connections.
1244 # @arg: If @device is a block device, then this is an optional format to open
1246 # If @device is 'vnc' and @target is 'password', this is the new VNC
1247 # password to set. See change-vnc-password for additional notes.
1249 # Returns: Nothing on success.
1250 # If @device is not a valid block device, DeviceNotFound
1252 # Notes: This interface is deprecated, and it is strongly recommended that you
1253 # avoid using it. For changing block devices, use
1254 # blockdev-change-medium; for changing VNC parameters, use
1255 # change-vnc-password.
1261 # 1. Change a removable medium
1263 # -> { "execute": "change",
1264 # "arguments": { "device": "ide1-cd0",
1265 # "target": "/srv/images/Fedora-12-x86_64-DVD.iso" } }
1266 # <- { "return": {} }
1268 # 2. Change VNC password
1270 # -> { "execute": "change",
1271 # "arguments": { "device": "vnc", "target": "password",
1272 # "arg": "foobar1" } }
1273 # <- { "return": {} }
1276 { 'command': 'change',
1277 'data': {'device': 'str', 'target': 'str', '*arg': 'str'} }
1282 # This structure describes a search result from @qom-list-types
1284 # @name: the type name found in the search
1286 # @abstract: the type is abstract and can't be directly instantiated.
1287 # Omitted if false. (since 2.10)
1289 # @parent: Name of parent type, if any (since 2.10)
1293 { 'struct': 'ObjectTypeInfo',
1294 'data': { 'name': 'str', '*abstract': 'bool', '*parent': 'str' } }
1299 # This command will return a list of types given search parameters
1301 # @implements: if specified, only return types that implement this type name
1303 # @abstract: if true, include abstract types in the results
1305 # Returns: a list of @ObjectTypeInfo or an empty list if no results are found
1309 { 'command': 'qom-list-types',
1310 'data': { '*implements': 'str', '*abstract': 'bool' },
1311 'returns': [ 'ObjectTypeInfo' ] }
1314 # @DevicePropertyInfo:
1316 # Information about device properties.
1318 # @name: the name of the property
1319 # @type: the typename of the property
1320 # @description: if specified, the description of the property.
1325 { 'struct': 'DevicePropertyInfo',
1326 'data': { 'name': 'str', 'type': 'str', '*description': 'str' } }
1329 # @device-list-properties:
1331 # List properties associated with a device.
1333 # @typename: the type name of a device
1335 # Returns: a list of DevicePropertyInfo describing a devices properties
1339 { 'command': 'device-list-properties',
1340 'data': { 'typename': 'str'},
1341 'returns': [ 'DevicePropertyInfo' ] }
1344 # @xen-set-global-dirty-log:
1346 # Enable or disable the global dirty log mode.
1348 # @enable: true to enable, false to disable.
1356 # -> { "execute": "xen-set-global-dirty-log",
1357 # "arguments": { "enable": true } }
1358 # <- { "return": {} }
1361 { 'command': 'xen-set-global-dirty-log', 'data': { 'enable': 'bool' } }
1366 # @driver: the name of the new device's driver
1368 # @bus: the device's parent bus (device tree path)
1370 # @id: the device's ID, must be unique
1372 # Additional arguments depend on the type.
1377 # 1. For detailed information about this command, please refer to the
1378 # 'docs/qdev-device-use.txt' file.
1380 # 2. It's possible to list device properties by running QEMU with the
1381 # "-device DEVICE,help" command-line argument, where DEVICE is the
1386 # -> { "execute": "device_add",
1387 # "arguments": { "driver": "e1000", "id": "net1",
1389 # "mac": "52:54:00:12:34:56" } }
1390 # <- { "return": {} }
1392 # TODO: This command effectively bypasses QAPI completely due to its
1393 # "additional arguments" business. It shouldn't have been added to
1394 # the schema in this form. It should be qapified properly, or
1395 # replaced by a properly qapified command.
1399 { 'command': 'device_add',
1400 'data': {'driver': 'str', '*bus': 'str', '*id': 'str'},
1401 'gen': false } # so we can get the additional arguments
1406 # Remove a device from a guest
1408 # @id: the device's ID or QOM path
1410 # Returns: Nothing on success
1411 # If @id is not a valid device, DeviceNotFound
1413 # Notes: When this command completes, the device may not be removed from the
1414 # guest. Hot removal is an operation that requires guest cooperation.
1415 # This command merely requests that the guest begin the hot removal
1416 # process. Completion of the device removal process is signaled with a
1417 # DEVICE_DELETED event. Guest reset will automatically complete removal
1424 # -> { "execute": "device_del",
1425 # "arguments": { "id": "net1" } }
1426 # <- { "return": {} }
1428 # -> { "execute": "device_del",
1429 # "arguments": { "id": "/machine/peripheral-anon/device[0]" } }
1430 # <- { "return": {} }
1433 { 'command': 'device_del', 'data': {'id': 'str'} }
1436 # @DumpGuestMemoryFormat:
1438 # An enumeration of guest-memory-dump's format.
1442 # @kdump-zlib: kdump-compressed format with zlib-compressed
1444 # @kdump-lzo: kdump-compressed format with lzo-compressed
1446 # @kdump-snappy: kdump-compressed format with snappy-compressed
1450 { 'enum': 'DumpGuestMemoryFormat',
1451 'data': [ 'elf', 'kdump-zlib', 'kdump-lzo', 'kdump-snappy' ] }
1454 # @dump-guest-memory:
1456 # Dump guest's memory to vmcore. It is a synchronous operation that can take
1457 # very long depending on the amount of guest memory.
1459 # @paging: if true, do paging to get guest's memory mapping. This allows
1460 # using gdb to process the core file.
1462 # IMPORTANT: this option can make QEMU allocate several gigabytes
1463 # of RAM. This can happen for a large guest, or a
1464 # malicious guest pretending to be large.
1466 # Also, paging=true has the following limitations:
1468 # 1. The guest may be in a catastrophic state or can have corrupted
1469 # memory, which cannot be trusted
1470 # 2. The guest can be in real-mode even if paging is enabled. For
1471 # example, the guest uses ACPI to sleep, and ACPI sleep state
1473 # 3. Currently only supported on i386 and x86_64.
1475 # @protocol: the filename or file descriptor of the vmcore. The supported
1478 # 1. file: the protocol starts with "file:", and the following
1479 # string is the file's path.
1480 # 2. fd: the protocol starts with "fd:", and the following string
1483 # @detach: if true, QMP will return immediately rather than
1484 # waiting for the dump to finish. The user can track progress
1485 # using "query-dump". (since 2.6).
1487 # @begin: if specified, the starting physical address.
1489 # @length: if specified, the memory size, in bytes. If you don't
1490 # want to dump all guest's memory, please specify the start @begin
1493 # @format: if specified, the format of guest memory dump. But non-elf
1494 # format is conflict with paging and filter, ie. @paging, @begin and
1495 # @length is not allowed to be specified with non-elf @format at the
1496 # same time (since 2.0)
1498 # Note: All boolean arguments default to false
1500 # Returns: nothing on success
1506 # -> { "execute": "dump-guest-memory",
1507 # "arguments": { "protocol": "fd:dump" } }
1508 # <- { "return": {} }
1511 { 'command': 'dump-guest-memory',
1512 'data': { 'paging': 'bool', 'protocol': 'str', '*detach': 'bool',
1513 '*begin': 'int', '*length': 'int',
1514 '*format': 'DumpGuestMemoryFormat'} }
1519 # Describe the status of a long-running background guest memory dump.
1521 # @none: no dump-guest-memory has started yet.
1523 # @active: there is one dump running in background.
1525 # @completed: the last dump has finished successfully.
1527 # @failed: the last dump has failed.
1531 { 'enum': 'DumpStatus',
1532 'data': [ 'none', 'active', 'completed', 'failed' ] }
1537 # The result format for 'query-dump'.
1539 # @status: enum of @DumpStatus, which shows current dump status
1541 # @completed: bytes written in latest dump (uncompressed)
1543 # @total: total bytes to be written in latest dump (uncompressed)
1547 { 'struct': 'DumpQueryResult',
1548 'data': { 'status': 'DumpStatus',
1555 # Query latest dump status.
1557 # Returns: A @DumpStatus object showing the dump status.
1563 # -> { "execute": "query-dump" }
1564 # <- { "return": { "status": "active", "completed": 1024000,
1565 # "total": 2048000 } }
1568 { 'command': 'query-dump', 'returns': 'DumpQueryResult' }
1571 # @DumpGuestMemoryCapability:
1573 # A list of the available formats for dump-guest-memory
1577 { 'struct': 'DumpGuestMemoryCapability',
1579 'formats': ['DumpGuestMemoryFormat'] } }
1582 # @query-dump-guest-memory-capability:
1584 # Returns the available formats for dump-guest-memory
1586 # Returns: A @DumpGuestMemoryCapability object listing available formats for
1593 # -> { "execute": "query-dump-guest-memory-capability" }
1594 # <- { "return": { "formats":
1595 # ["elf", "kdump-zlib", "kdump-lzo", "kdump-snappy"] }
1598 { 'command': 'query-dump-guest-memory-capability',
1599 'returns': 'DumpGuestMemoryCapability' }
1604 # Dump guest's storage keys
1606 # @filename: the path to the file to dump to
1608 # This command is only supported on s390 architecture.
1614 # -> { "execute": "dump-skeys",
1615 # "arguments": { "filename": "/tmp/skeys" } }
1616 # <- { "return": {} }
1619 { 'command': 'dump-skeys',
1620 'data': { 'filename': 'str' } }
1625 # Create a QOM object.
1627 # @qom-type: the class name for the object to be created
1629 # @id: the name of the new object
1631 # @props: a dictionary of properties to be passed to the backend
1633 # Returns: Nothing on success
1634 # Error if @qom-type is not a valid class name
1640 # -> { "execute": "object-add",
1641 # "arguments": { "qom-type": "rng-random", "id": "rng1",
1642 # "props": { "filename": "/dev/hwrng" } } }
1643 # <- { "return": {} }
1646 { 'command': 'object-add',
1647 'data': {'qom-type': 'str', 'id': 'str', '*props': 'any'} }
1652 # Remove a QOM object.
1654 # @id: the name of the QOM object to remove
1656 # Returns: Nothing on success
1657 # Error if @id is not a valid id for a QOM object
1663 # -> { "execute": "object-del", "arguments": { "id": "rng1" } }
1664 # <- { "return": {} }
1667 { 'command': 'object-del', 'data': {'id': 'str'} }
1672 # Receive a file descriptor via SCM rights and assign it a name
1674 # @fdname: file descriptor name
1676 # Returns: Nothing on success
1680 # Notes: If @fdname already exists, the file descriptor assigned to
1681 # it will be closed and replaced by the received file
1684 # The 'closefd' command can be used to explicitly close the
1685 # file descriptor when it is no longer needed.
1689 # -> { "execute": "getfd", "arguments": { "fdname": "fd1" } }
1690 # <- { "return": {} }
1693 { 'command': 'getfd', 'data': {'fdname': 'str'} }
1698 # Close a file descriptor previously passed via SCM rights
1700 # @fdname: file descriptor name
1702 # Returns: Nothing on success
1708 # -> { "execute": "closefd", "arguments": { "fdname": "fd1" } }
1709 # <- { "return": {} }
1712 { 'command': 'closefd', 'data': {'fdname': 'str'} }
1717 # Information describing a machine.
1719 # @name: the name of the machine
1721 # @alias: an alias for the machine name
1723 # @is-default: whether the machine is default
1725 # @cpu-max: maximum number of CPUs supported by the machine type
1728 # @hotpluggable-cpus: cpu hotplug via -device is supported (since 2.7.0)
1732 { 'struct': 'MachineInfo',
1733 'data': { 'name': 'str', '*alias': 'str',
1734 '*is-default': 'bool', 'cpu-max': 'int',
1735 'hotpluggable-cpus': 'bool'} }
1740 # Return a list of supported machines
1742 # Returns: a list of MachineInfo
1746 { 'command': 'query-machines', 'returns': ['MachineInfo'] }
1749 # @CpuDefinitionInfo:
1751 # Virtual CPU definition.
1753 # @name: the name of the CPU definition
1755 # @migration-safe: whether a CPU definition can be safely used for
1756 # migration in combination with a QEMU compatibility machine
1757 # when migrating between different QMU versions and between
1758 # hosts with different sets of (hardware or software)
1759 # capabilities. If not provided, information is not available
1760 # and callers should not assume the CPU definition to be
1761 # migration-safe. (since 2.8)
1763 # @static: whether a CPU definition is static and will not change depending on
1764 # QEMU version, machine type, machine options and accelerator options.
1765 # A static model is always migration-safe. (since 2.8)
1767 # @unavailable-features: List of properties that prevent
1768 # the CPU model from running in the current
1770 # @typename: Type name that can be used as argument to @device-list-properties,
1771 # to introspect properties configurable using -cpu or -global.
1774 # @unavailable-features is a list of QOM property names that
1775 # represent CPU model attributes that prevent the CPU from running.
1776 # If the QOM property is read-only, that means there's no known
1777 # way to make the CPU model run in the current host. Implementations
1778 # that choose not to provide specific information return the
1779 # property name "type".
1780 # If the property is read-write, it means that it MAY be possible
1781 # to run the CPU model in the current host if that property is
1782 # changed. Management software can use it as hints to suggest or
1783 # choose an alternative for the user, or just to generate meaningful
1784 # error messages explaining why the CPU model can't be used.
1785 # If @unavailable-features is an empty list, the CPU model is
1786 # runnable using the current host and machine-type.
1787 # If @unavailable-features is not present, runnability
1788 # information for the CPU is not available.
1792 { 'struct': 'CpuDefinitionInfo',
1793 'data': { 'name': 'str', '*migration-safe': 'bool', 'static': 'bool',
1794 '*unavailable-features': [ 'str' ], 'typename': 'str' } }
1797 # @query-cpu-definitions:
1799 # Return a list of supported virtual CPU definitions
1801 # Returns: a list of CpuDefInfo
1805 { 'command': 'query-cpu-definitions', 'returns': ['CpuDefinitionInfo'] }
1810 # Virtual CPU model.
1812 # A CPU model consists of the name of a CPU definition, to which
1813 # delta changes are applied (e.g. features added/removed). Most magic values
1814 # that an architecture might require should be hidden behind the name.
1815 # However, if required, architectures can expose relevant properties.
1817 # @name: the name of the CPU definition the model is based on
1818 # @props: a dictionary of QOM properties to be applied
1822 { 'struct': 'CpuModelInfo',
1823 'data': { 'name': 'str',
1827 # @CpuModelExpansionType:
1829 # An enumeration of CPU model expansion types.
1831 # @static: Expand to a static CPU model, a combination of a static base
1832 # model name and property delta changes. As the static base model will
1833 # never change, the expanded CPU model will be the same, independant of
1834 # independent of QEMU version, machine type, machine options, and
1835 # accelerator options. Therefore, the resulting model can be used by
1836 # tooling without having to specify a compatibility machine - e.g. when
1837 # displaying the "host" model. static CPU models are migration-safe.
1839 # @full: Expand all properties. The produced model is not guaranteed to be
1840 # migration-safe, but allows tooling to get an insight and work with
1843 # Note: When a non-migration-safe CPU model is expanded in static mode, some
1844 # features enabled by the CPU model may be omitted, because they can't be
1845 # implemented by a static CPU model definition (e.g. cache info passthrough and
1846 # PMU passthrough in x86). If you need an accurate representation of the
1847 # features enabled by a non-migration-safe CPU model, use @full. If you need a
1848 # static representation that will keep ABI compatibility even when changing QEMU
1849 # version or machine-type, use @static (but keep in mind that some features may
1854 { 'enum': 'CpuModelExpansionType',
1855 'data': [ 'static', 'full' ] }
1859 # @CpuModelExpansionInfo:
1861 # The result of a cpu model expansion.
1863 # @model: the expanded CpuModelInfo.
1867 { 'struct': 'CpuModelExpansionInfo',
1868 'data': { 'model': 'CpuModelInfo' } }
1872 # @query-cpu-model-expansion:
1874 # Expands a given CPU model (or a combination of CPU model + additional options)
1875 # to different granularities, allowing tooling to get an understanding what a
1876 # specific CPU model looks like in QEMU under a certain configuration.
1878 # This interface can be used to query the "host" CPU model.
1880 # The data returned by this command may be affected by:
1882 # * QEMU version: CPU models may look different depending on the QEMU version.
1883 # (Except for CPU models reported as "static" in query-cpu-definitions.)
1884 # * machine-type: CPU model may look different depending on the machine-type.
1885 # (Except for CPU models reported as "static" in query-cpu-definitions.)
1886 # * machine options (including accelerator): in some architectures, CPU models
1887 # may look different depending on machine and accelerator options. (Except for
1888 # CPU models reported as "static" in query-cpu-definitions.)
1889 # * "-cpu" arguments and global properties: arguments to the -cpu option and
1890 # global properties may affect expansion of CPU models. Using
1891 # query-cpu-model-expansion while using these is not advised.
1893 # Some architectures may not support all expansion types. s390x supports
1894 # "full" and "static".
1896 # Returns: a CpuModelExpansionInfo. Returns an error if expanding CPU models is
1897 # not supported, if the model cannot be expanded, if the model contains
1898 # an unknown CPU definition name, unknown properties or properties
1899 # with a wrong type. Also returns an error if an expansion type is
1904 { 'command': 'query-cpu-model-expansion',
1905 'data': { 'type': 'CpuModelExpansionType',
1906 'model': 'CpuModelInfo' },
1907 'returns': 'CpuModelExpansionInfo' }
1910 # @CpuModelCompareResult:
1912 # An enumeration of CPU model comparation results. The result is usually
1913 # calculated using e.g. CPU features or CPU generations.
1915 # @incompatible: If model A is incompatible to model B, model A is not
1916 # guaranteed to run where model B runs and the other way around.
1918 # @identical: If model A is identical to model B, model A is guaranteed to run
1919 # where model B runs and the other way around.
1921 # @superset: If model A is a superset of model B, model B is guaranteed to run
1922 # where model A runs. There are no guarantees about the other way.
1924 # @subset: If model A is a subset of model B, model A is guaranteed to run
1925 # where model B runs. There are no guarantees about the other way.
1929 { 'enum': 'CpuModelCompareResult',
1930 'data': [ 'incompatible', 'identical', 'superset', 'subset' ] }
1933 # @CpuModelCompareInfo:
1935 # The result of a CPU model comparison.
1937 # @result: The result of the compare operation.
1938 # @responsible-properties: List of properties that led to the comparison result
1939 # not being identical.
1941 # @responsible-properties is a list of QOM property names that led to
1942 # both CPUs not being detected as identical. For identical models, this
1944 # If a QOM property is read-only, that means there's no known way to make the
1945 # CPU models identical. If the special property name "type" is included, the
1946 # models are by definition not identical and cannot be made identical.
1950 { 'struct': 'CpuModelCompareInfo',
1951 'data': {'result': 'CpuModelCompareResult',
1952 'responsible-properties': ['str']
1957 # @query-cpu-model-comparison:
1959 # Compares two CPU models, returning how they compare in a specific
1960 # configuration. The results indicates how both models compare regarding
1961 # runnability. This result can be used by tooling to make decisions if a
1962 # certain CPU model will run in a certain configuration or if a compatible
1963 # CPU model has to be created by baselining.
1965 # Usually, a CPU model is compared against the maximum possible CPU model
1966 # of a certain configuration (e.g. the "host" model for KVM). If that CPU
1967 # model is identical or a subset, it will run in that configuration.
1969 # The result returned by this command may be affected by:
1971 # * QEMU version: CPU models may look different depending on the QEMU version.
1972 # (Except for CPU models reported as "static" in query-cpu-definitions.)
1973 # * machine-type: CPU model may look different depending on the machine-type.
1974 # (Except for CPU models reported as "static" in query-cpu-definitions.)
1975 # * machine options (including accelerator): in some architectures, CPU models
1976 # may look different depending on machine and accelerator options. (Except for
1977 # CPU models reported as "static" in query-cpu-definitions.)
1978 # * "-cpu" arguments and global properties: arguments to the -cpu option and
1979 # global properties may affect expansion of CPU models. Using
1980 # query-cpu-model-expansion while using these is not advised.
1982 # Some architectures may not support comparing CPU models. s390x supports
1983 # comparing CPU models.
1985 # Returns: a CpuModelBaselineInfo. Returns an error if comparing CPU models is
1986 # not supported, if a model cannot be used, if a model contains
1987 # an unknown cpu definition name, unknown properties or properties
1992 { 'command': 'query-cpu-model-comparison',
1993 'data': { 'modela': 'CpuModelInfo', 'modelb': 'CpuModelInfo' },
1994 'returns': 'CpuModelCompareInfo' }
1997 # @CpuModelBaselineInfo:
1999 # The result of a CPU model baseline.
2001 # @model: the baselined CpuModelInfo.
2005 { 'struct': 'CpuModelBaselineInfo',
2006 'data': { 'model': 'CpuModelInfo' } }
2009 # @query-cpu-model-baseline:
2011 # Baseline two CPU models, creating a compatible third model. The created
2012 # model will always be a static, migration-safe CPU model (see "static"
2013 # CPU model expansion for details).
2015 # This interface can be used by tooling to create a compatible CPU model out
2016 # two CPU models. The created CPU model will be identical to or a subset of
2017 # both CPU models when comparing them. Therefore, the created CPU model is
2018 # guaranteed to run where the given CPU models run.
2020 # The result returned by this command may be affected by:
2022 # * QEMU version: CPU models may look different depending on the QEMU version.
2023 # (Except for CPU models reported as "static" in query-cpu-definitions.)
2024 # * machine-type: CPU model may look different depending on the machine-type.
2025 # (Except for CPU models reported as "static" in query-cpu-definitions.)
2026 # * machine options (including accelerator): in some architectures, CPU models
2027 # may look different depending on machine and accelerator options. (Except for
2028 # CPU models reported as "static" in query-cpu-definitions.)
2029 # * "-cpu" arguments and global properties: arguments to the -cpu option and
2030 # global properties may affect expansion of CPU models. Using
2031 # query-cpu-model-expansion while using these is not advised.
2033 # Some architectures may not support baselining CPU models. s390x supports
2034 # baselining CPU models.
2036 # Returns: a CpuModelBaselineInfo. Returns an error if baselining CPU models is
2037 # not supported, if a model cannot be used, if a model contains
2038 # an unknown cpu definition name, unknown properties or properties
2043 { 'command': 'query-cpu-model-baseline',
2044 'data': { 'modela': 'CpuModelInfo',
2045 'modelb': 'CpuModelInfo' },
2046 'returns': 'CpuModelBaselineInfo' }
2051 # Information about a file descriptor that was added to an fd set.
2053 # @fdset-id: The ID of the fd set that @fd was added to.
2055 # @fd: The file descriptor that was received via SCM rights and
2056 # added to the fd set.
2060 { 'struct': 'AddfdInfo', 'data': {'fdset-id': 'int', 'fd': 'int'} }
2065 # Add a file descriptor, that was passed via SCM rights, to an fd set.
2067 # @fdset-id: The ID of the fd set to add the file descriptor to.
2069 # @opaque: A free-form string that can be used to describe the fd.
2071 # Returns: @AddfdInfo on success
2073 # If file descriptor was not received, FdNotSupplied
2075 # If @fdset-id is a negative value, InvalidParameterValue
2077 # Notes: The list of fd sets is shared by all monitor connections.
2079 # If @fdset-id is not specified, a new fd set will be created.
2085 # -> { "execute": "add-fd", "arguments": { "fdset-id": 1 } }
2086 # <- { "return": { "fdset-id": 1, "fd": 3 } }
2089 { 'command': 'add-fd', 'data': {'*fdset-id': 'int', '*opaque': 'str'},
2090 'returns': 'AddfdInfo' }
2095 # Remove a file descriptor from an fd set.
2097 # @fdset-id: The ID of the fd set that the file descriptor belongs to.
2099 # @fd: The file descriptor that is to be removed.
2101 # Returns: Nothing on success
2102 # If @fdset-id or @fd is not found, FdNotFound
2106 # Notes: The list of fd sets is shared by all monitor connections.
2108 # If @fd is not specified, all file descriptors in @fdset-id
2113 # -> { "execute": "remove-fd", "arguments": { "fdset-id": 1, "fd": 3 } }
2114 # <- { "return": {} }
2117 { 'command': 'remove-fd', 'data': {'fdset-id': 'int', '*fd': 'int'} }
2122 # Information about a file descriptor that belongs to an fd set.
2124 # @fd: The file descriptor value.
2126 # @opaque: A free-form string that can be used to describe the fd.
2130 { 'struct': 'FdsetFdInfo',
2131 'data': {'fd': 'int', '*opaque': 'str'} }
2136 # Information about an fd set.
2138 # @fdset-id: The ID of the fd set.
2140 # @fds: A list of file descriptors that belong to this fd set.
2144 { 'struct': 'FdsetInfo',
2145 'data': {'fdset-id': 'int', 'fds': ['FdsetFdInfo']} }
2150 # Return information describing all fd sets.
2152 # Returns: A list of @FdsetInfo
2156 # Note: The list of fd sets is shared by all monitor connections.
2160 # -> { "execute": "query-fdsets" }
2166 # "opaque": "rdonly:/path/to/file"
2170 # "opaque": "rdwr:/path/to/file"
2190 { 'command': 'query-fdsets', 'returns': ['FdsetInfo'] }
2195 # Information describing the QEMU target.
2197 # @arch: the target architecture (eg "x86_64", "i386", etc)
2201 { 'struct': 'TargetInfo',
2202 'data': { 'arch': 'str' } }
2207 # Return information about the target for this QEMU
2209 # Returns: TargetInfo
2213 { 'command': 'query-target', 'returns': 'TargetInfo' }
2218 # An enumeration of TPM models
2220 # @tpm-tis: TPM TIS model
2224 { 'enum': 'TpmModel', 'data': [ 'tpm-tis' ] }
2227 # @query-tpm-models:
2229 # Return a list of supported TPM models
2231 # Returns: a list of TpmModel
2237 # -> { "execute": "query-tpm-models" }
2238 # <- { "return": [ "tpm-tis" ] }
2241 { 'command': 'query-tpm-models', 'returns': ['TpmModel'] }
2246 # An enumeration of TPM types
2248 # @passthrough: TPM passthrough type
2252 { 'enum': 'TpmType', 'data': [ 'passthrough' ] }
2257 # Return a list of supported TPM types
2259 # Returns: a list of TpmType
2265 # -> { "execute": "query-tpm-types" }
2266 # <- { "return": [ "passthrough" ] }
2269 { 'command': 'query-tpm-types', 'returns': ['TpmType'] }
2272 # @TPMPassthroughOptions:
2274 # Information about the TPM passthrough type
2276 # @path: string describing the path used for accessing the TPM device
2278 # @cancel-path: string showing the TPM's sysfs cancel file
2279 # for cancellation of TPM commands while they are executing
2283 { 'struct': 'TPMPassthroughOptions', 'data': { '*path' : 'str',
2284 '*cancel-path' : 'str'} }
2289 # A union referencing different TPM backend types' configuration options
2291 # @type: 'passthrough' The configuration options for the TPM passthrough type
2295 { 'union': 'TpmTypeOptions',
2296 'data': { 'passthrough' : 'TPMPassthroughOptions' } }
2301 # Information about the TPM
2303 # @id: The Id of the TPM
2305 # @model: The TPM frontend model
2307 # @options: The TPM (backend) type configuration options
2311 { 'struct': 'TPMInfo',
2312 'data': {'id': 'str',
2313 'model': 'TpmModel',
2314 'options': 'TpmTypeOptions' } }
2319 # Return information about the TPM device
2321 # Returns: @TPMInfo on success
2327 # -> { "execute": "query-tpm" }
2330 # { "model": "tpm-tis",
2332 # { "type": "passthrough",
2334 # { "cancel-path": "/sys/class/misc/tpm0/device/cancel",
2335 # "path": "/dev/tpm0"
2344 { 'command': 'query-tpm', 'returns': ['TPMInfo'] }
2347 # @AcpiTableOptions:
2349 # Specify an ACPI table on the command line to load.
2351 # At most one of @file and @data can be specified. The list of files specified
2352 # by any one of them is loaded and concatenated in order. If both are omitted,
2355 # Other fields / optargs can be used to override fields of the generic ACPI
2356 # table header; refer to the ACPI specification 5.0, section 5.2.6 System
2357 # Description Table Header. If a header field is not overridden, then the
2358 # corresponding value from the concatenated blob is used (in case of @file), or
2359 # it is filled in with a hard-coded value (in case of @data).
2361 # String fields are copied into the matching ACPI member from lowest address
2362 # upwards, and silently truncated / NUL-padded to length.
2364 # @sig: table signature / identifier (4 bytes)
2366 # @rev: table revision number (dependent on signature, 1 byte)
2368 # @oem_id: OEM identifier (6 bytes)
2370 # @oem_table_id: OEM table identifier (8 bytes)
2372 # @oem_rev: OEM-supplied revision number (4 bytes)
2374 # @asl_compiler_id: identifier of the utility that created the table
2377 # @asl_compiler_rev: revision number of the utility that created the
2380 # @file: colon (:) separated list of pathnames to load and
2381 # concatenate as table data. The resultant binary blob is expected to
2382 # have an ACPI table header. At least one file is required. This field
2385 # @data: colon (:) separated list of pathnames to load and
2386 # concatenate as table data. The resultant binary blob must not have an
2387 # ACPI table header. At least one file is required. This field excludes
2392 { 'struct': 'AcpiTableOptions',
2397 '*oem_table_id': 'str',
2398 '*oem_rev': 'uint32',
2399 '*asl_compiler_id': 'str',
2400 '*asl_compiler_rev': 'uint32',
2405 # @CommandLineParameterType:
2407 # Possible types for an option parameter.
2409 # @string: accepts a character string
2411 # @boolean: accepts "on" or "off"
2413 # @number: accepts a number
2415 # @size: accepts a number followed by an optional suffix (K)ilo,
2416 # (M)ega, (G)iga, (T)era
2420 { 'enum': 'CommandLineParameterType',
2421 'data': ['string', 'boolean', 'number', 'size'] }
2424 # @CommandLineParameterInfo:
2426 # Details about a single parameter of a command line option.
2428 # @name: parameter name
2430 # @type: parameter @CommandLineParameterType
2432 # @help: human readable text string, not suitable for parsing.
2434 # @default: default value string (since 2.1)
2438 { 'struct': 'CommandLineParameterInfo',
2439 'data': { 'name': 'str',
2440 'type': 'CommandLineParameterType',
2442 '*default': 'str' } }
2445 # @CommandLineOptionInfo:
2447 # Details about a command line option, including its list of parameter details
2449 # @option: option name
2451 # @parameters: an array of @CommandLineParameterInfo
2455 { 'struct': 'CommandLineOptionInfo',
2456 'data': { 'option': 'str', 'parameters': ['CommandLineParameterInfo'] } }
2459 # @query-command-line-options:
2461 # Query command line option schema.
2463 # @option: option name
2465 # Returns: list of @CommandLineOptionInfo for all options (or for the given
2466 # @option). Returns an error if the given @option doesn't exist.
2472 # -> { "execute": "query-command-line-options",
2473 # "arguments": { "option": "option-rom" } }
2478 # "name": "romfile",
2482 # "name": "bootindex",
2486 # "option": "option-rom"
2492 {'command': 'query-command-line-options', 'data': { '*option': 'str' },
2493 'returns': ['CommandLineOptionInfo'] }
2496 # @X86CPURegister32:
2498 # A X86 32-bit register
2502 { 'enum': 'X86CPURegister32',
2503 'data': [ 'EAX', 'EBX', 'ECX', 'EDX', 'ESP', 'EBP', 'ESI', 'EDI' ] }
2506 # @X86CPUFeatureWordInfo:
2508 # Information about a X86 CPU feature word
2510 # @cpuid-input-eax: Input EAX value for CPUID instruction for that feature word
2512 # @cpuid-input-ecx: Input ECX value for CPUID instruction for that
2515 # @cpuid-register: Output register containing the feature bits
2517 # @features: value of output register, containing the feature bits
2521 { 'struct': 'X86CPUFeatureWordInfo',
2522 'data': { 'cpuid-input-eax': 'int',
2523 '*cpuid-input-ecx': 'int',
2524 'cpuid-register': 'X86CPURegister32',
2525 'features': 'int' } }
2528 # @DummyForceArrays:
2530 # Not used by QMP; hack to let us use X86CPUFeatureWordInfoList internally
2534 { 'struct': 'DummyForceArrays',
2535 'data': { 'unused': ['X86CPUFeatureWordInfo'] } }
2541 # @node: NUMA nodes configuration
2543 # @dist: NUMA distance configuration (since 2.10)
2545 # @cpu: property based CPU(s) to node mapping (Since: 2.10)
2549 { 'enum': 'NumaOptionsType',
2550 'data': [ 'node', 'dist', 'cpu' ] }
2555 # A discriminated record of NUMA options. (for OptsVisitor)
2559 { 'union': 'NumaOptions',
2560 'base': { 'type': 'NumaOptionsType' },
2561 'discriminator': 'type',
2563 'node': 'NumaNodeOptions',
2564 'dist': 'NumaDistOptions',
2565 'cpu': 'NumaCpuOptions' }}
2570 # Create a guest NUMA node. (for OptsVisitor)
2572 # @nodeid: NUMA node ID (increase by 1 from 0 if omitted)
2574 # @cpus: VCPUs belonging to this node (assign VCPUS round-robin
2577 # @mem: memory size of this node; mutually exclusive with @memdev.
2578 # Equally divide total memory among nodes if both @mem and @memdev are
2581 # @memdev: memory backend object. If specified for one node,
2582 # it must be specified for all nodes.
2586 { 'struct': 'NumaNodeOptions',
2588 '*nodeid': 'uint16',
2589 '*cpus': ['uint16'],
2596 # Set the distance between 2 NUMA nodes.
2598 # @src: source NUMA node.
2600 # @dst: destination NUMA node.
2602 # @val: NUMA distance from source node to destination node.
2603 # When a node is unreachable from another node, set the distance
2604 # between them to 255.
2608 { 'struct': 'NumaDistOptions',
2617 # Option "-numa cpu" overrides default cpu to node mapping.
2618 # It accepts the same set of cpu properties as returned by
2619 # query-hotpluggable-cpus[].props, where node-id could be used to
2620 # override default node mapping.
2624 { 'struct': 'NumaCpuOptions',
2625 'base': 'CpuInstanceProperties',
2631 # Host memory policy types
2633 # @default: restore default policy, remove any nondefault policy
2635 # @preferred: set the preferred host nodes for allocation
2637 # @bind: a strict policy that restricts memory allocation to the
2638 # host nodes specified
2640 # @interleave: memory allocations are interleaved across the set
2641 # of host nodes specified
2645 { 'enum': 'HostMemPolicy',
2646 'data': [ 'default', 'preferred', 'bind', 'interleave' ] }
2651 # Information about memory backend
2653 # @id: backend's ID if backend has 'id' property (since 2.9)
2655 # @size: memory backend size
2657 # @merge: enables or disables memory merge support
2659 # @dump: includes memory backend's memory in a core dump or not
2661 # @prealloc: enables or disables memory preallocation
2663 # @host-nodes: host nodes for its memory policy
2665 # @policy: memory policy of memory backend
2669 { 'struct': 'Memdev',
2676 'host-nodes': ['uint16'],
2677 'policy': 'HostMemPolicy' }}
2682 # Returns information for all memory backends.
2684 # Returns: a list of @Memdev.
2690 # -> { "execute": "query-memdev" }
2694 # "size": 536870912,
2697 # "prealloc": false,
2698 # "host-nodes": [0, 1],
2702 # "size": 536870912,
2706 # "host-nodes": [2, 3],
2707 # "policy": "preferred"
2713 { 'command': 'query-memdev', 'returns': ['Memdev'] }
2716 # @PCDIMMDeviceInfo:
2718 # PCDIMMDevice state information
2722 # @addr: physical address, where device is mapped
2724 # @size: size of memory that the device provides
2726 # @slot: slot number at which device is plugged in
2728 # @node: NUMA node number where device is plugged in
2730 # @memdev: memory backend linked with device
2732 # @hotplugged: true if device was hotplugged
2734 # @hotpluggable: true if device if could be added/removed while machine is running
2738 { 'struct': 'PCDIMMDeviceInfo',
2739 'data': { '*id': 'str',
2745 'hotplugged': 'bool',
2746 'hotpluggable': 'bool'
2751 # @MemoryDeviceInfo:
2753 # Union containing information about a memory device
2757 { 'union': 'MemoryDeviceInfo', 'data': {'dimm': 'PCDIMMDeviceInfo'} }
2760 # @query-memory-devices:
2762 # Lists available memory devices and their state
2768 # -> { "execute": "query-memory-devices" }
2769 # <- { "return": [ { "data":
2770 # { "addr": 5368709120,
2771 # "hotpluggable": true,
2772 # "hotplugged": true,
2774 # "memdev": "/objects/memX",
2776 # "size": 1073741824,
2782 { 'command': 'query-memory-devices', 'returns': ['MemoryDeviceInfo'] }
2787 # @DIMM: memory slot
2788 # @CPU: logical CPU slot (since 2.7)
2790 { 'enum': 'ACPISlotType', 'data': [ 'DIMM', 'CPU' ] }
2795 # OSPM Status Indication for a device
2796 # For description of possible values of @source and @status fields
2797 # see "_OST (OSPM Status Indication)" chapter of ACPI5.0 spec.
2799 # @device: device ID associated with slot
2801 # @slot: slot ID, unique per slot of a given @slot-type
2803 # @slot-type: type of the slot
2805 # @source: an integer containing the source event
2807 # @status: an integer containing the status code
2811 { 'struct': 'ACPIOSTInfo',
2812 'data' : { '*device': 'str',
2814 'slot-type': 'ACPISlotType',
2819 # @query-acpi-ospm-status:
2821 # Return a list of ACPIOSTInfo for devices that support status
2822 # reporting via ACPI _OST method.
2828 # -> { "execute": "query-acpi-ospm-status" }
2829 # <- { "return": [ { "device": "d1", "slot": "0", "slot-type": "DIMM", "source": 1, "status": 0},
2830 # { "slot": "1", "slot-type": "DIMM", "source": 0, "status": 0},
2831 # { "slot": "2", "slot-type": "DIMM", "source": 0, "status": 0},
2832 # { "slot": "3", "slot-type": "DIMM", "source": 0, "status": 0}
2836 { 'command': 'query-acpi-ospm-status', 'returns': ['ACPIOSTInfo'] }
2841 # An enumeration of the I/O operation types
2843 # @read: read operation
2845 # @write: write operation
2849 { 'enum': 'IoOperationType',
2850 'data': [ 'read', 'write' ] }
2853 # @rtc-reset-reinjection:
2855 # This command will reset the RTC interrupt reinjection backlog.
2856 # Can be used if another mechanism to synchronize guest time
2857 # is in effect, for example QEMU guest agent's guest-set-time
2864 # -> { "execute": "rtc-reset-reinjection" }
2865 # <- { "return": {} }
2868 { 'command': 'rtc-reset-reinjection' }
2873 # Mode of the replay subsystem.
2875 # @none: normal execution mode. Replay or record are not enabled.
2877 # @record: record mode. All non-deterministic data is written into the
2880 # @play: replay mode. Non-deterministic data required for system execution
2881 # is read from the log.
2885 { 'enum': 'ReplayMode',
2886 'data': [ 'none', 'record', 'play' ] }
2889 # @xen-load-devices-state:
2891 # Load the state of all devices from file. The RAM and the block devices
2892 # of the VM are not loaded by this command.
2894 # @filename: the file to load the state of the devices from as binary
2895 # data. See xen-save-devices-state.txt for a description of the binary
2902 # -> { "execute": "xen-load-devices-state",
2903 # "arguments": { "filename": "/tmp/resume" } }
2904 # <- { "return": {} }
2907 { 'command': 'xen-load-devices-state', 'data': {'filename': 'str'} }
2912 # The struct describes capability for a specific GIC (Generic
2913 # Interrupt Controller) version. These bits are not only decided by
2914 # QEMU/KVM software version, but also decided by the hardware that
2915 # the program is running upon.
2917 # @version: version of GIC to be described. Currently, only 2 and 3
2920 # @emulated: whether current QEMU/hardware supports emulated GIC
2921 # device in user space.
2923 # @kernel: whether current QEMU/hardware supports hardware
2924 # accelerated GIC device in kernel.
2928 { 'struct': 'GICCapability',
2929 'data': { 'version': 'int',
2931 'kernel': 'bool' } }
2934 # @query-gic-capabilities:
2936 # This command is ARM-only. It will return a list of GICCapability
2937 # objects that describe its capability bits.
2939 # Returns: a list of GICCapability objects.
2945 # -> { "execute": "query-gic-capabilities" }
2946 # <- { "return": [{ "version": 2, "emulated": true, "kernel": false },
2947 # { "version": 3, "emulated": false, "kernel": true } ] }
2950 { 'command': 'query-gic-capabilities', 'returns': ['GICCapability'] }
2953 # @CpuInstanceProperties:
2955 # List of properties to be used for hotplugging a CPU instance,
2956 # it should be passed by management with device_add command when
2957 # a CPU is being hotplugged.
2959 # @node-id: NUMA node ID the CPU belongs to
2960 # @socket-id: socket number within node/board the CPU belongs to
2961 # @core-id: core number within socket the CPU belongs to
2962 # @thread-id: thread number within core the CPU belongs to
2964 # Note: currently there are 4 properties that could be present
2965 # but management should be prepared to pass through other
2966 # properties with device_add command to allow for future
2967 # interface extension. This also requires the filed names to be kept in
2968 # sync with the properties passed to -device/device_add.
2972 { 'struct': 'CpuInstanceProperties',
2973 'data': { '*node-id': 'int',
2974 '*socket-id': 'int',
2983 # @type: CPU object type for usage with device_add command
2984 # @props: list of properties to be used for hotplugging CPU
2985 # @vcpus-count: number of logical VCPU threads @HotpluggableCPU provides
2986 # @qom-path: link to existing CPU object if CPU is present or
2987 # omitted if CPU is not present.
2991 { 'struct': 'HotpluggableCPU',
2992 'data': { 'type': 'str',
2993 'vcpus-count': 'int',
2994 'props': 'CpuInstanceProperties',
3000 # @query-hotpluggable-cpus:
3002 # Returns: a list of HotpluggableCPU objects.
3008 # For pseries machine type started with -smp 2,cores=2,maxcpus=4 -cpu POWER8:
3010 # -> { "execute": "query-hotpluggable-cpus" }
3012 # { "props": { "core": 8 }, "type": "POWER8-spapr-cpu-core",
3013 # "vcpus-count": 1 },
3014 # { "props": { "core": 0 }, "type": "POWER8-spapr-cpu-core",
3015 # "vcpus-count": 1, "qom-path": "/machine/unattached/device[0]"}
3018 # For pc machine type started with -smp 1,maxcpus=2:
3020 # -> { "execute": "query-hotpluggable-cpus" }
3023 # "type": "qemu64-x86_64-cpu", "vcpus-count": 1,
3024 # "props": {"core-id": 0, "socket-id": 1, "thread-id": 0}
3027 # "qom-path": "/machine/unattached/device[0]",
3028 # "type": "qemu64-x86_64-cpu", "vcpus-count": 1,
3029 # "props": {"core-id": 0, "socket-id": 0, "thread-id": 0}
3034 { 'command': 'query-hotpluggable-cpus', 'returns': ['HotpluggableCPU'] }
3041 # @guid: the globally unique identifier
3045 { 'struct': 'GuidInfo', 'data': {'guid': 'str'} }
3048 # @query-vm-generation-id:
3050 # Show Virtual Machine Generation ID
3054 { 'command': 'query-vm-generation-id', 'returns': 'GuidInfo' }