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
.
66 .mhandler
.cmd_new
= qmp_marshal_quit
,
79 -> { "execute": "quit" }
86 .args_type
= "force:-f,device:B",
87 .mhandler
.cmd_new
= qmp_marshal_eject
,
94 Eject a removable medium
.
98 - force
: force
ejection (json
-bool
, optional
)
99 - device
: device
name (json
-string
)
103 -> { "execute": "eject", "arguments": { "device": "ide1-cd0" } }
106 Note
: The
"force" argument defaults to
false.
112 .args_type
= "device:B,target:F,arg:s?",
113 .mhandler
.cmd_new
= qmp_marshal_change
,
120 Change a removable medium or VNC configuration
.
124 - "device": device
name (json
-string
)
125 - "target": filename or
item (json
-string
)
126 - "arg": additional
argument (json
-string
, optional
)
130 1. Change a removable medium
132 -> { "execute": "change",
133 "arguments": { "device": "ide1-cd0",
134 "target": "/srv/images/Fedora-12-x86_64-DVD.iso" } }
137 2. Change VNC password
139 -> { "execute": "change",
140 "arguments": { "device": "vnc", "target": "password",
147 .name
= "screendump",
148 .args_type
= "filename:F",
149 .mhandler
.cmd_new
= qmp_marshal_screendump
,
156 Save screen into PPM image
.
160 - "filename": file
path (json
-string
)
164 -> { "execute": "screendump", "arguments": { "filename": "/tmp/image" } }
172 .mhandler
.cmd_new
= qmp_marshal_stop
,
185 -> { "execute": "stop" }
193 .mhandler
.cmd_new
= qmp_marshal_cont
,
206 -> { "execute": "cont" }
212 .name
= "system_wakeup",
214 .mhandler
.cmd_new
= qmp_marshal_system_wakeup
,
221 Wakeup guest from suspend
.
227 -> { "execute": "system_wakeup" }
233 .name
= "system_reset",
235 .mhandler
.cmd_new
= qmp_marshal_system_reset
,
248 -> { "execute": "system_reset" }
254 .name
= "system_powerdown",
256 .mhandler
.cmd_new
= qmp_marshal_system_powerdown
,
263 Send system power down event
.
269 -> { "execute": "system_powerdown" }
275 .name
= "device_add",
276 .args_type
= "device:O",
277 .params
= "driver[,prop=value][,...]",
278 .help
= "add device, like -device on the command line",
279 .mhandler
.cmd_new
= qmp_device_add
,
290 - "driver": the name of the
new device
's driver (json-string)
291 - "bus": the device's parent
bus (device tree path
, json
-string
, optional
)
292 - "id": the device
's ID, must be unique (json-string)
297 -> { "execute": "device_add", "arguments": { "driver": "e1000", "id": "net1" } }
302 (1) For detailed information about this command, please refer to the
303 'docs
/qdev
-device
-use
.txt
' file.
305 (2) It's possible to list device properties by running QEMU with the
306 "-device DEVICE,\?" command
-line argument
, where DEVICE is the device
's name
311 .name = "device_del",
313 .mhandler.cmd_new = qmp_marshal_device_del,
324 - "id": the device's ID or QOM
path (json
-string
)
328 -> { "execute": "device_del", "arguments": { "id": "net1" } }
333 -> { "execute": "device_del", "arguments": { "id": "/machine/peripheral-anon/device[0]" } }
340 .args_type
= "keys:q,hold-time:i?",
341 .mhandler
.cmd_new
= qmp_marshal_send_key
,
353 - "key": key
sequence (a json
-array of key union values
,
354 union can be number or qcode
enum)
356 - hold
-time
: time to delay key up events
, milliseconds
. Defaults to
100
361 -> { "execute": "send-key",
362 "arguments": { "keys": [ { "type": "qcode", "data": "ctrl" },
363 { "type": "qcode", "data": "alt" },
364 { "type": "qcode", "data": "delete" } ] } }
371 .args_type
= "index:i",
372 .mhandler
.cmd_new
= qmp_marshal_cpu
,
383 - "index": the CPU
's index (json-int)
387 -> { "execute": "cpu", "arguments": { "index": 0 } }
390 Note: CPUs' indexes are obtained with the
'query-cpus' command
.
397 .mhandler
.cmd_new
= qmp_marshal_cpu_add
,
408 - "id": cpu
id (json
-int
)
412 -> { "execute": "cpu-add", "arguments": { "id": 2 } }
419 .args_type
= "val:l,size:i,filename:s,cpu:i?",
420 .mhandler
.cmd_new
= qmp_marshal_memsave
,
427 Save to disk virtual memory dump starting at
'val' of size
'size'.
431 - "val": the starting
address (json
-int
)
432 - "size": the memory size
, in bytes (json
-int
)
433 - "filename": file
path (json
-string
)
434 - "cpu": virtual CPU
index (json
-int
, optional
)
438 -> { "execute": "memsave",
439 "arguments": { "val": 10,
441 "filename": "/tmp/virtual-mem-dump" } }
448 .args_type
= "val:l,size:i,filename:s",
449 .mhandler
.cmd_new
= qmp_marshal_pmemsave
,
456 Save to disk physical memory dump starting at
'val' of size
'size'.
460 - "val": the starting
address (json
-int
)
461 - "size": the memory size
, in bytes (json
-int
)
462 - "filename": file
path (json
-string
)
466 -> { "execute": "pmemsave",
467 "arguments": { "val": 10,
469 "filename": "/tmp/physical-mem-dump" } }
475 .name
= "inject-nmi",
477 .mhandler
.cmd_new
= qmp_marshal_inject_nmi
,
484 Inject an NMI on the
default CPU (x86
/s390
) or all
CPUs (ppc64
).
490 -> { "execute": "inject-nmi" }
493 Note
: inject
-nmi fails when the guest doesn
't support injecting.
498 .name = "ringbuf-write",
499 .args_type = "device:s,data:s,format:s?",
500 .mhandler.cmd_new = qmp_marshal_ringbuf_write,
507 Write to a ring buffer character device.
511 - "device": ring buffer character device name (json-string)
512 - "data": data to write (json-string)
513 - "format": data format (json-string, optional)
514 - Possible values: "utf8" (default), "base64"
518 -> { "execute": "ringbuf-write",
519 "arguments": { "device": "foo",
527 .name = "ringbuf-read",
528 .args_type = "device:s,size:i,format:s?",
529 .mhandler.cmd_new = qmp_marshal_ringbuf_read,
536 Read from a ring buffer character device.
540 - "device": ring buffer character device name (json-string)
541 - "size": how many bytes to read at most (json-int)
542 - Number of data bytes, not number of characters in encoded data
543 - "format": data format (json-string, optional)
544 - Possible values: "utf8" (default), "base64"
545 - Naturally, format "utf8" works only when the ring buffer
546 contains valid UTF-8 text. Invalid UTF-8 sequences get
547 replaced. Bug: replacement doesn't work
. Bug
: can screw
548 up on encountering NUL characters
, after the ring buffer
549 lost data
, and when reading stops because the size limit
554 -> { "execute": "ringbuf-read",
555 "arguments": { "device": "foo",
558 <- {"return": "abcdefgh"}
563 .name
= "xen-save-devices-state",
564 .args_type
= "filename:F",
565 .mhandler
.cmd_new
= qmp_marshal_xen_save_devices_state
,
569 xen
-save
-devices
-state
572 Save the state of all devices to file
. The RAM and the block devices
573 of the VM are not saved by
this command
.
577 - "filename": the file to save the state of the devices to as binary
578 data
. See xen
-save
-devices
-state
.txt
for a description of the binary
583 -> { "execute": "xen-save-devices-state",
584 "arguments": { "filename": "/tmp/save" } }
590 .name
= "xen-load-devices-state",
591 .args_type
= "filename:F",
592 .mhandler
.cmd_new
= qmp_marshal_xen_load_devices_state
,
596 xen
-load
-devices
-state
597 ----------------------
599 Load the state of all devices from file
. The RAM and the block devices
600 of the VM are not loaded by
this command
.
604 - "filename": the file to load the state of the devices from as binary
605 data
. See xen
-save
-devices
-state
.txt
for a description of the binary
610 -> { "execute": "xen-load-devices-state",
611 "arguments": { "filename": "/tmp/resume" } }
617 .name
= "xen-set-global-dirty-log",
618 .args_type
= "enable:b",
619 .mhandler
.cmd_new
= qmp_marshal_xen_set_global_dirty_log
,
623 xen
-set
-global
-dirty
-log
626 Enable or disable the global dirty log mode
.
630 - "enable": Enable it or disable it
.
634 -> { "execute": "xen-set-global-dirty-log",
635 "arguments": { "enable": true } }
642 .args_type
= "detach:-d,blk:-b,inc:-i,uri:s",
643 .mhandler
.cmd_new
= qmp_marshal_migrate
,
654 - "blk": block migration
, full disk
copy (json
-bool
, optional
)
655 - "inc": incremental disk
copy (json
-bool
, optional
)
656 - "uri": Destination
URI (json
-string
)
660 -> { "execute": "migrate", "arguments": { "uri": "tcp:0:4446" } }
665 (1) The
'query-migrate' command should be used to check migration
's progress
666 and final result (this information is provided by the 'status
' member)
667 (2) All boolean arguments default to false
668 (3) The user Monitor's
"detach" argument is invalid
in QMP and should not
674 .name
= "migrate_cancel",
676 .mhandler
.cmd_new
= qmp_marshal_migrate_cancel
,
683 Cancel the current migration
.
689 -> { "execute": "migrate_cancel" }
695 .name
= "migrate-incoming",
696 .args_type
= "uri:s",
697 .mhandler
.cmd_new
= qmp_marshal_migrate_incoming
,
704 Continue an incoming migration
708 - "uri": Source
/listening
URI (json
-string
)
712 -> { "execute": "migrate-incoming", "arguments": { "uri": "tcp::4446" } }
717 (1) QEMU must be started with
-incoming defer to allow migrate
-incoming to
719 (2) The uri format is the same as
for -incoming
723 .name
= "migrate-set-cache-size",
724 .args_type
= "value:o",
725 .mhandler
.cmd_new
= qmp_marshal_migrate_set_cache_size
,
729 migrate
-set
-cache
-size
730 ----------------------
732 Set cache size to be used by XBZRLE migration
, the cache size will be rounded
733 down to the nearest power of
2
737 - "value": cache size
in bytes (json
-int
)
741 -> { "execute": "migrate-set-cache-size", "arguments": { "value": 536870912 } }
746 .name
= "migrate-start-postcopy",
748 .mhandler
.cmd_new
= qmp_marshal_migrate_start_postcopy
,
752 migrate
-start
-postcopy
753 ----------------------
755 Switch an
in-progress migration to postcopy mode
. Ignored after the end of
756 migration (or once already
in postcopy
).
759 -> { "execute": "migrate-start-postcopy" }
765 .name
= "query-migrate-cache-size",
767 .mhandler
.cmd_new
= qmp_marshal_query_migrate_cache_size
,
771 query
-migrate
-cache
-size
772 ------------------------
774 Show cache size to be used by XBZRLE migration
776 returns a json
-object with the following information
:
781 -> { "execute": "query-migrate-cache-size" }
782 <- { "return": 67108864 }
787 .name
= "migrate_set_speed",
788 .args_type
= "value:o",
789 .mhandler
.cmd_new
= qmp_marshal_migrate_set_speed
,
796 Set maximum speed
for migrations
.
800 - "value": maximum speed
, in bytes per
second (json
-int
)
804 -> { "execute": "migrate_set_speed", "arguments": { "value": 1024 } }
810 .name
= "migrate_set_downtime",
811 .args_type
= "value:T",
812 .mhandler
.cmd_new
= qmp_marshal_migrate_set_downtime
,
819 Set maximum tolerated
downtime (in seconds
) for migrations
.
823 - "value": maximum
downtime (json
-number
)
827 -> { "execute": "migrate_set_downtime", "arguments": { "value": 0.1 } }
833 .name
= "client_migrate_info",
834 .args_type
= "protocol:s,hostname:s,port:i?,tls-port:i?,cert-subject:s?",
835 .params
= "protocol hostname port tls-port cert-subject",
836 .help
= "set migration information for remote display",
837 .mhandler
.cmd_new
= qmp_marshal_client_migrate_info
,
844 Set migration information
for remote display
. This makes the server
845 ask the client to automatically reconnect
using the
new parameters
846 once migration finished successfully
. Only implemented
for SPICE
.
850 - "protocol": must be
"spice" (json
-string
)
851 - "hostname": migration target
hostname (json
-string
)
852 - "port": spice tcp port
for plaintext
channels (json
-int
, optional
)
853 - "tls-port": spice tcp port
for tls
-secured
channels (json
-int
, optional
)
854 - "cert-subject": server certificate
subject (json
-string
, optional
)
858 -> { "execute": "client_migrate_info",
859 "arguments": { "protocol": "spice",
860 "hostname": "virt42.lab.kraxel.org",
867 .name
= "dump-guest-memory",
868 .args_type
= "paging:b,protocol:s,detach:b?,begin:i?,end:i?,format:s?",
869 .params
= "-p protocol [-d] [begin] [length] [format]",
870 .help
= "dump guest memory to file",
871 .mhandler
.cmd_new
= qmp_marshal_dump_guest_memory
,
878 Dump guest memory to file
. The file can be processed with crash or gdb
.
882 - "paging": do paging to get guest
's memory mapping (json-bool)
883 - "protocol": destination file(started with "file:") or destination file
884 descriptor (started with "fd:") (json-string)
885 - "detach": if specified, command will return immediately, without waiting
886 for the dump to finish. The user can track progress using
887 "query-dump". (json-bool)
888 - "begin": the starting physical address. It's optional
, and should be specified
889 with length
together (json
-int
)
890 - "length": the memory size
, in bytes
. It
's optional, and should be specified
891 with begin together (json-int)
892 - "format": the format of guest memory dump. It's optional
, and can be
893 elf|kdump
-zlib|kdump
-lzo|kdump
-snappy
, but non
-elf formats will
894 conflict with paging and filter
, ie
. begin and
length (json
-string
)
898 -> { "execute": "dump-guest-memory", "arguments": { "protocol": "fd:dump" } }
903 (1) All boolean arguments
default to
false
908 .name
= "query-dump-guest-memory-capability",
910 .mhandler
.cmd_new
= qmp_marshal_query_dump_guest_memory_capability
,
914 query
-dump
-guest
-memory
-capability
917 Show available formats
for 'dump-guest-memory'
921 -> { "execute": "query-dump-guest-memory-capability" }
922 <- { "return": { "formats":
923 ["elf", "kdump-zlib", "kdump-lzo", "kdump-snappy"] }
928 .name
= "query-dump",
931 .help
= "query background dump status",
932 .mhandler
.cmd_new
= qmp_marshal_query_dump
,
939 Query background dump status
.
945 -> { "execute": "query-dump" }
946 <- { "return": { "status": "active", "completed": 1024000,
951 #
if defined TARGET_S390X
953 .name
= "dump-skeys",
954 .args_type
= "filename:F",
955 .mhandler
.cmd_new
= qmp_marshal_dump_skeys
,
963 Save guest storage keys to file
.
967 - "filename": file
path (json
-string
)
971 -> { "execute": "dump-skeys", "arguments": { "filename": "/tmp/skeys" } }
977 .name
= "netdev_add",
978 .args_type
= "netdev:O",
979 .mhandler
.cmd_new
= qmp_netdev_add
,
986 Add host network device
.
990 - "type": the device type
, "tap", "user", ... (json
-string
)
991 - "id": the device
's ID, must be unique (json-string)
996 -> { "execute": "netdev_add",
997 "arguments": { "type": "user", "id": "netdev1",
998 "dnssearch": "example.org" } }
1001 Note: The supported device options are the same ones supported by the '-netdev
'
1002 command-line argument, which are listed in the '-help
' output or QEMU's
1008 .name
= "netdev_del",
1009 .args_type
= "id:s",
1010 .mhandler
.cmd_new
= qmp_marshal_netdev_del
,
1017 Remove host network device
.
1021 - "id": the device
's ID, must be unique (json-string)
1025 -> { "execute": "netdev_del", "arguments": { "id": "netdev1" } }
1032 .name = "object-add",
1033 .args_type = "qom-type:s,id:s,props:q?",
1034 .mhandler.cmd_new = qmp_marshal_object_add,
1045 - "qom-type": the object's QOM type
, i
.e
. the
class name (json
-string
)
1046 - "id": the object
's ID, must be unique (json-string)
1047 - "props": a dictionary of object property values (optional, json-dict)
1051 -> { "execute": "object-add", "arguments": { "qom-type": "rng-random", "id": "rng1",
1052 "props": { "filename": "/dev/hwrng" } } }
1058 .name = "object-del",
1059 .args_type = "id:s",
1060 .mhandler.cmd_new = qmp_marshal_object_del,
1071 - "id": the object's
ID (json
-string
)
1075 -> { "execute": "object-del", "arguments": { "id": "rng1" } }
1083 .name
= "block_resize",
1084 .args_type
= "device:s?,node-name:s?,size:o",
1085 .mhandler
.cmd_new
= qmp_marshal_block_resize
,
1092 Resize a block image
while a guest is running
.
1096 - "device": the device
's ID, must be unique (json-string)
1097 - "node-name": the node name in the block driver state graph (json-string)
1102 -> { "execute": "block_resize", "arguments": { "device": "scratch", "size": 1073741824 } }
1108 .name = "block-stream",
1109 .args_type = "job-id:s?,device:B,base:s?,speed:o?,backing-file:s?,on-error:s?",
1110 .mhandler.cmd_new = qmp_marshal_block_stream,
1117 Copy data from a backing file into a block device.
1121 - "job-id": Identifier for the newly-created block job. If omitted,
1122 the device name will be used. (json-string, optional)
1123 - "device": The device name or node-name of a root node (json-string)
1124 - "base": The file name of the backing image above which copying starts
1125 (json-string, optional)
1126 - "backing-file": The backing file string to write into the active layer. This
1127 filename is not validated.
1129 If a pathname string is such that it cannot be resolved by
1130 QEMU, that means that subsequent QMP or HMP commands must use
1131 node-names for the image in question, as filename lookup
1134 If not specified, QEMU will automatically determine the
1135 backing file string to use, or error out if there is no
1136 obvious choice. Care should be taken when specifying the
1137 string, to specify a valid filename or protocol.
1138 (json-string, optional) (Since 2.1)
1139 - "speed": the maximum speed, in bytes per second (json-int, optional)
1140 - "on-error": the action to take on an error (default 'report
'). 'stop
' and
1141 'enospc
' can only be used if the block device supports io-status.
1142 (json-string, optional) (Since 2.1)
1146 -> { "execute": "block-stream", "arguments": { "device": "virtio0",
1147 "base": "/tmp/master.qcow2" } }
1153 .name = "block-commit",
1154 .args_type = "job-id:s?,device:B,base:s?,top:s?,backing-file:s?,speed:o?",
1155 .mhandler.cmd_new = qmp_marshal_block_commit,
1162 Live commit of data from overlay image nodes into backing nodes - i.e., writes
1163 data between 'top
' and 'base
' into 'base
'.
1167 - "job-id": Identifier for the newly-created block job. If omitted,
1168 the device name will be used. (json-string, optional)
1169 - "device": The device name or node-name of a root node (json-string)
1170 - "base": The file name of the backing image to write data into.
1171 If not specified, this is the deepest backing image
1172 (json-string, optional)
1173 - "top": The file name of the backing image within the image chain,
1174 which contains the topmost data to be committed down. If
1175 not specified, this is the active layer. (json-string, optional)
1177 - backing-file: The backing file string to write into the overlay
1178 image of 'top
'. If 'top
' is the active layer,
1179 specifying a backing file string is an error. This
1180 filename is not validated.
1182 If a pathname string is such that it cannot be
1183 resolved by QEMU, that means that subsequent QMP or
1184 HMP commands must use node-names for the image in
1185 question, as filename lookup methods will fail.
1187 If not specified, QEMU will automatically determine
1188 the backing file string to use, or error out if
1189 there is no obvious choice. Care should be taken
1190 when specifying the string, to specify a valid
1191 filename or protocol.
1192 (json-string, optional) (Since 2.1)
1194 If top == base, that is an error.
1195 If top == active, the job will not be completed by itself,
1196 user needs to complete the job with the block-job-complete
1197 command after getting the ready event. (Since 2.0)
1199 If the base image is smaller than top, then the base image
1200 will be resized to be the same size as top. If top is
1201 smaller than the base image, the base will not be
1202 truncated. If you want the base image size to match the
1203 size of the smaller top, you can safely truncate it
1204 yourself once the commit operation successfully completes.
1206 - "speed": the maximum speed, in bytes per second (json-int, optional)
1211 -> { "execute": "block-commit", "arguments": { "device": "virtio0",
1212 "top": "/tmp/snap1.qcow2" } }
1218 .name = "drive-backup",
1219 .args_type = "job-id:s?,sync:s,device:B,target:s,speed:i?,mode:s?,"
1220 "format:s?,bitmap:s?,compress:b?,"
1221 "on-source-error:s?,on-target-error:s?",
1222 .mhandler.cmd_new = qmp_marshal_drive_backup,
1229 Start a point-in-time copy of a block device to a new destination. The
1230 status of ongoing drive-backup operations can be checked with
1231 query-block-jobs where the BlockJobInfo.type field has the value 'backup
'.
1232 The operation can be stopped before it has completed using the
1233 block-job-cancel command.
1237 - "job-id": Identifier for the newly-created block job. If omitted,
1238 the device name will be used. (json-string, optional)
1239 - "device": the device name or node-name of a root node which should be copied.
1241 - "target": the target of the new image. If the file exists, or if it is a
1242 device, the existing file/device will be used as the new
1243 destination. If it does not exist, a new file will be created.
1245 - "format": the format of the new destination, default is to probe if 'mode
' is
1246 'existing
', else the format of the source
1247 (json-string, optional)
1248 - "sync": what parts of the disk image should be copied to the destination;
1249 possibilities include "full" for all the disk, "top" for only the sectors
1250 allocated in the topmost image, "incremental" for only the dirty sectors in
1251 the bitmap, or "none" to only replicate new I/O (MirrorSyncMode).
1252 - "bitmap": dirty bitmap name for sync==incremental. Must be present if sync
1253 is "incremental", must NOT be present otherwise.
1254 - "mode": whether and how QEMU should create a new image
1255 (NewImageMode, optional, default 'absolute
-paths
')
1256 - "speed": the maximum speed, in bytes per second (json-int, optional)
1257 - "compress": true to compress data, if the target format supports it.
1258 (json-bool, optional, default false)
1259 - "on-source-error": the action to take on an error on the source, default
1260 'report
'. 'stop
' and 'enospc
' can only be used
1261 if the block device supports io-status.
1262 (BlockdevOnError, optional)
1263 - "on-target-error": the action to take on an error on the target, default
1264 'report
' (no limitations, since this applies to
1265 a different block device than device).
1266 (BlockdevOnError, optional)
1269 -> { "execute": "drive-backup", "arguments": { "device": "drive0",
1271 "target": "backup.img" } }
1277 .name = "blockdev-backup",
1278 .args_type = "job-id:s?,sync:s,device:B,target:B,speed:i?,compress:b?,"
1279 "on-source-error:s?,on-target-error:s?",
1280 .mhandler.cmd_new = qmp_marshal_blockdev_backup,
1287 The device version of drive-backup: this command takes an existing named device
1292 - "job-id": Identifier for the newly-created block job. If omitted,
1293 the device name will be used. (json-string, optional)
1294 - "device": the device name or node-name of a root node which should be copied.
1296 - "target": the name of the backup target device. (json-string)
1297 - "sync": what parts of the disk image should be copied to the destination;
1298 possibilities include "full" for all the disk, "top" for only the
1299 sectors allocated in the topmost image, or "none" to only replicate
1300 new I/O (MirrorSyncMode).
1301 - "speed": the maximum speed, in bytes per second (json-int, optional)
1302 - "compress": true to compress data, if the target format supports it.
1303 (json-bool, optional, default false)
1304 - "on-source-error": the action to take on an error on the source, default
1305 'report
'. 'stop
' and 'enospc
' can only be used
1306 if the block device supports io-status.
1307 (BlockdevOnError, optional)
1308 - "on-target-error": the action to take on an error on the target, default
1309 'report
' (no limitations, since this applies to
1310 a different block device than device).
1311 (BlockdevOnError, optional)
1314 -> { "execute": "blockdev-backup", "arguments": { "device": "src-id",
1316 "target": "tgt-id" } }
1322 .name = "block-job-set-speed",
1323 .args_type = "device:B,speed:o",
1324 .mhandler.cmd_new = qmp_marshal_block_job_set_speed,
1328 .name = "block-job-cancel",
1329 .args_type = "device:B,force:b?",
1330 .mhandler.cmd_new = qmp_marshal_block_job_cancel,
1333 .name = "block-job-pause",
1334 .args_type = "device:B",
1335 .mhandler.cmd_new = qmp_marshal_block_job_pause,
1338 .name = "block-job-resume",
1339 .args_type = "device:B",
1340 .mhandler.cmd_new = qmp_marshal_block_job_resume,
1343 .name = "block-job-complete",
1344 .args_type = "device:B",
1345 .mhandler.cmd_new = qmp_marshal_block_job_complete,
1348 .name = "transaction",
1349 .args_type = "actions:q,properties:q?",
1350 .mhandler.cmd_new = qmp_marshal_transaction,
1357 Atomically operate on one or more block devices. Operations that are
1358 currently supported:
1362 - blockdev-snapshot-sync
1363 - blockdev-snapshot-internal-sync
1365 - block-dirty-bitmap-add
1366 - block-dirty-bitmap-clear
1368 Refer to the qemu/qapi-schema.json file for minimum required QEMU
1369 versions for these operations. A list of dictionaries is accepted,
1370 that contains the actions to be performed. If there is any failure
1371 performing any of the operations, all operations for the group are
1374 For external snapshots, the dictionary contains the device, the file to use for
1375 the new snapshot, and the format. The default format, if not specified, is
1378 Each new snapshot defaults to being created by QEMU (wiping any
1379 contents if the file already exists), but it is also possible to reuse
1380 an externally-created file. In the latter case, you should ensure that
1381 the new image file has the same contents as the current one; QEMU cannot
1382 perform any meaningful check. Typically this is achieved by using the
1383 current image file as the backing file for the new image.
1385 On failure, the original disks pre-snapshot attempt will be used.
1387 For internal snapshots, the dictionary contains the device and the snapshot's
1388 name
. If an internal snapshot matching name already exists
, the request will
1389 be rejected
. Only some image formats support it
, for example
, qcow2
, rbd
,
1392 On failure
, qemu will
try delete the newly created internal snapshot
in the
1393 transaction
. When an I
/O error occurs during deletion
, the user needs to fix
1394 it later with qemu
-img or other command
.
1399 - "type": the operation to
perform (json
-string
). Possible
1400 values
: "drive-backup", "blockdev-backup",
1401 "blockdev-snapshot-sync",
1402 "blockdev-snapshot-internal-sync",
1403 "abort", "block-dirty-bitmap-add",
1404 "block-dirty-bitmap-clear"
1405 - "data": a dictionary
. The contents depend on the value
1406 of
"type". When
"type" is
"blockdev-snapshot-sync":
1407 - "device": device name to
snapshot (json
-string
)
1408 - "node-name": graph node name to
snapshot (json
-string
)
1409 - "snapshot-file": name of
new image
file (json
-string
)
1410 - "snapshot-node-name": graph node name of the
new snapshot (json
-string
)
1411 - "format": format of
new image (json
-string
, optional
)
1412 - "mode": whether and how QEMU should create the snapshot file
1413 (NewImageMode
, optional
, default "absolute-paths")
1414 When
"type" is
"blockdev-snapshot-internal-sync":
1415 - "device": the device name or node
-name of a root node to snapshot
1417 - "name": name of the
new snapshot (json
-string
)
1421 -> { "execute": "transaction",
1422 "arguments": { "actions": [
1423 { "type": "blockdev-snapshot-sync", "data" : { "device": "ide-hd0",
1424 "snapshot-file": "/some/place/my-image",
1425 "format": "qcow2" } },
1426 { "type": "blockdev-snapshot-sync", "data" : { "node-name": "myfile",
1427 "snapshot-file": "/some/place/my-image2",
1428 "snapshot-node-name": "node3432",
1430 "format": "qcow2" } },
1431 { "type": "blockdev-snapshot-sync", "data" : { "device": "ide-hd1",
1432 "snapshot-file": "/some/place/my-image2",
1434 "format": "qcow2" } },
1435 { "type": "blockdev-snapshot-internal-sync", "data" : {
1436 "device": "ide-hd2",
1437 "name": "snapshot0" } } ] } }
1443 .name
= "block-dirty-bitmap-add",
1444 .args_type
= "node:B,name:s,granularity:i?",
1445 .mhandler
.cmd_new
= qmp_marshal_block_dirty_bitmap_add
,
1450 block
-dirty
-bitmap
-add
1451 ----------------------
1454 Create a dirty bitmap with a name on the device
, and start tracking the writes
.
1458 - "node": device
/node on which to create dirty
bitmap (json
-string
)
1459 - "name": name of the
new dirty
bitmap (json
-string
)
1460 - "granularity": granularity to track writes
with (int
, optional
)
1464 -> { "execute": "block-dirty-bitmap-add", "arguments": { "node": "drive0",
1465 "name": "bitmap0" } }
1471 .name
= "block-dirty-bitmap-remove",
1472 .args_type
= "node:B,name:s",
1473 .mhandler
.cmd_new
= qmp_marshal_block_dirty_bitmap_remove
,
1478 block
-dirty
-bitmap
-remove
1479 -------------------------
1482 Stop write tracking and remove the dirty bitmap that was created with
1483 block
-dirty
-bitmap
-add
.
1487 - "node": device
/node on which to remove dirty
bitmap (json
-string
)
1488 - "name": name of the dirty bitmap to
remove (json
-string
)
1492 -> { "execute": "block-dirty-bitmap-remove", "arguments": { "node": "drive0",
1493 "name": "bitmap0" } }
1499 .name
= "block-dirty-bitmap-clear",
1500 .args_type
= "node:B,name:s",
1501 .mhandler
.cmd_new
= qmp_marshal_block_dirty_bitmap_clear
,
1506 block
-dirty
-bitmap
-clear
1507 ------------------------
1510 Reset the dirty bitmap associated with a node so that an incremental backup
1511 from
this point
in time forward will only backup clusters modified after
this
1516 - "node": device
/node on which to remove dirty
bitmap (json
-string
)
1517 - "name": name of the dirty bitmap to
remove (json
-string
)
1521 -> { "execute": "block-dirty-bitmap-clear", "arguments": { "node": "drive0",
1522 "name": "bitmap0" } }
1528 .name
= "blockdev-snapshot-sync",
1529 .args_type
= "device:s?,node-name:s?,snapshot-file:s,snapshot-node-name:s?,format:s?,mode:s?",
1530 .mhandler
.cmd_new
= qmp_marshal_blockdev_snapshot_sync
,
1534 blockdev
-snapshot
-sync
1535 ----------------------
1537 Synchronous snapshot of a block device
. snapshot
-file specifies the
1538 target of the
new image
. If the file exists
, or
if it is a device
, the
1539 snapshot will be created
in the existing file
/device
. If does not
1540 exist
, a
new file will be created
. format specifies the format of the
1541 snapshot image
, default is qcow2
.
1545 - "device": device name to
snapshot (json
-string
)
1546 - "node-name": graph node name to
snapshot (json
-string
)
1547 - "snapshot-file": name of
new image
file (json
-string
)
1548 - "snapshot-node-name": graph node name of the
new snapshot (json
-string
)
1549 - "mode": whether and how QEMU should create the snapshot file
1550 (NewImageMode
, optional
, default "absolute-paths")
1551 - "format": format of
new image (json
-string
, optional
)
1555 -> { "execute": "blockdev-snapshot-sync", "arguments": { "device": "ide-hd0",
1557 "/some/place/my-image",
1558 "format": "qcow2" } }
1564 .name
= "blockdev-snapshot",
1565 .args_type
= "node:s,overlay:s",
1566 .mhandler
.cmd_new
= qmp_marshal_blockdev_snapshot
,
1574 Create a snapshot
, by installing
'node' as the backing image of
1575 'overlay'. Additionally
, if 'node' is associated with a block
1576 device
, the block device changes to
using 'overlay' as its
new active
1581 - "node": device that will have a snapshot
created (json
-string
)
1582 - "overlay": device that will have
'node' as its backing
image (json
-string
)
1586 -> { "execute": "blockdev-add",
1587 "arguments": { "options": { "driver": "qcow2",
1588 "node-name": "node1534",
1589 "file": { "driver": "file",
1590 "filename": "hd1.qcow2" },
1595 -> { "execute": "blockdev-snapshot", "arguments": { "node": "ide-hd0",
1596 "overlay": "node1534" } }
1602 .name
= "blockdev-snapshot-internal-sync",
1603 .args_type
= "device:B,name:s",
1604 .mhandler
.cmd_new
= qmp_marshal_blockdev_snapshot_internal_sync
,
1608 blockdev
-snapshot
-internal
-sync
1609 -------------------------------
1611 Synchronously take an internal snapshot of a block device when the format of
1612 image used supports it
. If the name is an empty string
, or a snapshot with
1613 name already exists
, the operation will fail
.
1617 - "device": the device name or node
-name of a root node to snapshot
1619 - "name": name of the
new snapshot (json
-string
)
1623 -> { "execute": "blockdev-snapshot-internal-sync",
1624 "arguments": { "device": "ide-hd0",
1625 "name": "snapshot0" }
1632 .name
= "blockdev-snapshot-delete-internal-sync",
1633 .args_type
= "device:B,id:s?,name:s?",
1635 qmp_marshal_blockdev_snapshot_delete_internal_sync
,
1639 blockdev
-snapshot
-delete
-internal
-sync
1640 --------------------------------------
1642 Synchronously delete an internal snapshot of a block device when the format of
1643 image used supports it
. The snapshot is identified by name or id or both
. One
1644 of name or id is required
. If the snapshot is not found
, the operation will
1649 - "device": the device name or node
-name of a root
node (json
-string
)
1650 - "id": ID of the
snapshot (json
-string
, optional
)
1651 - "name": name of the
snapshot (json
-string
, optional
)
1655 -> { "execute": "blockdev-snapshot-delete-internal-sync",
1656 "arguments": { "device": "ide-hd0",
1657 "name": "snapshot0" }
1661 "name": "snapshot0",
1663 "date-sec": 1000012,
1665 "vm-clock-sec": 100,
1673 .name
= "drive-mirror",
1674 .args_type
= "job-id:s?,sync:s,device:B,target:s,speed:i?,mode:s?,"
1675 "format:s?,node-name:s?,replaces:s?,"
1676 "on-source-error:s?,on-target-error:s?,"
1678 "granularity:i?,buf-size:i?",
1679 .mhandler
.cmd_new
= qmp_marshal_drive_mirror
,
1686 Start mirroring a block device
's writes to a new destination. target
1687 specifies the target of the new image. If the file exists, or if it is
1688 a device, it will be used as the new destination for writes. If it does not
1689 exist, a new file will be created. format specifies the format of the
1690 mirror image, default is to probe if mode='existing
', else the format
1695 - "job-id": Identifier for the newly-created block job. If omitted,
1696 the device name will be used. (json-string, optional)
1697 - "device": the device name or node-name of a root node whose writes should be
1698 mirrored. (json-string)
1699 - "target": name of new image file (json-string)
1700 - "format": format of new image (json-string, optional)
1701 - "node-name": the name of the new block driver state in the node graph
1702 (json-string, optional)
1703 - "replaces": the block driver node name to replace when finished
1704 (json-string, optional)
1705 - "mode": how an image file should be created into the target
1706 file/device (NewImageMode, optional, default 'absolute
-paths
')
1707 - "speed": maximum speed of the streaming job, in bytes per second
1709 - "granularity": granularity of the dirty bitmap, in bytes (json-int, optional)
1710 - "buf-size": maximum amount of data in flight from source to target, in bytes
1711 (json-int, default 10M)
1712 - "sync": what parts of the disk image should be copied to the destination;
1713 possibilities include "full" for all the disk, "top" for only the sectors
1714 allocated in the topmost image, or "none" to only replicate new I/O
1716 - "on-source-error": the action to take on an error on the source
1717 (BlockdevOnError, default 'report
')
1718 - "on-target-error": the action to take on an error on the target
1719 (BlockdevOnError, default 'report
')
1720 - "unmap": whether the target sectors should be discarded where source has only
1721 zeroes. (json-bool, optional, default true)
1723 The default value of the granularity is the image cluster size clamped
1724 between 4096 and 65536, if the image format defines one. If the format
1725 does not define a cluster size, the default value of the granularity
1731 -> { "execute": "drive-mirror", "arguments": { "device": "ide-hd0",
1732 "target": "/some/place/my-image",
1734 "format": "qcow2" } }
1740 .name = "blockdev-mirror",
1741 .args_type = "job-id:s?,sync:s,device:B,target:B,replaces:s?,speed:i?,"
1742 "on-source-error:s?,on-target-error:s?,"
1743 "granularity:i?,buf-size:i?",
1744 .mhandler.cmd_new = qmp_marshal_blockdev_mirror,
1751 Start mirroring a block device's writes to another block device
. target
1752 specifies the target of mirror operation
.
1756 - "job-id": Identifier
for the newly
-created block job
. If omitted
,
1757 the device name will be used
. (json
-string
, optional
)
1758 - "device": The device name or node
-name of a root node whose writes should be
1759 mirrored (json
-string
)
1760 - "target": device name to mirror
to (json
-string
)
1761 - "replaces": the block driver node name to replace when finished
1762 (json
-string
, optional
)
1763 - "speed": maximum speed of the streaming job
, in bytes per second
1765 - "granularity": granularity of the dirty bitmap
, in bytes (json
-int
, optional
)
1766 - "buf_size": maximum amount of data
in flight from source to target
, in bytes
1767 (json
-int
, default 10M
)
1768 - "sync": what parts of the disk image should be copied to the destination
;
1769 possibilities include
"full" for all the disk
, "top" for only the sectors
1770 allocated
in the topmost image
, or
"none" to only replicate
new I
/O
1772 - "on-source-error": the action to take on an error on the source
1773 (BlockdevOnError
, default 'report')
1774 - "on-target-error": the action to take on an error on the target
1775 (BlockdevOnError
, default 'report')
1777 The
default value of the granularity is the image cluster size clamped
1778 between
4096 and
65536, if the image format defines one
. If the format
1779 does not define a cluster size
, the
default value of the granularity
1784 -> { "execute": "blockdev-mirror", "arguments": { "device": "ide-hd0",
1785 "target": "target0",
1791 .name
= "change-backing-file",
1792 .args_type
= "device:s,image-node-name:s,backing-file:s",
1793 .mhandler
.cmd_new
= qmp_marshal_change_backing_file
,
1801 Change the backing file
in the image file metadata
. This does not cause
1802 QEMU to reopen the image file to reparse the backing
filename (it may
,
1803 however
, perform a reopen to change permissions from r
/o
-> r
/w
-> r
/o
,
1804 if needed
). The
new backing file string is written into the image file
1805 metadata
, and the QEMU internal strings are updated
.
1809 - "image-node-name": The name of the block driver state node of the
1810 image to modify
. The
"device" is argument is used to
1811 verify
"image-node-name" is
in the chain described by
1813 (json
-string
, optional
)
1815 - "device": The device name or node
-name of the root node that owns
1819 - "backing-file": The string to write as the backing file
. This string is
1820 not validated
, so care should be taken when specifying
1821 the string or the image chain may not be able to be
1825 Returns
: Nothing on success
1826 If
"device" does not exist or cannot be determined
, DeviceNotFound
1832 .args_type
= "value:M",
1833 .mhandler
.cmd_new
= qmp_marshal_balloon
,
1840 Request VM to change its memory
allocation (in bytes
).
1844 - "value": New memory
allocation (json
-int
)
1848 -> { "execute": "balloon", "arguments": { "value": 536870912 } }
1855 .args_type
= "name:s,up:b",
1856 .mhandler
.cmd_new
= qmp_marshal_set_link
,
1863 Change the link status of a network adapter
.
1867 - "name": network device
name (json
-string
)
1868 - "up": status is
up (json
-bool
)
1872 -> { "execute": "set_link", "arguments": { "name": "e1000.0", "up": false } }
1879 .args_type
= "fdname:s",
1880 .params
= "getfd name",
1881 .help
= "receive a file descriptor via SCM rights and assign it a name",
1882 .mhandler
.cmd_new
= qmp_marshal_getfd
,
1889 Receive a file descriptor via SCM rights and assign it a name
.
1893 - "fdname": file descriptor
name (json
-string
)
1897 -> { "execute": "getfd", "arguments": { "fdname": "fd1" } }
1902 (1) If the name specified by the
"fdname" argument already exists
,
1903 the file descriptor assigned to it will be closed and replaced
1904 by the received file descriptor
.
1905 (2) The
'closefd' command can be used to explicitly close the file
1906 descriptor when it is no longer needed
.
1912 .args_type
= "fdname:s",
1913 .params
= "closefd name",
1914 .help
= "close a file descriptor previously passed via SCM rights",
1915 .mhandler
.cmd_new
= qmp_marshal_closefd
,
1922 Close a file descriptor previously passed via SCM rights
.
1926 - "fdname": file descriptor
name (json
-string
)
1930 -> { "execute": "closefd", "arguments": { "fdname": "fd1" } }
1937 .args_type
= "fdset-id:i?,opaque:s?",
1938 .params
= "add-fd fdset-id opaque",
1939 .help
= "Add a file descriptor, that was passed via SCM rights, to an fd set",
1940 .mhandler
.cmd_new
= qmp_marshal_add_fd
,
1947 Add a file descriptor
, that was passed via SCM rights
, to an fd set
.
1951 - "fdset-id": The ID of the fd set to add the file descriptor to
.
1952 (json
-int
, optional
)
1953 - "opaque": A free
-form string that can be used to describe the fd
.
1954 (json
-string
, optional
)
1956 Return a json
-object with the following information
:
1958 - "fdset-id": The ID of the fd set that the fd was added to
. (json
-int
)
1959 - "fd": The file descriptor that was received via SCM rights and added to the
1964 -> { "execute": "add-fd", "arguments": { "fdset-id": 1 } }
1965 <- { "return": { "fdset-id": 1, "fd": 3 } }
1969 (1) The list of fd sets is shared by all monitor connections
.
1970 (2) If
"fdset-id" is not specified
, a
new fd set will be created
.
1975 .name
= "remove-fd",
1976 .args_type
= "fdset-id:i,fd:i?",
1977 .params
= "remove-fd fdset-id fd",
1978 .help
= "Remove a file descriptor from an fd set",
1979 .mhandler
.cmd_new
= qmp_marshal_remove_fd
,
1986 Remove a file descriptor from an fd set
.
1990 - "fdset-id": The ID of the fd set that the file descriptor belongs to
.
1992 - "fd": The file descriptor that is to be removed
. (json
-int
, optional
)
1996 -> { "execute": "remove-fd", "arguments": { "fdset-id": 1, "fd": 3 } }
2001 (1) The list of fd sets is shared by all monitor connections
.
2002 (2) If
"fd" is not specified
, all file descriptors
in "fdset-id" will be
2008 .name
= "query-fdsets",
2010 .help
= "Return information describing all fd sets",
2011 .mhandler
.cmd_new
= qmp_marshal_query_fdsets
,
2018 Return information describing all fd sets
.
2024 -> { "execute": "query-fdsets" }
2030 "opaque": "rdonly:/path/to/file"
2034 "opaque": "rdwr:/path/to/file"
2053 Note
: The list of fd sets is shared by all monitor connections
.
2058 .name
= "block_passwd",
2059 .args_type
= "device:s?,node-name:s?,password:s",
2060 .mhandler
.cmd_new
= qmp_marshal_block_passwd
,
2067 Set the password of encrypted block devices
.
2071 - "device": device
name (json
-string
)
2072 - "node-name": name
in the block driver state
graph (json
-string
)
2073 - "password": password (json
-string
)
2077 -> { "execute": "block_passwd", "arguments": { "device": "ide0-hd0",
2078 "password": "12345" } }
2084 .name
= "block_set_io_throttle",
2085 .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?",
2086 .mhandler
.cmd_new
= qmp_marshal_block_set_io_throttle
,
2090 block_set_io_throttle
2093 Change I
/O throttle limits
for a block drive
.
2097 - "device": device
name (json
-string
)
2098 - "bps": total throughput limit
in bytes per
second (json
-int
)
2099 - "bps_rd": read throughput limit
in bytes per
second (json
-int
)
2100 - "bps_wr": write throughput limit
in bytes per
second (json
-int
)
2101 - "iops": total I
/O operations per
second (json
-int
)
2102 - "iops_rd": read I
/O operations per
second (json
-int
)
2103 - "iops_wr": write I
/O operations per
second (json
-int
)
2104 - "bps_max": total throughput limit during bursts
, in bytes (json
-int
, optional
)
2105 - "bps_rd_max": read throughput limit during bursts
, in bytes (json
-int
, optional
)
2106 - "bps_wr_max": write throughput limit during bursts
, in bytes (json
-int
, optional
)
2107 - "iops_max": total I
/O operations per second during
bursts (json
-int
, optional
)
2108 - "iops_rd_max": read I
/O operations per second during
bursts (json
-int
, optional
)
2109 - "iops_wr_max": write I
/O operations per second during
bursts (json
-int
, optional
)
2110 - "bps_max_length": maximum length of the @bps_max burst period
, in seconds (json
-int
, optional
)
2111 - "bps_rd_max_length": maximum length of the @bps_rd_max burst period
, in seconds (json
-int
, optional
)
2112 - "bps_wr_max_length": maximum length of the @bps_wr_max burst period
, in seconds (json
-int
, optional
)
2113 - "iops_max_length": maximum length of the @iops_max burst period
, in seconds (json
-int
, optional
)
2114 - "iops_rd_max_length": maximum length of the @iops_rd_max burst period
, in seconds (json
-int
, optional
)
2115 - "iops_wr_max_length": maximum length of the @iops_wr_max burst period
, in seconds (json
-int
, optional
)
2116 - "iops_size": I
/O size
in bytes when
limiting (json
-int
, optional
)
2117 - "group": throttle group
name (json
-string
, optional
)
2121 -> { "execute": "block_set_io_throttle", "arguments": { "device": "virtio0",
2134 "bps_max_length": 60,
2141 .name
= "set_password",
2142 .args_type
= "protocol:s,password:s,connected:s?",
2143 .mhandler
.cmd_new
= qmp_marshal_set_password
,
2150 Set the password
for vnc
/spice protocols
.
2154 - "protocol": protocol
name (json
-string
)
2155 - "password": password (json
-string
)
2156 - "connected": [ keep | disconnect | fail
] (json
-string
, optional
)
2160 -> { "execute": "set_password", "arguments": { "protocol": "vnc",
2161 "password": "secret" } }
2167 .name
= "expire_password",
2168 .args_type
= "protocol:s,time:s",
2169 .mhandler
.cmd_new
= qmp_marshal_expire_password
,
2176 Set the password expire time
for vnc
/spice protocols
.
2180 - "protocol": protocol
name (json
-string
)
2181 - "time": [ now |
never |
+secs | secs
] (json
-string
)
2185 -> { "execute": "expire_password", "arguments": { "protocol": "vnc",
2192 .name
= "add_client",
2193 .args_type
= "protocol:s,fdname:s,skipauth:b?,tls:b?",
2194 .mhandler
.cmd_new
= qmp_marshal_add_client
,
2201 Add a graphics client
2205 - "protocol": protocol
name (json
-string
)
2206 - "fdname": file descriptor
name (json
-string
)
2207 - "skipauth": whether to skip
authentication (json
-bool
, optional
)
2208 - "tls": whether to perform
TLS (json
-bool
, optional
)
2212 -> { "execute": "add_client", "arguments": { "protocol": "vnc",
2213 "fdname": "myclient" } }
2218 .name
= "qmp_capabilities",
2221 .help
= "enable QMP capabilities",
2222 .mhandler
.cmd_new
= qmp_capabilities
,
2229 Enable QMP capabilities
.
2235 -> { "execute": "qmp_capabilities" }
2238 Note
: This command must be issued before issuing any other command
.
2243 .name
= "human-monitor-command",
2244 .args_type
= "command-line:s,cpu-index:i?",
2245 .mhandler
.cmd_new
= qmp_marshal_human_monitor_command
,
2249 human
-monitor
-command
2250 ---------------------
2252 Execute a Human Monitor command
.
2256 - command
-line
: the command name and its arguments
, just like the
2257 Human Monitor
's shell (json-string)
2258 - cpu-index: select the CPU number to be used by commands which access CPU
2259 data, like 'info registers
'. The Monitor selects CPU 0 if this
2260 argument is not provided (json-int, optional)
2264 -> { "execute": "human-monitor-command", "arguments": { "command-line": "info kvm" } }
2265 <- { "return": "kvm support: enabled\r\n" }
2269 (1) The Human Monitor is NOT an stable interface, this means that command
2270 names, arguments and responses can change or be removed at ANY time.
2271 Applications that rely on long term stability guarantees should NOT
2276 o This command is stateless, this means that commands that depend
2277 on state information (such as getfd) might not work
2279 o Commands that prompt the user for data (eg. 'cont
' when the block
2280 device is encrypted) don't currently work
2285 HXCOMM Each query command below is inside a SQMP
/EQMP section
, do NOT change
2286 HXCOMM
this! We will possibly move query commands definitions inside those
2287 HXCOMM sections
, just like regular commands
.
2297 Return a json
-object with the following information
:
2299 - "qemu": A json
-object containing three integer values
:
2300 - "major": QEMU
's major version (json-int)
2301 - "minor": QEMU's minor
version (json
-int
)
2302 - "micro": QEMU
's micro version (json-int)
2303 - "package": package's
version (json
-string
)
2307 -> { "execute": "query-version" }
2322 .name
= "query-version",
2324 .mhandler
.cmd_new
= qmp_marshal_query_version
,
2331 List QMP available commands
.
2333 Each command is represented by a json
-object
, the returned value is a json
-array
2336 Each json
-object contain
:
2338 - "name": command
's name (json-string)
2342 -> { "execute": "query-commands" }
2346 "name":"query-balloon"
2349 "name":"system_powerdown"
2354 Note: This example has been shortened as the real response is too long.
2359 .name = "query-commands",
2361 .mhandler.cmd_new = qmp_marshal_query_commands,
2368 List QMP available events.
2370 Each event is represented by a json-object, the returned value is a json-array
2373 Each json-object contains:
2375 - "name": event's
name (json
-string
)
2379 -> { "execute": "query-events" }
2391 Note
: This example has been shortened as the real response is too long
.
2396 .name
= "query-events",
2398 .mhandler
.cmd_new
= qmp_marshal_query_events
,
2405 Return the QMP wire schema
. The returned value is a json
-array of
2406 named schema entities
. Entities are commands
, events and various
2407 types
. See docs
/qapi
-code
-gen
.txt
for information on their structure
2413 .name
= "query-qmp-schema",
2415 .mhandler
.cmd_new
= qmp_query_qmp_schema
,
2422 Each device is represented by a json
-object
. The returned value is a json
-array
2425 Each json
-object contain the following
:
2427 - "label": device
's label (json-string)
2428 - "filename": device's
file (json
-string
)
2429 - "frontend-open": open
/closed state of the frontend device attached to
this
2434 -> { "execute": "query-chardev" }
2438 "label": "charchannel0",
2439 "filename": "unix:/var/lib/libvirt/qemu/seabios.rhel6.agent,server",
2440 "frontend-open": false
2443 "label": "charmonitor",
2444 "filename": "unix:/var/lib/libvirt/qemu/seabios.rhel6.monitor,server",
2445 "frontend-open": true
2448 "label": "charserial0",
2449 "filename": "pty:/dev/pts/2",
2450 "frontend-open": true
2458 .name
= "query-chardev",
2460 .mhandler
.cmd_new
= qmp_marshal_query_chardev
,
2464 query
-chardev
-backends
2467 List available character device backends
.
2469 Each backend is represented by a json
-object
, the returned value is a json
-array
2472 Each json
-object contains
:
2474 - "name": backend
name (json
-string
)
2478 -> { "execute": "query-chardev-backends" }
2499 .name
= "query-chardev-backends",
2501 .mhandler
.cmd_new
= qmp_marshal_query_chardev_backends
,
2508 Show the block devices
.
2510 Each block device information is stored
in a json
-object and the returned value
2511 is a json
-array of all devices
.
2513 Each json
-object contain the following
:
2515 - "device": device
name (json
-string
)
2516 - "type": device
type (json
-string
)
2517 - deprecated
, retained
for backward compatibility
2518 - Possible values
: "unknown"
2519 - "removable": true if the device is removable
, false otherwise (json
-bool
)
2520 - "locked": true if the device is locked
, false otherwise (json
-bool
)
2521 - "tray_open": only present
if removable
, true if the device has a tray
,
2522 and it is
open (json
-bool
)
2523 - "inserted": only present
if the device is inserted
, it is a json
-object
2524 containing the following
:
2525 - "file": device file
name (json
-string
)
2526 - "ro": true if read
-only
, false otherwise (json
-bool
)
2527 - "drv": driver format
name (json
-string
)
2528 - Possible values
: "blkdebug", "bochs", "cloop", "dmg",
2529 "file", "file", "ftp", "ftps", "host_cdrom",
2530 "host_device", "http", "https",
2531 "nbd", "parallels", "qcow", "qcow2", "raw",
2532 "tftp", "vdi", "vmdk", "vpc", "vvfat"
2533 - "backing_file": backing file
name (json
-string
, optional
)
2534 - "backing_file_depth": number of files
in the backing file
chain (json
-int
)
2535 - "encrypted": true if encrypted
, false otherwise (json
-bool
)
2536 - "bps": limit total bytes per
second (json
-int
)
2537 - "bps_rd": limit read bytes per
second (json
-int
)
2538 - "bps_wr": limit write bytes per
second (json
-int
)
2539 - "iops": limit total I
/O operations per
second (json
-int
)
2540 - "iops_rd": limit read operations per
second (json
-int
)
2541 - "iops_wr": limit write operations per
second (json
-int
)
2542 - "bps_max": total max
in bytes (json
-int
)
2543 - "bps_rd_max": read max
in bytes (json
-int
)
2544 - "bps_wr_max": write max
in bytes (json
-int
)
2545 - "iops_max": total I
/O operations
max (json
-int
)
2546 - "iops_rd_max": read I
/O operations
max (json
-int
)
2547 - "iops_wr_max": write I
/O operations
max (json
-int
)
2548 - "iops_size": I
/O size when limiting by
iops (json
-int
)
2549 - "detect_zeroes": detect and optimize zero
writing (json
-string
)
2550 - Possible values
: "off", "on", "unmap"
2551 - "write_threshold": write offset threshold
in bytes
, a event will be
2552 emitted
if crossed
. Zero
if disabled (json
-int
)
2553 - "image": the detail of the image
, it is a json
-object containing
2555 - "filename": image file
name (json
-string
)
2556 - "format": image
format (json
-string
)
2557 - "virtual-size": image capacity
in bytes (json
-int
)
2558 - "dirty-flag": true if image is not cleanly closed
, not present
2559 means
clean (json
-bool
, optional
)
2560 - "actual-size": actual size on disk
in bytes of the image
, not
2561 present when image does not support thin
2562 provision (json
-int
, optional
)
2563 - "cluster-size": size of a cluster
in bytes
, not present
if image
2564 format does not support
it (json
-int
, optional
)
2565 - "encrypted": true if the image is encrypted
, not present means
2566 false or the image format does not support
2567 encryption (json
-bool
, optional
)
2568 - "backing_file": backing file name
, not present means no backing
2569 file is used or the image format does not
2570 support backing file chain
2571 (json
-string
, optional
)
2572 - "full-backing-filename": full path of the backing file
, not
2573 present
if it equals backing_file or no
2574 backing file is used
2575 (json
-string
, optional
)
2576 - "backing-filename-format": the format of the backing file
, not
2577 present means unknown or no backing
2578 file (json
-string
, optional
)
2579 - "snapshots": the internal snapshot info
, it is an optional list
2580 of json
-object containing the following
:
2581 - "id": unique snapshot
id (json
-string
)
2582 - "name": snapshot
name (json
-string
)
2583 - "vm-state-size": size of the VM state
in bytes (json
-int
)
2584 - "date-sec": UTC date of the snapshot
in seconds (json
-int
)
2585 - "date-nsec": fractional part
in nanoseconds to be used with
2587 - "vm-clock-sec": VM clock relative to boot
in seconds
2589 - "vm-clock-nsec": fractional part
in nanoseconds to be used
2590 with vm
-clock
-sec (json
-int
)
2591 - "backing-image": the detail of the backing image
, it is an
2592 optional json
-object only present when a
2593 backing image present
for this image
2595 - "io-status": I
/O operation status
, only present
if the device supports it
2596 and the VM is configured to stop on errors
. It
's always reset
2597 to "ok" when the "cont" command is issued (json_string, optional)
2598 - Possible values: "ok", "failed", "nospace"
2602 -> { "execute": "query-block" }
2607 "device":"ide0-hd0",
2614 "file":"disks/test.qcow2",
2615 "backing_file_depth":1,
2629 "detect_zeroes": "on",
2630 "write_threshold": 0,
2632 "filename":"disks/test.qcow2",
2634 "virtual-size":2048000,
2635 "backing_file":"base.qcow2",
2636 "full-backing-filename":"disks/base.qcow2",
2637 "backing-filename-format":"qcow2",
2641 "name": "snapshot1",
2643 "date-sec": 10000200,
2645 "vm-clock-sec": 206,
2650 "filename":"disks/base.qcow2",
2652 "virtual-size":2048000
2660 "device":"ide1-cd0",
2683 .name = "query-block",
2685 .mhandler.cmd_new = qmp_marshal_query_block,
2692 Show block device statistics.
2694 Each device statistic information is stored in a json-object and the returned
2695 value is a json-array of all devices.
2697 Each json-object contain the following:
2699 - "device": device name (json-string)
2700 - "stats": A json-object with the statistics information, it contains:
2701 - "rd_bytes": bytes read (json-int)
2702 - "wr_bytes": bytes written (json-int)
2703 - "rd_operations": read operations (json-int)
2704 - "wr_operations": write operations (json-int)
2705 - "flush_operations": cache flush operations (json-int)
2706 - "wr_total_time_ns": total time spend on writes in nano-seconds (json-int)
2707 - "rd_total_time_ns": total time spend on reads in nano-seconds (json-int)
2708 - "flush_total_time_ns": total time spend on cache flushes in nano-seconds (json-int)
2709 - "wr_highest_offset": The offset after the greatest byte written to the
2710 BlockDriverState since it has been opened (json-int)
2711 - "rd_merged": number of read requests that have been merged into
2712 another request (json-int)
2713 - "wr_merged": number of write requests that have been merged into
2714 another request (json-int)
2715 - "idle_time_ns": time since the last I/O operation, in
2716 nanoseconds. If the field is absent it means
2717 that there haven't been any operations yet
2718 (json
-int
, optional
)
2719 - "failed_rd_operations": number of failed read operations
2721 - "failed_wr_operations": number of failed write operations
2723 - "failed_flush_operations": number of failed flush operations
2725 - "invalid_rd_operations": number of invalid read operations
2727 - "invalid_wr_operations": number of invalid write operations
2729 - "invalid_flush_operations": number of invalid flush operations
2731 - "account_invalid": whether invalid operations are included
in
2732 the last access
statistics (json
-bool
)
2733 - "account_failed": whether failed operations are included
in the
2734 latency and last access statistics
2736 - "timed_stats": A json
-array containing statistics collected
in
2737 specific intervals
, with the following members
:
2738 - "interval_length": interval used
for calculating the
2739 statistics
, in seconds (json
-int
)
2740 - "min_rd_latency_ns": minimum latency of read operations
in
2741 the defined interval
, in nanoseconds
2743 - "min_wr_latency_ns": minimum latency of write operations
in
2744 the defined interval
, in nanoseconds
2746 - "min_flush_latency_ns": minimum latency of flush operations
2747 in the defined interval
, in
2748 nanoseconds (json
-int
)
2749 - "max_rd_latency_ns": maximum latency of read operations
in
2750 the defined interval
, in nanoseconds
2752 - "max_wr_latency_ns": maximum latency of write operations
in
2753 the defined interval
, in nanoseconds
2755 - "max_flush_latency_ns": maximum latency of flush operations
2756 in the defined interval
, in
2757 nanoseconds (json
-int
)
2758 - "avg_rd_latency_ns": average latency of read operations
in
2759 the defined interval
, in nanoseconds
2761 - "avg_wr_latency_ns": average latency of write operations
in
2762 the defined interval
, in nanoseconds
2764 - "avg_flush_latency_ns": average latency of flush operations
2765 in the defined interval
, in
2766 nanoseconds (json
-int
)
2767 - "avg_rd_queue_depth": average number of pending read
2768 operations
in the defined interval
2770 - "avg_wr_queue_depth": average number of pending write
2771 operations
in the defined interval
2773 - "parent": Contains recursively the statistics of the underlying
2774 protocol (e
.g
. the host file
for a qcow2 image
). If there is
2775 no underlying protocol
, this field is omitted
2776 (json
-object
, optional
)
2780 -> { "execute": "query-blockstats" }
2784 "device":"ide0-hd0",
2787 "wr_highest_offset":3686448128,
2789 "wr_operations":751,
2790 "rd_bytes":122567168,
2791 "rd_operations":36772
2792 "wr_total_times_ns":313253456
2793 "rd_total_times_ns":3465673657
2794 "flush_total_times_ns":49653
2795 "flush_operations":61,
2798 "idle_time_ns":2953431879,
2799 "account_invalid":true,
2800 "account_failed":false
2804 "wr_highest_offset":2821110784,
2806 "wr_operations":692,
2807 "rd_bytes":122739200,
2808 "rd_operations":36604
2809 "flush_operations":51,
2810 "wr_total_times_ns":313253456
2811 "rd_total_times_ns":3465673657
2812 "flush_total_times_ns":49653,
2815 "idle_time_ns":2953431879,
2816 "account_invalid":true,
2817 "account_failed":false
2821 "device":"ide1-cd0",
2823 "wr_highest_offset":0,
2828 "flush_operations":0,
2829 "wr_total_times_ns":0
2830 "rd_total_times_ns":0
2831 "flush_total_times_ns":0,
2834 "account_invalid":false,
2835 "account_failed":false
2841 "wr_highest_offset":0,
2846 "flush_operations":0,
2847 "wr_total_times_ns":0
2848 "rd_total_times_ns":0
2849 "flush_total_times_ns":0,
2852 "account_invalid":false,
2853 "account_failed":false
2859 "wr_highest_offset":0,
2864 "flush_operations":0,
2865 "wr_total_times_ns":0
2866 "rd_total_times_ns":0
2867 "flush_total_times_ns":0,
2870 "account_invalid":false,
2871 "account_failed":false
2880 .name
= "query-blockstats",
2881 .args_type
= "query-nodes:b?",
2882 .mhandler
.cmd_new
= qmp_marshal_query_blockstats
,
2889 Show CPU information
.
2891 Return a json
-array
. Each CPU is represented by a json
-object
, which contains
:
2893 - "CPU": CPU
index (json
-int
)
2894 - "current": true if this is the current CPU
, false otherwise (json
-bool
)
2895 - "halted": true if the cpu is halted
, false otherwise (json
-bool
)
2896 - "qom_path": path to the CPU object
in the QOM
tree (json
-str
)
2897 - "arch": architecture of the cpu
, which determines what additional
2898 keys will be
present (json
-str
)
2899 - Current program counter
. The key
's name depends on the architecture:
2900 "pc": i386/x86_64 (json-int)
2901 "nip": PPC (json-int)
2902 "pc" and "npc": sparc (json-int)
2903 "PC": mips (json-int)
2904 - "thread_id": ID of the underlying host thread (json-int)
2908 -> { "execute": "query-cpus" }
2915 "qom_path":"/machine/unattached/device[0]",
2924 "qom_path":"/machine/unattached/device[2]",
2935 .name = "query-cpus",
2937 .mhandler.cmd_new = qmp_marshal_query_cpus,
2944 Returns a list of information about each iothread.
2946 Note this list excludes the QEMU main loop thread, which is not declared
2947 using the -object iothread command-line option. It is always the main thread
2950 Return a json-array. Each iothread is represented by a json-object, which contains:
2952 - "id": name of iothread (json-str)
2953 - "thread-id": ID of the underlying host thread (json-int)
2957 -> { "execute": "query-iothreads" }
2974 .name = "query-iothreads",
2976 .mhandler.cmd_new = qmp_marshal_query_iothreads,
2983 PCI buses and devices information.
2985 The returned value is a json-array of all buses. Each bus is represented by
2986 a json-object, which has a key with a json-array of all PCI devices attached
2987 to it. Each device is represented by a json-object.
2989 The bus json-object contains the following:
2991 - "bus": bus number (json-int)
2992 - "devices": a json-array of json-objects, each json-object represents a
2995 The PCI device json-object contains the following:
2997 - "bus": identical to the parent's bus
number (json
-int
)
2998 - "slot": slot
number (json
-int
)
2999 - "function": function number (json
-int
)
3000 - "class_info": a json
-object containing
:
3001 - "desc": device
class description (json
-string
, optional
)
3002 - "class": device
class number (json
-int
)
3003 - "id": a json
-object containing
:
3004 - "device": device
ID (json
-int
)
3005 - "vendor": vendor
ID (json
-int
)
3006 - "irq": device
's IRQ if assigned (json-int, optional)
3007 - "qdev_id": qdev id string (json-string)
3008 - "pci_bridge": It's a json
-object
, only present
if this device is a
3009 PCI bridge
, contains
:
3010 - "bus": bus
number (json
-int
)
3011 - "secondary": secondary bus
number (json
-int
)
3012 - "subordinate": subordinate bus
number (json
-int
)
3013 - "io_range": I
/O memory range information
, a json
-object with the
3015 - "base": base address
, in bytes (json
-int
)
3016 - "limit": limit address
, in bytes (json
-int
)
3017 - "memory_range": memory range information
, a json
-object with the
3019 - "base": base address
, in bytes (json
-int
)
3020 - "limit": limit address
, in bytes (json
-int
)
3021 - "prefetchable_range": Prefetchable memory range information
, a
3022 json
-object with the following members
:
3023 - "base": base address
, in bytes (json
-int
)
3024 - "limit": limit address
, in bytes (json
-int
)
3025 - "devices": a json
-array of PCI devices
if there
's any attached, each
3026 each element is represented by a json-object, which contains
3027 the same members of the 'PCI device json
-object
' described
3029 - "regions": a json-array of json-objects, each json-object represents a
3030 memory region of this device
3032 The memory range json-object contains the following:
3034 - "base": base memory address (json-int)
3035 - "limit": limit value (json-int)
3037 The region json-object can be an I/O region or a memory region, an I/O region
3038 json-object contains the following:
3040 - "type": "io" (json-string, fixed)
3041 - "bar": BAR number (json-int)
3042 - "address": memory address (json-int)
3043 - "size": memory size (json-int)
3045 A memory region json-object contains the following:
3047 - "type": "memory" (json-string, fixed)
3048 - "bar": BAR number (json-int)
3049 - "address": memory address (json-int)
3050 - "size": memory size (json-int)
3051 - "mem_type_64": true or false (json-bool)
3052 - "prefetch": true or false (json-bool)
3056 -> { "execute": "query-pci" }
3068 "desc":"Host bridge"
3102 "desc":"IDE controller"
3124 "desc":"VGA controller"
3134 "mem_type_64":false,
3137 "address":4026531840,
3142 "mem_type_64":false,
3145 "address":4060086272,
3150 "mem_type_64":false,
3165 "desc":"RAM controller"
3186 Note: This example has been shortened as the real response is too long.
3191 .name = "query-pci",
3193 .mhandler.cmd_new = qmp_marshal_query_pci,
3200 Show KVM information.
3202 Return a json-object with the following information:
3204 - "enabled": true if KVM support is enabled, false otherwise (json-bool)
3205 - "present": true if QEMU has KVM support, false otherwise (json-bool)
3209 -> { "execute": "query-kvm" }
3210 <- { "return": { "enabled": true, "present": true } }
3215 .name = "query-kvm",
3217 .mhandler.cmd_new = qmp_marshal_query_kvm,
3224 Return a json-object with the following information:
3226 - "running": true if the VM is running, or false if it is paused (json-bool)
3227 - "singlestep": true if the VM is in single step mode,
3228 false otherwise (json-bool)
3229 - "status": one of the following values (json-string)
3230 "debug" - QEMU is running on a debugger
3231 "inmigrate" - guest is paused waiting for an incoming migration
3232 "internal-error" - An internal error that prevents further guest
3233 execution has occurred
3234 "io-error" - the last IOP has failed and the device is configured
3235 to pause on I/O errors
3236 "paused" - guest has been paused via the 'stop
' command
3237 "postmigrate" - guest is paused following a successful 'migrate
'
3238 "prelaunch" - QEMU was started with -S and guest has not started
3239 "finish-migrate" - guest is paused to finish the migration process
3240 "restore-vm" - guest is paused to restore VM state
3241 "running" - guest is actively running
3242 "save-vm" - guest is paused to save the VM state
3243 "shutdown" - guest is shut down (and -no-shutdown is in use)
3244 "watchdog" - the watchdog action is configured to pause and
3249 -> { "execute": "query-status" }
3250 <- { "return": { "running": true, "singlestep": false, "status": "running" } }
3255 .name = "query-status",
3257 .mhandler.cmd_new = qmp_marshal_query_status,
3264 Show VM mice information.
3266 Each mouse is represented by a json-object, the returned value is a json-array
3269 The mouse json-object contains the following:
3271 - "name": mouse's
name (json
-string
)
3272 - "index": mouse
's index (json-int)
3273 - "current": true if this mouse is receiving events, false otherwise (json-bool)
3274 - "absolute": true if the mouse generates absolute input events (json-bool)
3278 -> { "execute": "query-mice" }
3282 "name":"QEMU Microsoft Mouse",
3288 "name":"QEMU PS/2 Mouse",
3299 .name = "query-mice",
3301 .mhandler.cmd_new = qmp_marshal_query_mice,
3308 Show VNC server information.
3310 Return a json-object with server information. Connected clients are returned
3311 as a json-array of json-objects.
3313 The main json-object contains the following:
3315 - "enabled": true or false (json-bool)
3316 - "host": server's IP
address (json
-string
)
3317 - "family": address
family (json
-string
)
3318 - Possible values
: "ipv4", "ipv6", "unix", "unknown"
3319 - "service": server
's port number (json-string)
3320 - "auth": authentication method (json-string)
3321 - Possible values: "invalid", "none", "ra2", "ra2ne", "sasl", "tight",
3322 "tls", "ultra", "unknown", "vencrypt", "vencrypt",
3323 "vencrypt+plain", "vencrypt+tls+none",
3324 "vencrypt+tls+plain", "vencrypt+tls+sasl",
3325 "vencrypt+tls+vnc", "vencrypt+x509+none",
3326 "vencrypt+x509+plain", "vencrypt+x509+sasl",
3327 "vencrypt+x509+vnc", "vnc"
3328 - "clients": a json-array of all connected clients
3330 Clients are described by a json-object, each one contain the following:
3332 - "host": client's IP
address (json
-string
)
3333 - "family": address
family (json
-string
)
3334 - Possible values
: "ipv4", "ipv6", "unix", "unknown"
3335 - "service": client
's port number (json-string)
3336 - "x509_dname": TLS dname (json-string, optional)
3337 - "sasl_username": SASL username (json-string, optional)
3341 -> { "execute": "query-vnc" }
3362 .name = "query-vnc",
3364 .mhandler.cmd_new = qmp_marshal_query_vnc,
3367 .name = "query-vnc-servers",
3369 .mhandler.cmd_new = qmp_marshal_query_vnc_servers,
3376 Show SPICE server information.
3378 Return a json-object with server information. Connected clients are returned
3379 as a json-array of json-objects.
3381 The main json-object contains the following:
3383 - "enabled": true or false (json-bool)
3384 - "host": server's IP
address (json
-string
)
3385 - "port": server
's port number (json-int, optional)
3386 - "tls-port": server's port
number (json
-int
, optional
)
3387 - "auth": authentication
method (json
-string
)
3388 - Possible values
: "none", "spice"
3389 - "channels": a json
-array of all active channels clients
3391 Channels are described by a json
-object
, each one contain the following
:
3393 - "host": client
's IP address (json-string)
3394 - "family": address family (json-string)
3395 - Possible values: "ipv4", "ipv6", "unix", "unknown"
3396 - "port": client's port
number (json
-string
)
3397 - "connection-id": spice connection id
. All channels with the same id
3398 belong to the same spice
session (json
-int
)
3399 - "channel-type": channel type
. "1" is the main control channel
, filter
for
3400 this one
if you want track spice sessions
only (json
-int
)
3401 - "channel-id": channel id
. Usually
"0", might be different needed when
3402 multiple channels of the same type exist
, such as multiple
3403 display channels
in a multihead
setup (json
-int
)
3404 - "tls": whether the channel is
encrypted (json
-bool
)
3408 -> { "execute": "query-spice" }
3421 "connection-id": 1804289383,
3422 "host": "127.0.0.1",
3430 "connection-id": 1804289383,
3431 "host": "127.0.0.1",
3435 [ ... more channels follow
... ]
3442 #
if defined(CONFIG_SPICE
)
3444 .name
= "query-spice",
3446 .mhandler
.cmd_new
= qmp_marshal_query_spice
,
3456 Return a json
-object with the following information
:
3458 - "name": VM
's name (json-string, optional)
3462 -> { "execute": "query-name" }
3463 <- { "return": { "name": "qemu-name" } }
3468 .name = "query-name",
3470 .mhandler.cmd_new = qmp_marshal_query_name,
3479 Return a json-object with the following information:
3481 - "UUID": Universally Unique Identifier (json-string)
3485 -> { "execute": "query-uuid" }
3486 <- { "return": { "UUID": "550e8400-e29b-41d4-a716-446655440000" } }
3491 .name = "query-uuid",
3493 .mhandler.cmd_new = qmp_marshal_query_uuid,
3497 query-command-line-options
3498 --------------------------
3500 Show command line option schema.
3502 Return a json-array of command line option schema for all options (or for
3503 the given option), returning an error if the given option doesn't exist
.
3505 Each array entry contains the following
:
3507 - "option": option
name (json
-string
)
3508 - "parameters": a json
-array describes all parameters of the option
:
3509 - "name": parameter
name (json
-string
)
3510 - "type": parameter
type (one of
'string', 'boolean', 'number',
3512 - "help": human readable description of the parameter
3513 (json
-string
, optional
)
3514 - "default": default value string
for the parameter
3515 (json
-string
, optional
)
3519 -> { "execute": "query-command-line-options", "arguments": { "option": "option-rom" } }
3528 "name": "bootindex",
3532 "option": "option-rom"
3540 .name
= "query-command-line-options",
3541 .args_type
= "option:s?",
3542 .mhandler
.cmd_new
= qmp_marshal_query_command_line_options
,
3551 Return a json
-object
. If migration is active there will be another json
-object
3552 with RAM migration status and
if block migration is active another one with
3553 block migration status
.
3555 The main json
-object contains the following
:
3557 - "status": migration
status (json
-string
)
3558 - Possible values
: "setup", "active", "completed", "failed", "cancelled"
3559 - "total-time": total amount of ms since migration started
. If
3560 migration has ended
, it returns the total migration
3562 - "setup-time" amount of setup time
in milliseconds _before_ the
3563 iterations begin but _after_ the QMP command is issued
.
3564 This is designed to provide an accounting of any activities
3565 (such as RDMA pinning
) which may be expensive
, but
do not
3566 actually occur during the iterative migration rounds
3567 themselves
. (json
-int
)
3568 - "downtime": only present when migration has finished correctly
3569 total amount
in ms
for downtime that
happened (json
-int
)
3570 - "expected-downtime": only present
while migration is active
3571 total amount
in ms
for downtime that was calculated on
3572 the last bitmap
round (json
-int
)
3573 - "ram": only present
if "status" is
"active", it is a json
-object with the
3574 following RAM information
:
3575 - "transferred": amount transferred
in bytes (json
-int
)
3576 - "remaining": amount remaining to transfer
in bytes (json
-int
)
3577 - "total": total amount of memory
in bytes (json
-int
)
3578 - "duplicate": number of pages filled entirely with the same
3580 These are sent over the wire much more efficiently
.
3581 - "skipped": number of skipped zero
pages (json
-int
)
3582 - "normal" : number of whole pages transferred
. I
.e
. they
3583 were not sent as duplicate or xbzrle
pages (json
-int
)
3584 - "normal-bytes" : number of bytes transferred
in whole
3585 pages
. This is just normal pages times size of one page
,
3586 but
this way upper levels don
't need to care about page
3588 - "dirty-sync-count": times that dirty ram was synchronized (json-int)
3589 - "disk": only present if "status" is "active" and it is a block migration,
3590 it is a json-object with the following disk information:
3591 - "transferred": amount transferred in bytes (json-int)
3592 - "remaining": amount remaining to transfer in bytes json-int)
3593 - "total": total disk size in bytes (json-int)
3594 - "xbzrle-cache": only present if XBZRLE is active.
3595 It is a json-object with the following XBZRLE information:
3596 - "cache-size": XBZRLE cache size in bytes
3597 - "bytes": number of bytes transferred for XBZRLE compressed pages
3598 - "pages": number of XBZRLE compressed pages
3599 - "cache-miss": number of XBRZRLE page cache misses
3600 - "cache-miss-rate": rate of XBRZRLE page cache misses
3601 - "overflow": number of times XBZRLE overflows. This means
3602 that the XBZRLE encoding was bigger than just sent the
3603 whole page, and then we sent the whole page instead (as as
3608 1. Before the first migration
3610 -> { "execute": "query-migrate" }
3613 2. Migration is done and has succeeded
3615 -> { "execute": "query-migrate" }
3617 "status": "completed",
3627 "normal-bytes":123456,
3628 "dirty-sync-count":15
3633 3. Migration is done and has failed
3635 -> { "execute": "query-migrate" }
3636 <- { "return": { "status": "failed" } }
3638 4. Migration is being performed and is not a block migration:
3640 -> { "execute": "query-migrate" }
3650 "expected-downtime":12345,
3653 "normal-bytes":123456,
3654 "dirty-sync-count":15
3659 5. Migration is being performed and is a block migration:
3661 -> { "execute": "query-migrate" }
3667 "remaining":1053304,
3671 "expected-downtime":12345,
3674 "normal-bytes":123456,
3675 "dirty-sync-count":15
3679 "remaining":20880384,
3685 6. Migration is being performed and XBZRLE is active:
3687 -> { "execute": "query-migrate" }
3691 "capabilities" : [ { "capability": "xbzrle", "state" : true } ],
3694 "remaining":1053304,
3698 "expected-downtime":12345,
3701 "normal-bytes":3412992,
3702 "dirty-sync-count":15
3705 "cache-size":67108864,
3709 "cache-miss-rate":0.123,
3718 .name = "query-migrate",
3720 .mhandler.cmd_new = qmp_marshal_query_migrate,
3724 migrate-set-capabilities
3725 ------------------------
3727 Enable/Disable migration capabilities
3729 - "xbzrle": XBZRLE support
3730 - "rdma-pin-all": pin all pages when using RDMA during migration
3731 - "auto-converge": throttle down guest to help convergence of migration
3732 - "zero-blocks": compress zero blocks during block migration
3733 - "compress": use multiple compression threads to accelerate live migration
3734 - "events": generate events for each migration state change
3735 - "postcopy-ram": postcopy mode for live migration
3741 -> { "execute": "migrate-set-capabilities" , "arguments":
3742 { "capabilities": [ { "capability": "xbzrle", "state": true } ] } }
3747 .name = "migrate-set-capabilities",
3748 .args_type = "capabilities:q",
3749 .params = "capability:s,state:b",
3750 .mhandler.cmd_new = qmp_marshal_migrate_set_capabilities,
3753 query-migrate-capabilities
3754 --------------------------
3756 Query current migration capabilities
3758 - "capabilities": migration capabilities state
3759 - "xbzrle" : XBZRLE state (json-bool)
3760 - "rdma-pin-all" : RDMA Pin Page state (json-bool)
3761 - "auto-converge" : Auto Converge state (json-bool)
3762 - "zero-blocks" : Zero Blocks state (json-bool)
3763 - "compress": Multiple compression threads state (json-bool)
3764 - "events": Migration state change event state (json-bool)
3765 - "postcopy-ram": postcopy ram state (json-bool)
3771 -> { "execute": "query-migrate-capabilities" }
3773 {"state": false, "capability": "xbzrle"},
3774 {"state": false, "capability": "rdma-pin-all"},
3775 {"state": false, "capability": "auto-converge"},
3776 {"state": false, "capability": "zero-blocks"},
3777 {"state": false, "capability": "compress"},
3778 {"state": true, "capability": "events"},
3779 {"state": false, "capability": "postcopy-ram"}
3785 .name = "query-migrate-capabilities",
3787 .mhandler.cmd_new = qmp_marshal_query_migrate_capabilities,
3791 migrate-set-parameters
3792 ----------------------
3794 Set migration parameters
3796 - "compress-level": set compression level during migration (json-int)
3797 - "compress-threads": set compression thread count for migration (json-int)
3798 - "decompress-threads": set decompression thread count for migration (json-int)
3799 - "cpu-throttle-initial": set initial percentage of time guest cpus are
3800 throttled for auto-converge (json-int)
3801 - "cpu-throttle-increment": set throttle increasing percentage for
3802 auto-converge (json-int)
3808 -> { "execute": "migrate-set-parameters" , "arguments":
3809 { "compress-level": 1 } }
3814 .name = "migrate-set-parameters",
3816 "compress-level:i?,compress-threads:i?,decompress-threads:i?,cpu-throttle-initial:i?,cpu-throttle-increment:i?",
3817 .mhandler.cmd_new = qmp_marshal_migrate_set_parameters,
3820 query-migrate-parameters
3821 ------------------------
3823 Query current migration parameters
3825 - "parameters": migration parameters value
3826 - "compress-level" : compression level value (json-int)
3827 - "compress-threads" : compression thread count value (json-int)
3828 - "decompress-threads" : decompression thread count value (json-int)
3829 - "cpu-throttle-initial" : initial percentage of time guest cpus are
3830 throttled (json-int)
3831 - "cpu-throttle-increment" : throttle increasing percentage for
3832 auto-converge (json-int)
3838 -> { "execute": "query-migrate-parameters" }
3841 "decompress-threads": 2,
3842 "cpu-throttle-increment": 10,
3843 "compress-threads": 8,
3844 "compress-level": 1,
3845 "cpu-throttle-initial": 20
3852 .name = "query-migrate-parameters",
3854 .mhandler.cmd_new = qmp_marshal_query_migrate_parameters,
3861 Show balloon information.
3863 Make an asynchronous request for balloon info. When the request completes a
3864 json-object will be returned containing the following data:
3866 - "actual": current balloon value in bytes (json-int)
3870 -> { "execute": "query-balloon" }
3873 "actual":1073741824,
3880 .name = "query-balloon",
3882 .mhandler.cmd_new = qmp_marshal_query_balloon,
3886 .name = "query-block-jobs",
3888 .mhandler.cmd_new = qmp_marshal_query_block_jobs,
3893 .args_type = "path:s",
3894 .mhandler.cmd_new = qmp_marshal_qom_list,
3899 .args_type = "path:s,property:s,value:q",
3900 .mhandler.cmd_new = qmp_marshal_qom_set,
3905 .args_type = "path:s,property:s",
3906 .mhandler.cmd_new = qmp_marshal_qom_get,
3910 .name = "nbd-server-start",
3911 .args_type = "addr:q,tls-creds:s?",
3912 .mhandler.cmd_new = qmp_marshal_nbd_server_start,
3915 .name = "nbd-server-add",
3916 .args_type = "device:B,writable:b?",
3917 .mhandler.cmd_new = qmp_marshal_nbd_server_add,
3920 .name = "nbd-server-stop",
3922 .mhandler.cmd_new = qmp_marshal_nbd_server_stop,
3926 .name = "change-vnc-password",
3927 .args_type = "password:s",
3928 .mhandler.cmd_new = qmp_marshal_change_vnc_password,
3931 .name = "qom-list-types",
3932 .args_type = "implements:s?,abstract:b?",
3933 .mhandler.cmd_new = qmp_marshal_qom_list_types,
3937 .name = "device-list-properties",
3938 .args_type = "typename:s",
3939 .mhandler.cmd_new = qmp_marshal_device_list_properties,
3943 .name = "query-machines",
3945 .mhandler.cmd_new = qmp_marshal_query_machines,
3949 .name = "query-cpu-definitions",
3951 .mhandler.cmd_new = qmp_marshal_query_cpu_definitions,
3955 .name = "query-cpu-model-expansion",
3956 .args_type = "type:s,model:q",
3957 .mhandler.cmd_new = qmp_marshal_query_cpu_model_expansion,
3961 .name = "query-cpu-model-comparison",
3962 .args_type = "modela:q,modelb:q",
3963 .mhandler.cmd_new = qmp_marshal_query_cpu_model_comparison,
3967 .name = "query-cpu-model-baseline",
3968 .args_type = "modela:q,modelb:q",
3969 .mhandler.cmd_new = qmp_marshal_query_cpu_model_baseline,
3973 .name = "query-target",
3975 .mhandler.cmd_new = qmp_marshal_query_target,
3979 .name = "query-tpm",
3981 .mhandler.cmd_new = qmp_marshal_query_tpm,
3988 Return information about the TPM device.
3994 -> { "execute": "query-tpm" }
3997 { "model": "tpm-tis",
3999 { "type": "passthrough",
4001 { "cancel-path": "/sys/class/misc/tpm0/device/cancel",
4013 .name = "query-tpm-models",
4015 .mhandler.cmd_new = qmp_marshal_query_tpm_models,
4022 Return a list of supported TPM models.
4028 -> { "execute": "query-tpm-models" }
4029 <- { "return": [ "tpm-tis" ] }
4034 .name = "query-tpm-types",
4036 .mhandler.cmd_new = qmp_marshal_query_tpm_types,
4043 Return a list of supported TPM types.
4049 -> { "execute": "query-tpm-types" }
4050 <- { "return": [ "passthrough" ] }
4055 .name = "chardev-add",
4056 .args_type = "id:s,backend:q",
4057 .mhandler.cmd_new = qmp_marshal_chardev_add,
4068 - "id": the chardev's ID
, must be
unique (json
-string
)
4069 - "backend": chardev backend type
+ parameters
4073 -> { "execute" : "chardev-add",
4074 "arguments" : { "id" : "foo",
4075 "backend" : { "type" : "null", "data" : {} } } }
4078 -> { "execute" : "chardev-add",
4079 "arguments" : { "id" : "bar",
4080 "backend" : { "type" : "file",
4081 "data" : { "out" : "/tmp/bar.log" } } } }
4084 -> { "execute" : "chardev-add",
4085 "arguments" : { "id" : "baz",
4086 "backend" : { "type" : "pty", "data" : {} } } }
4087 <- { "return": { "pty" : "/dev/pty/42" } }
4092 .name
= "chardev-remove",
4093 .args_type
= "id:s",
4094 .mhandler
.cmd_new
= qmp_marshal_chardev_remove
,
4106 - "id": the chardev
's ID, must exist and not be in use (json-string)
4110 -> { "execute": "chardev-remove", "arguments": { "id" : "foo" } }
4115 .name = "query-rx-filter",
4116 .args_type = "name:s?",
4117 .mhandler.cmd_new = qmp_marshal_query_rx_filter,
4124 Show rx-filter information.
4126 Returns a json-array of rx-filter information for all NICs (or for the
4127 given NIC), returning an error if the given NIC doesn't exist
, or
4128 given NIC doesn
't support rx-filter querying, or given net client
4131 The query will clear the event notification flag of each NIC
, then qemu
4132 will start to emit event to QMP monitor
.
4134 Each array entry contains the following
:
4136 - "name": net client
name (json
-string
)
4137 - "promiscuous": promiscuous mode is
enabled (json
-bool
)
4138 - "multicast": multicast receive
state (one of
'normal', 'none', 'all')
4139 - "unicast": unicast receive
state (one of
'normal', 'none', 'all')
4140 - "vlan": vlan receive
state (one of
'normal', 'none', 'all') (Since
2.0)
4141 - "broadcast-allowed": allow to receive
broadcast (json
-bool
)
4142 - "multicast-overflow": multicast table is
overflowed (json
-bool
)
4143 - "unicast-overflow": unicast table is
overflowed (json
-bool
)
4144 - "main-mac": main macaddr
string (json
-string
)
4145 - "vlan-table": a json
-array of active vlan id
4146 - "unicast-table": a json
-array of unicast macaddr string
4147 - "multicast-table": a json
-array of multicast macaddr string
4151 -> { "execute": "query-rx-filter", "arguments": { "name": "vnet0" } }
4154 "promiscuous": true,
4156 "main-mac": "52:54:00:12:34:56",
4157 "unicast": "normal",
4165 "multicast": "normal",
4166 "multicast-overflow": false,
4167 "unicast-overflow": false,
4168 "multicast-table": [
4169 "01:00:5e:00:00:01",
4170 "33:33:00:00:00:01",
4173 "broadcast-allowed": false
4181 .name
= "blockdev-add",
4182 .args_type
= "options:q",
4183 .mhandler
.cmd_new
= qmp_marshal_blockdev_add
,
4192 This command is still a work
in progress
. It doesn
't support all
4193 block drivers among other things. Stay away from it unless you want
4194 to help with its development.
4198 - "options": block driver options
4202 -> { "execute": "blockdev-add",
4203 "arguments": { "options" : { "driver": "qcow2",
4204 "file": { "driver": "file",
4205 "filename": "test.qcow2" } } } }
4210 -> { "execute": "blockdev-add",
4222 "filename": "/tmp/test.qcow2"
4228 "filename": "/dev/fdset/4"
4240 .name = "x-blockdev-del",
4241 .args_type = "id:s?,node-name:s?",
4242 .mhandler.cmd_new = qmp_marshal_x_blockdev_del,
4250 Deletes a block device thas has been added using blockdev-add.
4251 The selected device can be either a block backend or a graph node.
4253 In the former case the backend will be destroyed, along with its
4254 inserted medium if there's any
. The command will fail
if the backend
4255 or its medium are
in use
.
4257 In the latter
case the node will be destroyed
. The command will fail
4258 if the node is attached to a block backend or is otherwise being
4261 One of
"id" or
"node-name" must be specified
, but not both
.
4263 This command is still a work
in progress and is considered
4264 experimental
. Stay away from it unless you want to help with its
4269 - "id": Name of the block backend device to
delete (json
-string
, optional
)
4270 - "node-name": Name of the graph node to
delete (json
-string
, optional
)
4274 -> { "execute": "blockdev-add",
4281 "filename": "test.qcow2"
4289 -> { "execute": "x-blockdev-del",
4290 "arguments": { "id": "drive0" }
4297 .name
= "blockdev-open-tray",
4298 .args_type
= "device:s,force:b?",
4299 .mhandler
.cmd_new
= qmp_marshal_blockdev_open_tray
,
4306 Opens a block device
's tray. If there is a block driver state tree inserted as a
4307 medium, it will become inaccessible to the guest (but it will remain associated
4308 to the block device, so closing the tray will make it accessible again).
4310 If the tray was already open before, this will be a no-op.
4312 Once the tray opens, a DEVICE_TRAY_MOVED event is emitted. There are cases in
4313 which no such event will be generated, these include:
4314 - if the guest has locked the tray, @force is false and the guest does not
4315 respond to the eject request
4316 - if the BlockBackend denoted by @device does not have a guest device attached
4318 - if the guest device does not have an actual tray and is empty, for instance
4319 for floppy disk drives
4323 - "device": block device name (json-string)
4324 - "force": if false (the default), an eject request will be sent to the guest if
4325 it has locked the tray (and the tray will not be opened immediately);
4326 if true, the tray will be opened regardless of whether it is locked
4327 (json-bool, optional)
4331 -> { "execute": "blockdev-open-tray",
4332 "arguments": { "device": "ide1-cd0" } }
4334 <- { "timestamp": { "seconds": 1418751016,
4335 "microseconds": 716996 },
4336 "event": "DEVICE_TRAY_MOVED",
4337 "data": { "device": "ide1-cd0",
4338 "tray-open": true } }
4345 .name = "blockdev-close-tray",
4346 .args_type = "device:s",
4347 .mhandler.cmd_new = qmp_marshal_blockdev_close_tray,
4354 Closes a block device's tray
. If there is a block driver state tree associated
4355 with the block
device (which is currently ejected
), that tree will be loaded as
4358 If the tray was already closed before
, this will be a no
-op
.
4362 - "device": block device
name (json
-string
)
4366 -> { "execute": "blockdev-close-tray",
4367 "arguments": { "device": "ide1-cd0" } }
4369 <- { "timestamp": { "seconds": 1418751345,
4370 "microseconds": 272147 },
4371 "event": "DEVICE_TRAY_MOVED",
4372 "data": { "device": "ide1-cd0",
4373 "tray-open": false } }
4380 .name
= "x-blockdev-remove-medium",
4381 .args_type
= "device:s",
4382 .mhandler
.cmd_new
= qmp_marshal_x_blockdev_remove_medium
,
4386 x
-blockdev
-remove
-medium
4387 ------------------------
4389 Removes a
medium (a block driver state tree
) from a block device
. That block
4390 device
's tray must currently be open (unless there is no attached guest device).
4392 If the tray is open and there is no medium inserted, this will be a no-op.
4394 This command is still a work in progress and is considered experimental.
4395 Stay away from it unless you want to help with its development.
4399 - "device": block device name (json-string)
4403 -> { "execute": "x-blockdev-remove-medium",
4404 "arguments": { "device": "ide1-cd0" } }
4406 <- { "error": { "class": "GenericError",
4407 "desc": "Tray of device 'ide1
-cd0
' is not open" } }
4409 -> { "execute": "blockdev-open-tray",
4410 "arguments": { "device": "ide1-cd0" } }
4412 <- { "timestamp": { "seconds": 1418751627,
4413 "microseconds": 549958 },
4414 "event": "DEVICE_TRAY_MOVED",
4415 "data": { "device": "ide1-cd0",
4416 "tray-open": true } }
4420 -> { "execute": "x-blockdev-remove-medium",
4421 "arguments": { "device": "ide1-cd0" } }
4428 .name = "x-blockdev-insert-medium",
4429 .args_type = "device:s,node-name:s",
4430 .mhandler.cmd_new = qmp_marshal_x_blockdev_insert_medium,
4434 x-blockdev-insert-medium
4435 ------------------------
4437 Inserts a medium (a block driver state tree) into a block device. That block
4438 device's tray must currently be
open (unless there is no attached guest device
)
4439 and there must be no medium inserted already
.
4441 This command is still a work
in progress and is considered experimental
.
4442 Stay away from it unless you want to help with its development
.
4446 - "device": block device
name (json
-string
)
4447 - "node-name": root node of the BDS tree to insert into the block device
4451 -> { "execute": "blockdev-add",
4452 "arguments": { "options": { "node-name": "node0",
4454 "file": { "driver": "file",
4455 "filename": "fedora.iso" } } } }
4459 -> { "execute": "x-blockdev-insert-medium",
4460 "arguments": { "device": "ide1-cd0",
4461 "node-name": "node0" } }
4468 .name
= "x-blockdev-change",
4469 .args_type
= "parent:B,child:B?,node:B?",
4470 .mhandler
.cmd_new
= qmp_marshal_x_blockdev_change
,
4477 Dynamically reconfigure the block driver state graph
. It can be used
4478 to add
, remove
, insert or replace a graph node
. Currently only the
4479 Quorum driver
implements this feature to add or remove its child
. This
4480 is useful to fix a broken quorum child
.
4482 If @node is specified
, it will be inserted under @parent
. @child
4483 may not be specified
in this case. If both @parent and @child are
4484 specified but @node is not
, @child will be detached from @parent
.
4487 - "parent": the id or name of the parent
node (json
-string
)
4488 - "child": the name of a child under the given parent
node (json
-string
, optional
)
4489 - "node": the name of the node that will be
added (json
-string
, optional
)
4491 Note
: this command is experimental
, and not a stable API
. It doesn
't
4492 support all kinds of operations, all kinds of children, nor all block
4495 Warning: The data in a new quorum child MUST be consistent with that of
4496 the rest of the array.
4500 Add a new node to a quorum
4501 -> { "execute": "blockdev-add",
4502 "arguments": { "options": { "driver": "raw",
4503 "node-name": "new_node",
4504 "file": { "driver": "file",
4505 "filename": "test.raw" } } } }
4507 -> { "execute": "x-blockdev-change",
4508 "arguments": { "parent": "disk1",
4509 "node": "new_node" } }
4512 Delete a quorum's node
4513 -> { "execute": "x-blockdev-change",
4514 "arguments": { "parent": "disk1",
4515 "child": "children.1" } }
4521 .name
= "query-named-block-nodes",
4523 .mhandler
.cmd_new
= qmp_marshal_query_named_block_nodes
,
4527 @query
-named
-block
-nodes
4528 ------------------------
4530 Return a list of BlockDeviceInfo
for all the named block driver nodes
4534 -> { "execute": "query-named-block-nodes" }
4535 <- { "return": [ { "ro":false,
4538 "file":"disks/test.qcow2",
4539 "node-name": "my-node",
4540 "backing_file_depth":1,
4554 "write_threshold": 0,
4556 "filename":"disks/test.qcow2",
4558 "virtual-size":2048000,
4559 "backing_file":"base.qcow2",
4560 "full-backing-filename":"disks/base.qcow2",
4561 "backing-filename-format":"qcow2",
4565 "name": "snapshot1",
4567 "date-sec": 10000200,
4569 "vm-clock-sec": 206,
4574 "filename":"disks/base.qcow2",
4576 "virtual-size":2048000
4583 .name
= "blockdev-change-medium",
4584 .args_type
= "device:B,filename:F,format:s?,read-only-mode:s?",
4585 .mhandler
.cmd_new
= qmp_marshal_blockdev_change_medium
,
4589 blockdev
-change
-medium
4590 ----------------------
4592 Changes the medium inserted into a block device by ejecting the current medium
4593 and loading a
new image file which is inserted as the
new medium
.
4597 - "device": device
name (json
-string
)
4598 - "filename": filename of the
new image (json
-string
)
4599 - "format": format of the
new image (json
-string
, optional
)
4600 - "read-only-mode": new read
-only
mode (json
-string
, optional
)
4601 - Possible values
: "retain" (default), "read-only", "read-write"
4605 1. Change a removable medium
4607 -> { "execute": "blockdev-change-medium",
4608 "arguments": { "device": "ide1-cd0",
4609 "filename": "/srv/images/Fedora-12-x86_64-DVD.iso",
4613 2. Load a read
-only medium into a writable drive
4615 -> { "execute": "blockdev-change-medium",
4616 "arguments": { "device": "isa-fd0",
4617 "filename": "/srv/images/ro.img",
4619 "read-only-mode": "retain" } }
4622 { "class": "GenericError",
4623 "desc": "Could not open '/srv/images/ro.img': Permission denied" } }
4625 -> { "execute": "blockdev-change-medium",
4626 "arguments": { "device": "isa-fd0",
4627 "filename": "/srv/images/ro.img",
4629 "read-only-mode": "read-only" } }
4636 .name
= "query-memdev",
4638 .mhandler
.cmd_new
= qmp_marshal_query_memdev
,
4645 Show memory devices information
.
4650 -> { "execute": "query-memdev" }
4657 "host-nodes": [0, 1],
4665 "host-nodes": [2, 3],
4666 "policy": "preferred"
4674 .name
= "query-memory-devices",
4676 .mhandler
.cmd_new
= qmp_marshal_query_memory_devices
,
4680 @query
-memory
-devices
4681 --------------------
4683 Return a list of memory devices
.
4686 -> { "execute": "query-memory-devices" }
4687 <- { "return": [ { "data":
4688 { "addr": 5368709120,
4689 "hotpluggable": true,
4692 "memdev": "/objects/memX",
4701 .name
= "query-acpi-ospm-status",
4703 .mhandler
.cmd_new
= qmp_marshal_query_acpi_ospm_status
,
4707 @query
-acpi
-ospm
-status
4708 --------------------
4710 Return list of ACPIOSTInfo
for devices that support status reporting
4711 via ACPI _OST method
.
4714 -> { "execute": "query-acpi-ospm-status" }
4715 <- { "return": [ { "device": "d1", "slot": "0", "slot-type": "DIMM", "source": 1, "status": 0},
4716 { "slot": "1", "slot-type": "DIMM", "source": 0, "status": 0},
4717 { "slot": "2", "slot-type": "DIMM", "source": 0, "status": 0},
4718 { "slot": "3", "slot-type": "DIMM", "source": 0, "status": 0}
4722 #
if defined TARGET_I386
4724 .name
= "rtc-reset-reinjection",
4726 .mhandler
.cmd_new
= qmp_marshal_rtc_reset_reinjection
,
4731 rtc
-reset
-reinjection
4732 ---------------------
4734 Reset the RTC interrupt reinjection backlog
.
4740 -> { "execute": "rtc-reset-reinjection" }
4745 .name
= "trace-event-get-state",
4746 .args_type
= "name:s,vcpu:i?",
4747 .mhandler
.cmd_new
= qmp_marshal_trace_event_get_state
,
4751 trace-event
-get
-state
4752 ---------------------
4754 Query the state of events
.
4758 - "name": Event name
pattern (json
-string
).
4759 - "vcpu": The vCPU to query
, any vCPU by
default (json
-int
, optional
).
4761 An event is returned
if:
4762 - its name matches the
"name" pattern
, and
4763 - if "vcpu" is given
, the event has the
"vcpu" property
.
4765 Therefore
, if "vcpu" is given
, the operation will only match per
-vCPU events
,
4766 returning their state on the specified vCPU
. Special
case: if "name" is an exact
4767 match
, "vcpu" is given and the event does not have the
"vcpu" property
, an error
4772 -> { "execute": "trace-event-get-state", "arguments": { "name": "qemu_memalign" } }
4773 <- { "return": [ { "name": "qemu_memalign", "state": "disabled" } ] }
4777 .name
= "trace-event-set-state",
4778 .args_type
= "name:s,enable:b,ignore-unavailable:b?,vcpu:i?",
4779 .mhandler
.cmd_new
= qmp_marshal_trace_event_set_state
,
4783 trace-event
-set
-state
4784 ---------------------
4786 Set the state of events
.
4790 - "name": Event name
pattern (json
-string
).
4791 - "enable": Whether to enable or disable the
event (json
-bool
).
4792 - "ignore-unavailable": Whether to ignore errors
for events that cannot be
4793 changed (json
-bool
, optional
).
4794 - "vcpu": The vCPU to act upon
, all vCPUs by
default (json
-int
, optional
).
4796 An event
's state is modified if:
4797 - its name matches the "name" pattern, and
4798 - if "vcpu" is given, the event has the "vcpu" property.
4800 Therefore, if "vcpu" is given, the operation will only match per-vCPU events,
4801 setting their state on the specified vCPU. Special case: if "name" is an exact
4802 match, "vcpu" is given and the event does not have the "vcpu" property, an error
4807 -> { "execute": "trace-event-set-state", "arguments": { "name": "qemu_memalign", "enable": "true" } }
4812 .name = "input-send-event",
4813 .args_type = "console:i?,events:q",
4814 .mhandler.cmd_new = qmp_marshal_input_send_event,
4821 Send input event to guest.
4825 - "device": display device (json-string, optional)
4826 - "head": display head (json-int, optional)
4827 - "events": list of input events
4829 The consoles are visible in the qom tree, under
4830 /backend/console[$index]. They have a device link and head property, so
4831 it is possible to map which console belongs to which device and display.
4835 Press left mouse button.
4837 -> { "execute": "input-send-event",
4838 "arguments": { "device": "video0",
4839 "events": [ { "type": "btn",
4840 "data" : { "down": true, "button": "left" } } ] } }
4843 -> { "execute": "input-send-event",
4844 "arguments": { "device": "video0",
4845 "events": [ { "type": "btn",
4846 "data" : { "down": false, "button": "left" } } ] } }
4853 -> { "execute": "input-send-event",
4854 "arguments": { "events": [
4855 { "type": "key", "data" : { "down": true,
4856 "key": {"type": "qcode", "data": "ctrl" } } },
4857 { "type": "key", "data" : { "down": true,
4858 "key": {"type": "qcode", "data": "alt" } } },
4859 { "type": "key", "data" : { "down": true,
4860 "key": {"type": "qcode", "data": "delete" } } } ] } }
4865 Move mouse pointer to absolute coordinates (20000, 400).
4867 -> { "execute": "input-send-event" ,
4868 "arguments": { "events": [
4869 { "type": "abs", "data" : { "axis": "x", "value" : 20000 } },
4870 { "type": "abs", "data" : { "axis": "y", "value" : 400 } } ] } }
4876 .name = "block-set-write-threshold",
4877 .args_type = "node-name:s,write-threshold:l",
4878 .mhandler.cmd_new = qmp_marshal_block_set_write_threshold,
4882 block-set-write-threshold
4885 Change the write threshold for a block drive. The threshold is an offset,
4886 thus must be non-negative. Default is no write threshold.
4887 Setting the threshold to zero disables it.
4891 - "node-name": the node name in the block driver state graph (json-string)
4892 - "write-threshold": the write threshold in bytes (json-int)
4896 -> { "execute": "block-set-write-threshold",
4897 "arguments": { "node-name": "mydev",
4898 "write-threshold": 17179869184 } }
4904 .name = "query-rocker",
4905 .args_type = "name:s",
4906 .mhandler.cmd_new = qmp_marshal_query_rocker,
4915 - "name": switch name
4919 -> { "execute": "query-rocker", "arguments": { "name": "sw1" } }
4920 <- { "return": {"name": "sw1", "ports": 2, "id": 1327446905938}}
4925 .name = "query-rocker-ports",
4926 .args_type = "name:s",
4927 .mhandler.cmd_new = qmp_marshal_query_rocker_ports,
4931 Show rocker switch ports
4932 ------------------------
4936 - "name": switch name
4940 -> { "execute": "query-rocker-ports", "arguments": { "name": "sw1" } }
4941 <- { "return": [ {"duplex": "full", "enabled": true, "name": "sw1.1",
4942 "autoneg": "off", "link-up": true, "speed": 10000},
4943 {"duplex": "full", "enabled": true, "name": "sw1.2",
4944 "autoneg": "off", "link-up": true, "speed": 10000}
4950 .name = "query-rocker-of-dpa-flows",
4951 .args_type = "name:s,tbl-id:i?",
4952 .mhandler.cmd_new = qmp_marshal_query_rocker_of_dpa_flows,
4956 Show rocker switch OF-DPA flow tables
4957 -------------------------------------
4961 - "name": switch name
4962 - "tbl-id": (optional) flow table ID
4966 -> { "execute": "query-rocker-of-dpa-flows", "arguments": { "name": "sw1" } }
4967 <- { "return": [ {"key": {"in-pport": 0, "priority": 1, "tbl-id": 0},
4970 "action": {"goto-tbl": 10},
4971 "mask": {"in-pport": 4294901760}
4979 .name = "query-rocker-of-dpa-groups",
4980 .args_type = "name:s,type:i?",
4981 .mhandler.cmd_new = qmp_marshal_query_rocker_of_dpa_groups,
4985 Show rocker OF-DPA group tables
4986 -------------------------------
4990 - "name": switch name
4991 - "type": (optional) group type
4995 -> { "execute": "query-rocker-of-dpa-groups", "arguments": { "name": "sw1" } }
4996 <- { "return": [ {"type": 0, "out-pport": 2, "pport": 2, "vlan-id": 3841,
4997 "pop-vlan": 1, "id": 251723778},
4998 {"type": 0, "out-pport": 0, "pport": 0, "vlan-id": 3841,
4999 "pop-vlan": 1, "id": 251723776},
5000 {"type": 0, "out-pport": 1, "pport": 1, "vlan-id": 3840,
5001 "pop-vlan": 1, "id": 251658241},
5002 {"type": 0, "out-pport": 0, "pport": 0, "vlan-id": 3840,
5003 "pop-vlan": 1, "id": 251658240}
5008 #if defined TARGET_ARM
5010 .name = "query-gic-capabilities",
5012 .mhandler.cmd_new = qmp_marshal_query_gic_capabilities,
5017 query-gic-capabilities
5020 Return a list of GICCapability objects, describing supported GIC
5021 (Generic Interrupt Controller) versions.
5027 -> { "execute": "query-gic-capabilities" }
5028 <- { "return": [{ "version": 2, "emulated": true, "kernel": false },
5029 { "version": 3, "emulated": false, "kernel": true } ] }
5034 .name = "query-hotpluggable-cpus",
5036 .mhandler.cmd_new = qmp_marshal_query_hotpluggable_cpus,
5040 Show existing/possible CPUs
5041 ---------------------------
5045 Example for pseries machine type started with
5046 -smp 2,cores=2,maxcpus=4 -cpu POWER8:
5048 -> { "execute": "query-hotpluggable-cpus" }
5050 { "props": { "core-id": 8 }, "type": "POWER8-spapr-cpu-core",
5052 { "props": { "core-id": 0 }, "type": "POWER8-spapr-cpu-core",
5053 "vcpus-count": 1, "qom-path": "/machine/unattached/device[0]"}
5056 Example
for pc machine type started with
5058 -> { "execute": "query-hotpluggable-cpus" }
5061 "type": "qemu64-x86_64-cpu", "vcpus-count": 1,
5062 "props": {"core-id": 0, "socket-id": 1, "thread-id": 0}
5065 "qom-path": "/machine/unattached/device[0]",
5066 "type": "qemu64-x86_64-cpu", "vcpus-count": 1,
5067 "props": {"core-id": 0, "socket-id": 0, "thread-id": 0}