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?",
1399 block-dirty-bitmap-add
1400 ----------------------
1403 Create a dirty bitmap with a name on the device, and start tracking the writes.
1407 - "node": device/node on which to create dirty bitmap (json-string)
1408 - "name": name of the new dirty bitmap (json-string)
1409 - "granularity": granularity to track writes with (int, optional)
1413 -> { "execute": "block-dirty-bitmap-add", "arguments": { "node": "drive0",
1414 "name": "bitmap0" } }
1420 .name = "block-dirty-bitmap-remove",
1421 .args_type = "node:B,name:s",
1426 block-dirty-bitmap-remove
1427 -------------------------
1430 Stop write tracking and remove the dirty bitmap that was created with
1431 block-dirty-bitmap-add.
1435 - "node": device/node on which to remove dirty bitmap (json-string)
1436 - "name": name of the dirty bitmap to remove (json-string)
1440 -> { "execute": "block-dirty-bitmap-remove", "arguments": { "node": "drive0",
1441 "name": "bitmap0" } }
1447 .name = "block-dirty-bitmap-clear",
1448 .args_type = "node:B,name:s",
1453 block-dirty-bitmap-clear
1454 ------------------------
1457 Reset the dirty bitmap associated with a node so that an incremental backup
1458 from this point in time forward will only backup clusters modified after this
1463 - "node": device/node on which to remove dirty bitmap (json-string)
1464 - "name": name of the dirty bitmap to remove (json-string)
1468 -> { "execute": "block-dirty-bitmap-clear", "arguments": { "node": "drive0",
1469 "name": "bitmap0" } }
1475 .name = "blockdev-snapshot-sync",
1476 .args_type = "device:s?,node-name:s?,snapshot-file:s,snapshot-node-name:s?,format:s?,mode:s?",
1480 blockdev-snapshot-sync
1481 ----------------------
1483 Synchronous snapshot of a block device. snapshot-file specifies the
1484 target of the new image. If the file exists, or if it is a device, the
1485 snapshot will be created in the existing file/device. If does not
1486 exist, a new file will be created. format specifies the format of the
1487 snapshot image, default is qcow2.
1491 - "device": device name to snapshot (json-string)
1492 - "node-name": graph node name to snapshot (json-string)
1493 - "snapshot-file": name of new image file (json-string)
1494 - "snapshot-node-name": graph node name of the new snapshot (json-string)
1495 - "mode": whether and how QEMU should create the snapshot file
1496 (NewImageMode, optional, default "absolute-paths")
1497 - "format": format of new image (json-string, optional)
1501 -> { "execute": "blockdev-snapshot-sync", "arguments": { "device": "ide-hd0",
1503 "/some/place/my-image",
1504 "format": "qcow2" } }
1510 .name = "blockdev-snapshot",
1511 .args_type = "node:s,overlay:s",
1519 Create a snapshot, by installing 'node' as the backing image of
1520 'overlay'. Additionally, if 'node' is associated with a block
1521 device, the block device changes to using 'overlay' as its new active
1526 - "node": device that will have a snapshot created (json-string)
1527 - "overlay": device that will have 'node' as its backing image (json-string)
1531 -> { "execute": "blockdev-add",
1532 "arguments": { "options": { "driver": "qcow2",
1533 "node-name": "node1534",
1534 "file": { "driver": "file",
1535 "filename": "hd1.qcow2" },
1540 -> { "execute": "blockdev-snapshot", "arguments": { "node": "ide-hd0",
1541 "overlay": "node1534" } }
1547 .name = "blockdev-snapshot-internal-sync",
1548 .args_type = "device:B,name:s",
1552 blockdev-snapshot-internal-sync
1553 -------------------------------
1555 Synchronously take an internal snapshot of a block device when the format of
1556 image used supports it. If the name is an empty string, or a snapshot with
1557 name already exists, the operation will fail.
1561 - "device": the device name or node-name of a root node to snapshot
1563 - "name": name of the new snapshot (json-string)
1567 -> { "execute": "blockdev-snapshot-internal-sync",
1568 "arguments": { "device": "ide-hd0",
1569 "name": "snapshot0" }
1576 .name = "blockdev-snapshot-delete-internal-sync",
1577 .args_type = "device:B,id:s?,name:s?",
1581 blockdev-snapshot-delete-internal-sync
1582 --------------------------------------
1584 Synchronously delete an internal snapshot of a block device when the format of
1585 image used supports it. The snapshot is identified by name or id or both. One
1586 of name or id is required. If the snapshot is not found, the operation will
1591 - "device": the device name or node-name of a root node (json-string)
1592 - "id": ID of the snapshot (json-string, optional)
1593 - "name": name of the snapshot (json-string, optional)
1597 -> { "execute": "blockdev-snapshot-delete-internal-sync",
1598 "arguments": { "device": "ide-hd0",
1599 "name": "snapshot0" }
1603 "name": "snapshot0",
1605 "date-sec": 1000012,
1607 "vm-clock-sec": 100,
1615 .name = "drive-mirror",
1616 .args_type = "job-id:s?,sync:s,device:B,target:s,speed:i?,mode:s?,"
1617 "format:s?,node-name:s?,replaces:s?,"
1618 "on-source-error:s?,on-target-error:s?,"
1620 "granularity:i?,buf-size:i?",
1627 Start mirroring a block device's writes to a new destination. target
1628 specifies the target of the new image. If the file exists, or if it is
1629 a device, it will be used as the new destination for writes. If it does not
1630 exist, a new file will be created. format specifies the format of the
1631 mirror image, default is to probe if mode='existing', else the format
1636 - "job-id": Identifier for the newly-created block job. If omitted,
1637 the device name will be used. (json-string, optional)
1638 - "device": the device name or node-name of a root node whose writes should be
1639 mirrored. (json-string)
1640 - "target": name of new image file (json-string)
1641 - "format": format of new image (json-string, optional)
1642 - "node-name": the name of the new block driver state in the node graph
1643 (json-string, optional)
1644 - "replaces": the block driver node name to replace when finished
1645 (json-string, optional)
1646 - "mode": how an image file should be created into the target
1647 file/device (NewImageMode, optional, default 'absolute-paths')
1648 - "speed": maximum speed of the streaming job, in bytes per second
1650 - "granularity": granularity of the dirty bitmap, in bytes (json-int, optional)
1651 - "buf-size": maximum amount of data in flight from source to target, in bytes
1652 (json-int, default 10M)
1653 - "sync": what parts of the disk image should be copied to the destination;
1654 possibilities include "full" for all the disk, "top" for only the sectors
1655 allocated in the topmost image, or "none" to only replicate new I/O
1657 - "on-source-error": the action to take on an error on the source
1658 (BlockdevOnError, default 'report')
1659 - "on-target-error": the action to take on an error on the target
1660 (BlockdevOnError, default 'report')
1661 - "unmap": whether the target sectors should be discarded where source has only
1662 zeroes. (json-bool, optional, default true)
1664 The default value of the granularity is the image cluster size clamped
1665 between 4096 and 65536, if the image format defines one. If the format
1666 does not define a cluster size, the default value of the granularity
1672 -> { "execute": "drive-mirror", "arguments": { "device": "ide-hd0",
1673 "target": "/some/place/my-image",
1675 "format": "qcow2" } }
1681 .name = "blockdev-mirror",
1682 .args_type = "job-id:s?,sync:s,device:B,target:B,replaces:s?,speed:i?,"
1683 "on-source-error:s?,on-target-error:s?,"
1684 "granularity:i?,buf-size:i?",
1691 Start mirroring a block device's writes to another block device. target
1692 specifies the target of mirror operation.
1696 - "job-id": Identifier for the newly-created block job. If omitted,
1697 the device name will be used. (json-string, optional)
1698 - "device": The device name or node-name of a root node whose writes should be
1699 mirrored (json-string)
1700 - "target": device name to mirror to (json-string)
1701 - "replaces": the block driver node name to replace when finished
1702 (json-string, optional)
1703 - "speed": maximum speed of the streaming job, in bytes per second
1705 - "granularity": granularity of the dirty bitmap, in bytes (json-int, optional)
1706 - "buf_size": maximum amount of data in flight from source to target, in bytes
1707 (json-int, default 10M)
1708 - "sync": what parts of the disk image should be copied to the destination;
1709 possibilities include "full" for all the disk, "top" for only the sectors
1710 allocated in the topmost image, or "none" to only replicate new I/O
1712 - "on-source-error": the action to take on an error on the source
1713 (BlockdevOnError, default 'report')
1714 - "on-target-error": the action to take on an error on the target
1715 (BlockdevOnError, default 'report')
1717 The default value of the granularity is the image cluster size clamped
1718 between 4096 and 65536, if the image format defines one. If the format
1719 does not define a cluster size, the default value of the granularity
1724 -> { "execute": "blockdev-mirror", "arguments": { "device": "ide-hd0",
1725 "target": "target0",
1731 .name = "change-backing-file",
1732 .args_type = "device:s,image-node-name:s,backing-file:s",
1740 Change the backing file in the image file metadata. This does not cause
1741 QEMU to reopen the image file to reparse the backing filename (it may,
1742 however, perform a reopen to change permissions from r/o -> r/w -> r/o,
1743 if needed). The new backing file string is written into the image file
1744 metadata, and the QEMU internal strings are updated.
1748 - "image-node-name": The name of the block driver state node of the
1749 image to modify. The "device" is argument is used to
1750 verify "image-node-name" is in the chain described by
1752 (json-string, optional)
1754 - "device": The device name or node-name of the root node that owns
1758 - "backing-file": The string to write as the backing file. This string is
1759 not validated, so care should be taken when specifying
1760 the string or the image chain may not be able to be
1764 Returns: Nothing on success
1765 If "device" does not exist or cannot be determined, DeviceNotFound
1771 .args_type = "value:M",
1778 Request VM to change its memory allocation (in bytes).
1782 - "value": New memory allocation (json-int)
1786 -> { "execute": "balloon", "arguments": { "value": 536870912 } }
1793 .args_type = "name:s,up:b",
1800 Change the link status of a network adapter.
1804 - "name": network device name (json-string)
1805 - "up": status is up (json-bool)
1809 -> { "execute": "set_link", "arguments": { "name": "e1000.0", "up": false } }
1816 .args_type = "fdname:s",
1817 .params = "getfd name",
1818 .help = "receive a file descriptor via SCM rights and assign it a name",
1825 Receive a file descriptor via SCM rights and assign it a name.
1829 - "fdname": file descriptor name (json-string)
1833 -> { "execute": "getfd", "arguments": { "fdname": "fd1" } }
1838 (1) If the name specified by the "fdname" argument already exists,
1839 the file descriptor assigned to it will be closed and replaced
1840 by the received file descriptor.
1841 (2) The 'closefd' command can be used to explicitly close the file
1842 descriptor when it is no longer needed.
1848 .args_type = "fdname:s",
1849 .params = "closefd name",
1850 .help = "close a file descriptor previously passed via SCM rights",
1857 Close a file descriptor previously passed via SCM rights.
1861 - "fdname": file descriptor name (json-string)
1865 -> { "execute": "closefd", "arguments": { "fdname": "fd1" } }
1872 .args_type = "fdset-id:i?,opaque:s?",
1873 .params = "add-fd fdset-id opaque",
1874 .help = "Add a file descriptor, that was passed via SCM rights, to an fd set",
1881 Add a file descriptor, that was passed via SCM rights, to an fd set.
1885 - "fdset-id": The ID of the fd set to add the file descriptor to.
1886 (json-int, optional)
1887 - "opaque": A free-form string that can be used to describe the fd.
1888 (json-string, optional)
1890 Return a json-object with the following information:
1892 - "fdset-id": The ID of the fd set that the fd was added to. (json-int)
1893 - "fd": The file descriptor that was received via SCM rights and added to the
1898 -> { "execute": "add-fd", "arguments": { "fdset-id": 1 } }
1899 <- { "return": { "fdset-id": 1, "fd": 3 } }
1903 (1) The list of fd sets is shared by all monitor connections.
1904 (2) If "fdset-id" is not specified, a new fd set will be created.
1909 .name = "remove-fd",
1910 .args_type = "fdset-id:i,fd:i?",
1911 .params = "remove-fd fdset-id fd",
1912 .help = "Remove a file descriptor from an fd set",
1919 Remove a file descriptor from an fd set.
1923 - "fdset-id": The ID of the fd set that the file descriptor belongs to.
1925 - "fd": The file descriptor that is to be removed. (json-int, optional)
1929 -> { "execute": "remove-fd", "arguments": { "fdset-id": 1, "fd": 3 } }
1934 (1) The list of fd sets is shared by all monitor connections.
1935 (2) If "fd" is not specified, all file descriptors in "fdset-id" will be
1941 .name = "query-fdsets",
1943 .help = "Return information describing all fd sets",
1950 Return information describing all fd sets.
1956 -> { "execute": "query-fdsets" }
1962 "opaque": "rdonly:/path/to/file"
1966 "opaque": "rdwr:/path/to/file"
1985 Note: The list of fd sets is shared by all monitor connections.
1990 .name = "block_passwd",
1991 .args_type = "device:s?,node-name:s?,password:s",
1998 Set the password of encrypted block devices.
2002 - "device": device name (json-string)
2003 - "node-name": name in the block driver state graph (json-string)
2004 - "password": password (json-string)
2008 -> { "execute": "block_passwd", "arguments": { "device": "ide0-hd0",
2009 "password": "12345" } }
2015 .name = "block_set_io_throttle",
2016 .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?",
2020 block_set_io_throttle
2023 Change I/O throttle limits for a block drive.
2027 - "device": device name (json-string)
2028 - "bps": total throughput limit in bytes per second (json-int)
2029 - "bps_rd": read throughput limit in bytes per second (json-int)
2030 - "bps_wr": write throughput limit in bytes per second (json-int)
2031 - "iops": total I/O operations per second (json-int)
2032 - "iops_rd": read I/O operations per second (json-int)
2033 - "iops_wr": write I/O operations per second (json-int)
2034 - "bps_max": total throughput limit during bursts, in bytes (json-int, optional)
2035 - "bps_rd_max": read throughput limit during bursts, in bytes (json-int, optional)
2036 - "bps_wr_max": write throughput limit during bursts, in bytes (json-int, optional)
2037 - "iops_max": total I/O operations per second during bursts (json-int, optional)
2038 - "iops_rd_max": read I/O operations per second during bursts (json-int, optional)
2039 - "iops_wr_max": write I/O operations per second during bursts (json-int, optional)
2040 - "bps_max_length": maximum length of the @bps_max burst period, in seconds (json-int, optional)
2041 - "bps_rd_max_length": maximum length of the @bps_rd_max burst period, in seconds (json-int, optional)
2042 - "bps_wr_max_length": maximum length of the @bps_wr_max burst period, in seconds (json-int, optional)
2043 - "iops_max_length": maximum length of the @iops_max burst period, in seconds (json-int, optional)
2044 - "iops_rd_max_length": maximum length of the @iops_rd_max burst period, in seconds (json-int, optional)
2045 - "iops_wr_max_length": maximum length of the @iops_wr_max burst period, in seconds (json-int, optional)
2046 - "iops_size": I/O size in bytes when limiting (json-int, optional)
2047 - "group": throttle group name (json-string, optional)
2051 -> { "execute": "block_set_io_throttle", "arguments": { "device": "virtio0",
2064 "bps_max_length": 60,
2071 .name = "set_password",
2072 .args_type = "protocol:s,password:s,connected:s?",
2079 Set the password for vnc/spice protocols.
2083 - "protocol": protocol name (json-string)
2084 - "password": password (json-string)
2085 - "connected": [ keep | disconnect | fail ] (json-string, optional)
2089 -> { "execute": "set_password", "arguments": { "protocol": "vnc",
2090 "password": "secret" } }
2096 .name = "expire_password",
2097 .args_type = "protocol:s,time:s",
2104 Set the password expire time for vnc/spice protocols.
2108 - "protocol": protocol name (json-string)
2109 - "time": [ now | never | +secs | secs ] (json-string)
2113 -> { "execute": "expire_password", "arguments": { "protocol": "vnc",
2120 .name = "add_client",
2121 .args_type = "protocol:s,fdname:s,skipauth:b?,tls:b?",
2128 Add a graphics client
2132 - "protocol": protocol name (json-string)
2133 - "fdname": file descriptor name (json-string)
2134 - "skipauth": whether to skip authentication (json-bool, optional)
2135 - "tls": whether to perform TLS (json-bool, optional)
2139 -> { "execute": "add_client", "arguments": { "protocol": "vnc",
2140 "fdname": "myclient" } }
2145 .name = "qmp_capabilities",
2148 .help = "enable QMP capabilities",
2155 Enable QMP capabilities.
2161 -> { "execute": "qmp_capabilities" }
2164 Note: This command must be issued before issuing any other command.
2169 .name = "human-monitor-command",
2170 .args_type = "command-line:s,cpu-index:i?",
2174 human-monitor-command
2175 ---------------------
2177 Execute a Human Monitor command.
2181 - command-line: the command name and its arguments, just like the
2182 Human Monitor's shell (json-string)
2183 - cpu-index: select the CPU number to be used by commands which access CPU
2184 data, like 'info registers'. The Monitor selects CPU 0 if this
2185 argument is not provided (json-int, optional)
2189 -> { "execute": "human-monitor-command", "arguments": { "command-line": "info kvm" } }
2190 <- { "return": "kvm support: enabled\r\n" }
2194 (1) The Human Monitor is NOT an stable interface, this means that command
2195 names, arguments and responses can change or be removed at ANY time.
2196 Applications that rely on long term stability guarantees should NOT
2201 o This command is stateless, this means that commands that depend
2202 on state information (such as getfd) might not work
2204 o Commands that prompt the user for data (eg. 'cont' when the block
2205 device is encrypted) don't currently work
2210 HXCOMM Each query command below is inside a SQMP/EQMP section, do NOT change
2211 HXCOMM this! We will possibly move query commands definitions inside those
2212 HXCOMM sections, just like regular commands.
2222 Return a json-object with the following information:
2224 - "qemu": A json-object containing three integer values:
2225 - "major": QEMU's major version (json-int)
2226 - "minor": QEMU's minor version (json-int)
2227 - "micro": QEMU's micro version (json-int)
2228 - "package": package's version (json-string)
2232 -> { "execute": "query-version" }
2247 .name = "query-version",
2255 List QMP available commands.
2257 Each command is represented by a json-object, the returned value is a json-array
2260 Each json-object contain:
2262 - "name": command's name (json-string)
2266 -> { "execute": "query-commands" }
2270 "name":"query-balloon"
2273 "name":"system_powerdown"
2278 Note: This example has been shortened as the real response is too long.
2283 .name = "query-commands",
2291 List QMP available events.
2293 Each event is represented by a json-object, the returned value is a json-array
2296 Each json-object contains:
2298 - "name": event's name (json-string)
2302 -> { "execute": "query-events" }
2314 Note: This example has been shortened as the real response is too long.
2319 .name = "query-events",
2327 Return the QMP wire schema. The returned value is a json-array of
2328 named schema entities. Entities are commands, events and various
2329 types. See docs/qapi-code-gen.txt for information on their structure
2335 .name = "query-qmp-schema",
2343 Each device is represented by a json-object. The returned value is a json-array
2346 Each json-object contain the following:
2348 - "label": device's label (json-string)
2349 - "filename": device's file (json-string)
2350 - "frontend-open": open/closed state of the frontend device attached to this
2355 -> { "execute": "query-chardev" }
2359 "label": "charchannel0",
2360 "filename": "unix:/var/lib/libvirt/qemu/seabios.rhel6.agent,server",
2361 "frontend-open": false
2364 "label": "charmonitor",
2365 "filename": "unix:/var/lib/libvirt/qemu/seabios.rhel6.monitor,server",
2366 "frontend-open": true
2369 "label": "charserial0",
2370 "filename": "pty:/dev/pts/2",
2371 "frontend-open": true
2379 .name = "query-chardev",
2384 query-chardev-backends
2387 List available character device backends.
2389 Each backend is represented by a json-object, the returned value is a json-array
2392 Each json-object contains:
2394 - "name": backend name (json-string)
2398 -> { "execute": "query-chardev-backends" }
2419 .name = "query-chardev-backends",
2427 Show the block devices.
2429 Each block device information is stored in a json-object and the returned value
2430 is a json-array of all devices.
2432 Each json-object contain the following:
2434 - "device": device name (json-string)
2435 - "type": device type (json-string)
2436 - deprecated, retained for backward compatibility
2437 - Possible values: "unknown"
2438 - "removable": true if the device is removable, false otherwise (json-bool)
2439 - "locked": true if the device is locked, false otherwise (json-bool)
2440 - "tray_open": only present if removable, true if the device has a tray,
2441 and it is open (json-bool)
2442 - "inserted": only present if the device is inserted, it is a json-object
2443 containing the following:
2444 - "file": device file name (json-string)
2445 - "ro": true if read-only, false otherwise (json-bool)
2446 - "drv": driver format name (json-string)
2447 - Possible values: "blkdebug", "bochs", "cloop", "dmg",
2448 "file", "file", "ftp", "ftps", "host_cdrom",
2449 "host_device", "http", "https",
2450 "nbd", "parallels", "qcow", "qcow2", "raw",
2451 "tftp", "vdi", "vmdk", "vpc", "vvfat"
2452 - "backing_file": backing file name (json-string, optional)
2453 - "backing_file_depth": number of files in the backing file chain (json-int)
2454 - "encrypted": true if encrypted, false otherwise (json-bool)
2455 - "bps": limit total bytes per second (json-int)
2456 - "bps_rd": limit read bytes per second (json-int)
2457 - "bps_wr": limit write bytes per second (json-int)
2458 - "iops": limit total I/O operations per second (json-int)
2459 - "iops_rd": limit read operations per second (json-int)
2460 - "iops_wr": limit write operations per second (json-int)
2461 - "bps_max": total max in bytes (json-int)
2462 - "bps_rd_max": read max in bytes (json-int)
2463 - "bps_wr_max": write max in bytes (json-int)
2464 - "iops_max": total I/O operations max (json-int)
2465 - "iops_rd_max": read I/O operations max (json-int)
2466 - "iops_wr_max": write I/O operations max (json-int)
2467 - "iops_size": I/O size when limiting by iops (json-int)
2468 - "detect_zeroes": detect and optimize zero writing (json-string)
2469 - Possible values: "off", "on", "unmap"
2470 - "write_threshold": write offset threshold in bytes, a event will be
2471 emitted if crossed. Zero if disabled (json-int)
2472 - "image": the detail of the image, it is a json-object containing
2474 - "filename": image file name (json-string)
2475 - "format": image format (json-string)
2476 - "virtual-size": image capacity in bytes (json-int)
2477 - "dirty-flag": true if image is not cleanly closed, not present
2478 means clean (json-bool, optional)
2479 - "actual-size": actual size on disk in bytes of the image, not
2480 present when image does not support thin
2481 provision (json-int, optional)
2482 - "cluster-size": size of a cluster in bytes, not present if image
2483 format does not support it (json-int, optional)
2484 - "encrypted": true if the image is encrypted, not present means
2485 false or the image format does not support
2486 encryption (json-bool, optional)
2487 - "backing_file": backing file name, not present means no backing
2488 file is used or the image format does not
2489 support backing file chain
2490 (json-string, optional)
2491 - "full-backing-filename": full path of the backing file, not
2492 present if it equals backing_file or no
2493 backing file is used
2494 (json-string, optional)
2495 - "backing-filename-format": the format of the backing file, not
2496 present means unknown or no backing
2497 file (json-string, optional)
2498 - "snapshots": the internal snapshot info, it is an optional list
2499 of json-object containing the following:
2500 - "id": unique snapshot id (json-string)
2501 - "name": snapshot name (json-string)
2502 - "vm-state-size": size of the VM state in bytes (json-int)
2503 - "date-sec": UTC date of the snapshot in seconds (json-int)
2504 - "date-nsec": fractional part in nanoseconds to be used with
2506 - "vm-clock-sec": VM clock relative to boot in seconds
2508 - "vm-clock-nsec": fractional part in nanoseconds to be used
2509 with vm-clock-sec (json-int)
2510 - "backing-image": the detail of the backing image, it is an
2511 optional json-object only present when a
2512 backing image present for this image
2514 - "io-status": I/O operation status, only present if the device supports it
2515 and the VM is configured to stop on errors. It's always reset
2516 to "ok" when the "cont" command is issued (json_string, optional)
2517 - Possible values: "ok", "failed", "nospace"
2521 -> { "execute": "query-block" }
2526 "device":"ide0-hd0",
2533 "file":"disks/test.qcow2",
2534 "backing_file_depth":1,
2548 "detect_zeroes": "on",
2549 "write_threshold": 0,
2551 "filename":"disks/test.qcow2",
2553 "virtual-size":2048000,
2554 "backing_file":"base.qcow2",
2555 "full-backing-filename":"disks/base.qcow2",
2556 "backing-filename-format":"qcow2",
2560 "name": "snapshot1",
2562 "date-sec": 10000200,
2564 "vm-clock-sec": 206,
2569 "filename":"disks/base.qcow2",
2571 "virtual-size":2048000
2579 "device":"ide1-cd0",
2602 .name = "query-block",
2610 Show block device statistics.
2612 Each device statistic information is stored in a json-object and the returned
2613 value is a json-array of all devices.
2615 Each json-object contain the following:
2617 - "device": device name (json-string)
2618 - "stats": A json-object with the statistics information, it contains:
2619 - "rd_bytes": bytes read (json-int)
2620 - "wr_bytes": bytes written (json-int)
2621 - "rd_operations": read operations (json-int)
2622 - "wr_operations": write operations (json-int)
2623 - "flush_operations": cache flush operations (json-int)
2624 - "wr_total_time_ns": total time spend on writes in nano-seconds (json-int)
2625 - "rd_total_time_ns": total time spend on reads in nano-seconds (json-int)
2626 - "flush_total_time_ns": total time spend on cache flushes in nano-seconds (json-int)
2627 - "wr_highest_offset": The offset after the greatest byte written to the
2628 BlockDriverState since it has been opened (json-int)
2629 - "rd_merged": number of read requests that have been merged into
2630 another request (json-int)
2631 - "wr_merged": number of write requests that have been merged into
2632 another request (json-int)
2633 - "idle_time_ns": time since the last I/O operation, in
2634 nanoseconds. If the field is absent it means
2635 that there haven't been any operations yet
2636 (json-int, optional)
2637 - "failed_rd_operations": number of failed read operations
2639 - "failed_wr_operations": number of failed write operations
2641 - "failed_flush_operations": number of failed flush operations
2643 - "invalid_rd_operations": number of invalid read operations
2645 - "invalid_wr_operations": number of invalid write operations
2647 - "invalid_flush_operations": number of invalid flush operations
2649 - "account_invalid": whether invalid operations are included in
2650 the last access statistics (json-bool)
2651 - "account_failed": whether failed operations are included in the
2652 latency and last access statistics
2654 - "timed_stats": A json-array containing statistics collected in
2655 specific intervals, with the following members:
2656 - "interval_length": interval used for calculating the
2657 statistics, in seconds (json-int)
2658 - "min_rd_latency_ns": minimum latency of read operations in
2659 the defined interval, in nanoseconds
2661 - "min_wr_latency_ns": minimum latency of write operations in
2662 the defined interval, in nanoseconds
2664 - "min_flush_latency_ns": minimum latency of flush operations
2665 in the defined interval, in
2666 nanoseconds (json-int)
2667 - "max_rd_latency_ns": maximum latency of read operations in
2668 the defined interval, in nanoseconds
2670 - "max_wr_latency_ns": maximum latency of write operations in
2671 the defined interval, in nanoseconds
2673 - "max_flush_latency_ns": maximum latency of flush operations
2674 in the defined interval, in
2675 nanoseconds (json-int)
2676 - "avg_rd_latency_ns": average latency of read operations in
2677 the defined interval, in nanoseconds
2679 - "avg_wr_latency_ns": average latency of write operations in
2680 the defined interval, in nanoseconds
2682 - "avg_flush_latency_ns": average latency of flush operations
2683 in the defined interval, in
2684 nanoseconds (json-int)
2685 - "avg_rd_queue_depth": average number of pending read
2686 operations in the defined interval
2688 - "avg_wr_queue_depth": average number of pending write
2689 operations in the defined interval
2691 - "parent": Contains recursively the statistics of the underlying
2692 protocol (e.g. the host file for a qcow2 image). If there is
2693 no underlying protocol, this field is omitted
2694 (json-object, optional)
2698 -> { "execute": "query-blockstats" }
2702 "device":"ide0-hd0",
2705 "wr_highest_offset":3686448128,
2707 "wr_operations":751,
2708 "rd_bytes":122567168,
2709 "rd_operations":36772
2710 "wr_total_times_ns":313253456
2711 "rd_total_times_ns":3465673657
2712 "flush_total_times_ns":49653
2713 "flush_operations":61,
2716 "idle_time_ns":2953431879,
2717 "account_invalid":true,
2718 "account_failed":false
2722 "wr_highest_offset":2821110784,
2724 "wr_operations":692,
2725 "rd_bytes":122739200,
2726 "rd_operations":36604
2727 "flush_operations":51,
2728 "wr_total_times_ns":313253456
2729 "rd_total_times_ns":3465673657
2730 "flush_total_times_ns":49653,
2733 "idle_time_ns":2953431879,
2734 "account_invalid":true,
2735 "account_failed":false
2739 "device":"ide1-cd0",
2741 "wr_highest_offset":0,
2746 "flush_operations":0,
2747 "wr_total_times_ns":0
2748 "rd_total_times_ns":0
2749 "flush_total_times_ns":0,
2752 "account_invalid":false,
2753 "account_failed":false
2759 "wr_highest_offset":0,
2764 "flush_operations":0,
2765 "wr_total_times_ns":0
2766 "rd_total_times_ns":0
2767 "flush_total_times_ns":0,
2770 "account_invalid":false,
2771 "account_failed":false
2777 "wr_highest_offset":0,
2782 "flush_operations":0,
2783 "wr_total_times_ns":0
2784 "rd_total_times_ns":0
2785 "flush_total_times_ns":0,
2788 "account_invalid":false,
2789 "account_failed":false
2798 .name = "query-blockstats",
2799 .args_type = "query-nodes:b?",
2806 Show CPU information.
2808 Return a json-array. Each CPU is represented by a json-object, which contains:
2810 - "CPU": CPU index (json-int)
2811 - "current": true if this is the current CPU, false otherwise (json-bool)
2812 - "halted": true if the cpu is halted, false otherwise (json-bool)
2813 - "qom_path": path to the CPU object in the QOM tree (json-str)
2814 - "arch": architecture of the cpu, which determines what additional
2815 keys will be present (json-str)
2816 - Current program counter. The key's name depends on the architecture:
2817 "pc": i386/x86_64 (json-int)
2818 "nip": PPC (json-int)
2819 "pc" and "npc": sparc (json-int)
2820 "PC": mips (json-int)
2821 - "thread_id": ID of the underlying host thread (json-int)
2825 -> { "execute": "query-cpus" }
2832 "qom_path":"/machine/unattached/device[0]",
2841 "qom_path":"/machine/unattached/device[2]",
2852 .name = "query-cpus",
2860 Returns a list of information about each iothread.
2862 Note this list excludes the QEMU main loop thread, which is not declared
2863 using the -object iothread command-line option. It is always the main thread
2866 Return a json-array. Each iothread is represented by a json-object, which contains:
2868 - "id": name of iothread (json-str)
2869 - "thread-id": ID of the underlying host thread (json-int)
2873 -> { "execute": "query-iothreads" }
2890 .name = "query-iothreads",
2898 PCI buses and devices information.
2900 The returned value is a json-array of all buses. Each bus is represented by
2901 a json-object, which has a key with a json-array of all PCI devices attached
2902 to it. Each device is represented by a json-object.
2904 The bus json-object contains the following:
2906 - "bus": bus number (json-int)
2907 - "devices": a json-array of json-objects, each json-object represents a
2910 The PCI device json-object contains the following:
2912 - "bus": identical to the parent's bus number (json-int)
2913 - "slot": slot number (json-int)
2914 - "function": function number (json-int)
2915 - "class_info": a json-object containing:
2916 - "desc": device class description (json-string, optional)
2917 - "class": device class number (json-int)
2918 - "id": a json-object containing:
2919 - "device": device ID (json-int)
2920 - "vendor": vendor ID (json-int)
2921 - "irq": device's IRQ if assigned (json-int, optional)
2922 - "qdev_id": qdev id string (json-string)
2923 - "pci_bridge": It's a json-object, only present if this device is a
2924 PCI bridge, contains:
2925 - "bus": bus number (json-int)
2926 - "secondary": secondary bus number (json-int)
2927 - "subordinate": subordinate bus number (json-int)
2928 - "io_range": I/O memory range information, a json-object with the
2930 - "base": base address, in bytes (json-int)
2931 - "limit": limit address, in bytes (json-int)
2932 - "memory_range": memory range information, a json-object with the
2934 - "base": base address, in bytes (json-int)
2935 - "limit": limit address, in bytes (json-int)
2936 - "prefetchable_range": Prefetchable memory range information, a
2937 json-object with the following members:
2938 - "base": base address, in bytes (json-int)
2939 - "limit": limit address, in bytes (json-int)
2940 - "devices": a json-array of PCI devices if there's any attached, each
2941 each element is represented by a json-object, which contains
2942 the same members of the 'PCI device json-object' described
2944 - "regions": a json-array of json-objects, each json-object represents a
2945 memory region of this device
2947 The memory range json-object contains the following:
2949 - "base": base memory address (json-int)
2950 - "limit": limit value (json-int)
2952 The region json-object can be an I/O region or a memory region, an I/O region
2953 json-object contains the following:
2955 - "type": "io" (json-string, fixed)
2956 - "bar": BAR number (json-int)
2957 - "address": memory address (json-int)
2958 - "size": memory size (json-int)
2960 A memory region json-object contains the following:
2962 - "type": "memory" (json-string, fixed)
2963 - "bar": BAR number (json-int)
2964 - "address": memory address (json-int)
2965 - "size": memory size (json-int)
2966 - "mem_type_64": true or false (json-bool)
2967 - "prefetch": true or false (json-bool)
2971 -> { "execute": "query-pci" }
2983 "desc":"Host bridge"
3017 "desc":"IDE controller"
3039 "desc":"VGA controller"
3049 "mem_type_64":false,
3052 "address":4026531840,
3057 "mem_type_64":false,
3060 "address":4060086272,
3065 "mem_type_64":false,
3080 "desc":"RAM controller"
3101 Note: This example has been shortened as the real response is too long.
3106 .name = "query-pci",
3114 Show KVM information.
3116 Return a json-object with the following information:
3118 - "enabled": true if KVM support is enabled, false otherwise (json-bool)
3119 - "present": true if QEMU has KVM support, false otherwise (json-bool)
3123 -> { "execute": "query-kvm" }
3124 <- { "return": { "enabled": true, "present": true } }
3129 .name = "query-kvm",
3137 Return a json-object with the following information:
3139 - "running": true if the VM is running, or false if it is paused (json-bool)
3140 - "singlestep": true if the VM is in single step mode,
3141 false otherwise (json-bool)
3142 - "status": one of the following values (json-string)
3143 "debug" - QEMU is running on a debugger
3144 "inmigrate" - guest is paused waiting for an incoming migration
3145 "internal-error" - An internal error that prevents further guest
3146 execution has occurred
3147 "io-error" - the last IOP has failed and the device is configured
3148 to pause on I/O errors
3149 "paused" - guest has been paused via the 'stop' command
3150 "postmigrate" - guest is paused following a successful 'migrate'
3151 "prelaunch" - QEMU was started with -S and guest has not started
3152 "finish-migrate" - guest is paused to finish the migration process
3153 "restore-vm" - guest is paused to restore VM state
3154 "running" - guest is actively running
3155 "save-vm" - guest is paused to save the VM state
3156 "shutdown" - guest is shut down (and -no-shutdown is in use)
3157 "watchdog" - the watchdog action is configured to pause and
3162 -> { "execute": "query-status" }
3163 <- { "return": { "running": true, "singlestep": false, "status": "running" } }
3168 .name = "query-status",
3176 Show VM mice information.
3178 Each mouse is represented by a json-object, the returned value is a json-array
3181 The mouse json-object contains the following:
3183 - "name": mouse's name (json-string)
3184 - "index": mouse's index (json-int)
3185 - "current": true if this mouse is receiving events, false otherwise (json-bool)
3186 - "absolute": true if the mouse generates absolute input events (json-bool)
3190 -> { "execute": "query-mice" }
3194 "name":"QEMU Microsoft Mouse",
3200 "name":"QEMU PS/2 Mouse",
3211 .name = "query-mice",
3219 Show VNC server information.
3221 Return a json-object with server information. Connected clients are returned
3222 as a json-array of json-objects.
3224 The main json-object contains the following:
3226 - "enabled": true or false (json-bool)
3227 - "host": server's IP address (json-string)
3228 - "family": address family (json-string)
3229 - Possible values: "ipv4", "ipv6", "unix", "unknown"
3230 - "service": server's port number (json-string)
3231 - "auth": authentication method (json-string)
3232 - Possible values: "invalid", "none", "ra2", "ra2ne", "sasl", "tight",
3233 "tls", "ultra", "unknown", "vencrypt", "vencrypt",
3234 "vencrypt+plain", "vencrypt+tls+none",
3235 "vencrypt+tls+plain", "vencrypt+tls+sasl",
3236 "vencrypt+tls+vnc", "vencrypt+x509+none",
3237 "vencrypt+x509+plain", "vencrypt+x509+sasl",
3238 "vencrypt+x509+vnc", "vnc"
3239 - "clients": a json-array of all connected clients
3241 Clients are described by a json-object, each one contain the following:
3243 - "host": client's IP address (json-string)
3244 - "family": address family (json-string)
3245 - Possible values: "ipv4", "ipv6", "unix", "unknown"
3246 - "service": client's port number (json-string)
3247 - "x509_dname": TLS dname (json-string, optional)
3248 - "sasl_username": SASL username (json-string, optional)
3252 -> { "execute": "query-vnc" }
3273 .name = "query-vnc",
3277 .name = "query-vnc-servers",
3285 Show SPICE server information.
3287 Return a json-object with server information. Connected clients are returned
3288 as a json-array of json-objects.
3290 The main json-object contains the following:
3292 - "enabled": true or false (json-bool)
3293 - "host": server's IP address (json-string)
3294 - "port": server's port number (json-int, optional)
3295 - "tls-port": server's port number (json-int, optional)
3296 - "auth": authentication method (json-string)
3297 - Possible values: "none", "spice"
3298 - "channels": a json-array of all active channels clients
3300 Channels are described by a json-object, each one contain the following:
3302 - "host": client's IP address (json-string)
3303 - "family": address family (json-string)
3304 - Possible values: "ipv4", "ipv6", "unix", "unknown"
3305 - "port": client's port number (json-string)
3306 - "connection-id": spice connection id. All channels with the same id
3307 belong to the same spice session (json-int)
3308 - "channel-type": channel type. "1" is the main control channel, filter for
3309 this one if you want track spice sessions only (json-int)
3310 - "channel-id": channel id. Usually "0", might be different needed when
3311 multiple channels of the same type exist, such as multiple
3312 display channels in a multihead setup (json-int)
3313 - "tls": whether the channel is encrypted (json-bool)
3317 -> { "execute": "query-spice" }
3330 "connection-id": 1804289383,
3331 "host": "127.0.0.1",
3339 "connection-id": 1804289383,
3340 "host": "127.0.0.1",
3344 [ ... more channels follow ... ]
3351 #if defined(CONFIG_SPICE)
3353 .name = "query-spice",
3364 Return a json-object with the following information:
3366 - "name": VM's name (json-string, optional)
3370 -> { "execute": "query-name" }
3371 <- { "return": { "name": "qemu-name" } }
3376 .name = "query-name",
3386 Return a json-object with the following information:
3388 - "UUID": Universally Unique Identifier (json-string)
3392 -> { "execute": "query-uuid" }
3393 <- { "return": { "UUID": "550e8400-e29b-41d4-a716-446655440000" } }
3398 .name = "query-uuid",
3403 query-command-line-options
3404 --------------------------
3406 Show command line option schema.
3408 Return a json-array of command line option schema for all options (or for
3409 the given option), returning an error if the given option doesn't exist.
3411 Each array entry contains the following:
3413 - "option": option name (json-string)
3414 - "parameters": a json-array describes all parameters of the option:
3415 - "name": parameter name (json-string)
3416 - "type": parameter type (one of 'string', 'boolean', 'number',
3418 - "help": human readable description of the parameter
3419 (json-string, optional)
3420 - "default": default value string for the parameter
3421 (json-string, optional)
3425 -> { "execute": "query-command-line-options", "arguments": { "option": "option-rom" } }
3434 "name": "bootindex",
3438 "option": "option-rom"
3446 .name = "query-command-line-options",
3447 .args_type = "option:s?",
3456 Return a json-object. If migration is active there will be another json-object
3457 with RAM migration status and if block migration is active another one with
3458 block migration status.
3460 The main json-object contains the following:
3462 - "status": migration status (json-string)
3463 - Possible values: "setup", "active", "completed", "failed", "cancelled"
3464 - "total-time": total amount of ms since migration started. If
3465 migration has ended, it returns the total migration
3467 - "setup-time" amount of setup time in milliseconds _before_ the
3468 iterations begin but _after_ the QMP command is issued.
3469 This is designed to provide an accounting of any activities
3470 (such as RDMA pinning) which may be expensive, but do not
3471 actually occur during the iterative migration rounds
3472 themselves. (json-int)
3473 - "downtime": only present when migration has finished correctly
3474 total amount in ms for downtime that happened (json-int)
3475 - "expected-downtime": only present while migration is active
3476 total amount in ms for downtime that was calculated on
3477 the last bitmap round (json-int)
3478 - "ram": only present if "status" is "active", it is a json-object with the
3479 following RAM information:
3480 - "transferred": amount transferred in bytes (json-int)
3481 - "remaining": amount remaining to transfer in bytes (json-int)
3482 - "total": total amount of memory in bytes (json-int)
3483 - "duplicate": number of pages filled entirely with the same
3485 These are sent over the wire much more efficiently.
3486 - "skipped": number of skipped zero pages (json-int)
3487 - "normal" : number of whole pages transferred. I.e. they
3488 were not sent as duplicate or xbzrle pages (json-int)
3489 - "normal-bytes" : number of bytes transferred in whole
3490 pages. This is just normal pages times size of one page,
3491 but this way upper levels don't need to care about page
3493 - "dirty-sync-count": times that dirty ram was synchronized (json-int)
3494 - "disk": only present if "status" is "active" and it is a block migration,
3495 it is a json-object with the following disk information:
3496 - "transferred": amount transferred in bytes (json-int)
3497 - "remaining": amount remaining to transfer in bytes json-int)
3498 - "total": total disk size in bytes (json-int)
3499 - "xbzrle-cache": only present if XBZRLE is active.
3500 It is a json-object with the following XBZRLE information:
3501 - "cache-size": XBZRLE cache size in bytes
3502 - "bytes": number of bytes transferred for XBZRLE compressed pages
3503 - "pages": number of XBZRLE compressed pages
3504 - "cache-miss": number of XBRZRLE page cache misses
3505 - "cache-miss-rate": rate of XBRZRLE page cache misses
3506 - "overflow": number of times XBZRLE overflows. This means
3507 that the XBZRLE encoding was bigger than just sent the
3508 whole page, and then we sent the whole page instead (as as
3513 1. Before the first migration
3515 -> { "execute": "query-migrate" }
3518 2. Migration is done and has succeeded
3520 -> { "execute": "query-migrate" }
3522 "status": "completed",
3532 "normal-bytes":123456,
3533 "dirty-sync-count":15
3538 3. Migration is done and has failed
3540 -> { "execute": "query-migrate" }
3541 <- { "return": { "status": "failed" } }
3543 4. Migration is being performed and is not a block migration:
3545 -> { "execute": "query-migrate" }
3555 "expected-downtime":12345,
3558 "normal-bytes":123456,
3559 "dirty-sync-count":15
3564 5. Migration is being performed and is a block migration:
3566 -> { "execute": "query-migrate" }
3572 "remaining":1053304,
3576 "expected-downtime":12345,
3579 "normal-bytes":123456,
3580 "dirty-sync-count":15
3584 "remaining":20880384,
3590 6. Migration is being performed and XBZRLE is active:
3592 -> { "execute": "query-migrate" }
3596 "capabilities" : [ { "capability": "xbzrle", "state" : true } ],
3599 "remaining":1053304,
3603 "expected-downtime":12345,
3606 "normal-bytes":3412992,
3607 "dirty-sync-count":15
3610 "cache-size":67108864,
3614 "cache-miss-rate":0.123,
3623 .name = "query-migrate",
3628 migrate-set-capabilities
3629 ------------------------
3631 Enable/Disable migration capabilities
3633 - "xbzrle": XBZRLE support
3634 - "rdma-pin-all": pin all pages when using RDMA during migration
3635 - "auto-converge": throttle down guest to help convergence of migration
3636 - "zero-blocks": compress zero blocks during block migration
3637 - "compress": use multiple compression threads to accelerate live migration
3638 - "events": generate events for each migration state change
3639 - "postcopy-ram": postcopy mode for live migration
3645 -> { "execute": "migrate-set-capabilities" , "arguments":
3646 { "capabilities": [ { "capability": "xbzrle", "state": true } ] } }
3651 .name = "migrate-set-capabilities",
3652 .args_type = "capabilities:q",
3653 .params = "capability:s,state:b",
3656 query-migrate-capabilities
3657 --------------------------
3659 Query current migration capabilities
3661 - "capabilities": migration capabilities state
3662 - "xbzrle" : XBZRLE state (json-bool)
3663 - "rdma-pin-all" : RDMA Pin Page state (json-bool)
3664 - "auto-converge" : Auto Converge state (json-bool)
3665 - "zero-blocks" : Zero Blocks state (json-bool)
3666 - "compress": Multiple compression threads state (json-bool)
3667 - "events": Migration state change event state (json-bool)
3668 - "postcopy-ram": postcopy ram state (json-bool)
3674 -> { "execute": "query-migrate-capabilities" }
3676 {"state": false, "capability": "xbzrle"},
3677 {"state": false, "capability": "rdma-pin-all"},
3678 {"state": false, "capability": "auto-converge"},
3679 {"state": false, "capability": "zero-blocks"},
3680 {"state": false, "capability": "compress"},
3681 {"state": true, "capability": "events"},
3682 {"state": false, "capability": "postcopy-ram"}
3688 .name = "query-migrate-capabilities",
3693 migrate-set-parameters
3694 ----------------------
3696 Set migration parameters
3698 - "compress-level": set compression level during migration (json-int)
3699 - "compress-threads": set compression thread count for migration (json-int)
3700 - "decompress-threads": set decompression thread count for migration (json-int)
3701 - "cpu-throttle-initial": set initial percentage of time guest cpus are
3702 throttled for auto-converge (json-int)
3703 - "cpu-throttle-increment": set throttle increasing percentage for
3704 auto-converge (json-int)
3710 -> { "execute": "migrate-set-parameters" , "arguments":
3711 { "compress-level": 1 } }
3716 .name = "migrate-set-parameters",
3718 "compress-level:i?,compress-threads:i?,decompress-threads:i?,cpu-throttle-initial:i?,cpu-throttle-increment:i?",
3721 query-migrate-parameters
3722 ------------------------
3724 Query current migration parameters
3726 - "parameters": migration parameters value
3727 - "compress-level" : compression level value (json-int)
3728 - "compress-threads" : compression thread count value (json-int)
3729 - "decompress-threads" : decompression thread count value (json-int)
3730 - "cpu-throttle-initial" : initial percentage of time guest cpus are
3731 throttled (json-int)
3732 - "cpu-throttle-increment" : throttle increasing percentage for
3733 auto-converge (json-int)
3739 -> { "execute": "query-migrate-parameters" }
3742 "decompress-threads": 2,
3743 "cpu-throttle-increment": 10,
3744 "compress-threads": 8,
3745 "compress-level": 1,
3746 "cpu-throttle-initial": 20
3753 .name = "query-migrate-parameters",
3761 Show balloon information.
3763 Make an asynchronous request for balloon info. When the request completes a
3764 json-object will be returned containing the following data:
3766 - "actual": current balloon value in bytes (json-int)
3770 -> { "execute": "query-balloon" }
3773 "actual":1073741824,
3780 .name = "query-balloon",
3785 .name = "query-block-jobs",
3791 .args_type = "path:s",
3796 .args_type = "path:s,property:s,value:q",
3801 .args_type = "path:s,property:s",
3805 .name = "nbd-server-start",
3806 .args_type = "addr:q,tls-creds:s?",
3809 .name = "nbd-server-add",
3810 .args_type = "device:B,writable:b?",
3813 .name = "nbd-server-stop",
3818 .name = "change-vnc-password",
3819 .args_type = "password:s",
3822 .name = "qom-list-types",
3823 .args_type = "implements:s?,abstract:b?",
3827 .name = "device-list-properties",
3828 .args_type = "typename:s",
3832 .name = "query-machines",
3837 .name = "query-cpu-definitions",
3842 .name = "query-cpu-model-expansion",
3843 .args_type = "type:s,model:q",
3847 .name = "query-cpu-model-comparison",
3848 .args_type = "modela:q,modelb:q",
3852 .name = "query-cpu-model-baseline",
3853 .args_type = "modela:q,modelb:q",
3857 .name = "query-target",
3862 .name = "query-tpm",
3870 Return information about the TPM device.
3876 -> { "execute": "query-tpm" }
3879 { "model": "tpm-tis",
3881 { "type": "passthrough",
3883 { "cancel-path": "/sys/class/misc/tpm0/device/cancel",
3895 .name = "query-tpm-models",
3903 Return a list of supported TPM models.
3909 -> { "execute": "query-tpm-models" }
3910 <- { "return": [ "tpm-tis" ] }
3915 .name = "query-tpm-types",
3923 Return a list of supported TPM types.
3929 -> { "execute": "query-tpm-types" }
3930 <- { "return": [ "passthrough" ] }
3935 .name = "chardev-add",
3936 .args_type = "id:s,backend:q",
3947 - "id": the chardev's ID, must be unique (json-string)
3948 - "backend": chardev backend type + parameters
3952 -> { "execute" : "chardev-add",
3953 "arguments" : { "id" : "foo",
3954 "backend" : { "type" : "null", "data" : {} } } }
3957 -> { "execute" : "chardev-add",
3958 "arguments" : { "id" : "bar",
3959 "backend" : { "type" : "file",
3960 "data" : { "out" : "/tmp/bar.log" } } } }
3963 -> { "execute" : "chardev-add",
3964 "arguments" : { "id" : "baz",
3965 "backend" : { "type" : "pty", "data" : {} } } }
3966 <- { "return": { "pty" : "/dev/pty/42" } }
3971 .name = "chardev-remove",
3972 .args_type = "id:s",
3984 - "id": the chardev's ID, must exist and not be in use (json-string)
3988 -> { "execute": "chardev-remove", "arguments": { "id" : "foo" } }
3993 .name = "query-rx-filter",
3994 .args_type = "name:s?",
4001 Show rx-filter information.
4003 Returns a json-array of rx-filter information for all NICs (or for the
4004 given NIC), returning an error if the given NIC doesn't exist, or
4005 given NIC doesn't support rx-filter querying, or given net client
4008 The query will clear the event notification flag of each NIC, then qemu
4009 will start to emit event to QMP monitor.
4011 Each array entry contains the following:
4013 - "name": net client name (json-string)
4014 - "promiscuous": promiscuous mode is enabled (json-bool)
4015 - "multicast": multicast receive state (one of 'normal', 'none', 'all')
4016 - "unicast": unicast receive state (one of 'normal', 'none', 'all')
4017 - "vlan": vlan receive state (one of 'normal', 'none', 'all') (Since 2.0)
4018 - "broadcast-allowed": allow to receive broadcast (json-bool)
4019 - "multicast-overflow": multicast table is overflowed (json-bool)
4020 - "unicast-overflow": unicast table is overflowed (json-bool)
4021 - "main-mac": main macaddr string (json-string)
4022 - "vlan-table": a json-array of active vlan id
4023 - "unicast-table": a json-array of unicast macaddr string
4024 - "multicast-table": a json-array of multicast macaddr string
4028 -> { "execute": "query-rx-filter", "arguments": { "name": "vnet0" } }
4031 "promiscuous": true,
4033 "main-mac": "52:54:00:12:34:56",
4034 "unicast": "normal",
4042 "multicast": "normal",
4043 "multicast-overflow": false,
4044 "unicast-overflow": false,
4045 "multicast-table": [
4046 "01:00:5e:00:00:01",
4047 "33:33:00:00:00:01",
4050 "broadcast-allowed": false
4058 .name = "blockdev-add",
4059 .args_type = "options:q",
4068 This command is still a work in progress. It doesn't support all
4069 block drivers among other things. Stay away from it unless you want
4070 to help with its development.
4074 - "options": block driver options
4078 -> { "execute": "blockdev-add",
4079 "arguments": { "options" : { "driver": "qcow2",
4080 "file": { "driver": "file",
4081 "filename": "test.qcow2" } } } }
4086 -> { "execute": "blockdev-add",
4098 "filename": "/tmp/test.qcow2"
4104 "filename": "/dev/fdset/4"
4116 .name = "x-blockdev-del",
4117 .args_type = "id:s?,node-name:s?",
4125 Deletes a block device thas has been added using blockdev-add.
4126 The selected device can be either a block backend or a graph node.
4128 In the former case the backend will be destroyed, along with its
4129 inserted medium if there's any. The command will fail if the backend
4130 or its medium are in use.
4132 In the latter case the node will be destroyed. The command will fail
4133 if the node is attached to a block backend or is otherwise being
4136 One of "id" or "node-name" must be specified, but not both.
4138 This command is still a work in progress and is considered
4139 experimental. Stay away from it unless you want to help with its
4144 - "id": Name of the block backend device to delete (json-string, optional)
4145 - "node-name": Name of the graph node to delete (json-string, optional)
4149 -> { "execute": "blockdev-add",
4156 "filename": "test.qcow2"
4164 -> { "execute": "x-blockdev-del",
4165 "arguments": { "id": "drive0" }
4172 .name = "blockdev-open-tray",
4173 .args_type = "device:s,force:b?",
4180 Opens a block device's tray. If there is a block driver state tree inserted as a
4181 medium, it will become inaccessible to the guest (but it will remain associated
4182 to the block device, so closing the tray will make it accessible again).
4184 If the tray was already open before, this will be a no-op.
4186 Once the tray opens, a DEVICE_TRAY_MOVED event is emitted. There are cases in
4187 which no such event will be generated, these include:
4188 - if the guest has locked the tray, @force is false and the guest does not
4189 respond to the eject request
4190 - if the BlockBackend denoted by @device does not have a guest device attached
4192 - if the guest device does not have an actual tray and is empty, for instance
4193 for floppy disk drives
4197 - "device": block device name (json-string)
4198 - "force": if false (the default), an eject request will be sent to the guest if
4199 it has locked the tray (and the tray will not be opened immediately);
4200 if true, the tray will be opened regardless of whether it is locked
4201 (json-bool, optional)
4205 -> { "execute": "blockdev-open-tray",
4206 "arguments": { "device": "ide1-cd0" } }
4208 <- { "timestamp": { "seconds": 1418751016,
4209 "microseconds": 716996 },
4210 "event": "DEVICE_TRAY_MOVED",
4211 "data": { "device": "ide1-cd0",
4212 "tray-open": true } }
4219 .name = "blockdev-close-tray",
4220 .args_type = "device:s",
4227 Closes a block device's tray. If there is a block driver state tree associated
4228 with the block device (which is currently ejected), that tree will be loaded as
4231 If the tray was already closed before, this will be a no-op.
4235 - "device": block device name (json-string)
4239 -> { "execute": "blockdev-close-tray",
4240 "arguments": { "device": "ide1-cd0" } }
4242 <- { "timestamp": { "seconds": 1418751345,
4243 "microseconds": 272147 },
4244 "event": "DEVICE_TRAY_MOVED",
4245 "data": { "device": "ide1-cd0",
4246 "tray-open": false } }
4253 .name = "x-blockdev-remove-medium",
4254 .args_type = "device:s",
4258 x-blockdev-remove-medium
4259 ------------------------
4261 Removes a medium (a block driver state tree) from a block device. That block
4262 device's tray must currently be open (unless there is no attached guest device).
4264 If the tray is open and there is no medium inserted, this will be a no-op.
4266 This command is still a work in progress and is considered experimental.
4267 Stay away from it unless you want to help with its development.
4271 - "device": block device name (json-string)
4275 -> { "execute": "x-blockdev-remove-medium",
4276 "arguments": { "device": "ide1-cd0" } }
4278 <- { "error": { "class": "GenericError",
4279 "desc": "Tray of device 'ide1-cd0' is not open" } }
4281 -> { "execute": "blockdev-open-tray",
4282 "arguments": { "device": "ide1-cd0" } }
4284 <- { "timestamp": { "seconds": 1418751627,
4285 "microseconds": 549958 },
4286 "event": "DEVICE_TRAY_MOVED",
4287 "data": { "device": "ide1-cd0",
4288 "tray-open": true } }
4292 -> { "execute": "x-blockdev-remove-medium",
4293 "arguments": { "device": "ide1-cd0" } }
4300 .name = "x-blockdev-insert-medium",
4301 .args_type = "device:s,node-name:s",
4305 x-blockdev-insert-medium
4306 ------------------------
4308 Inserts a medium (a block driver state tree) into a block device. That block
4309 device's tray must currently be open (unless there is no attached guest device)
4310 and there must be no medium inserted already.
4312 This command is still a work in progress and is considered experimental.
4313 Stay away from it unless you want to help with its development.
4317 - "device": block device name (json-string)
4318 - "node-name": root node of the BDS tree to insert into the block device
4322 -> { "execute": "blockdev-add",
4323 "arguments": { "options": { "node-name": "node0",
4325 "file": { "driver": "file",
4326 "filename": "fedora.iso" } } } }
4330 -> { "execute": "x-blockdev-insert-medium",
4331 "arguments": { "device": "ide1-cd0",
4332 "node-name": "node0" } }
4339 .name = "x-blockdev-change",
4340 .args_type = "parent:B,child:B?,node:B?",
4347 Dynamically reconfigure the block driver state graph. It can be used
4348 to add, remove, insert or replace a graph node. Currently only the
4349 Quorum driver implements this feature to add or remove its child. This
4350 is useful to fix a broken quorum child.
4352 If @node is specified, it will be inserted under @parent. @child
4353 may not be specified in this case. If both @parent and @child are
4354 specified but @node is not, @child will be detached from @parent.
4357 - "parent": the id or name of the parent node (json-string)
4358 - "child": the name of a child under the given parent node (json-string, optional)
4359 - "node": the name of the node that will be added (json-string, optional)
4361 Note: this command is experimental, and not a stable API. It doesn't
4362 support all kinds of operations, all kinds of children, nor all block
4365 Warning: The data in a new quorum child MUST be consistent with that of
4366 the rest of the array.
4370 Add a new node to a quorum
4371 -> { "execute": "blockdev-add",
4372 "arguments": { "options": { "driver": "raw",
4373 "node-name": "new_node",
4374 "file": { "driver": "file",
4375 "filename": "test.raw" } } } }
4377 -> { "execute": "x-blockdev-change",
4378 "arguments": { "parent": "disk1",
4379 "node": "new_node" } }
4382 Delete a quorum's node
4383 -> { "execute": "x-blockdev-change",
4384 "arguments": { "parent": "disk1",
4385 "child": "children.1" } }
4391 .name = "query-named-block-nodes",
4396 @query-named-block-nodes
4397 ------------------------
4399 Return a list of BlockDeviceInfo for all the named block driver nodes
4403 -> { "execute": "query-named-block-nodes" }
4404 <- { "return": [ { "ro":false,
4407 "file":"disks/test.qcow2",
4408 "node-name": "my-node",
4409 "backing_file_depth":1,
4423 "write_threshold": 0,
4425 "filename":"disks/test.qcow2",
4427 "virtual-size":2048000,
4428 "backing_file":"base.qcow2",
4429 "full-backing-filename":"disks/base.qcow2",
4430 "backing-filename-format":"qcow2",
4434 "name": "snapshot1",
4436 "date-sec": 10000200,
4438 "vm-clock-sec": 206,
4443 "filename":"disks/base.qcow2",
4445 "virtual-size":2048000
4452 .name = "blockdev-change-medium",
4453 .args_type = "device:B,filename:F,format:s?,read-only-mode:s?",
4457 blockdev-change-medium
4458 ----------------------
4460 Changes the medium inserted into a block device by ejecting the current medium
4461 and loading a new image file which is inserted as the new medium.
4465 - "device": device name (json-string)
4466 - "filename": filename of the new image (json-string)
4467 - "format": format of the new image (json-string, optional)
4468 - "read-only-mode": new read-only mode (json-string, optional)
4469 - Possible values: "retain" (default), "read-only", "read-write"
4473 1. Change a removable medium
4475 -> { "execute": "blockdev-change-medium",
4476 "arguments": { "device": "ide1-cd0",
4477 "filename": "/srv/images/Fedora-12-x86_64-DVD.iso",
4481 2. Load a read-only medium into a writable drive
4483 -> { "execute": "blockdev-change-medium",
4484 "arguments": { "device": "isa-fd0",
4485 "filename": "/srv/images/ro.img",
4487 "read-only-mode": "retain" } }
4490 { "class": "GenericError",
4491 "desc": "Could not open '/srv/images/ro.img': Permission denied" } }
4493 -> { "execute": "blockdev-change-medium",
4494 "arguments": { "device": "isa-fd0",
4495 "filename": "/srv/images/ro.img",
4497 "read-only-mode": "read-only" } }
4504 .name = "query-memdev",
4512 Show memory devices information.
4517 -> { "execute": "query-memdev" }
4524 "host-nodes": [0, 1],
4532 "host-nodes": [2, 3],
4533 "policy": "preferred"
4541 .name = "query-memory-devices",
4546 @query-memory-devices
4547 --------------------
4549 Return a list of memory devices.
4552 -> { "execute": "query-memory-devices" }
4553 <- { "return": [ { "data":
4554 { "addr": 5368709120,
4555 "hotpluggable": true,
4558 "memdev": "/objects/memX",
4567 .name = "query-acpi-ospm-status",
4572 @query-acpi-ospm-status
4573 --------------------
4575 Return list of ACPIOSTInfo for devices that support status reporting
4576 via ACPI _OST method.
4579 -> { "execute": "query-acpi-ospm-status" }
4580 <- { "return": [ { "device": "d1", "slot": "0", "slot-type": "DIMM", "source": 1, "status": 0},
4581 { "slot": "1", "slot-type": "DIMM", "source": 0, "status": 0},
4582 { "slot": "2", "slot-type": "DIMM", "source": 0, "status": 0},
4583 { "slot": "3", "slot-type": "DIMM", "source": 0, "status": 0}
4587 #if defined TARGET_I386
4589 .name = "rtc-reset-reinjection",
4595 rtc-reset-reinjection
4596 ---------------------
4598 Reset the RTC interrupt reinjection backlog.
4604 -> { "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" } ] }
4640 .name = "trace-event-set-state",
4641 .args_type = "name:s,enable:b,ignore-unavailable:b?,vcpu:i?",
4645 trace-event-set-state
4646 ---------------------
4648 Set the state of events.
4652 - "name": Event name pattern (json-string).
4653 - "enable": Whether to enable or disable the event (json-bool).
4654 - "ignore-unavailable": Whether to ignore errors for events that cannot be
4655 changed (json-bool, optional).
4656 - "vcpu": The vCPU to act upon, all vCPUs by default (json-int, optional).
4658 An event's state is modified if:
4659 - its name matches the "name" pattern, and
4660 - if "vcpu" is given, the event has the "vcpu" property.
4662 Therefore, if "vcpu" is given, the operation will only match per-vCPU events,
4663 setting their state on the specified vCPU. Special case: if "name" is an exact
4664 match, "vcpu" is given and the event does not have the "vcpu" property, an error
4669 -> { "execute": "trace-event-set-state", "arguments": { "name": "qemu_memalign", "enable": "true" } }
4674 .name = "input-send-event",
4675 .args_type = "console:i?,events:q",
4682 Send input event to guest.
4686 - "device": display device (json-string, optional)
4687 - "head": display head (json-int, optional)
4688 - "events": list of input events
4690 The consoles are visible in the qom tree, under
4691 /backend/console[$index]. They have a device link and head property, so
4692 it is possible to map which console belongs to which device and display.
4696 Press left mouse button.
4698 -> { "execute": "input-send-event",
4699 "arguments": { "device": "video0",
4700 "events": [ { "type": "btn",
4701 "data" : { "down": true, "button": "left" } } ] } }
4704 -> { "execute": "input-send-event",
4705 "arguments": { "device": "video0",
4706 "events": [ { "type": "btn",
4707 "data" : { "down": false, "button": "left" } } ] } }
4714 -> { "execute": "input-send-event",
4715 "arguments": { "events": [
4716 { "type": "key", "data" : { "down": true,
4717 "key": {"type": "qcode", "data": "ctrl" } } },
4718 { "type": "key", "data" : { "down": true,
4719 "key": {"type": "qcode", "data": "alt" } } },
4720 { "type": "key", "data" : { "down": true,
4721 "key": {"type": "qcode", "data": "delete" } } } ] } }
4726 Move mouse pointer to absolute coordinates (20000, 400).
4728 -> { "execute": "input-send-event" ,
4729 "arguments": { "events": [
4730 { "type": "abs", "data" : { "axis": "x", "value" : 20000 } },
4731 { "type": "abs", "data" : { "axis": "y", "value" : 400 } } ] } }
4737 .name = "block-set-write-threshold",
4738 .args_type = "node-name:s,write-threshold:l",
4742 block-set-write-threshold
4745 Change the write threshold for a block drive. The threshold is an offset,
4746 thus must be non-negative. Default is no write threshold.
4747 Setting the threshold to zero disables it.
4751 - "node-name": the node name in the block driver state graph (json-string)
4752 - "write-threshold": the write threshold in bytes (json-int)
4756 -> { "execute": "block-set-write-threshold",
4757 "arguments": { "node-name": "mydev",
4758 "write-threshold": 17179869184 } }
4764 .name = "query-rocker",
4765 .args_type = "name:s",
4774 - "name": switch name
4778 -> { "execute": "query-rocker", "arguments": { "name": "sw1" } }
4779 <- { "return": {"name": "sw1", "ports": 2, "id": 1327446905938}}
4784 .name = "query-rocker-ports",
4785 .args_type = "name:s",
4789 Show rocker switch ports
4790 ------------------------
4794 - "name": switch name
4798 -> { "execute": "query-rocker-ports", "arguments": { "name": "sw1" } }
4799 <- { "return": [ {"duplex": "full", "enabled": true, "name": "sw1.1",
4800 "autoneg": "off", "link-up": true, "speed": 10000},
4801 {"duplex": "full", "enabled": true, "name": "sw1.2",
4802 "autoneg": "off", "link-up": true, "speed": 10000}
4808 .name = "query-rocker-of-dpa-flows",
4809 .args_type = "name:s,tbl-id:i?",
4813 Show rocker switch OF-DPA flow tables
4814 -------------------------------------
4818 - "name": switch name
4819 - "tbl-id": (optional) flow table ID
4823 -> { "execute": "query-rocker-of-dpa-flows", "arguments": { "name": "sw1" } }
4824 <- { "return": [ {"key": {"in-pport": 0, "priority": 1, "tbl-id": 0},
4827 "action": {"goto-tbl": 10},
4828 "mask": {"in-pport": 4294901760}
4836 .name = "query-rocker-of-dpa-groups",
4837 .args_type = "name:s,type:i?",
4841 Show rocker OF-DPA group tables
4842 -------------------------------
4846 - "name": switch name
4847 - "type": (optional) group type
4851 -> { "execute": "query-rocker-of-dpa-groups", "arguments": { "name": "sw1" } }
4852 <- { "return": [ {"type": 0, "out-pport": 2, "pport": 2, "vlan-id": 3841,
4853 "pop-vlan": 1, "id": 251723778},
4854 {"type": 0, "out-pport": 0, "pport": 0, "vlan-id": 3841,
4855 "pop-vlan": 1, "id": 251723776},
4856 {"type": 0, "out-pport": 1, "pport": 1, "vlan-id": 3840,
4857 "pop-vlan": 1, "id": 251658241},
4858 {"type": 0, "out-pport": 0, "pport": 0, "vlan-id": 3840,
4859 "pop-vlan": 1, "id": 251658240}
4864 #if defined TARGET_ARM
4866 .name = "query-gic-capabilities",
4872 query-gic-capabilities
4875 Return a list of GICCapability objects, describing supported GIC
4876 (Generic Interrupt Controller) versions.
4882 -> { "execute": "query-gic-capabilities" }
4883 <- { "return": [{ "version": 2, "emulated": true, "kernel": false },
4884 { "version": 3, "emulated": false, "kernel": true } ] }
4889 .name = "query-hotpluggable-cpus",
4894 Show existing/possible CPUs
4895 ---------------------------
4899 Example for pseries machine type started with
4900 -smp 2,cores=2,maxcpus=4 -cpu POWER8:
4902 -> { "execute": "query-hotpluggable-cpus" }
4904 { "props": { "core-id": 8 }, "type": "POWER8-spapr-cpu-core",
4906 { "props": { "core-id": 0 }, "type": "POWER8-spapr-cpu-core",
4907 "vcpus-count": 1, "qom-path": "/machine/unattached/device[0]"}
4910 Example for pc machine type started with
4912 -> { "execute": "query-hotpluggable-cpus" }
4915 "type": "qemu64-x86_64-cpu", "vcpus-count": 1,
4916 "props": {"core-id": 0, "socket-id": 1, "thread-id": 0}
4919 "qom-path": "/machine/unattached/device[0]",
4920 "type": "qemu64-x86_64-cpu", "vcpus-count": 1,
4921 "props": {"core-id": 0, "socket-id": 0, "thread-id": 0}