1 HXCOMM QMP dispatch table and documentation
2 HXCOMM Text between SQMP and EQMP is copied to the QMP documentation file and
3 HXCOMM does not show up in the other formats.
9 This document describes all commands currently supported by QMP.
11 Most of the time their usage is exactly the same as in the user Monitor, this
12 means that any other document which also describe commands (the manpage,
13 QEMU's manual, etc) can and should be consulted.
15 QMP has two types of commands: regular and query commands. Regular commands
16 usually change the Virtual Machine's state someway, while query commands just
17 return information. The sections below are divided accordingly.
19 It's important to observe that all communication examples are formatted in
20 a reader-friendly way, so that they're easier to understand. However, in real
21 protocol usage, they're emitted as a single line.
23 Also, the following notation is used to denote data flow:
25 -> data issued by the Client
26 <- Server data response
28 Please, refer to the QMP specification (QMP/qmp-spec.txt) for detailed
29 information on the Server command and response formats.
31 NOTE: This document is temporary and will be replaced soon.
33 1. Stability Considerations
34 ===========================
36 The current QMP command set (described in this file) may be useful for a
37 number of use cases, however it's limited and several commands have bad
38 defined semantics, specially with regard to command completion.
40 These problems are going to be solved incrementally in the next QEMU releases
41 and we're going to establish a deprecation policy for badly defined commands.
43 If you're planning to adopt QMP, please observe the following:
45 1. The deprecation policy will take effect and be documented soon, please
46 check the documentation of each used command as soon as a new release of
49 2. DO NOT rely on anything which is not explicit documented
51 3. Errors, in special, are not documented. Applications should NOT check
52 for specific errors classes or data (it's strongly recommended to only
53 check for the "error" key)
58 Server's responses in the examples below are always a success response, please
59 refer to the QMP specification for more details on error responses.
78 -> { "execute": "quit" }
85 .args_type = "force:-f,device:B",
92 Eject a removable medium.
96 - force: force ejection (json-bool, optional)
97 - device: device name (json-string)
101 -> { "execute": "eject", "arguments": { "device": "ide1-cd0" } }
104 Note: The "force" argument defaults to false.
110 .args_type = "device:B,target:F,arg:s?",
117 Change a removable medium or VNC configuration.
121 - "device": device name (json-string)
122 - "target": filename or item (json-string)
123 - "arg": additional argument (json-string, optional)
127 1. Change a removable medium
129 -> { "execute": "change",
130 "arguments": { "device": "ide1-cd0",
131 "target": "/srv/images/Fedora-12-x86_64-DVD.iso" } }
134 2. Change VNC password
136 -> { "execute": "change",
137 "arguments": { "device": "vnc", "target": "password",
144 .name = "screendump",
145 .args_type = "filename:F",
152 Save screen into PPM image.
156 - "filename": file path (json-string)
160 -> { "execute": "screendump", "arguments": { "filename": "/tmp/image" } }
180 -> { "execute": "stop" }
200 -> { "execute": "cont" }
206 .name = "system_wakeup",
214 Wakeup guest from suspend.
220 -> { "execute": "system_wakeup" }
226 .name = "system_reset",
240 -> { "execute": "system_reset" }
246 .name = "system_powerdown",
254 Send system power down event.
260 -> { "execute": "system_powerdown" }
266 .name = "device_add",
267 .args_type = "device:O",
268 .params = "driver[,prop=value][,...]",
269 .help = "add device, like -device on the command line",
280 - "driver": the name of the new device's driver (json-string)
281 - "bus": the device's parent bus (device tree path, json-string, optional)
282 - "id": the device's ID, must be unique (json-string)
287 -> { "execute": "device_add", "arguments": { "driver": "e1000", "id": "net1" } }
292 (1) For detailed information about this command, please refer to the
293 'docs/qdev-device-use.txt' file.
295 (2) It's possible to list device properties by running QEMU with the
296 "-device DEVICE,\?" command-line argument, where DEVICE is the device's name
301 .name = "device_del",
313 - "id": the device's ID or QOM path (json-string)
317 -> { "execute": "device_del", "arguments": { "id": "net1" } }
322 -> { "execute": "device_del", "arguments": { "id": "/machine/peripheral-anon/device[0]" } }
329 .args_type = "keys:q,hold-time:i?",
341 - "key": key sequence (a json-array of key union values,
342 union can be number or qcode enum)
344 - hold-time: time to delay key up events, milliseconds. Defaults to 100
349 -> { "execute": "send-key",
350 "arguments": { "keys": [ { "type": "qcode", "data": "ctrl" },
351 { "type": "qcode", "data": "alt" },
352 { "type": "qcode", "data": "delete" } ] } }
359 .args_type = "index:i",
370 - "index": the CPU's index (json-int)
374 -> { "execute": "cpu", "arguments": { "index": 0 } }
377 Note: CPUs' indexes are obtained with the 'query-cpus' command.
394 - "id": cpu id (json-int)
398 -> { "execute": "cpu-add", "arguments": { "id": 2 } }
405 .args_type = "val:l,size:i,filename:s,cpu:i?",
412 Save to disk virtual memory dump starting at 'val' of size 'size'.
416 - "val": the starting address (json-int)
417 - "size": the memory size, in bytes (json-int)
418 - "filename": file path (json-string)
419 - "cpu": virtual CPU index (json-int, optional)
423 -> { "execute": "memsave",
424 "arguments": { "val": 10,
426 "filename": "/tmp/virtual-mem-dump" } }
433 .args_type = "val:l,size:i,filename:s",
440 Save to disk physical memory dump starting at 'val' of size 'size'.
444 - "val": the starting address (json-int)
445 - "size": the memory size, in bytes (json-int)
446 - "filename": file path (json-string)
450 -> { "execute": "pmemsave",
451 "arguments": { "val": 10,
453 "filename": "/tmp/physical-mem-dump" } }
459 .name = "inject-nmi",
467 Inject an NMI on the default CPU (x86/s390) or all CPUs (ppc64).
473 -> { "execute": "inject-nmi" }
476 Note: inject-nmi fails when the guest doesn't support injecting.
481 .name = "ringbuf-write",
482 .args_type = "device:s,data:s,format:s?",
489 Write to a ring buffer character device.
493 - "device": ring buffer character device name (json-string)
494 - "data": data to write (json-string)
495 - "format": data format (json-string, optional)
496 - Possible values: "utf8" (default), "base64"
500 -> { "execute": "ringbuf-write",
501 "arguments": { "device": "foo",
509 .name = "ringbuf-read",
510 .args_type = "device:s,size:i,format:s?",
517 Read from a ring buffer character device.
521 - "device": ring buffer character device name (json-string)
522 - "size": how many bytes to read at most (json-int)
523 - Number of data bytes, not number of characters in encoded data
524 - "format": data format (json-string, optional)
525 - Possible values: "utf8" (default), "base64"
526 - Naturally, format "utf8" works only when the ring buffer
527 contains valid UTF-8 text. Invalid UTF-8 sequences get
528 replaced. Bug: replacement doesn't work. Bug: can screw
529 up on encountering NUL characters, after the ring buffer
530 lost data, and when reading stops because the size limit
535 -> { "execute": "ringbuf-read",
536 "arguments": { "device": "foo",
539 <- {"return": "abcdefgh"}
544 .name = "xen-save-devices-state",
545 .args_type = "filename:F",
549 xen-save-devices-state
552 Save the state of all devices to file. The RAM and the block devices
553 of the VM are not saved by this command.
557 - "filename": the file to save the state of the devices to as binary
558 data. See xen-save-devices-state.txt for a description of the binary
563 -> { "execute": "xen-save-devices-state",
564 "arguments": { "filename": "/tmp/save" } }
570 .name = "xen-load-devices-state",
571 .args_type = "filename:F",
575 xen-load-devices-state
576 ----------------------
578 Load the state of all devices from file. The RAM and the block devices
579 of the VM are not loaded by this command.
583 - "filename": the file to load the state of the devices from as binary
584 data. See xen-save-devices-state.txt for a description of the binary
589 -> { "execute": "xen-load-devices-state",
590 "arguments": { "filename": "/tmp/resume" } }
596 .name = "xen-set-global-dirty-log",
597 .args_type = "enable:b",
601 xen-set-global-dirty-log
604 Enable or disable the global dirty log mode.
608 - "enable": Enable it or disable it.
612 -> { "execute": "xen-set-global-dirty-log",
613 "arguments": { "enable": true } }
620 .args_type = "detach:-d,blk:-b,inc:-i,uri:s",
631 - "blk": block migration, full disk copy (json-bool, optional)
632 - "inc": incremental disk copy (json-bool, optional)
633 - "uri": Destination URI (json-string)
637 -> { "execute": "migrate", "arguments": { "uri": "tcp:0:4446" } }
642 (1) The 'query-migrate' command should be used to check migration's progress
643 and final result (this information is provided by the 'status' member)
644 (2) All boolean arguments default to false
645 (3) The user Monitor's "detach" argument is invalid in QMP and should not
651 .name = "migrate_cancel",
659 Cancel the current migration.
665 -> { "execute": "migrate_cancel" }
671 .name = "migrate-incoming",
672 .args_type = "uri:s",
679 Continue an incoming migration
683 - "uri": Source/listening URI (json-string)
687 -> { "execute": "migrate-incoming", "arguments": { "uri": "tcp::4446" } }
692 (1) QEMU must be started with -incoming defer to allow migrate-incoming to
694 (2) The uri format is the same as for -incoming
698 .name = "migrate-set-cache-size",
699 .args_type = "value:o",
703 migrate-set-cache-size
704 ----------------------
706 Set cache size to be used by XBZRLE migration, the cache size will be rounded
707 down to the nearest power of 2
711 - "value": cache size in bytes (json-int)
715 -> { "execute": "migrate-set-cache-size", "arguments": { "value": 536870912 } }
720 .name = "migrate-start-postcopy",
725 migrate-start-postcopy
726 ----------------------
728 Switch an in-progress migration to postcopy mode. Ignored after the end of
729 migration (or once already in postcopy).
732 -> { "execute": "migrate-start-postcopy" }
738 .name = "query-migrate-cache-size",
743 query-migrate-cache-size
744 ------------------------
746 Show cache size to be used by XBZRLE migration
748 returns a json-object with the following information:
753 -> { "execute": "query-migrate-cache-size" }
754 <- { "return": 67108864 }
759 .name = "migrate_set_speed",
760 .args_type = "value:o",
767 Set maximum speed for migrations.
771 - "value": maximum speed, in bytes per second (json-int)
775 -> { "execute": "migrate_set_speed", "arguments": { "value": 1024 } }
781 .name = "migrate_set_downtime",
782 .args_type = "value:T",
789 Set maximum tolerated downtime (in seconds) for migrations.
793 - "value": maximum downtime (json-number)
797 -> { "execute": "migrate_set_downtime", "arguments": { "value": 0.1 } }
803 .name = "client_migrate_info",
804 .args_type = "protocol:s,hostname:s,port:i?,tls-port:i?,cert-subject:s?",
805 .params = "protocol hostname port tls-port cert-subject",
806 .help = "set migration information for remote display",
813 Set migration information for remote display. This makes the server
814 ask the client to automatically reconnect using the new parameters
815 once migration finished successfully. Only implemented for SPICE.
819 - "protocol": must be "spice" (json-string)
820 - "hostname": migration target hostname (json-string)
821 - "port": spice tcp port for plaintext channels (json-int, optional)
822 - "tls-port": spice tcp port for tls-secured channels (json-int, optional)
823 - "cert-subject": server certificate subject (json-string, optional)
827 -> { "execute": "client_migrate_info",
828 "arguments": { "protocol": "spice",
829 "hostname": "virt42.lab.kraxel.org",
836 .name = "dump-guest-memory",
837 .args_type = "paging:b,protocol:s,detach:b?,begin:i?,end:i?,format:s?",
838 .params = "-p protocol [-d] [begin] [length] [format]",
839 .help = "dump guest memory to file",
846 Dump guest memory to file. The file can be processed with crash or gdb.
850 - "paging": do paging to get guest's memory mapping (json-bool)
851 - "protocol": destination file(started with "file:") or destination file
852 descriptor (started with "fd:") (json-string)
853 - "detach": if specified, command will return immediately, without waiting
854 for the dump to finish. The user can track progress using
855 "query-dump". (json-bool)
856 - "begin": the starting physical address. It's optional, and should be specified
857 with length together (json-int)
858 - "length": the memory size, in bytes. It's optional, and should be specified
859 with begin together (json-int)
860 - "format": the format of guest memory dump. It's optional, and can be
861 elf|kdump-zlib|kdump-lzo|kdump-snappy, but non-elf formats will
862 conflict with paging and filter, ie. begin and length (json-string)
866 -> { "execute": "dump-guest-memory", "arguments": { "protocol": "fd:dump" } }
871 (1) All boolean arguments default to false
876 .name = "query-dump-guest-memory-capability",
881 query-dump-guest-memory-capability
884 Show available formats for 'dump-guest-memory'
888 -> { "execute": "query-dump-guest-memory-capability" }
889 <- { "return": { "formats":
890 ["elf", "kdump-zlib", "kdump-lzo", "kdump-snappy"] }
895 .name = "query-dump",
898 .help = "query background dump status",
905 Query background dump status.
911 -> { "execute": "query-dump" }
912 <- { "return": { "status": "active", "completed": 1024000,
917 #if defined TARGET_S390X
919 .name = "dump-skeys",
920 .args_type = "filename:F",
928 Save guest storage keys to file.
932 - "filename": file path (json-string)
936 -> { "execute": "dump-skeys", "arguments": { "filename": "/tmp/skeys" } }
942 .name = "netdev_add",
943 .args_type = "netdev:O",
950 Add host network device.
954 - "type": the device type, "tap", "user", ... (json-string)
955 - "id": the device's ID, must be unique (json-string)
960 -> { "execute": "netdev_add",
961 "arguments": { "type": "user", "id": "netdev1",
962 "dnssearch": "example.org" } }
965 Note: The supported device options are the same ones supported by the '-netdev'
966 command-line argument, which are listed in the '-help' output or QEMU's
972 .name = "netdev_del",
980 Remove host network device.
984 - "id": the device's ID, must be unique (json-string)
988 -> { "execute": "netdev_del", "arguments": { "id": "netdev1" } }
995 .name = "object-add",
996 .args_type = "qom-type:s,id:s,props:q?",
1007 - "qom-type": the object's QOM type, i.e. the class name (json-string)
1008 - "id": the object's ID, must be unique (json-string)
1009 - "props": a dictionary of object property values (optional, json-dict)
1013 -> { "execute": "object-add", "arguments": { "qom-type": "rng-random", "id": "rng1",
1014 "props": { "filename": "/dev/hwrng" } } }
1020 .name = "object-del",
1021 .args_type = "id:s",
1032 - "id": the object's ID (json-string)
1036 -> { "execute": "object-del", "arguments": { "id": "rng1" } }
1044 .name = "block_resize",
1045 .args_type = "device:s?,node-name:s?,size:o",
1052 Resize a block image while a guest is running.
1056 - "device": the device's ID, must be unique (json-string)
1057 - "node-name": the node name in the block driver state graph (json-string)
1062 -> { "execute": "block_resize", "arguments": { "device": "scratch", "size": 1073741824 } }
1068 .name = "block-stream",
1069 .args_type = "job-id:s?,device:B,base:s?,speed:o?,backing-file:s?,on-error:s?",
1076 Copy data from a backing file into a block device.
1080 - "job-id": Identifier for the newly-created block job. If omitted,
1081 the device name will be used. (json-string, optional)
1082 - "device": The device name or node-name of a root node (json-string)
1083 - "base": The file name of the backing image above which copying starts
1084 (json-string, optional)
1085 - "backing-file": The backing file string to write into the active layer. This
1086 filename is not validated.
1088 If a pathname string is such that it cannot be resolved by
1089 QEMU, that means that subsequent QMP or HMP commands must use
1090 node-names for the image in question, as filename lookup
1093 If not specified, QEMU will automatically determine the
1094 backing file string to use, or error out if there is no
1095 obvious choice. Care should be taken when specifying the
1096 string, to specify a valid filename or protocol.
1097 (json-string, optional) (Since 2.1)
1098 - "speed": the maximum speed, in bytes per second (json-int, optional)
1099 - "on-error": the action to take on an error (default 'report'). 'stop' and
1100 'enospc' can only be used if the block device supports io-status.
1101 (json-string, optional) (Since 2.1)
1105 -> { "execute": "block-stream", "arguments": { "device": "virtio0",
1106 "base": "/tmp/master.qcow2" } }
1112 .name = "block-commit",
1113 .args_type = "job-id:s?,device:B,base:s?,top:s?,backing-file:s?,speed:o?",
1120 Live commit of data from overlay image nodes into backing nodes - i.e., writes
1121 data between 'top' and 'base' into 'base'.
1125 - "job-id": Identifier for the newly-created block job. If omitted,
1126 the device name will be used. (json-string, optional)
1127 - "device": The device name or node-name of a root node (json-string)
1128 - "base": The file name of the backing image to write data into.
1129 If not specified, this is the deepest backing image
1130 (json-string, optional)
1131 - "top": The file name of the backing image within the image chain,
1132 which contains the topmost data to be committed down. If
1133 not specified, this is the active layer. (json-string, optional)
1135 - backing-file: The backing file string to write into the overlay
1136 image of 'top'. If 'top' is the active layer,
1137 specifying a backing file string is an error. This
1138 filename is not validated.
1140 If a pathname string is such that it cannot be
1141 resolved by QEMU, that means that subsequent QMP or
1142 HMP commands must use node-names for the image in
1143 question, as filename lookup methods will fail.
1145 If not specified, QEMU will automatically determine
1146 the backing file string to use, or error out if
1147 there is no obvious choice. Care should be taken
1148 when specifying the string, to specify a valid
1149 filename or protocol.
1150 (json-string, optional) (Since 2.1)
1152 If top == base, that is an error.
1153 If top == active, the job will not be completed by itself,
1154 user needs to complete the job with the block-job-complete
1155 command after getting the ready event. (Since 2.0)
1157 If the base image is smaller than top, then the base image
1158 will be resized to be the same size as top. If top is
1159 smaller than the base image, the base will not be
1160 truncated. If you want the base image size to match the
1161 size of the smaller top, you can safely truncate it
1162 yourself once the commit operation successfully completes.
1164 - "speed": the maximum speed, in bytes per second (json-int, optional)
1169 -> { "execute": "block-commit", "arguments": { "device": "virtio0",
1170 "top": "/tmp/snap1.qcow2" } }
1176 .name = "drive-backup",
1177 .args_type = "job-id:s?,sync:s,device:B,target:s,speed:i?,mode:s?,"
1178 "format:s?,bitmap:s?,compress:b?,"
1179 "on-source-error:s?,on-target-error:s?",
1186 Start a point-in-time copy of a block device to a new destination. The
1187 status of ongoing drive-backup operations can be checked with
1188 query-block-jobs where the BlockJobInfo.type field has the value 'backup'.
1189 The operation can be stopped before it has completed using the
1190 block-job-cancel command.
1194 - "job-id": Identifier for the newly-created block job. If omitted,
1195 the device name will be used. (json-string, optional)
1196 - "device": the device name or node-name of a root node which should be copied.
1198 - "target": the target of the new image. If the file exists, or if it is a
1199 device, the existing file/device will be used as the new
1200 destination. If it does not exist, a new file will be created.
1202 - "format": the format of the new destination, default is to probe if 'mode' is
1203 'existing', else the format of the source
1204 (json-string, optional)
1205 - "sync": what parts of the disk image should be copied to the destination;
1206 possibilities include "full" for all the disk, "top" for only the sectors
1207 allocated in the topmost image, "incremental" for only the dirty sectors in
1208 the bitmap, or "none" to only replicate new I/O (MirrorSyncMode).
1209 - "bitmap": dirty bitmap name for sync==incremental. Must be present if sync
1210 is "incremental", must NOT be present otherwise.
1211 - "mode": whether and how QEMU should create a new image
1212 (NewImageMode, optional, default 'absolute-paths')
1213 - "speed": the maximum speed, in bytes per second (json-int, optional)
1214 - "compress": true to compress data, if the target format supports it.
1215 (json-bool, optional, default false)
1216 - "on-source-error": the action to take on an error on the source, default
1217 'report'. 'stop' and 'enospc' can only be used
1218 if the block device supports io-status.
1219 (BlockdevOnError, optional)
1220 - "on-target-error": the action to take on an error on the target, default
1221 'report' (no limitations, since this applies to
1222 a different block device than device).
1223 (BlockdevOnError, optional)
1226 -> { "execute": "drive-backup", "arguments": { "device": "drive0",
1228 "target": "backup.img" } }
1234 .name = "blockdev-backup",
1235 .args_type = "job-id:s?,sync:s,device:B,target:B,speed:i?,compress:b?,"
1236 "on-source-error:s?,on-target-error:s?",
1243 The device version of drive-backup: this command takes an existing named device
1248 - "job-id": Identifier for the newly-created block job. If omitted,
1249 the device name will be used. (json-string, optional)
1250 - "device": the device name or node-name of a root node which should be copied.
1252 - "target": the name of the backup target device. (json-string)
1253 - "sync": what parts of the disk image should be copied to the destination;
1254 possibilities include "full" for all the disk, "top" for only the
1255 sectors allocated in the topmost image, or "none" to only replicate
1256 new I/O (MirrorSyncMode).
1257 - "speed": the maximum speed, in bytes per second (json-int, optional)
1258 - "compress": true to compress data, if the target format supports it.
1259 (json-bool, optional, default false)
1260 - "on-source-error": the action to take on an error on the source, default
1261 'report'. 'stop' and 'enospc' can only be used
1262 if the block device supports io-status.
1263 (BlockdevOnError, optional)
1264 - "on-target-error": the action to take on an error on the target, default
1265 'report' (no limitations, since this applies to
1266 a different block device than device).
1267 (BlockdevOnError, optional)
1270 -> { "execute": "blockdev-backup", "arguments": { "device": "src-id",
1272 "target": "tgt-id" } }
1278 .name = "block-job-set-speed",
1279 .args_type = "device:B,speed:o",
1283 .name = "block-job-cancel",
1284 .args_type = "device:B,force:b?",
1287 .name = "block-job-pause",
1288 .args_type = "device:B",
1291 .name = "block-job-resume",
1292 .args_type = "device:B",
1295 .name = "block-job-complete",
1296 .args_type = "device:B",
1299 .name = "transaction",
1300 .args_type = "actions:q,properties:q?",
1307 Atomically operate on one or more block devices. Operations that are
1308 currently supported:
1312 - blockdev-snapshot-sync
1313 - blockdev-snapshot-internal-sync
1315 - block-dirty-bitmap-add
1316 - block-dirty-bitmap-clear
1318 Refer to the qemu/qapi-schema.json file for minimum required QEMU
1319 versions for these operations. A list of dictionaries is accepted,
1320 that contains the actions to be performed. If there is any failure
1321 performing any of the operations, all operations for the group are
1324 For external snapshots, the dictionary contains the device, the file to use for
1325 the new snapshot, and the format. The default format, if not specified, is
1328 Each new snapshot defaults to being created by QEMU (wiping any
1329 contents if the file already exists), but it is also possible to reuse
1330 an externally-created file. In the latter case, you should ensure that
1331 the new image file has the same contents as the current one; QEMU cannot
1332 perform any meaningful check. Typically this is achieved by using the
1333 current image file as the backing file for the new image.
1335 On failure, the original disks pre-snapshot attempt will be used.
1337 For internal snapshots, the dictionary contains the device and the snapshot's
1338 name. If an internal snapshot matching name already exists, the request will
1339 be rejected. Only some image formats support it, for example, qcow2, rbd,
1342 On failure, qemu will try delete the newly created internal snapshot in the
1343 transaction. When an I/O error occurs during deletion, the user needs to fix
1344 it later with qemu-img or other command.
1349 - "type": the operation to perform (json-string). Possible
1350 values: "drive-backup", "blockdev-backup",
1351 "blockdev-snapshot-sync",
1352 "blockdev-snapshot-internal-sync",
1353 "abort", "block-dirty-bitmap-add",
1354 "block-dirty-bitmap-clear"
1355 - "data": a dictionary. The contents depend on the value
1356 of "type". When "type" is "blockdev-snapshot-sync":
1357 - "device": device name to snapshot (json-string)
1358 - "node-name": graph node name to snapshot (json-string)
1359 - "snapshot-file": name of new image file (json-string)
1360 - "snapshot-node-name": graph node name of the new snapshot (json-string)
1361 - "format": format of new image (json-string, optional)
1362 - "mode": whether and how QEMU should create the snapshot file
1363 (NewImageMode, optional, default "absolute-paths")
1364 When "type" is "blockdev-snapshot-internal-sync":
1365 - "device": the device name or node-name of a root node to snapshot
1367 - "name": name of the new snapshot (json-string)
1371 -> { "execute": "transaction",
1372 "arguments": { "actions": [
1373 { "type": "blockdev-snapshot-sync", "data" : { "device": "ide-hd0",
1374 "snapshot-file": "/some/place/my-image",
1375 "format": "qcow2" } },
1376 { "type": "blockdev-snapshot-sync", "data" : { "node-name": "myfile",
1377 "snapshot-file": "/some/place/my-image2",
1378 "snapshot-node-name": "node3432",
1380 "format": "qcow2" } },
1381 { "type": "blockdev-snapshot-sync", "data" : { "device": "ide-hd1",
1382 "snapshot-file": "/some/place/my-image2",
1384 "format": "qcow2" } },
1385 { "type": "blockdev-snapshot-internal-sync", "data" : {
1386 "device": "ide-hd2",
1387 "name": "snapshot0" } } ] } }
1393 .name = "block-dirty-bitmap-add",
1394 .args_type = "node:B,name:s,granularity:i?",
1398 block-dirty-bitmap-add
1399 ----------------------
1402 Create a dirty bitmap with a name on the device, and start tracking the writes.
1406 - "node": device/node on which to create dirty bitmap (json-string)
1407 - "name": name of the new dirty bitmap (json-string)
1408 - "granularity": granularity to track writes with (int, optional)
1412 -> { "execute": "block-dirty-bitmap-add", "arguments": { "node": "drive0",
1413 "name": "bitmap0" } }
1419 .name = "block-dirty-bitmap-remove",
1420 .args_type = "node:B,name:s",
1424 block-dirty-bitmap-remove
1425 -------------------------
1428 Stop write tracking and remove the dirty bitmap that was created with
1429 block-dirty-bitmap-add.
1433 - "node": device/node on which to remove dirty bitmap (json-string)
1434 - "name": name of the dirty bitmap to remove (json-string)
1438 -> { "execute": "block-dirty-bitmap-remove", "arguments": { "node": "drive0",
1439 "name": "bitmap0" } }
1445 .name = "block-dirty-bitmap-clear",
1446 .args_type = "node:B,name:s",
1450 block-dirty-bitmap-clear
1451 ------------------------
1454 Reset the dirty bitmap associated with a node so that an incremental backup
1455 from this point in time forward will only backup clusters modified after this
1460 - "node": device/node on which to remove dirty bitmap (json-string)
1461 - "name": name of the dirty bitmap to remove (json-string)
1465 -> { "execute": "block-dirty-bitmap-clear", "arguments": { "node": "drive0",
1466 "name": "bitmap0" } }
1472 .name = "blockdev-snapshot-sync",
1473 .args_type = "device:s?,node-name:s?,snapshot-file:s,snapshot-node-name:s?,format:s?,mode:s?",
1477 blockdev-snapshot-sync
1478 ----------------------
1480 Synchronous snapshot of a block device. snapshot-file specifies the
1481 target of the new image. If the file exists, or if it is a device, the
1482 snapshot will be created in the existing file/device. If does not
1483 exist, a new file will be created. format specifies the format of the
1484 snapshot image, default is qcow2.
1488 - "device": device name to snapshot (json-string)
1489 - "node-name": graph node name to snapshot (json-string)
1490 - "snapshot-file": name of new image file (json-string)
1491 - "snapshot-node-name": graph node name of the new snapshot (json-string)
1492 - "mode": whether and how QEMU should create the snapshot file
1493 (NewImageMode, optional, default "absolute-paths")
1494 - "format": format of new image (json-string, optional)
1498 -> { "execute": "blockdev-snapshot-sync", "arguments": { "device": "ide-hd0",
1500 "/some/place/my-image",
1501 "format": "qcow2" } }
1507 .name = "blockdev-snapshot",
1508 .args_type = "node:s,overlay:s",
1516 Create a snapshot, by installing 'node' as the backing image of
1517 'overlay'. Additionally, if 'node' is associated with a block
1518 device, the block device changes to using 'overlay' as its new active
1523 - "node": device that will have a snapshot created (json-string)
1524 - "overlay": device that will have 'node' as its backing image (json-string)
1528 -> { "execute": "blockdev-add",
1529 "arguments": { "options": { "driver": "qcow2",
1530 "node-name": "node1534",
1531 "file": { "driver": "file",
1532 "filename": "hd1.qcow2" },
1537 -> { "execute": "blockdev-snapshot", "arguments": { "node": "ide-hd0",
1538 "overlay": "node1534" } }
1544 .name = "blockdev-snapshot-internal-sync",
1545 .args_type = "device:B,name:s",
1549 blockdev-snapshot-internal-sync
1550 -------------------------------
1552 Synchronously take an internal snapshot of a block device when the format of
1553 image used supports it. If the name is an empty string, or a snapshot with
1554 name already exists, the operation will fail.
1558 - "device": the device name or node-name of a root node to snapshot
1560 - "name": name of the new snapshot (json-string)
1564 -> { "execute": "blockdev-snapshot-internal-sync",
1565 "arguments": { "device": "ide-hd0",
1566 "name": "snapshot0" }
1573 .name = "blockdev-snapshot-delete-internal-sync",
1574 .args_type = "device:B,id:s?,name:s?",
1578 blockdev-snapshot-delete-internal-sync
1579 --------------------------------------
1581 Synchronously delete an internal snapshot of a block device when the format of
1582 image used supports it. The snapshot is identified by name or id or both. One
1583 of name or id is required. If the snapshot is not found, the operation will
1588 - "device": the device name or node-name of a root node (json-string)
1589 - "id": ID of the snapshot (json-string, optional)
1590 - "name": name of the snapshot (json-string, optional)
1594 -> { "execute": "blockdev-snapshot-delete-internal-sync",
1595 "arguments": { "device": "ide-hd0",
1596 "name": "snapshot0" }
1600 "name": "snapshot0",
1602 "date-sec": 1000012,
1604 "vm-clock-sec": 100,
1612 .name = "drive-mirror",
1613 .args_type = "job-id:s?,sync:s,device:B,target:s,speed:i?,mode:s?,"
1614 "format:s?,node-name:s?,replaces:s?,"
1615 "on-source-error:s?,on-target-error:s?,"
1617 "granularity:i?,buf-size:i?",
1624 Start mirroring a block device's writes to a new destination. target
1625 specifies the target of the new image. If the file exists, or if it is
1626 a device, it will be used as the new destination for writes. If it does not
1627 exist, a new file will be created. format specifies the format of the
1628 mirror image, default is to probe if mode='existing', else the format
1633 - "job-id": Identifier for the newly-created block job. If omitted,
1634 the device name will be used. (json-string, optional)
1635 - "device": the device name or node-name of a root node whose writes should be
1636 mirrored. (json-string)
1637 - "target": name of new image file (json-string)
1638 - "format": format of new image (json-string, optional)
1639 - "node-name": the name of the new block driver state in the node graph
1640 (json-string, optional)
1641 - "replaces": the block driver node name to replace when finished
1642 (json-string, optional)
1643 - "mode": how an image file should be created into the target
1644 file/device (NewImageMode, optional, default 'absolute-paths')
1645 - "speed": maximum speed of the streaming job, in bytes per second
1647 - "granularity": granularity of the dirty bitmap, in bytes (json-int, optional)
1648 - "buf-size": maximum amount of data in flight from source to target, in bytes
1649 (json-int, default 10M)
1650 - "sync": what parts of the disk image should be copied to the destination;
1651 possibilities include "full" for all the disk, "top" for only the sectors
1652 allocated in the topmost image, or "none" to only replicate new I/O
1654 - "on-source-error": the action to take on an error on the source
1655 (BlockdevOnError, default 'report')
1656 - "on-target-error": the action to take on an error on the target
1657 (BlockdevOnError, default 'report')
1658 - "unmap": whether the target sectors should be discarded where source has only
1659 zeroes. (json-bool, optional, default true)
1661 The default value of the granularity is the image cluster size clamped
1662 between 4096 and 65536, if the image format defines one. If the format
1663 does not define a cluster size, the default value of the granularity
1669 -> { "execute": "drive-mirror", "arguments": { "device": "ide-hd0",
1670 "target": "/some/place/my-image",
1672 "format": "qcow2" } }
1678 .name = "blockdev-mirror",
1679 .args_type = "job-id:s?,sync:s,device:B,target:B,replaces:s?,speed:i?,"
1680 "on-source-error:s?,on-target-error:s?,"
1681 "granularity:i?,buf-size:i?",
1688 Start mirroring a block device's writes to another block device. target
1689 specifies the target of mirror operation.
1693 - "job-id": Identifier for the newly-created block job. If omitted,
1694 the device name will be used. (json-string, optional)
1695 - "device": The device name or node-name of a root node whose writes should be
1696 mirrored (json-string)
1697 - "target": device name to mirror to (json-string)
1698 - "replaces": the block driver node name to replace when finished
1699 (json-string, optional)
1700 - "speed": maximum speed of the streaming job, in bytes per second
1702 - "granularity": granularity of the dirty bitmap, in bytes (json-int, optional)
1703 - "buf_size": maximum amount of data in flight from source to target, in bytes
1704 (json-int, default 10M)
1705 - "sync": what parts of the disk image should be copied to the destination;
1706 possibilities include "full" for all the disk, "top" for only the sectors
1707 allocated in the topmost image, or "none" to only replicate new I/O
1709 - "on-source-error": the action to take on an error on the source
1710 (BlockdevOnError, default 'report')
1711 - "on-target-error": the action to take on an error on the target
1712 (BlockdevOnError, default 'report')
1714 The default value of the granularity is the image cluster size clamped
1715 between 4096 and 65536, if the image format defines one. If the format
1716 does not define a cluster size, the default value of the granularity
1721 -> { "execute": "blockdev-mirror", "arguments": { "device": "ide-hd0",
1722 "target": "target0",
1728 .name = "change-backing-file",
1729 .args_type = "device:s,image-node-name:s,backing-file:s",
1737 Change the backing file in the image file metadata. This does not cause
1738 QEMU to reopen the image file to reparse the backing filename (it may,
1739 however, perform a reopen to change permissions from r/o -> r/w -> r/o,
1740 if needed). The new backing file string is written into the image file
1741 metadata, and the QEMU internal strings are updated.
1745 - "image-node-name": The name of the block driver state node of the
1746 image to modify. The "device" is argument is used to
1747 verify "image-node-name" is in the chain described by
1749 (json-string, optional)
1751 - "device": The device name or node-name of the root node that owns
1755 - "backing-file": The string to write as the backing file. This string is
1756 not validated, so care should be taken when specifying
1757 the string or the image chain may not be able to be
1761 Returns: Nothing on success
1762 If "device" does not exist or cannot be determined, DeviceNotFound
1768 .args_type = "value:M",
1775 Request VM to change its memory allocation (in bytes).
1779 - "value": New memory allocation (json-int)
1783 -> { "execute": "balloon", "arguments": { "value": 536870912 } }
1790 .args_type = "name:s,up:b",
1797 Change the link status of a network adapter.
1801 - "name": network device name (json-string)
1802 - "up": status is up (json-bool)
1806 -> { "execute": "set_link", "arguments": { "name": "e1000.0", "up": false } }
1813 .args_type = "fdname:s",
1814 .params = "getfd name",
1815 .help = "receive a file descriptor via SCM rights and assign it a name",
1822 Receive a file descriptor via SCM rights and assign it a name.
1826 - "fdname": file descriptor name (json-string)
1830 -> { "execute": "getfd", "arguments": { "fdname": "fd1" } }
1835 (1) If the name specified by the "fdname" argument already exists,
1836 the file descriptor assigned to it will be closed and replaced
1837 by the received file descriptor.
1838 (2) The 'closefd' command can be used to explicitly close the file
1839 descriptor when it is no longer needed.
1845 .args_type = "fdname:s",
1846 .params = "closefd name",
1847 .help = "close a file descriptor previously passed via SCM rights",
1854 Close a file descriptor previously passed via SCM rights.
1858 - "fdname": file descriptor name (json-string)
1862 -> { "execute": "closefd", "arguments": { "fdname": "fd1" } }
1869 .args_type = "fdset-id:i?,opaque:s?",
1870 .params = "add-fd fdset-id opaque",
1871 .help = "Add a file descriptor, that was passed via SCM rights, to an fd set",
1878 Add a file descriptor, that was passed via SCM rights, to an fd set.
1882 - "fdset-id": The ID of the fd set to add the file descriptor to.
1883 (json-int, optional)
1884 - "opaque": A free-form string that can be used to describe the fd.
1885 (json-string, optional)
1887 Return a json-object with the following information:
1889 - "fdset-id": The ID of the fd set that the fd was added to. (json-int)
1890 - "fd": The file descriptor that was received via SCM rights and added to the
1895 -> { "execute": "add-fd", "arguments": { "fdset-id": 1 } }
1896 <- { "return": { "fdset-id": 1, "fd": 3 } }
1900 (1) The list of fd sets is shared by all monitor connections.
1901 (2) If "fdset-id" is not specified, a new fd set will be created.
1906 .name = "remove-fd",
1907 .args_type = "fdset-id:i,fd:i?",
1908 .params = "remove-fd fdset-id fd",
1909 .help = "Remove a file descriptor from an fd set",
1916 Remove a file descriptor from an fd set.
1920 - "fdset-id": The ID of the fd set that the file descriptor belongs to.
1922 - "fd": The file descriptor that is to be removed. (json-int, optional)
1926 -> { "execute": "remove-fd", "arguments": { "fdset-id": 1, "fd": 3 } }
1931 (1) The list of fd sets is shared by all monitor connections.
1932 (2) If "fd" is not specified, all file descriptors in "fdset-id" will be
1938 .name = "query-fdsets",
1940 .help = "Return information describing all fd sets",
1947 Return information describing all fd sets.
1953 -> { "execute": "query-fdsets" }
1959 "opaque": "rdonly:/path/to/file"
1963 "opaque": "rdwr:/path/to/file"
1982 Note: The list of fd sets is shared by all monitor connections.
1987 .name = "block_passwd",
1988 .args_type = "device:s?,node-name:s?,password:s",
1995 Set the password of encrypted block devices.
1999 - "device": device name (json-string)
2000 - "node-name": name in the block driver state graph (json-string)
2001 - "password": password (json-string)
2005 -> { "execute": "block_passwd", "arguments": { "device": "ide0-hd0",
2006 "password": "12345" } }
2012 .name = "block_set_io_throttle",
2013 .args_type = "device:B,bps:l,bps_rd:l,bps_wr:l,iops:l,iops_rd:l,iops_wr:l,bps_max:l?,bps_rd_max:l?,bps_wr_max:l?,iops_max:l?,iops_rd_max:l?,iops_wr_max:l?,bps_max_length:l?,bps_rd_max_length:l?,bps_wr_max_length:l?,iops_max_length:l?,iops_rd_max_length:l?,iops_wr_max_length:l?,iops_size:l?,group:s?",
2017 block_set_io_throttle
2020 Change I/O throttle limits for a block drive.
2024 - "device": device name (json-string)
2025 - "bps": total throughput limit in bytes per second (json-int)
2026 - "bps_rd": read throughput limit in bytes per second (json-int)
2027 - "bps_wr": write throughput limit in bytes per second (json-int)
2028 - "iops": total I/O operations per second (json-int)
2029 - "iops_rd": read I/O operations per second (json-int)
2030 - "iops_wr": write I/O operations per second (json-int)
2031 - "bps_max": total throughput limit during bursts, in bytes (json-int, optional)
2032 - "bps_rd_max": read throughput limit during bursts, in bytes (json-int, optional)
2033 - "bps_wr_max": write throughput limit during bursts, in bytes (json-int, optional)
2034 - "iops_max": total I/O operations per second during bursts (json-int, optional)
2035 - "iops_rd_max": read I/O operations per second during bursts (json-int, optional)
2036 - "iops_wr_max": write I/O operations per second during bursts (json-int, optional)
2037 - "bps_max_length": maximum length of the @bps_max burst period, in seconds (json-int, optional)
2038 - "bps_rd_max_length": maximum length of the @bps_rd_max burst period, in seconds (json-int, optional)
2039 - "bps_wr_max_length": maximum length of the @bps_wr_max burst period, in seconds (json-int, optional)
2040 - "iops_max_length": maximum length of the @iops_max burst period, in seconds (json-int, optional)
2041 - "iops_rd_max_length": maximum length of the @iops_rd_max burst period, in seconds (json-int, optional)
2042 - "iops_wr_max_length": maximum length of the @iops_wr_max burst period, in seconds (json-int, optional)
2043 - "iops_size": I/O size in bytes when limiting (json-int, optional)
2044 - "group": throttle group name (json-string, optional)
2048 -> { "execute": "block_set_io_throttle", "arguments": { "device": "virtio0",
2061 "bps_max_length": 60,
2068 .name = "set_password",
2069 .args_type = "protocol:s,password:s,connected:s?",
2076 Set the password for vnc/spice protocols.
2080 - "protocol": protocol name (json-string)
2081 - "password": password (json-string)
2082 - "connected": [ keep | disconnect | fail ] (json-string, optional)
2086 -> { "execute": "set_password", "arguments": { "protocol": "vnc",
2087 "password": "secret" } }
2093 .name = "expire_password",
2094 .args_type = "protocol:s,time:s",
2101 Set the password expire time for vnc/spice protocols.
2105 - "protocol": protocol name (json-string)
2106 - "time": [ now | never | +secs | secs ] (json-string)
2110 -> { "execute": "expire_password", "arguments": { "protocol": "vnc",
2117 .name = "add_client",
2118 .args_type = "protocol:s,fdname:s,skipauth:b?,tls:b?",
2125 Add a graphics client
2129 - "protocol": protocol name (json-string)
2130 - "fdname": file descriptor name (json-string)
2131 - "skipauth": whether to skip authentication (json-bool, optional)
2132 - "tls": whether to perform TLS (json-bool, optional)
2136 -> { "execute": "add_client", "arguments": { "protocol": "vnc",
2137 "fdname": "myclient" } }
2142 .name = "qmp_capabilities",
2145 .help = "enable QMP capabilities",
2152 Enable QMP capabilities.
2158 -> { "execute": "qmp_capabilities" }
2161 Note: This command must be issued before issuing any other command.
2166 .name = "human-monitor-command",
2167 .args_type = "command-line:s,cpu-index:i?",
2171 human-monitor-command
2172 ---------------------
2174 Execute a Human Monitor command.
2178 - command-line: the command name and its arguments, just like the
2179 Human Monitor's shell (json-string)
2180 - cpu-index: select the CPU number to be used by commands which access CPU
2181 data, like 'info registers'. The Monitor selects CPU 0 if this
2182 argument is not provided (json-int, optional)
2186 -> { "execute": "human-monitor-command", "arguments": { "command-line": "info kvm" } }
2187 <- { "return": "kvm support: enabled\r\n" }
2191 (1) The Human Monitor is NOT an stable interface, this means that command
2192 names, arguments and responses can change or be removed at ANY time.
2193 Applications that rely on long term stability guarantees should NOT
2198 o This command is stateless, this means that commands that depend
2199 on state information (such as getfd) might not work
2201 o Commands that prompt the user for data (eg. 'cont' when the block
2202 device is encrypted) don't currently work
2207 HXCOMM Each query command below is inside a SQMP/EQMP section, do NOT change
2208 HXCOMM this! We will possibly move query commands definitions inside those
2209 HXCOMM sections, just like regular commands.
2219 Return a json-object with the following information:
2221 - "qemu": A json-object containing three integer values:
2222 - "major": QEMU's major version (json-int)
2223 - "minor": QEMU's minor version (json-int)
2224 - "micro": QEMU's micro version (json-int)
2225 - "package": package's version (json-string)
2229 -> { "execute": "query-version" }
2244 .name = "query-version",
2252 List QMP available commands.
2254 Each command is represented by a json-object, the returned value is a json-array
2257 Each json-object contain:
2259 - "name": command's name (json-string)
2263 -> { "execute": "query-commands" }
2267 "name":"query-balloon"
2270 "name":"system_powerdown"
2275 Note: This example has been shortened as the real response is too long.
2280 .name = "query-commands",
2288 List QMP available events.
2290 Each event is represented by a json-object, the returned value is a json-array
2293 Each json-object contains:
2295 - "name": event's name (json-string)
2299 -> { "execute": "query-events" }
2311 Note: This example has been shortened as the real response is too long.
2316 .name = "query-events",
2324 Return the QMP wire schema. The returned value is a json-array of
2325 named schema entities. Entities are commands, events and various
2326 types. See docs/qapi-code-gen.txt for information on their structure
2332 .name = "query-qmp-schema",
2340 Each device is represented by a json-object. The returned value is a json-array
2343 Each json-object contain the following:
2345 - "label": device's label (json-string)
2346 - "filename": device's file (json-string)
2347 - "frontend-open": open/closed state of the frontend device attached to this
2352 -> { "execute": "query-chardev" }
2356 "label": "charchannel0",
2357 "filename": "unix:/var/lib/libvirt/qemu/seabios.rhel6.agent,server",
2358 "frontend-open": false
2361 "label": "charmonitor",
2362 "filename": "unix:/var/lib/libvirt/qemu/seabios.rhel6.monitor,server",
2363 "frontend-open": true
2366 "label": "charserial0",
2367 "filename": "pty:/dev/pts/2",
2368 "frontend-open": true
2376 .name = "query-chardev",
2381 query-chardev-backends
2384 List available character device backends.
2386 Each backend is represented by a json-object, the returned value is a json-array
2389 Each json-object contains:
2391 - "name": backend name (json-string)
2395 -> { "execute": "query-chardev-backends" }
2416 .name = "query-chardev-backends",
2424 Show the block devices.
2426 Each block device information is stored in a json-object and the returned value
2427 is a json-array of all devices.
2429 Each json-object contain the following:
2431 - "device": device name (json-string)
2432 - "type": device type (json-string)
2433 - deprecated, retained for backward compatibility
2434 - Possible values: "unknown"
2435 - "removable": true if the device is removable, false otherwise (json-bool)
2436 - "locked": true if the device is locked, false otherwise (json-bool)
2437 - "tray_open": only present if removable, true if the device has a tray,
2438 and it is open (json-bool)
2439 - "inserted": only present if the device is inserted, it is a json-object
2440 containing the following:
2441 - "file": device file name (json-string)
2442 - "ro": true if read-only, false otherwise (json-bool)
2443 - "drv": driver format name (json-string)
2444 - Possible values: "blkdebug", "bochs", "cloop", "dmg",
2445 "file", "file", "ftp", "ftps", "host_cdrom",
2446 "host_device", "http", "https",
2447 "nbd", "parallels", "qcow", "qcow2", "raw",
2448 "tftp", "vdi", "vmdk", "vpc", "vvfat"
2449 - "backing_file": backing file name (json-string, optional)
2450 - "backing_file_depth": number of files in the backing file chain (json-int)
2451 - "encrypted": true if encrypted, false otherwise (json-bool)
2452 - "bps": limit total bytes per second (json-int)
2453 - "bps_rd": limit read bytes per second (json-int)
2454 - "bps_wr": limit write bytes per second (json-int)
2455 - "iops": limit total I/O operations per second (json-int)
2456 - "iops_rd": limit read operations per second (json-int)
2457 - "iops_wr": limit write operations per second (json-int)
2458 - "bps_max": total max in bytes (json-int)
2459 - "bps_rd_max": read max in bytes (json-int)
2460 - "bps_wr_max": write max in bytes (json-int)
2461 - "iops_max": total I/O operations max (json-int)
2462 - "iops_rd_max": read I/O operations max (json-int)
2463 - "iops_wr_max": write I/O operations max (json-int)
2464 - "iops_size": I/O size when limiting by iops (json-int)
2465 - "detect_zeroes": detect and optimize zero writing (json-string)
2466 - Possible values: "off", "on", "unmap"
2467 - "write_threshold": write offset threshold in bytes, a event will be
2468 emitted if crossed. Zero if disabled (json-int)
2469 - "image": the detail of the image, it is a json-object containing
2471 - "filename": image file name (json-string)
2472 - "format": image format (json-string)
2473 - "virtual-size": image capacity in bytes (json-int)
2474 - "dirty-flag": true if image is not cleanly closed, not present
2475 means clean (json-bool, optional)
2476 - "actual-size": actual size on disk in bytes of the image, not
2477 present when image does not support thin
2478 provision (json-int, optional)
2479 - "cluster-size": size of a cluster in bytes, not present if image
2480 format does not support it (json-int, optional)
2481 - "encrypted": true if the image is encrypted, not present means
2482 false or the image format does not support
2483 encryption (json-bool, optional)
2484 - "backing_file": backing file name, not present means no backing
2485 file is used or the image format does not
2486 support backing file chain
2487 (json-string, optional)
2488 - "full-backing-filename": full path of the backing file, not
2489 present if it equals backing_file or no
2490 backing file is used
2491 (json-string, optional)
2492 - "backing-filename-format": the format of the backing file, not
2493 present means unknown or no backing
2494 file (json-string, optional)
2495 - "snapshots": the internal snapshot info, it is an optional list
2496 of json-object containing the following:
2497 - "id": unique snapshot id (json-string)
2498 - "name": snapshot name (json-string)
2499 - "vm-state-size": size of the VM state in bytes (json-int)
2500 - "date-sec": UTC date of the snapshot in seconds (json-int)
2501 - "date-nsec": fractional part in nanoseconds to be used with
2503 - "vm-clock-sec": VM clock relative to boot in seconds
2505 - "vm-clock-nsec": fractional part in nanoseconds to be used
2506 with vm-clock-sec (json-int)
2507 - "backing-image": the detail of the backing image, it is an
2508 optional json-object only present when a
2509 backing image present for this image
2511 - "io-status": I/O operation status, only present if the device supports it
2512 and the VM is configured to stop on errors. It's always reset
2513 to "ok" when the "cont" command is issued (json_string, optional)
2514 - Possible values: "ok", "failed", "nospace"
2518 -> { "execute": "query-block" }
2523 "device":"ide0-hd0",
2530 "file":"disks/test.qcow2",
2531 "backing_file_depth":1,
2545 "detect_zeroes": "on",
2546 "write_threshold": 0,
2548 "filename":"disks/test.qcow2",
2550 "virtual-size":2048000,
2551 "backing_file":"base.qcow2",
2552 "full-backing-filename":"disks/base.qcow2",
2553 "backing-filename-format":"qcow2",
2557 "name": "snapshot1",
2559 "date-sec": 10000200,
2561 "vm-clock-sec": 206,
2566 "filename":"disks/base.qcow2",
2568 "virtual-size":2048000
2576 "device":"ide1-cd0",
2599 .name = "query-block",
2607 Show block device statistics.
2609 Each device statistic information is stored in a json-object and the returned
2610 value is a json-array of all devices.
2612 Each json-object contain the following:
2614 - "device": device name (json-string)
2615 - "stats": A json-object with the statistics information, it contains:
2616 - "rd_bytes": bytes read (json-int)
2617 - "wr_bytes": bytes written (json-int)
2618 - "rd_operations": read operations (json-int)
2619 - "wr_operations": write operations (json-int)
2620 - "flush_operations": cache flush operations (json-int)
2621 - "wr_total_time_ns": total time spend on writes in nano-seconds (json-int)
2622 - "rd_total_time_ns": total time spend on reads in nano-seconds (json-int)
2623 - "flush_total_time_ns": total time spend on cache flushes in nano-seconds (json-int)
2624 - "wr_highest_offset": The offset after the greatest byte written to the
2625 BlockDriverState since it has been opened (json-int)
2626 - "rd_merged": number of read requests that have been merged into
2627 another request (json-int)
2628 - "wr_merged": number of write requests that have been merged into
2629 another request (json-int)
2630 - "idle_time_ns": time since the last I/O operation, in
2631 nanoseconds. If the field is absent it means
2632 that there haven't been any operations yet
2633 (json-int, optional)
2634 - "failed_rd_operations": number of failed read operations
2636 - "failed_wr_operations": number of failed write operations
2638 - "failed_flush_operations": number of failed flush operations
2640 - "invalid_rd_operations": number of invalid read operations
2642 - "invalid_wr_operations": number of invalid write operations
2644 - "invalid_flush_operations": number of invalid flush operations
2646 - "account_invalid": whether invalid operations are included in
2647 the last access statistics (json-bool)
2648 - "account_failed": whether failed operations are included in the
2649 latency and last access statistics
2651 - "timed_stats": A json-array containing statistics collected in
2652 specific intervals, with the following members:
2653 - "interval_length": interval used for calculating the
2654 statistics, in seconds (json-int)
2655 - "min_rd_latency_ns": minimum latency of read operations in
2656 the defined interval, in nanoseconds
2658 - "min_wr_latency_ns": minimum latency of write operations in
2659 the defined interval, in nanoseconds
2661 - "min_flush_latency_ns": minimum latency of flush operations
2662 in the defined interval, in
2663 nanoseconds (json-int)
2664 - "max_rd_latency_ns": maximum latency of read operations in
2665 the defined interval, in nanoseconds
2667 - "max_wr_latency_ns": maximum latency of write operations in
2668 the defined interval, in nanoseconds
2670 - "max_flush_latency_ns": maximum latency of flush operations
2671 in the defined interval, in
2672 nanoseconds (json-int)
2673 - "avg_rd_latency_ns": average latency of read operations in
2674 the defined interval, in nanoseconds
2676 - "avg_wr_latency_ns": average latency of write operations in
2677 the defined interval, in nanoseconds
2679 - "avg_flush_latency_ns": average latency of flush operations
2680 in the defined interval, in
2681 nanoseconds (json-int)
2682 - "avg_rd_queue_depth": average number of pending read
2683 operations in the defined interval
2685 - "avg_wr_queue_depth": average number of pending write
2686 operations in the defined interval
2688 - "parent": Contains recursively the statistics of the underlying
2689 protocol (e.g. the host file for a qcow2 image). If there is
2690 no underlying protocol, this field is omitted
2691 (json-object, optional)
2695 -> { "execute": "query-blockstats" }
2699 "device":"ide0-hd0",
2702 "wr_highest_offset":3686448128,
2704 "wr_operations":751,
2705 "rd_bytes":122567168,
2706 "rd_operations":36772
2707 "wr_total_times_ns":313253456
2708 "rd_total_times_ns":3465673657
2709 "flush_total_times_ns":49653
2710 "flush_operations":61,
2713 "idle_time_ns":2953431879,
2714 "account_invalid":true,
2715 "account_failed":false
2719 "wr_highest_offset":2821110784,
2721 "wr_operations":692,
2722 "rd_bytes":122739200,
2723 "rd_operations":36604
2724 "flush_operations":51,
2725 "wr_total_times_ns":313253456
2726 "rd_total_times_ns":3465673657
2727 "flush_total_times_ns":49653,
2730 "idle_time_ns":2953431879,
2731 "account_invalid":true,
2732 "account_failed":false
2736 "device":"ide1-cd0",
2738 "wr_highest_offset":0,
2743 "flush_operations":0,
2744 "wr_total_times_ns":0
2745 "rd_total_times_ns":0
2746 "flush_total_times_ns":0,
2749 "account_invalid":false,
2750 "account_failed":false
2756 "wr_highest_offset":0,
2761 "flush_operations":0,
2762 "wr_total_times_ns":0
2763 "rd_total_times_ns":0
2764 "flush_total_times_ns":0,
2767 "account_invalid":false,
2768 "account_failed":false
2774 "wr_highest_offset":0,
2779 "flush_operations":0,
2780 "wr_total_times_ns":0
2781 "rd_total_times_ns":0
2782 "flush_total_times_ns":0,
2785 "account_invalid":false,
2786 "account_failed":false
2795 .name = "query-blockstats",
2796 .args_type = "query-nodes:b?",
2803 Show CPU information.
2805 Return a json-array. Each CPU is represented by a json-object, which contains:
2807 - "CPU": CPU index (json-int)
2808 - "current": true if this is the current CPU, false otherwise (json-bool)
2809 - "halted": true if the cpu is halted, false otherwise (json-bool)
2810 - "qom_path": path to the CPU object in the QOM tree (json-str)
2811 - "arch": architecture of the cpu, which determines what additional
2812 keys will be present (json-str)
2813 - Current program counter. The key's name depends on the architecture:
2814 "pc": i386/x86_64 (json-int)
2815 "nip": PPC (json-int)
2816 "pc" and "npc": sparc (json-int)
2817 "PC": mips (json-int)
2818 - "thread_id": ID of the underlying host thread (json-int)
2822 -> { "execute": "query-cpus" }
2829 "qom_path":"/machine/unattached/device[0]",
2838 "qom_path":"/machine/unattached/device[2]",
2849 .name = "query-cpus",
2857 Returns a list of information about each iothread.
2859 Note this list excludes the QEMU main loop thread, which is not declared
2860 using the -object iothread command-line option. It is always the main thread
2863 Return a json-array. Each iothread is represented by a json-object, which contains:
2865 - "id": name of iothread (json-str)
2866 - "thread-id": ID of the underlying host thread (json-int)
2870 -> { "execute": "query-iothreads" }
2887 .name = "query-iothreads",
2895 PCI buses and devices information.
2897 The returned value is a json-array of all buses. Each bus is represented by
2898 a json-object, which has a key with a json-array of all PCI devices attached
2899 to it. Each device is represented by a json-object.
2901 The bus json-object contains the following:
2903 - "bus": bus number (json-int)
2904 - "devices": a json-array of json-objects, each json-object represents a
2907 The PCI device json-object contains the following:
2909 - "bus": identical to the parent's bus number (json-int)
2910 - "slot": slot number (json-int)
2911 - "function": function number (json-int)
2912 - "class_info": a json-object containing:
2913 - "desc": device class description (json-string, optional)
2914 - "class": device class number (json-int)
2915 - "id": a json-object containing:
2916 - "device": device ID (json-int)
2917 - "vendor": vendor ID (json-int)
2918 - "irq": device's IRQ if assigned (json-int, optional)
2919 - "qdev_id": qdev id string (json-string)
2920 - "pci_bridge": It's a json-object, only present if this device is a
2921 PCI bridge, contains:
2922 - "bus": bus number (json-int)
2923 - "secondary": secondary bus number (json-int)
2924 - "subordinate": subordinate bus number (json-int)
2925 - "io_range": I/O memory range information, a json-object with the
2927 - "base": base address, in bytes (json-int)
2928 - "limit": limit address, in bytes (json-int)
2929 - "memory_range": memory range information, a json-object with the
2931 - "base": base address, in bytes (json-int)
2932 - "limit": limit address, in bytes (json-int)
2933 - "prefetchable_range": Prefetchable memory range information, a
2934 json-object with the following members:
2935 - "base": base address, in bytes (json-int)
2936 - "limit": limit address, in bytes (json-int)
2937 - "devices": a json-array of PCI devices if there's any attached, each
2938 each element is represented by a json-object, which contains
2939 the same members of the 'PCI device json-object' described
2941 - "regions": a json-array of json-objects, each json-object represents a
2942 memory region of this device
2944 The memory range json-object contains the following:
2946 - "base": base memory address (json-int)
2947 - "limit": limit value (json-int)
2949 The region json-object can be an I/O region or a memory region, an I/O region
2950 json-object contains the following:
2952 - "type": "io" (json-string, fixed)
2953 - "bar": BAR number (json-int)
2954 - "address": memory address (json-int)
2955 - "size": memory size (json-int)
2957 A memory region json-object contains the following:
2959 - "type": "memory" (json-string, fixed)
2960 - "bar": BAR number (json-int)
2961 - "address": memory address (json-int)
2962 - "size": memory size (json-int)
2963 - "mem_type_64": true or false (json-bool)
2964 - "prefetch": true or false (json-bool)
2968 -> { "execute": "query-pci" }
2980 "desc":"Host bridge"
3014 "desc":"IDE controller"
3036 "desc":"VGA controller"
3046 "mem_type_64":false,
3049 "address":4026531840,
3054 "mem_type_64":false,
3057 "address":4060086272,
3062 "mem_type_64":false,
3077 "desc":"RAM controller"
3098 Note: This example has been shortened as the real response is too long.
3103 .name = "query-pci",
3111 Show KVM information.
3113 Return a json-object with the following information:
3115 - "enabled": true if KVM support is enabled, false otherwise (json-bool)
3116 - "present": true if QEMU has KVM support, false otherwise (json-bool)
3120 -> { "execute": "query-kvm" }
3121 <- { "return": { "enabled": true, "present": true } }
3126 .name = "query-kvm",
3134 Return a json-object with the following information:
3136 - "running": true if the VM is running, or false if it is paused (json-bool)
3137 - "singlestep": true if the VM is in single step mode,
3138 false otherwise (json-bool)
3139 - "status": one of the following values (json-string)
3140 "debug" - QEMU is running on a debugger
3141 "inmigrate" - guest is paused waiting for an incoming migration
3142 "internal-error" - An internal error that prevents further guest
3143 execution has occurred
3144 "io-error" - the last IOP has failed and the device is configured
3145 to pause on I/O errors
3146 "paused" - guest has been paused via the 'stop' command
3147 "postmigrate" - guest is paused following a successful 'migrate'
3148 "prelaunch" - QEMU was started with -S and guest has not started
3149 "finish-migrate" - guest is paused to finish the migration process
3150 "restore-vm" - guest is paused to restore VM state
3151 "running" - guest is actively running
3152 "save-vm" - guest is paused to save the VM state
3153 "shutdown" - guest is shut down (and -no-shutdown is in use)
3154 "watchdog" - the watchdog action is configured to pause and
3159 -> { "execute": "query-status" }
3160 <- { "return": { "running": true, "singlestep": false, "status": "running" } }
3165 .name = "query-status",
3173 Show VM mice information.
3175 Each mouse is represented by a json-object, the returned value is a json-array
3178 The mouse json-object contains the following:
3180 - "name": mouse's name (json-string)
3181 - "index": mouse's index (json-int)
3182 - "current": true if this mouse is receiving events, false otherwise (json-bool)
3183 - "absolute": true if the mouse generates absolute input events (json-bool)
3187 -> { "execute": "query-mice" }
3191 "name":"QEMU Microsoft Mouse",
3197 "name":"QEMU PS/2 Mouse",
3208 .name = "query-mice",
3216 Show VNC server information.
3218 Return a json-object with server information. Connected clients are returned
3219 as a json-array of json-objects.
3221 The main json-object contains the following:
3223 - "enabled": true or false (json-bool)
3224 - "host": server's IP address (json-string)
3225 - "family": address family (json-string)
3226 - Possible values: "ipv4", "ipv6", "unix", "unknown"
3227 - "service": server's port number (json-string)
3228 - "auth": authentication method (json-string)
3229 - Possible values: "invalid", "none", "ra2", "ra2ne", "sasl", "tight",
3230 "tls", "ultra", "unknown", "vencrypt", "vencrypt",
3231 "vencrypt+plain", "vencrypt+tls+none",
3232 "vencrypt+tls+plain", "vencrypt+tls+sasl",
3233 "vencrypt+tls+vnc", "vencrypt+x509+none",
3234 "vencrypt+x509+plain", "vencrypt+x509+sasl",
3235 "vencrypt+x509+vnc", "vnc"
3236 - "clients": a json-array of all connected clients
3238 Clients are described by a json-object, each one contain the following:
3240 - "host": client's IP address (json-string)
3241 - "family": address family (json-string)
3242 - Possible values: "ipv4", "ipv6", "unix", "unknown"
3243 - "service": client's port number (json-string)
3244 - "x509_dname": TLS dname (json-string, optional)
3245 - "sasl_username": SASL username (json-string, optional)
3249 -> { "execute": "query-vnc" }
3270 .name = "query-vnc",
3274 .name = "query-vnc-servers",
3282 Show SPICE server information.
3284 Return a json-object with server information. Connected clients are returned
3285 as a json-array of json-objects.
3287 The main json-object contains the following:
3289 - "enabled": true or false (json-bool)
3290 - "host": server's IP address (json-string)
3291 - "port": server's port number (json-int, optional)
3292 - "tls-port": server's port number (json-int, optional)
3293 - "auth": authentication method (json-string)
3294 - Possible values: "none", "spice"
3295 - "channels": a json-array of all active channels clients
3297 Channels are described by a json-object, each one contain the following:
3299 - "host": client's IP address (json-string)
3300 - "family": address family (json-string)
3301 - Possible values: "ipv4", "ipv6", "unix", "unknown"
3302 - "port": client's port number (json-string)
3303 - "connection-id": spice connection id. All channels with the same id
3304 belong to the same spice session (json-int)
3305 - "channel-type": channel type. "1" is the main control channel, filter for
3306 this one if you want track spice sessions only (json-int)
3307 - "channel-id": channel id. Usually "0", might be different needed when
3308 multiple channels of the same type exist, such as multiple
3309 display channels in a multihead setup (json-int)
3310 - "tls": whether the channel is encrypted (json-bool)
3314 -> { "execute": "query-spice" }
3327 "connection-id": 1804289383,
3328 "host": "127.0.0.1",
3336 "connection-id": 1804289383,
3337 "host": "127.0.0.1",
3341 [ ... more channels follow ... ]
3348 #if defined(CONFIG_SPICE)
3350 .name = "query-spice",
3361 Return a json-object with the following information:
3363 - "name": VM's name (json-string, optional)
3367 -> { "execute": "query-name" }
3368 <- { "return": { "name": "qemu-name" } }
3373 .name = "query-name",
3383 Return a json-object with the following information:
3385 - "UUID": Universally Unique Identifier (json-string)
3389 -> { "execute": "query-uuid" }
3390 <- { "return": { "UUID": "550e8400-e29b-41d4-a716-446655440000" } }
3395 .name = "query-uuid",
3400 query-command-line-options
3401 --------------------------
3403 Show command line option schema.
3405 Return a json-array of command line option schema for all options (or for
3406 the given option), returning an error if the given option doesn't exist.
3408 Each array entry contains the following:
3410 - "option": option name (json-string)
3411 - "parameters": a json-array describes all parameters of the option:
3412 - "name": parameter name (json-string)
3413 - "type": parameter type (one of 'string', 'boolean', 'number',
3415 - "help": human readable description of the parameter
3416 (json-string, optional)
3417 - "default": default value string for the parameter
3418 (json-string, optional)
3422 -> { "execute": "query-command-line-options", "arguments": { "option": "option-rom" } }
3431 "name": "bootindex",
3435 "option": "option-rom"
3443 .name = "query-command-line-options",
3444 .args_type = "option:s?",
3453 Return a json-object. If migration is active there will be another json-object
3454 with RAM migration status and if block migration is active another one with
3455 block migration status.
3457 The main json-object contains the following:
3459 - "status": migration status (json-string)
3460 - Possible values: "setup", "active", "completed", "failed", "cancelled"
3461 - "total-time": total amount of ms since migration started. If
3462 migration has ended, it returns the total migration
3464 - "setup-time" amount of setup time in milliseconds _before_ the
3465 iterations begin but _after_ the QMP command is issued.
3466 This is designed to provide an accounting of any activities
3467 (such as RDMA pinning) which may be expensive, but do not
3468 actually occur during the iterative migration rounds
3469 themselves. (json-int)
3470 - "downtime": only present when migration has finished correctly
3471 total amount in ms for downtime that happened (json-int)
3472 - "expected-downtime": only present while migration is active
3473 total amount in ms for downtime that was calculated on
3474 the last bitmap round (json-int)
3475 - "ram": only present if "status" is "active", it is a json-object with the
3476 following RAM information:
3477 - "transferred": amount transferred in bytes (json-int)
3478 - "remaining": amount remaining to transfer in bytes (json-int)
3479 - "total": total amount of memory in bytes (json-int)
3480 - "duplicate": number of pages filled entirely with the same
3482 These are sent over the wire much more efficiently.
3483 - "skipped": number of skipped zero pages (json-int)
3484 - "normal" : number of whole pages transferred. I.e. they
3485 were not sent as duplicate or xbzrle pages (json-int)
3486 - "normal-bytes" : number of bytes transferred in whole
3487 pages. This is just normal pages times size of one page,
3488 but this way upper levels don't need to care about page
3490 - "dirty-sync-count": times that dirty ram was synchronized (json-int)
3491 - "disk": only present if "status" is "active" and it is a block migration,
3492 it is a json-object with the following disk information:
3493 - "transferred": amount transferred in bytes (json-int)
3494 - "remaining": amount remaining to transfer in bytes json-int)
3495 - "total": total disk size in bytes (json-int)
3496 - "xbzrle-cache": only present if XBZRLE is active.
3497 It is a json-object with the following XBZRLE information:
3498 - "cache-size": XBZRLE cache size in bytes
3499 - "bytes": number of bytes transferred for XBZRLE compressed pages
3500 - "pages": number of XBZRLE compressed pages
3501 - "cache-miss": number of XBRZRLE page cache misses
3502 - "cache-miss-rate": rate of XBRZRLE page cache misses
3503 - "overflow": number of times XBZRLE overflows. This means
3504 that the XBZRLE encoding was bigger than just sent the
3505 whole page, and then we sent the whole page instead (as as
3510 1. Before the first migration
3512 -> { "execute": "query-migrate" }
3515 2. Migration is done and has succeeded
3517 -> { "execute": "query-migrate" }
3519 "status": "completed",
3529 "normal-bytes":123456,
3530 "dirty-sync-count":15
3535 3. Migration is done and has failed
3537 -> { "execute": "query-migrate" }
3538 <- { "return": { "status": "failed" } }
3540 4. Migration is being performed and is not a block migration:
3542 -> { "execute": "query-migrate" }
3552 "expected-downtime":12345,
3555 "normal-bytes":123456,
3556 "dirty-sync-count":15
3561 5. Migration is being performed and is a block migration:
3563 -> { "execute": "query-migrate" }
3569 "remaining":1053304,
3573 "expected-downtime":12345,
3576 "normal-bytes":123456,
3577 "dirty-sync-count":15
3581 "remaining":20880384,
3587 6. Migration is being performed and XBZRLE is active:
3589 -> { "execute": "query-migrate" }
3593 "capabilities" : [ { "capability": "xbzrle", "state" : true } ],
3596 "remaining":1053304,
3600 "expected-downtime":12345,
3603 "normal-bytes":3412992,
3604 "dirty-sync-count":15
3607 "cache-size":67108864,
3611 "cache-miss-rate":0.123,
3620 .name = "query-migrate",
3625 migrate-set-capabilities
3626 ------------------------
3628 Enable/Disable migration capabilities
3630 - "xbzrle": XBZRLE support
3631 - "rdma-pin-all": pin all pages when using RDMA during migration
3632 - "auto-converge": throttle down guest to help convergence of migration
3633 - "zero-blocks": compress zero blocks during block migration
3634 - "compress": use multiple compression threads to accelerate live migration
3635 - "events": generate events for each migration state change
3636 - "postcopy-ram": postcopy mode for live migration
3642 -> { "execute": "migrate-set-capabilities" , "arguments":
3643 { "capabilities": [ { "capability": "xbzrle", "state": true } ] } }
3648 .name = "migrate-set-capabilities",
3649 .args_type = "capabilities:q",
3650 .params = "capability:s,state:b",
3653 query-migrate-capabilities
3654 --------------------------
3656 Query current migration capabilities
3658 - "capabilities": migration capabilities state
3659 - "xbzrle" : XBZRLE state (json-bool)
3660 - "rdma-pin-all" : RDMA Pin Page state (json-bool)
3661 - "auto-converge" : Auto Converge state (json-bool)
3662 - "zero-blocks" : Zero Blocks state (json-bool)
3663 - "compress": Multiple compression threads state (json-bool)
3664 - "events": Migration state change event state (json-bool)
3665 - "postcopy-ram": postcopy ram state (json-bool)
3671 -> { "execute": "query-migrate-capabilities" }
3673 {"state": false, "capability": "xbzrle"},
3674 {"state": false, "capability": "rdma-pin-all"},
3675 {"state": false, "capability": "auto-converge"},
3676 {"state": false, "capability": "zero-blocks"},
3677 {"state": false, "capability": "compress"},
3678 {"state": true, "capability": "events"},
3679 {"state": false, "capability": "postcopy-ram"}
3685 .name = "query-migrate-capabilities",
3690 migrate-set-parameters
3691 ----------------------
3693 Set migration parameters
3695 - "compress-level": set compression level during migration (json-int)
3696 - "compress-threads": set compression thread count for migration (json-int)
3697 - "decompress-threads": set decompression thread count for migration (json-int)
3698 - "cpu-throttle-initial": set initial percentage of time guest cpus are
3699 throttled for auto-converge (json-int)
3700 - "cpu-throttle-increment": set throttle increasing percentage for
3701 auto-converge (json-int)
3707 -> { "execute": "migrate-set-parameters" , "arguments":
3708 { "compress-level": 1 } }
3713 .name = "migrate-set-parameters",
3715 "compress-level:i?,compress-threads:i?,decompress-threads:i?,cpu-throttle-initial:i?,cpu-throttle-increment:i?",
3718 query-migrate-parameters
3719 ------------------------
3721 Query current migration parameters
3723 - "parameters": migration parameters value
3724 - "compress-level" : compression level value (json-int)
3725 - "compress-threads" : compression thread count value (json-int)
3726 - "decompress-threads" : decompression thread count value (json-int)
3727 - "cpu-throttle-initial" : initial percentage of time guest cpus are
3728 throttled (json-int)
3729 - "cpu-throttle-increment" : throttle increasing percentage for
3730 auto-converge (json-int)
3736 -> { "execute": "query-migrate-parameters" }
3739 "decompress-threads": 2,
3740 "cpu-throttle-increment": 10,
3741 "compress-threads": 8,
3742 "compress-level": 1,
3743 "cpu-throttle-initial": 20
3750 .name = "query-migrate-parameters",
3758 Show balloon information.
3760 Make an asynchronous request for balloon info. When the request completes a
3761 json-object will be returned containing the following data:
3763 - "actual": current balloon value in bytes (json-int)
3767 -> { "execute": "query-balloon" }
3770 "actual":1073741824,
3777 .name = "query-balloon",
3782 .name = "query-block-jobs",
3788 .args_type = "path:s",
3793 .args_type = "path:s,property:s,value:q",
3798 .args_type = "path:s,property:s",
3802 .name = "nbd-server-start",
3803 .args_type = "addr:q,tls-creds:s?",
3806 .name = "nbd-server-add",
3807 .args_type = "device:B,writable:b?",
3810 .name = "nbd-server-stop",
3815 .name = "change-vnc-password",
3816 .args_type = "password:s",
3819 .name = "qom-list-types",
3820 .args_type = "implements:s?,abstract:b?",
3824 .name = "device-list-properties",
3825 .args_type = "typename:s",
3829 .name = "query-machines",
3834 .name = "query-cpu-definitions",
3839 .name = "query-cpu-model-expansion",
3840 .args_type = "type:s,model:q",
3844 .name = "query-cpu-model-comparison",
3845 .args_type = "modela:q,modelb:q",
3849 .name = "query-cpu-model-baseline",
3850 .args_type = "modela:q,modelb:q",
3854 .name = "query-target",
3859 .name = "query-tpm",
3867 Return information about the TPM device.
3873 -> { "execute": "query-tpm" }
3876 { "model": "tpm-tis",
3878 { "type": "passthrough",
3880 { "cancel-path": "/sys/class/misc/tpm0/device/cancel",
3892 .name = "query-tpm-models",
3900 Return a list of supported TPM models.
3906 -> { "execute": "query-tpm-models" }
3907 <- { "return": [ "tpm-tis" ] }
3912 .name = "query-tpm-types",
3920 Return a list of supported TPM types.
3926 -> { "execute": "query-tpm-types" }
3927 <- { "return": [ "passthrough" ] }
3932 .name = "chardev-add",
3933 .args_type = "id:s,backend:q",
3944 - "id": the chardev's ID, must be unique (json-string)
3945 - "backend": chardev backend type + parameters
3949 -> { "execute" : "chardev-add",
3950 "arguments" : { "id" : "foo",
3951 "backend" : { "type" : "null", "data" : {} } } }
3954 -> { "execute" : "chardev-add",
3955 "arguments" : { "id" : "bar",
3956 "backend" : { "type" : "file",
3957 "data" : { "out" : "/tmp/bar.log" } } } }
3960 -> { "execute" : "chardev-add",
3961 "arguments" : { "id" : "baz",
3962 "backend" : { "type" : "pty", "data" : {} } } }
3963 <- { "return": { "pty" : "/dev/pty/42" } }
3968 .name = "chardev-remove",
3969 .args_type = "id:s",
3981 - "id": the chardev's ID, must exist and not be in use (json-string)
3985 -> { "execute": "chardev-remove", "arguments": { "id" : "foo" } }
3990 .name = "query-rx-filter",
3991 .args_type = "name:s?",
3998 Show rx-filter information.
4000 Returns a json-array of rx-filter information for all NICs (or for the
4001 given NIC), returning an error if the given NIC doesn't exist, or
4002 given NIC doesn't support rx-filter querying, or given net client
4005 The query will clear the event notification flag of each NIC, then qemu
4006 will start to emit event to QMP monitor.
4008 Each array entry contains the following:
4010 - "name": net client name (json-string)
4011 - "promiscuous": promiscuous mode is enabled (json-bool)
4012 - "multicast": multicast receive state (one of 'normal', 'none', 'all')
4013 - "unicast": unicast receive state (one of 'normal', 'none', 'all')
4014 - "vlan": vlan receive state (one of 'normal', 'none', 'all') (Since 2.0)
4015 - "broadcast-allowed": allow to receive broadcast (json-bool)
4016 - "multicast-overflow": multicast table is overflowed (json-bool)
4017 - "unicast-overflow": unicast table is overflowed (json-bool)
4018 - "main-mac": main macaddr string (json-string)
4019 - "vlan-table": a json-array of active vlan id
4020 - "unicast-table": a json-array of unicast macaddr string
4021 - "multicast-table": a json-array of multicast macaddr string
4025 -> { "execute": "query-rx-filter", "arguments": { "name": "vnet0" } }
4028 "promiscuous": true,
4030 "main-mac": "52:54:00:12:34:56",
4031 "unicast": "normal",
4039 "multicast": "normal",
4040 "multicast-overflow": false,
4041 "unicast-overflow": false,
4042 "multicast-table": [
4043 "01:00:5e:00:00:01",
4044 "33:33:00:00:00:01",
4047 "broadcast-allowed": false
4055 .name = "blockdev-add",
4056 .args_type = "options:q",
4065 This command is still a work in progress. It doesn't support all
4066 block drivers among other things. Stay away from it unless you want
4067 to help with its development.
4071 - "options": block driver options
4075 -> { "execute": "blockdev-add",
4076 "arguments": { "options" : { "driver": "qcow2",
4077 "file": { "driver": "file",
4078 "filename": "test.qcow2" } } } }
4083 -> { "execute": "blockdev-add",
4095 "filename": "/tmp/test.qcow2"
4101 "filename": "/dev/fdset/4"
4113 .name = "x-blockdev-del",
4114 .args_type = "id:s?,node-name:s?",
4122 Deletes a block device thas has been added using blockdev-add.
4123 The selected device can be either a block backend or a graph node.
4125 In the former case the backend will be destroyed, along with its
4126 inserted medium if there's any. The command will fail if the backend
4127 or its medium are in use.
4129 In the latter case the node will be destroyed. The command will fail
4130 if the node is attached to a block backend or is otherwise being
4133 One of "id" or "node-name" must be specified, but not both.
4135 This command is still a work in progress and is considered
4136 experimental. Stay away from it unless you want to help with its
4141 - "id": Name of the block backend device to delete (json-string, optional)
4142 - "node-name": Name of the graph node to delete (json-string, optional)
4146 -> { "execute": "blockdev-add",
4153 "filename": "test.qcow2"
4161 -> { "execute": "x-blockdev-del",
4162 "arguments": { "id": "drive0" }
4169 .name = "blockdev-open-tray",
4170 .args_type = "device:s,force:b?",
4177 Opens a block device's tray. If there is a block driver state tree inserted as a
4178 medium, it will become inaccessible to the guest (but it will remain associated
4179 to the block device, so closing the tray will make it accessible again).
4181 If the tray was already open before, this will be a no-op.
4183 Once the tray opens, a DEVICE_TRAY_MOVED event is emitted. There are cases in
4184 which no such event will be generated, these include:
4185 - if the guest has locked the tray, @force is false and the guest does not
4186 respond to the eject request
4187 - if the BlockBackend denoted by @device does not have a guest device attached
4189 - if the guest device does not have an actual tray and is empty, for instance
4190 for floppy disk drives
4194 - "device": block device name (json-string)
4195 - "force": if false (the default), an eject request will be sent to the guest if
4196 it has locked the tray (and the tray will not be opened immediately);
4197 if true, the tray will be opened regardless of whether it is locked
4198 (json-bool, optional)
4202 -> { "execute": "blockdev-open-tray",
4203 "arguments": { "device": "ide1-cd0" } }
4205 <- { "timestamp": { "seconds": 1418751016,
4206 "microseconds": 716996 },
4207 "event": "DEVICE_TRAY_MOVED",
4208 "data": { "device": "ide1-cd0",
4209 "tray-open": true } }
4216 .name = "blockdev-close-tray",
4217 .args_type = "device:s",
4224 Closes a block device's tray. If there is a block driver state tree associated
4225 with the block device (which is currently ejected), that tree will be loaded as
4228 If the tray was already closed before, this will be a no-op.
4232 - "device": block device name (json-string)
4236 -> { "execute": "blockdev-close-tray",
4237 "arguments": { "device": "ide1-cd0" } }
4239 <- { "timestamp": { "seconds": 1418751345,
4240 "microseconds": 272147 },
4241 "event": "DEVICE_TRAY_MOVED",
4242 "data": { "device": "ide1-cd0",
4243 "tray-open": false } }
4250 .name = "x-blockdev-remove-medium",
4251 .args_type = "device:s",
4255 x-blockdev-remove-medium
4256 ------------------------
4258 Removes a medium (a block driver state tree) from a block device. That block
4259 device's tray must currently be open (unless there is no attached guest device).
4261 If the tray is open and there is no medium inserted, this will be a no-op.
4263 This command is still a work in progress and is considered experimental.
4264 Stay away from it unless you want to help with its development.
4268 - "device": block device name (json-string)
4272 -> { "execute": "x-blockdev-remove-medium",
4273 "arguments": { "device": "ide1-cd0" } }
4275 <- { "error": { "class": "GenericError",
4276 "desc": "Tray of device 'ide1-cd0' is not open" } }
4278 -> { "execute": "blockdev-open-tray",
4279 "arguments": { "device": "ide1-cd0" } }
4281 <- { "timestamp": { "seconds": 1418751627,
4282 "microseconds": 549958 },
4283 "event": "DEVICE_TRAY_MOVED",
4284 "data": { "device": "ide1-cd0",
4285 "tray-open": true } }
4289 -> { "execute": "x-blockdev-remove-medium",
4290 "arguments": { "device": "ide1-cd0" } }
4297 .name = "x-blockdev-insert-medium",
4298 .args_type = "device:s,node-name:s",
4302 x-blockdev-insert-medium
4303 ------------------------
4305 Inserts a medium (a block driver state tree) into a block device. That block
4306 device's tray must currently be open (unless there is no attached guest device)
4307 and there must be no medium inserted already.
4309 This command is still a work in progress and is considered experimental.
4310 Stay away from it unless you want to help with its development.
4314 - "device": block device name (json-string)
4315 - "node-name": root node of the BDS tree to insert into the block device
4319 -> { "execute": "blockdev-add",
4320 "arguments": { "options": { "node-name": "node0",
4322 "file": { "driver": "file",
4323 "filename": "fedora.iso" } } } }
4327 -> { "execute": "x-blockdev-insert-medium",
4328 "arguments": { "device": "ide1-cd0",
4329 "node-name": "node0" } }
4336 .name = "x-blockdev-change",
4337 .args_type = "parent:B,child:B?,node:B?",
4344 Dynamically reconfigure the block driver state graph. It can be used
4345 to add, remove, insert or replace a graph node. Currently only the
4346 Quorum driver implements this feature to add or remove its child. This
4347 is useful to fix a broken quorum child.
4349 If @node is specified, it will be inserted under @parent. @child
4350 may not be specified in this case. If both @parent and @child are
4351 specified but @node is not, @child will be detached from @parent.
4354 - "parent": the id or name of the parent node (json-string)
4355 - "child": the name of a child under the given parent node (json-string, optional)
4356 - "node": the name of the node that will be added (json-string, optional)
4358 Note: this command is experimental, and not a stable API. It doesn't
4359 support all kinds of operations, all kinds of children, nor all block
4362 Warning: The data in a new quorum child MUST be consistent with that of
4363 the rest of the array.
4367 Add a new node to a quorum
4368 -> { "execute": "blockdev-add",
4369 "arguments": { "options": { "driver": "raw",
4370 "node-name": "new_node",
4371 "file": { "driver": "file",
4372 "filename": "test.raw" } } } }
4374 -> { "execute": "x-blockdev-change",
4375 "arguments": { "parent": "disk1",
4376 "node": "new_node" } }
4379 Delete a quorum's node
4380 -> { "execute": "x-blockdev-change",
4381 "arguments": { "parent": "disk1",
4382 "child": "children.1" } }
4388 .name = "query-named-block-nodes",
4393 query-named-block-nodes
4394 -----------------------
4396 Return a list of BlockDeviceInfo for all the named block driver nodes
4400 -> { "execute": "query-named-block-nodes" }
4401 <- { "return": [ { "ro":false,
4404 "file":"disks/test.qcow2",
4405 "node-name": "my-node",
4406 "backing_file_depth":1,
4420 "write_threshold": 0,
4422 "filename":"disks/test.qcow2",
4424 "virtual-size":2048000,
4425 "backing_file":"base.qcow2",
4426 "full-backing-filename":"disks/base.qcow2",
4427 "backing-filename-format":"qcow2",
4431 "name": "snapshot1",
4433 "date-sec": 10000200,
4435 "vm-clock-sec": 206,
4440 "filename":"disks/base.qcow2",
4442 "virtual-size":2048000
4449 .name = "blockdev-change-medium",
4450 .args_type = "device:B,filename:F,format:s?,read-only-mode:s?",
4454 blockdev-change-medium
4455 ----------------------
4457 Changes the medium inserted into a block device by ejecting the current medium
4458 and loading a new image file which is inserted as the new medium.
4462 - "device": device name (json-string)
4463 - "filename": filename of the new image (json-string)
4464 - "format": format of the new image (json-string, optional)
4465 - "read-only-mode": new read-only mode (json-string, optional)
4466 - Possible values: "retain" (default), "read-only", "read-write"
4470 1. Change a removable medium
4472 -> { "execute": "blockdev-change-medium",
4473 "arguments": { "device": "ide1-cd0",
4474 "filename": "/srv/images/Fedora-12-x86_64-DVD.iso",
4478 2. Load a read-only medium into a writable drive
4480 -> { "execute": "blockdev-change-medium",
4481 "arguments": { "device": "isa-fd0",
4482 "filename": "/srv/images/ro.img",
4484 "read-only-mode": "retain" } }
4487 { "class": "GenericError",
4488 "desc": "Could not open '/srv/images/ro.img': Permission denied" } }
4490 -> { "execute": "blockdev-change-medium",
4491 "arguments": { "device": "isa-fd0",
4492 "filename": "/srv/images/ro.img",
4494 "read-only-mode": "read-only" } }
4501 .name = "query-memdev",
4509 Show memory devices information.
4514 -> { "execute": "query-memdev" }
4521 "host-nodes": [0, 1],
4529 "host-nodes": [2, 3],
4530 "policy": "preferred"
4538 .name = "query-memory-devices",
4543 query-memory-devices
4544 --------------------
4546 Return a list of memory devices.
4549 -> { "execute": "query-memory-devices" }
4550 <- { "return": [ { "data":
4551 { "addr": 5368709120,
4552 "hotpluggable": true,
4555 "memdev": "/objects/memX",
4565 .name = "query-acpi-ospm-status",
4570 query-acpi-ospm-status
4571 ----------------------
4573 Return list of ACPIOSTInfo for devices that support status reporting
4574 via ACPI _OST method.
4577 -> { "execute": "query-acpi-ospm-status" }
4578 <- { "return": [ { "device": "d1", "slot": "0", "slot-type": "DIMM", "source": 1, "status": 0},
4579 { "slot": "1", "slot-type": "DIMM", "source": 0, "status": 0},
4580 { "slot": "2", "slot-type": "DIMM", "source": 0, "status": 0},
4581 { "slot": "3", "slot-type": "DIMM", "source": 0, "status": 0}
4586 #if defined TARGET_I386
4588 .name = "rtc-reset-reinjection",
4594 rtc-reset-reinjection
4595 ---------------------
4597 Reset the RTC interrupt reinjection backlog.
4603 -> { "execute": "rtc-reset-reinjection" }
4609 .name = "trace-event-get-state",
4610 .args_type = "name:s,vcpu:i?",
4614 trace-event-get-state
4615 ---------------------
4617 Query the state of events.
4621 - "name": Event name pattern (json-string).
4622 - "vcpu": The vCPU to query, any vCPU by default (json-int, optional).
4624 An event is returned if:
4625 - its name matches the "name" pattern, and
4626 - if "vcpu" is given, the event has the "vcpu" property.
4628 Therefore, if "vcpu" is given, the operation will only match per-vCPU events,
4629 returning their state on the specified vCPU. Special case: if "name" is an exact
4630 match, "vcpu" is given and the event does not have the "vcpu" property, an error
4635 -> { "execute": "trace-event-get-state", "arguments": { "name": "qemu_memalign" } }
4636 <- { "return": [ { "name": "qemu_memalign", "state": "disabled" } ] }
4641 .name = "trace-event-set-state",
4642 .args_type = "name:s,enable:b,ignore-unavailable:b?,vcpu:i?",
4646 trace-event-set-state
4647 ---------------------
4649 Set the state of events.
4653 - "name": Event name pattern (json-string).
4654 - "enable": Whether to enable or disable the event (json-bool).
4655 - "ignore-unavailable": Whether to ignore errors for events that cannot be
4656 changed (json-bool, optional).
4657 - "vcpu": The vCPU to act upon, all vCPUs by default (json-int, optional).
4659 An event's state is modified if:
4660 - its name matches the "name" pattern, and
4661 - if "vcpu" is given, the event has the "vcpu" property.
4663 Therefore, if "vcpu" is given, the operation will only match per-vCPU events,
4664 setting their state on the specified vCPU. Special case: if "name" is an exact
4665 match, "vcpu" is given and the event does not have the "vcpu" property, an error
4670 -> { "execute": "trace-event-set-state", "arguments": { "name": "qemu_memalign", "enable": "true" } }
4676 .name = "input-send-event",
4677 .args_type = "console:i?,events:q",
4684 Send input event to guest.
4688 - "device": display device (json-string, optional)
4689 - "head": display head (json-int, optional)
4690 - "events": list of input events
4692 The consoles are visible in the qom tree, under
4693 /backend/console[$index]. They have a device link and head property, so
4694 it is possible to map which console belongs to which device and display.
4698 Press left mouse button.
4700 -> { "execute": "input-send-event",
4701 "arguments": { "device": "video0",
4702 "events": [ { "type": "btn",
4703 "data" : { "down": true, "button": "left" } } ] } }
4706 -> { "execute": "input-send-event",
4707 "arguments": { "device": "video0",
4708 "events": [ { "type": "btn",
4709 "data" : { "down": false, "button": "left" } } ] } }
4716 -> { "execute": "input-send-event",
4717 "arguments": { "events": [
4718 { "type": "key", "data" : { "down": true,
4719 "key": {"type": "qcode", "data": "ctrl" } } },
4720 { "type": "key", "data" : { "down": true,
4721 "key": {"type": "qcode", "data": "alt" } } },
4722 { "type": "key", "data" : { "down": true,
4723 "key": {"type": "qcode", "data": "delete" } } } ] } }
4728 Move mouse pointer to absolute coordinates (20000, 400).
4730 -> { "execute": "input-send-event" ,
4731 "arguments": { "events": [
4732 { "type": "abs", "data" : { "axis": "x", "value" : 20000 } },
4733 { "type": "abs", "data" : { "axis": "y", "value" : 400 } } ] } }
4739 .name = "block-set-write-threshold",
4740 .args_type = "node-name:s,write-threshold:l",
4744 block-set-write-threshold
4747 Change the write threshold for a block drive. The threshold is an offset,
4748 thus must be non-negative. Default is no write threshold.
4749 Setting the threshold to zero disables it.
4753 - "node-name": the node name in the block driver state graph (json-string)
4754 - "write-threshold": the write threshold in bytes (json-int)
4758 -> { "execute": "block-set-write-threshold",
4759 "arguments": { "node-name": "mydev",
4760 "write-threshold": 17179869184 } }
4766 .name = "query-rocker",
4767 .args_type = "name:s",
4776 - "name": switch name
4780 -> { "execute": "query-rocker", "arguments": { "name": "sw1" } }
4781 <- { "return": {"name": "sw1", "ports": 2, "id": 1327446905938}}
4786 .name = "query-rocker-ports",
4787 .args_type = "name:s",
4791 Show rocker switch ports
4792 ------------------------
4796 - "name": switch name
4800 -> { "execute": "query-rocker-ports", "arguments": { "name": "sw1" } }
4801 <- { "return": [ {"duplex": "full", "enabled": true, "name": "sw1.1",
4802 "autoneg": "off", "link-up": true, "speed": 10000},
4803 {"duplex": "full", "enabled": true, "name": "sw1.2",
4804 "autoneg": "off", "link-up": true, "speed": 10000}
4810 .name = "query-rocker-of-dpa-flows",
4811 .args_type = "name:s,tbl-id:i?",
4815 Show rocker switch OF-DPA flow tables
4816 -------------------------------------
4820 - "name": switch name
4821 - "tbl-id": (optional) flow table ID
4825 -> { "execute": "query-rocker-of-dpa-flows", "arguments": { "name": "sw1" } }
4826 <- { "return": [ {"key": {"in-pport": 0, "priority": 1, "tbl-id": 0},
4829 "action": {"goto-tbl": 10},
4830 "mask": {"in-pport": 4294901760}
4838 .name = "query-rocker-of-dpa-groups",
4839 .args_type = "name:s,type:i?",
4843 Show rocker OF-DPA group tables
4844 -------------------------------
4848 - "name": switch name
4849 - "type": (optional) group type
4853 -> { "execute": "query-rocker-of-dpa-groups", "arguments": { "name": "sw1" } }
4854 <- { "return": [ {"type": 0, "out-pport": 2, "pport": 2, "vlan-id": 3841,
4855 "pop-vlan": 1, "id": 251723778},
4856 {"type": 0, "out-pport": 0, "pport": 0, "vlan-id": 3841,
4857 "pop-vlan": 1, "id": 251723776},
4858 {"type": 0, "out-pport": 1, "pport": 1, "vlan-id": 3840,
4859 "pop-vlan": 1, "id": 251658241},
4860 {"type": 0, "out-pport": 0, "pport": 0, "vlan-id": 3840,
4861 "pop-vlan": 1, "id": 251658240}
4866 #if defined TARGET_ARM
4868 .name = "query-gic-capabilities",
4874 query-gic-capabilities
4877 Return a list of GICCapability objects, describing supported GIC
4878 (Generic Interrupt Controller) versions.
4884 -> { "execute": "query-gic-capabilities" }
4885 <- { "return": [{ "version": 2, "emulated": true, "kernel": false },
4886 { "version": 3, "emulated": false, "kernel": true } ] }
4891 .name = "query-hotpluggable-cpus",
4896 Show existing/possible CPUs
4897 ---------------------------
4901 Example for pseries machine type started with
4902 -smp 2,cores=2,maxcpus=4 -cpu POWER8:
4904 -> { "execute": "query-hotpluggable-cpus" }
4906 { "props": { "core-id": 8 }, "type": "POWER8-spapr-cpu-core",
4908 { "props": { "core-id": 0 }, "type": "POWER8-spapr-cpu-core",
4909 "vcpus-count": 1, "qom-path": "/machine/unattached/device[0]"}
4912 Example for pc machine type started with
4914 -> { "execute": "query-hotpluggable-cpus" }
4917 "type": "qemu64-x86_64-cpu", "vcpus-count": 1,
4918 "props": {"core-id": 0, "socket-id": 1, "thread-id": 0}
4921 "qom-path": "/machine/unattached/device[0]",
4922 "type": "qemu64-x86_64-cpu", "vcpus-count": 1,
4923 "props": {"core-id": 0, "socket-id": 0, "thread-id": 0}