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"
515 Bug: invalid base64 is currently not rejected.
516 Whitespace *is* invalid.
520 -> { "execute": "ringbuf-write",
521 "arguments": { "device": "foo",
529 .name = "ringbuf-read",
530 .args_type = "device:s,size:i,format:s?",
531 .mhandler.cmd_new = qmp_marshal_ringbuf_read,
538 Read from a ring buffer character device.
542 - "device": ring buffer character device name (json-string)
543 - "size": how many bytes to read at most (json-int)
544 - Number of data bytes, not number of characters in encoded data
545 - "format": data format (json-string, optional)
546 - Possible values: "utf8" (default), "base64"
547 - Naturally, format "utf8" works only when the ring buffer
548 contains valid UTF-8 text. Invalid UTF-8 sequences get
549 replaced. Bug: replacement doesn't work
. Bug
: can screw
550 up on encountering NUL characters
, after the ring buffer
551 lost data
, and when reading stops because the size limit
556 -> { "execute": "ringbuf-read",
557 "arguments": { "device": "foo",
560 <- {"return": "abcdefgh"}
565 .name
= "xen-save-devices-state",
566 .args_type
= "filename:F",
567 .mhandler
.cmd_new
= qmp_marshal_xen_save_devices_state
,
571 xen
-save
-devices
-state
574 Save the state of all devices to file
. The RAM and the block devices
575 of the VM are not saved by
this command
.
579 - "filename": the file to save the state of the devices to as binary
580 data
. See xen
-save
-devices
-state
.txt
for a description of the binary
585 -> { "execute": "xen-save-devices-state",
586 "arguments": { "filename": "/tmp/save" } }
592 .name
= "xen-set-global-dirty-log",
593 .args_type
= "enable:b",
594 .mhandler
.cmd_new
= qmp_marshal_xen_set_global_dirty_log
,
598 xen
-set
-global
-dirty
-log
601 Enable or disable the global dirty log mode
.
605 - "enable": Enable it or disable it
.
609 -> { "execute": "xen-set-global-dirty-log",
610 "arguments": { "enable": true } }
617 .args_type
= "detach:-d,blk:-b,inc:-i,uri:s",
618 .mhandler
.cmd_new
= qmp_marshal_migrate
,
629 - "blk": block migration
, full disk
copy (json
-bool
, optional
)
630 - "inc": incremental disk
copy (json
-bool
, optional
)
631 - "uri": Destination
URI (json
-string
)
635 -> { "execute": "migrate", "arguments": { "uri": "tcp:0:4446" } }
640 (1) The
'query-migrate' command should be used to check migration
's progress
641 and final result (this information is provided by the 'status
' member)
642 (2) All boolean arguments default to false
643 (3) The user Monitor's
"detach" argument is invalid
in QMP and should not
649 .name
= "migrate_cancel",
651 .mhandler
.cmd_new
= qmp_marshal_migrate_cancel
,
658 Cancel the current migration
.
664 -> { "execute": "migrate_cancel" }
670 .name
= "migrate-incoming",
671 .args_type
= "uri:s",
672 .mhandler
.cmd_new
= qmp_marshal_migrate_incoming
,
679 Continue an incoming migration
683 - "uri": Source
/listening
URI (json
-string
)
687 -> { "execute": "migrate-incoming", "arguments": { "uri": "tcp::4446" } }
692 (1) QEMU must be started with
-incoming defer to allow migrate
-incoming to
694 (2) The uri format is the same as
for -incoming
698 .name
= "migrate-set-cache-size",
699 .args_type
= "value:o",
700 .mhandler
.cmd_new
= qmp_marshal_migrate_set_cache_size
,
704 migrate
-set
-cache
-size
705 ----------------------
707 Set cache size to be used by XBZRLE migration
, the cache size will be rounded
708 down to the nearest power of
2
712 - "value": cache size
in bytes (json
-int
)
716 -> { "execute": "migrate-set-cache-size", "arguments": { "value": 536870912 } }
721 .name
= "query-migrate-cache-size",
723 .mhandler
.cmd_new
= qmp_marshal_query_migrate_cache_size
,
727 query
-migrate
-cache
-size
728 ------------------------
730 Show cache size to be used by XBZRLE migration
732 returns a json
-object with the following information
:
737 -> { "execute": "query-migrate-cache-size" }
738 <- { "return": 67108864 }
743 .name
= "migrate_set_speed",
744 .args_type
= "value:o",
745 .mhandler
.cmd_new
= qmp_marshal_migrate_set_speed
,
752 Set maximum speed
for migrations
.
756 - "value": maximum speed
, in bytes per
second (json
-int
)
760 -> { "execute": "migrate_set_speed", "arguments": { "value": 1024 } }
766 .name
= "migrate_set_downtime",
767 .args_type
= "value:T",
768 .mhandler
.cmd_new
= qmp_marshal_migrate_set_downtime
,
775 Set maximum tolerated
downtime (in seconds
) for migrations
.
779 - "value": maximum
downtime (json
-number
)
783 -> { "execute": "migrate_set_downtime", "arguments": { "value": 0.1 } }
789 .name
= "client_migrate_info",
790 .args_type
= "protocol:s,hostname:s,port:i?,tls-port:i?,cert-subject:s?",
791 .params
= "protocol hostname port tls-port cert-subject",
792 .help
= "set migration information for remote display",
793 .mhandler
.cmd_new
= qmp_marshal_client_migrate_info
,
800 Set migration information
for remote display
. This makes the server
801 ask the client to automatically reconnect
using the
new parameters
802 once migration finished successfully
. Only implemented
for SPICE
.
806 - "protocol": must be
"spice" (json
-string
)
807 - "hostname": migration target
hostname (json
-string
)
808 - "port": spice tcp port
for plaintext
channels (json
-int
, optional
)
809 - "tls-port": spice tcp port
for tls
-secured
channels (json
-int
, optional
)
810 - "cert-subject": server certificate
subject (json
-string
, optional
)
814 -> { "execute": "client_migrate_info",
815 "arguments": { "protocol": "spice",
816 "hostname": "virt42.lab.kraxel.org",
823 .name
= "dump-guest-memory",
824 .args_type
= "paging:b,protocol:s,begin:i?,end:i?,format:s?",
825 .params
= "-p protocol [begin] [length] [format]",
826 .help
= "dump guest memory to file",
827 .mhandler
.cmd_new
= qmp_marshal_dump_guest_memory
,
834 Dump guest memory to file
. The file can be processed with crash or gdb
.
838 - "paging": do paging to get guest
's memory mapping (json-bool)
839 - "protocol": destination file(started with "file:") or destination file
840 descriptor (started with "fd:") (json-string)
841 - "begin": the starting physical address. It's optional
, and should be specified
842 with length
together (json
-int
)
843 - "length": the memory size
, in bytes
. It
's optional, and should be specified
844 with begin together (json-int)
845 - "format": the format of guest memory dump. It's optional
, and can be
846 elf|kdump
-zlib|kdump
-lzo|kdump
-snappy
, but non
-elf formats will
847 conflict with paging and filter
, ie
. begin and
length (json
-string
)
851 -> { "execute": "dump-guest-memory", "arguments": { "protocol": "fd:dump" } }
856 (1) All boolean arguments
default to
false
861 .name
= "query-dump-guest-memory-capability",
863 .mhandler
.cmd_new
= qmp_marshal_query_dump_guest_memory_capability
,
867 query
-dump
-guest
-memory
-capability
870 Show available formats
for 'dump-guest-memory'
874 -> { "execute": "query-dump-guest-memory-capability" }
875 <- { "return": { "formats":
876 ["elf", "kdump-zlib", "kdump-lzo", "kdump-snappy"] }
880 #
if defined TARGET_S390X
882 .name
= "dump-skeys",
883 .args_type
= "filename:F",
884 .mhandler
.cmd_new
= qmp_marshal_dump_skeys
,
892 Save guest storage keys to file
.
896 - "filename": file
path (json
-string
)
900 -> { "execute": "dump-skeys", "arguments": { "filename": "/tmp/skeys" } }
906 .name
= "netdev_add",
907 .args_type
= "netdev:O",
908 .mhandler
.cmd_new
= qmp_netdev_add
,
915 Add host network device
.
919 - "type": the device type
, "tap", "user", ... (json
-string
)
920 - "id": the device
's ID, must be unique (json-string)
925 -> { "execute": "netdev_add",
926 "arguments": { "type": "user", "id": "netdev1",
927 "dnssearch": "example.org" } }
930 Note: The supported device options are the same ones supported by the '-netdev
'
931 command-line argument, which are listed in the '-help
' output or QEMU's
937 .name
= "netdev_del",
939 .mhandler
.cmd_new
= qmp_marshal_netdev_del
,
946 Remove host network device
.
950 - "id": the device
's ID, must be unique (json-string)
954 -> { "execute": "netdev_del", "arguments": { "id": "netdev1" } }
961 .name = "object-add",
962 .args_type = "qom-type:s,id:s,props:q?",
963 .mhandler.cmd_new = qmp_marshal_object_add,
974 - "qom-type": the object's QOM type
, i
.e
. the
class name (json
-string
)
975 - "id": the object
's ID, must be unique (json-string)
976 - "props": a dictionary of object property values (optional, json-dict)
980 -> { "execute": "object-add", "arguments": { "qom-type": "rng-random", "id": "rng1",
981 "props": { "filename": "/dev/hwrng" } } }
987 .name = "object-del",
989 .mhandler.cmd_new = qmp_marshal_object_del,
1000 - "id": the object's
ID (json
-string
)
1004 -> { "execute": "object-del", "arguments": { "id": "rng1" } }
1012 .name
= "block_resize",
1013 .args_type
= "device:s?,node-name:s?,size:o",
1014 .mhandler
.cmd_new
= qmp_marshal_block_resize
,
1021 Resize a block image
while a guest is running
.
1025 - "device": the device
's ID, must be unique (json-string)
1026 - "node-name": the node name in the block driver state graph (json-string)
1031 -> { "execute": "block_resize", "arguments": { "device": "scratch", "size": 1073741824 } }
1037 .name = "block-stream",
1038 .args_type = "device:B,base:s?,speed:o?,backing-file:s?,on-error:s?",
1039 .mhandler.cmd_new = qmp_marshal_block_stream,
1046 Copy data from a backing file into a block device.
1050 - "device": The device's ID
, must be
unique (json
-string
)
1051 - "base": The file name of the backing image above which copying starts
1052 (json
-string
, optional
)
1053 - "backing-file": The backing file string to write into the active layer
. This
1054 filename is not validated
.
1056 If a pathname string is such that it cannot be resolved by
1057 QEMU
, that means that subsequent QMP or HMP commands must use
1058 node
-names
for the image
in question
, as filename lookup
1061 If not specified
, QEMU will automatically determine the
1062 backing file string to use
, or error out
if there is no
1063 obvious choice
. Care should be taken when specifying the
1064 string
, to specify a valid filename or protocol
.
1065 (json
-string
, optional
) (Since
2.1)
1066 - "speed": the maximum speed
, in bytes per
second (json
-int
, optional
)
1067 - "on-error": the action to take on an
error (default 'report'). 'stop' and
1068 'enospc' can only be used
if the block device supports io
-status
.
1069 (json
-string
, optional
) (Since
2.1)
1073 -> { "execute": "block-stream", "arguments": { "device": "virtio0",
1074 "base": "/tmp/master.qcow2" } }
1080 .name
= "block-commit",
1081 .args_type
= "device:B,base:s?,top:s?,backing-file:s?,speed:o?",
1082 .mhandler
.cmd_new
= qmp_marshal_block_commit
,
1089 Live commit of data from overlay image nodes into backing nodes
- i
.e
., writes
1090 data between
'top' and
'base' into
'base'.
1094 - "device": The device
's ID, must be unique (json-string)
1095 - "base": The file name of the backing image to write data into.
1096 If not specified, this is the deepest backing image
1097 (json-string, optional)
1098 - "top": The file name of the backing image within the image chain,
1099 which contains the topmost data to be committed down. If
1100 not specified, this is the active layer. (json-string, optional)
1102 - backing-file: The backing file string to write into the overlay
1103 image of 'top
'. If 'top
' is the active layer,
1104 specifying a backing file string is an error. This
1105 filename is not validated.
1107 If a pathname string is such that it cannot be
1108 resolved by QEMU, that means that subsequent QMP or
1109 HMP commands must use node-names for the image in
1110 question, as filename lookup methods will fail.
1112 If not specified, QEMU will automatically determine
1113 the backing file string to use, or error out if
1114 there is no obvious choice. Care should be taken
1115 when specifying the string, to specify a valid
1116 filename or protocol.
1117 (json-string, optional) (Since 2.1)
1119 If top == base, that is an error.
1120 If top == active, the job will not be completed by itself,
1121 user needs to complete the job with the block-job-complete
1122 command after getting the ready event. (Since 2.0)
1124 If the base image is smaller than top, then the base image
1125 will be resized to be the same size as top. If top is
1126 smaller than the base image, the base will not be
1127 truncated. If you want the base image size to match the
1128 size of the smaller top, you can safely truncate it
1129 yourself once the commit operation successfully completes.
1131 - "speed": the maximum speed, in bytes per second (json-int, optional)
1136 -> { "execute": "block-commit", "arguments": { "device": "virtio0",
1137 "top": "/tmp/snap1.qcow2" } }
1143 .name = "drive-backup",
1144 .args_type = "sync:s,device:B,target:s,speed:i?,mode:s?,format:s?,"
1145 "bitmap:s?,on-source-error:s?,on-target-error:s?",
1146 .mhandler.cmd_new = qmp_marshal_drive_backup,
1153 Start a point-in-time copy of a block device to a new destination. The
1154 status of ongoing drive-backup operations can be checked with
1155 query-block-jobs where the BlockJobInfo.type field has the value 'backup
'.
1156 The operation can be stopped before it has completed using the
1157 block-job-cancel command.
1161 - "device": the name of the device which should be copied.
1163 - "target": the target of the new image. If the file exists, or if it is a
1164 device, the existing file/device will be used as the new
1165 destination. If it does not exist, a new file will be created.
1167 - "format": the format of the new destination, default is to probe if 'mode
' is
1168 'existing
', else the format of the source
1169 (json-string, optional)
1170 - "sync": what parts of the disk image should be copied to the destination;
1171 possibilities include "full" for all the disk, "top" for only the sectors
1172 allocated in the topmost image, "incremental" for only the dirty sectors in
1173 the bitmap, or "none" to only replicate new I/O (MirrorSyncMode).
1174 - "bitmap": dirty bitmap name for sync==incremental. Must be present if sync
1175 is "incremental", must NOT be present otherwise.
1176 - "mode": whether and how QEMU should create a new image
1177 (NewImageMode, optional, default 'absolute
-paths
')
1178 - "speed": the maximum speed, in bytes per second (json-int, optional)
1179 - "on-source-error": the action to take on an error on the source, default
1180 'report
'. 'stop
' and 'enospc
' can only be used
1181 if the block device supports io-status.
1182 (BlockdevOnError, optional)
1183 - "on-target-error": the action to take on an error on the target, default
1184 'report
' (no limitations, since this applies to
1185 a different block device than device).
1186 (BlockdevOnError, optional)
1189 -> { "execute": "drive-backup", "arguments": { "device": "drive0",
1191 "target": "backup.img" } }
1197 .name = "blockdev-backup",
1198 .args_type = "sync:s,device:B,target:B,speed:i?,"
1199 "on-source-error:s?,on-target-error:s?",
1200 .mhandler.cmd_new = qmp_marshal_blockdev_backup,
1207 The device version of drive-backup: this command takes an existing named device
1212 - "device": the name of the device which should be copied.
1214 - "target": the name of the backup target device. (json-string)
1215 - "sync": what parts of the disk image should be copied to the destination;
1216 possibilities include "full" for all the disk, "top" for only the
1217 sectors allocated in the topmost image, or "none" to only replicate
1218 new I/O (MirrorSyncMode).
1219 - "speed": the maximum speed, in bytes per second (json-int, optional)
1220 - "on-source-error": the action to take on an error on the source, default
1221 'report
'. 'stop
' and 'enospc
' can only be used
1222 if the block device supports io-status.
1223 (BlockdevOnError, optional)
1224 - "on-target-error": the action to take on an error on the target, default
1225 'report
' (no limitations, since this applies to
1226 a different block device than device).
1227 (BlockdevOnError, optional)
1230 -> { "execute": "blockdev-backup", "arguments": { "device": "src-id",
1232 "target": "tgt-id" } }
1238 .name = "block-job-set-speed",
1239 .args_type = "device:B,speed:o",
1240 .mhandler.cmd_new = qmp_marshal_block_job_set_speed,
1244 .name = "block-job-cancel",
1245 .args_type = "device:B,force:b?",
1246 .mhandler.cmd_new = qmp_marshal_block_job_cancel,
1249 .name = "block-job-pause",
1250 .args_type = "device:B",
1251 .mhandler.cmd_new = qmp_marshal_block_job_pause,
1254 .name = "block-job-resume",
1255 .args_type = "device:B",
1256 .mhandler.cmd_new = qmp_marshal_block_job_resume,
1259 .name = "block-job-complete",
1260 .args_type = "device:B",
1261 .mhandler.cmd_new = qmp_marshal_block_job_complete,
1264 .name = "transaction",
1265 .args_type = "actions:q",
1266 .mhandler.cmd_new = qmp_marshal_transaction,
1273 Atomically operate on one or more block devices. Operations that are
1274 currently supported:
1278 - blockdev-snapshot-sync
1279 - blockdev-snapshot-internal-sync
1281 - block-dirty-bitmap-add
1282 - block-dirty-bitmap-clear
1284 Refer to the qemu/qapi-schema.json file for minimum required QEMU
1285 versions for these operations. A list of dictionaries is accepted,
1286 that contains the actions to be performed. If there is any failure
1287 performing any of the operations, all operations for the group are
1290 For external snapshots, the dictionary contains the device, the file to use for
1291 the new snapshot, and the format. The default format, if not specified, is
1294 Each new snapshot defaults to being created by QEMU (wiping any
1295 contents if the file already exists), but it is also possible to reuse
1296 an externally-created file. In the latter case, you should ensure that
1297 the new image file has the same contents as the current one; QEMU cannot
1298 perform any meaningful check. Typically this is achieved by using the
1299 current image file as the backing file for the new image.
1301 On failure, the original disks pre-snapshot attempt will be used.
1303 For internal snapshots, the dictionary contains the device and the snapshot's
1304 name
. If an internal snapshot matching name already exists
, the request will
1305 be rejected
. Only some image formats support it
, for example
, qcow2
, rbd
,
1308 On failure
, qemu will
try delete the newly created internal snapshot
in the
1309 transaction
. When an I
/O error occurs during deletion
, the user needs to fix
1310 it later with qemu
-img or other command
.
1315 - "type": the operation to
perform (json
-string
). Possible
1316 values
: "drive-backup", "blockdev-backup",
1317 "blockdev-snapshot-sync",
1318 "blockdev-snapshot-internal-sync",
1319 "abort", "block-dirty-bitmap-add",
1320 "block-dirty-bitmap-clear"
1321 - "data": a dictionary
. The contents depend on the value
1322 of
"type". When
"type" is
"blockdev-snapshot-sync":
1323 - "device": device name to
snapshot (json
-string
)
1324 - "node-name": graph node name to
snapshot (json
-string
)
1325 - "snapshot-file": name of
new image
file (json
-string
)
1326 - "snapshot-node-name": graph node name of the
new snapshot (json
-string
)
1327 - "format": format of
new image (json
-string
, optional
)
1328 - "mode": whether and how QEMU should create the snapshot file
1329 (NewImageMode
, optional
, default "absolute-paths")
1330 When
"type" is
"blockdev-snapshot-internal-sync":
1331 - "device": device name to
snapshot (json
-string
)
1332 - "name": name of the
new snapshot (json
-string
)
1336 -> { "execute": "transaction",
1337 "arguments": { "actions": [
1338 { "type": "blockdev-snapshot-sync", "data" : { "device": "ide-hd0",
1339 "snapshot-file": "/some/place/my-image",
1340 "format": "qcow2" } },
1341 { "type": "blockdev-snapshot-sync", "data" : { "node-name": "myfile",
1342 "snapshot-file": "/some/place/my-image2",
1343 "snapshot-node-name": "node3432",
1345 "format": "qcow2" } },
1346 { "type": "blockdev-snapshot-sync", "data" : { "device": "ide-hd1",
1347 "snapshot-file": "/some/place/my-image2",
1349 "format": "qcow2" } },
1350 { "type": "blockdev-snapshot-internal-sync", "data" : {
1351 "device": "ide-hd2",
1352 "name": "snapshot0" } } ] } }
1358 .name
= "block-dirty-bitmap-add",
1359 .args_type
= "node:B,name:s,granularity:i?",
1360 .mhandler
.cmd_new
= qmp_marshal_block_dirty_bitmap_add
,
1365 block
-dirty
-bitmap
-add
1366 ----------------------
1369 Create a dirty bitmap with a name on the device
, and start tracking the writes
.
1373 - "node": device
/node on which to create dirty
bitmap (json
-string
)
1374 - "name": name of the
new dirty
bitmap (json
-string
)
1375 - "granularity": granularity to track writes
with (int
, optional
)
1379 -> { "execute": "block-dirty-bitmap-add", "arguments": { "node": "drive0",
1380 "name": "bitmap0" } }
1386 .name
= "block-dirty-bitmap-remove",
1387 .args_type
= "node:B,name:s",
1388 .mhandler
.cmd_new
= qmp_marshal_block_dirty_bitmap_remove
,
1393 block
-dirty
-bitmap
-remove
1394 -------------------------
1397 Stop write tracking and remove the dirty bitmap that was created with
1398 block
-dirty
-bitmap
-add
.
1402 - "node": device
/node on which to remove dirty
bitmap (json
-string
)
1403 - "name": name of the dirty bitmap to
remove (json
-string
)
1407 -> { "execute": "block-dirty-bitmap-remove", "arguments": { "node": "drive0",
1408 "name": "bitmap0" } }
1414 .name
= "block-dirty-bitmap-clear",
1415 .args_type
= "node:B,name:s",
1416 .mhandler
.cmd_new
= qmp_marshal_block_dirty_bitmap_clear
,
1421 block
-dirty
-bitmap
-clear
1422 ------------------------
1425 Reset the dirty bitmap associated with a node so that an incremental backup
1426 from
this point
in time forward will only backup clusters modified after
this
1431 - "node": device
/node on which to remove dirty
bitmap (json
-string
)
1432 - "name": name of the dirty bitmap to
remove (json
-string
)
1436 -> { "execute": "block-dirty-bitmap-clear", "arguments": { "node": "drive0",
1437 "name": "bitmap0" } }
1443 .name
= "blockdev-snapshot-sync",
1444 .args_type
= "device:s?,node-name:s?,snapshot-file:s,snapshot-node-name:s?,format:s?,mode:s?",
1445 .mhandler
.cmd_new
= qmp_marshal_blockdev_snapshot_sync
,
1449 blockdev
-snapshot
-sync
1450 ----------------------
1452 Synchronous snapshot of a block device
. snapshot
-file specifies the
1453 target of the
new image
. If the file exists
, or
if it is a device
, the
1454 snapshot will be created
in the existing file
/device
. If does not
1455 exist
, a
new file will be created
. format specifies the format of the
1456 snapshot image
, default is qcow2
.
1460 - "device": device name to
snapshot (json
-string
)
1461 - "node-name": graph node name to
snapshot (json
-string
)
1462 - "snapshot-file": name of
new image
file (json
-string
)
1463 - "snapshot-node-name": graph node name of the
new snapshot (json
-string
)
1464 - "mode": whether and how QEMU should create the snapshot file
1465 (NewImageMode
, optional
, default "absolute-paths")
1466 - "format": format of
new image (json
-string
, optional
)
1470 -> { "execute": "blockdev-snapshot-sync", "arguments": { "device": "ide-hd0",
1472 "/some/place/my-image",
1473 "format": "qcow2" } }
1479 .name
= "blockdev-snapshot-internal-sync",
1480 .args_type
= "device:B,name:s",
1481 .mhandler
.cmd_new
= qmp_marshal_blockdev_snapshot_internal_sync
,
1485 blockdev
-snapshot
-internal
-sync
1486 -------------------------------
1488 Synchronously take an internal snapshot of a block device when the format of
1489 image used supports it
. If the name is an empty string
, or a snapshot with
1490 name already exists
, the operation will fail
.
1494 - "device": device name to
snapshot (json
-string
)
1495 - "name": name of the
new snapshot (json
-string
)
1499 -> { "execute": "blockdev-snapshot-internal-sync",
1500 "arguments": { "device": "ide-hd0",
1501 "name": "snapshot0" }
1508 .name
= "blockdev-snapshot-delete-internal-sync",
1509 .args_type
= "device:B,id:s?,name:s?",
1511 qmp_marshal_blockdev_snapshot_delete_internal_sync
,
1515 blockdev
-snapshot
-delete
-internal
-sync
1516 --------------------------------------
1518 Synchronously delete an internal snapshot of a block device when the format of
1519 image used supports it
. The snapshot is identified by name or id or both
. One
1520 of name or id is required
. If the snapshot is not found
, the operation will
1525 - "device": device
name (json
-string
)
1526 - "id": ID of the
snapshot (json
-string
, optional
)
1527 - "name": name of the
snapshot (json
-string
, optional
)
1531 -> { "execute": "blockdev-snapshot-delete-internal-sync",
1532 "arguments": { "device": "ide-hd0",
1533 "name": "snapshot0" }
1537 "name": "snapshot0",
1539 "date-sec": 1000012,
1541 "vm-clock-sec": 100,
1549 .name
= "drive-mirror",
1550 .args_type
= "sync:s,device:B,target:s,speed:i?,mode:s?,format:s?,"
1551 "node-name:s?,replaces:s?,"
1552 "on-source-error:s?,on-target-error:s?,"
1554 "granularity:i?,buf-size:i?",
1555 .mhandler
.cmd_new
= qmp_marshal_drive_mirror
,
1562 Start mirroring a block device
's writes to a new destination. target
1563 specifies the target of the new image. If the file exists, or if it is
1564 a device, it will be used as the new destination for writes. If it does not
1565 exist, a new file will be created. format specifies the format of the
1566 mirror image, default is to probe if mode='existing
', else the format
1571 - "device": device name to operate on (json-string)
1572 - "target": name of new image file (json-string)
1573 - "format": format of new image (json-string, optional)
1574 - "node-name": the name of the new block driver state in the node graph
1575 (json-string, optional)
1576 - "replaces": the block driver node name to replace when finished
1577 (json-string, optional)
1578 - "mode": how an image file should be created into the target
1579 file/device (NewImageMode, optional, default 'absolute
-paths
')
1580 - "speed": maximum speed of the streaming job, in bytes per second
1582 - "granularity": granularity of the dirty bitmap, in bytes (json-int, optional)
1583 - "buf_size": maximum amount of data in flight from source to target, in bytes
1584 (json-int, default 10M)
1585 - "sync": what parts of the disk image should be copied to the destination;
1586 possibilities include "full" for all the disk, "top" for only the sectors
1587 allocated in the topmost image, or "none" to only replicate new I/O
1589 - "on-source-error": the action to take on an error on the source
1590 (BlockdevOnError, default 'report
')
1591 - "on-target-error": the action to take on an error on the target
1592 (BlockdevOnError, default 'report
')
1593 - "unmap": whether the target sectors should be discarded where source has only
1594 zeroes. (json-bool, optional, default true)
1596 The default value of the granularity is the image cluster size clamped
1597 between 4096 and 65536, if the image format defines one. If the format
1598 does not define a cluster size, the default value of the granularity
1604 -> { "execute": "drive-mirror", "arguments": { "device": "ide-hd0",
1605 "target": "/some/place/my-image",
1607 "format": "qcow2" } }
1613 .name = "change-backing-file",
1614 .args_type = "device:s,image-node-name:s,backing-file:s",
1615 .mhandler.cmd_new = qmp_marshal_change_backing_file,
1623 Change the backing file in the image file metadata. This does not cause
1624 QEMU to reopen the image file to reparse the backing filename (it may,
1625 however, perform a reopen to change permissions from r/o -> r/w -> r/o,
1626 if needed). The new backing file string is written into the image file
1627 metadata, and the QEMU internal strings are updated.
1631 - "image-node-name": The name of the block driver state node of the
1632 image to modify. The "device" is argument is used to
1633 verify "image-node-name" is in the chain described by
1635 (json-string, optional)
1637 - "device": The name of the device.
1640 - "backing-file": The string to write as the backing file. This string is
1641 not validated, so care should be taken when specifying
1642 the string or the image chain may not be able to be
1646 Returns: Nothing on success
1647 If "device" does not exist or cannot be determined, DeviceNotFound
1653 .args_type = "value:M",
1654 .mhandler.cmd_new = qmp_marshal_balloon,
1661 Request VM to change its memory allocation (in bytes).
1665 - "value": New memory allocation (json-int)
1669 -> { "execute": "balloon", "arguments": { "value": 536870912 } }
1676 .args_type = "name:s,up:b",
1677 .mhandler.cmd_new = qmp_marshal_set_link,
1684 Change the link status of a network adapter.
1688 - "name": network device name (json-string)
1689 - "up": status is up (json-bool)
1693 -> { "execute": "set_link", "arguments": { "name": "e1000.0", "up": false } }
1700 .args_type = "fdname:s",
1701 .params = "getfd name",
1702 .help = "receive a file descriptor via SCM rights and assign it a name",
1703 .mhandler.cmd_new = qmp_marshal_getfd,
1710 Receive a file descriptor via SCM rights and assign it a name.
1714 - "fdname": file descriptor name (json-string)
1718 -> { "execute": "getfd", "arguments": { "fdname": "fd1" } }
1723 (1) If the name specified by the "fdname" argument already exists,
1724 the file descriptor assigned to it will be closed and replaced
1725 by the received file descriptor.
1726 (2) The 'closefd
' command can be used to explicitly close the file
1727 descriptor when it is no longer needed.
1733 .args_type = "fdname:s",
1734 .params = "closefd name",
1735 .help = "close a file descriptor previously passed via SCM rights",
1736 .mhandler.cmd_new = qmp_marshal_closefd,
1743 Close a file descriptor previously passed via SCM rights.
1747 - "fdname": file descriptor name (json-string)
1751 -> { "execute": "closefd", "arguments": { "fdname": "fd1" } }
1758 .args_type = "fdset-id:i?,opaque:s?",
1759 .params = "add-fd fdset-id opaque",
1760 .help = "Add a file descriptor, that was passed via SCM rights, to an fd set",
1761 .mhandler.cmd_new = qmp_marshal_add_fd,
1768 Add a file descriptor, that was passed via SCM rights, to an fd set.
1772 - "fdset-id": The ID of the fd set to add the file descriptor to.
1773 (json-int, optional)
1774 - "opaque": A free-form string that can be used to describe the fd.
1775 (json-string, optional)
1777 Return a json-object with the following information:
1779 - "fdset-id": The ID of the fd set that the fd was added to. (json-int)
1780 - "fd": The file descriptor that was received via SCM rights and added to the
1785 -> { "execute": "add-fd", "arguments": { "fdset-id": 1 } }
1786 <- { "return": { "fdset-id": 1, "fd": 3 } }
1790 (1) The list of fd sets is shared by all monitor connections.
1791 (2) If "fdset-id" is not specified, a new fd set will be created.
1796 .name = "remove-fd",
1797 .args_type = "fdset-id:i,fd:i?",
1798 .params = "remove-fd fdset-id fd",
1799 .help = "Remove a file descriptor from an fd set",
1800 .mhandler.cmd_new = qmp_marshal_remove_fd,
1807 Remove a file descriptor from an fd set.
1811 - "fdset-id": The ID of the fd set that the file descriptor belongs to.
1813 - "fd": The file descriptor that is to be removed. (json-int, optional)
1817 -> { "execute": "remove-fd", "arguments": { "fdset-id": 1, "fd": 3 } }
1822 (1) The list of fd sets is shared by all monitor connections.
1823 (2) If "fd" is not specified, all file descriptors in "fdset-id" will be
1829 .name = "query-fdsets",
1831 .help = "Return information describing all fd sets",
1832 .mhandler.cmd_new = qmp_marshal_query_fdsets,
1839 Return information describing all fd sets.
1845 -> { "execute": "query-fdsets" }
1851 "opaque": "rdonly:/path/to/file"
1855 "opaque": "rdwr:/path/to/file"
1874 Note: The list of fd sets is shared by all monitor connections.
1879 .name = "block_passwd",
1880 .args_type = "device:s?,node-name:s?,password:s",
1881 .mhandler.cmd_new = qmp_marshal_block_passwd,
1888 Set the password of encrypted block devices.
1892 - "device": device name (json-string)
1893 - "node-name": name in the block driver state graph (json-string)
1894 - "password": password (json-string)
1898 -> { "execute": "block_passwd", "arguments": { "device": "ide0-hd0",
1899 "password": "12345" } }
1905 .name = "block_set_io_throttle",
1906 .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?,iops_size:l?,group:s?",
1907 .mhandler.cmd_new = qmp_marshal_block_set_io_throttle,
1911 block_set_io_throttle
1914 Change I/O throttle limits for a block drive.
1918 - "device": device name (json-string)
1919 - "bps": total throughput limit in bytes per second (json-int)
1920 - "bps_rd": read throughput limit in bytes per second (json-int)
1921 - "bps_wr": write throughput limit in bytes per second (json-int)
1922 - "iops": total I/O operations per second (json-int)
1923 - "iops_rd": read I/O operations per second (json-int)
1924 - "iops_wr": write I/O operations per second (json-int)
1925 - "bps_max": total max in bytes (json-int)
1926 - "bps_rd_max": read max in bytes (json-int)
1927 - "bps_wr_max": write max in bytes (json-int)
1928 - "iops_max": total I/O operations max (json-int)
1929 - "iops_rd_max": read I/O operations max (json-int)
1930 - "iops_wr_max": write I/O operations max (json-int)
1931 - "iops_size": I/O size in bytes when limiting (json-int)
1932 - "group": throttle group name (json-string)
1936 -> { "execute": "block_set_io_throttle", "arguments": { "device": "virtio0",
1955 .name = "set_password",
1956 .args_type = "protocol:s,password:s,connected:s?",
1957 .mhandler.cmd_new = qmp_marshal_set_password,
1964 Set the password for vnc/spice protocols.
1968 - "protocol": protocol name (json-string)
1969 - "password": password (json-string)
1970 - "connected": [ keep | disconnect | fail ] (json-string, optional)
1974 -> { "execute": "set_password", "arguments": { "protocol": "vnc",
1975 "password": "secret" } }
1981 .name = "expire_password",
1982 .args_type = "protocol:s,time:s",
1983 .mhandler.cmd_new = qmp_marshal_expire_password,
1990 Set the password expire time for vnc/spice protocols.
1994 - "protocol": protocol name (json-string)
1995 - "time": [ now | never | +secs | secs ] (json-string)
1999 -> { "execute": "expire_password", "arguments": { "protocol": "vnc",
2006 .name = "add_client",
2007 .args_type = "protocol:s,fdname:s,skipauth:b?,tls:b?",
2008 .mhandler.cmd_new = qmp_marshal_add_client,
2015 Add a graphics client
2019 - "protocol": protocol name (json-string)
2020 - "fdname": file descriptor name (json-string)
2021 - "skipauth": whether to skip authentication (json-bool, optional)
2022 - "tls": whether to perform TLS (json-bool, optional)
2026 -> { "execute": "add_client", "arguments": { "protocol": "vnc",
2027 "fdname": "myclient" } }
2032 .name = "qmp_capabilities",
2035 .help = "enable QMP capabilities",
2036 .mhandler.cmd_new = qmp_capabilities,
2043 Enable QMP capabilities.
2049 -> { "execute": "qmp_capabilities" }
2052 Note: This command must be issued before issuing any other command.
2057 .name = "human-monitor-command",
2058 .args_type = "command-line:s,cpu-index:i?",
2059 .mhandler.cmd_new = qmp_marshal_human_monitor_command,
2063 human-monitor-command
2064 ---------------------
2066 Execute a Human Monitor command.
2070 - command-line: the command name and its arguments, just like the
2071 Human Monitor's
shell (json
-string
)
2072 - cpu
-index
: select the CPU number to be used by commands which access CPU
2073 data
, like
'info registers'. The Monitor selects CPU
0 if this
2074 argument is not
provided (json
-int
, optional
)
2078 -> { "execute": "human-monitor-command", "arguments": { "command-line": "info kvm" } }
2079 <- { "return": "kvm support: enabled\r\n" }
2083 (1) The Human Monitor is NOT an stable
interface, this means that command
2084 names
, arguments and responses can change or be removed at ANY time
.
2085 Applications that rely on long term stability guarantees should NOT
2090 o This command is stateless
, this means that commands that depend
2091 on state
information (such as getfd
) might not work
2093 o Commands that prompt the user
for data (eg
. 'cont' when the block
2094 device is encrypted
) don
't currently work
2099 HXCOMM Each query command below is inside a SQMP/EQMP section, do NOT change
2100 HXCOMM this! We will possibly move query commands definitions inside those
2101 HXCOMM sections, just like regular commands.
2111 Return a json-object with the following information:
2113 - "qemu": A json-object containing three integer values:
2114 - "major": QEMU's major
version (json
-int
)
2115 - "minor": QEMU
's minor version (json-int)
2116 - "micro": QEMU's micro
version (json
-int
)
2117 - "package": package's version (json-string)
2121 -> { "execute": "query-version" }
2136 .name = "query-version",
2138 .mhandler.cmd_new = qmp_marshal_query_version,
2145 List QMP available commands.
2147 Each command is represented by a json-object, the returned value is a json-array
2150 Each json-object contain:
2152 - "name": command's
name (json
-string
)
2156 -> { "execute": "query-commands" }
2160 "name":"query-balloon"
2163 "name":"system_powerdown"
2168 Note
: This example has been shortened as the real response is too long
.
2173 .name
= "query-commands",
2175 .mhandler
.cmd_new
= qmp_marshal_query_commands
,
2182 List QMP available events
.
2184 Each event is represented by a json
-object
, the returned value is a json
-array
2187 Each json
-object contains
:
2189 - "name": event
's name (json-string)
2193 -> { "execute": "query-events" }
2205 Note: This example has been shortened as the real response is too long.
2210 .name = "query-events",
2212 .mhandler.cmd_new = qmp_marshal_query_events,
2219 Return the QMP wire schema. The returned value is a json-array of
2220 named schema entities. Entities are commands, events and various
2221 types. See docs/qapi-code-gen.txt for information on their structure
2227 .name = "query-qmp-schema",
2229 .mhandler.cmd_new = qmp_query_qmp_schema,
2236 Each device is represented by a json-object. The returned value is a json-array
2239 Each json-object contain the following:
2241 - "label": device's
label (json
-string
)
2242 - "filename": device
's file (json-string)
2243 - "frontend-open": open/closed state of the frontend device attached to this
2248 -> { "execute": "query-chardev" }
2252 "label": "charchannel0",
2253 "filename": "unix:/var/lib/libvirt/qemu/seabios.rhel6.agent,server",
2254 "frontend-open": false
2257 "label": "charmonitor",
2258 "filename": "unix:/var/lib/libvirt/qemu/seabios.rhel6.monitor,server",
2259 "frontend-open": true
2262 "label": "charserial0",
2263 "filename": "pty:/dev/pts/2",
2264 "frontend-open": true
2272 .name = "query-chardev",
2274 .mhandler.cmd_new = qmp_marshal_query_chardev,
2278 query-chardev-backends
2281 List available character device backends.
2283 Each backend is represented by a json-object, the returned value is a json-array
2286 Each json-object contains:
2288 - "name": backend name (json-string)
2292 -> { "execute": "query-chardev-backends" }
2313 .name = "query-chardev-backends",
2315 .mhandler.cmd_new = qmp_marshal_query_chardev_backends,
2322 Show the block devices.
2324 Each block device information is stored in a json-object and the returned value
2325 is a json-array of all devices.
2327 Each json-object contain the following:
2329 - "device": device name (json-string)
2330 - "type": device type (json-string)
2331 - deprecated, retained for backward compatibility
2332 - Possible values: "unknown"
2333 - "removable": true if the device is removable, false otherwise (json-bool)
2334 - "locked": true if the device is locked, false otherwise (json-bool)
2335 - "tray_open": only present if removable, true if the device has a tray,
2336 and it is open (json-bool)
2337 - "inserted": only present if the device is inserted, it is a json-object
2338 containing the following:
2339 - "file": device file name (json-string)
2340 - "ro": true if read-only, false otherwise (json-bool)
2341 - "drv": driver format name (json-string)
2342 - Possible values: "blkdebug", "bochs", "cloop", "dmg",
2343 "file", "file", "ftp", "ftps", "host_cdrom",
2344 "host_device", "http", "https",
2345 "nbd", "parallels", "qcow", "qcow2", "raw",
2346 "tftp", "vdi", "vmdk", "vpc", "vvfat"
2347 - "backing_file": backing file name (json-string, optional)
2348 - "backing_file_depth": number of files in the backing file chain (json-int)
2349 - "encrypted": true if encrypted, false otherwise (json-bool)
2350 - "bps": limit total bytes per second (json-int)
2351 - "bps_rd": limit read bytes per second (json-int)
2352 - "bps_wr": limit write bytes per second (json-int)
2353 - "iops": limit total I/O operations per second (json-int)
2354 - "iops_rd": limit read operations per second (json-int)
2355 - "iops_wr": limit write operations per second (json-int)
2356 - "bps_max": total max in bytes (json-int)
2357 - "bps_rd_max": read max in bytes (json-int)
2358 - "bps_wr_max": write max in bytes (json-int)
2359 - "iops_max": total I/O operations max (json-int)
2360 - "iops_rd_max": read I/O operations max (json-int)
2361 - "iops_wr_max": write I/O operations max (json-int)
2362 - "iops_size": I/O size when limiting by iops (json-int)
2363 - "detect_zeroes": detect and optimize zero writing (json-string)
2364 - Possible values: "off", "on", "unmap"
2365 - "write_threshold": write offset threshold in bytes, a event will be
2366 emitted if crossed. Zero if disabled (json-int)
2367 - "image": the detail of the image, it is a json-object containing
2369 - "filename": image file name (json-string)
2370 - "format": image format (json-string)
2371 - "virtual-size": image capacity in bytes (json-int)
2372 - "dirty-flag": true if image is not cleanly closed, not present
2373 means clean (json-bool, optional)
2374 - "actual-size": actual size on disk in bytes of the image, not
2375 present when image does not support thin
2376 provision (json-int, optional)
2377 - "cluster-size": size of a cluster in bytes, not present if image
2378 format does not support it (json-int, optional)
2379 - "encrypted": true if the image is encrypted, not present means
2380 false or the image format does not support
2381 encryption (json-bool, optional)
2382 - "backing_file": backing file name, not present means no backing
2383 file is used or the image format does not
2384 support backing file chain
2385 (json-string, optional)
2386 - "full-backing-filename": full path of the backing file, not
2387 present if it equals backing_file or no
2388 backing file is used
2389 (json-string, optional)
2390 - "backing-filename-format": the format of the backing file, not
2391 present means unknown or no backing
2392 file (json-string, optional)
2393 - "snapshots": the internal snapshot info, it is an optional list
2394 of json-object containing the following:
2395 - "id": unique snapshot id (json-string)
2396 - "name": snapshot name (json-string)
2397 - "vm-state-size": size of the VM state in bytes (json-int)
2398 - "date-sec": UTC date of the snapshot in seconds (json-int)
2399 - "date-nsec": fractional part in nanoseconds to be used with
2401 - "vm-clock-sec": VM clock relative to boot in seconds
2403 - "vm-clock-nsec": fractional part in nanoseconds to be used
2404 with vm-clock-sec (json-int)
2405 - "backing-image": the detail of the backing image, it is an
2406 optional json-object only present when a
2407 backing image present for this image
2409 - "io-status": I/O operation status, only present if the device supports it
2410 and the VM is configured to stop on errors. It's always reset
2411 to
"ok" when the
"cont" command is
issued (json_string
, optional
)
2412 - Possible values
: "ok", "failed", "nospace"
2416 -> { "execute": "query-block" }
2421 "device":"ide0-hd0",
2428 "file":"disks/test.qcow2",
2429 "backing_file_depth":1,
2443 "detect_zeroes": "on",
2444 "write_threshold": 0,
2446 "filename":"disks/test.qcow2",
2448 "virtual-size":2048000,
2449 "backing_file":"base.qcow2",
2450 "full-backing-filename":"disks/base.qcow2",
2451 "backing-filename-format":"qcow2",
2455 "name": "snapshot1",
2457 "date-sec": 10000200,
2459 "vm-clock-sec": 206,
2464 "filename":"disks/base.qcow2",
2466 "virtual-size":2048000
2474 "device":"ide1-cd0",
2497 .name
= "query-block",
2499 .mhandler
.cmd_new
= qmp_marshal_query_block
,
2506 Show block device statistics
.
2508 Each device statistic information is stored
in a json
-object and the returned
2509 value is a json
-array of all devices
.
2511 Each json
-object contain the following
:
2513 - "device": device
name (json
-string
)
2514 - "stats": A json
-object with the statistics information
, it contains
:
2515 - "rd_bytes": bytes
read (json
-int
)
2516 - "wr_bytes": bytes
written (json
-int
)
2517 - "rd_operations": read
operations (json
-int
)
2518 - "wr_operations": write
operations (json
-int
)
2519 - "flush_operations": cache flush
operations (json
-int
)
2520 - "wr_total_time_ns": total time spend on writes
in nano
-seconds (json
-int
)
2521 - "rd_total_time_ns": total time spend on reads
in nano
-seconds (json
-int
)
2522 - "flush_total_time_ns": total time spend on cache flushes
in nano
-seconds (json
-int
)
2523 - "wr_highest_offset": The offset after the greatest byte written to the
2524 BlockDriverState since it has been
opened (json
-int
)
2525 - "rd_merged": number of read requests that have been merged into
2526 another
request (json
-int
)
2527 - "wr_merged": number of write requests that have been merged into
2528 another
request (json
-int
)
2529 - "parent": Contains recursively the statistics of the underlying
2530 protocol (e
.g
. the host file
for a qcow2 image
). If there is
2531 no underlying protocol
, this field is omitted
2532 (json
-object
, optional
)
2536 -> { "execute": "query-blockstats" }
2540 "device":"ide0-hd0",
2543 "wr_highest_offset":3686448128,
2545 "wr_operations":751,
2546 "rd_bytes":122567168,
2547 "rd_operations":36772
2548 "wr_total_times_ns":313253456
2549 "rd_total_times_ns":3465673657
2550 "flush_total_times_ns":49653
2551 "flush_operations":61,
2557 "wr_highest_offset":2821110784,
2559 "wr_operations":692,
2560 "rd_bytes":122739200,
2561 "rd_operations":36604
2562 "flush_operations":51,
2563 "wr_total_times_ns":313253456
2564 "rd_total_times_ns":3465673657
2565 "flush_total_times_ns":49653,
2571 "device":"ide1-cd0",
2573 "wr_highest_offset":0,
2578 "flush_operations":0,
2579 "wr_total_times_ns":0
2580 "rd_total_times_ns":0
2581 "flush_total_times_ns":0,
2589 "wr_highest_offset":0,
2594 "flush_operations":0,
2595 "wr_total_times_ns":0
2596 "rd_total_times_ns":0
2597 "flush_total_times_ns":0,
2605 "wr_highest_offset":0,
2610 "flush_operations":0,
2611 "wr_total_times_ns":0
2612 "rd_total_times_ns":0
2613 "flush_total_times_ns":0,
2624 .name
= "query-blockstats",
2625 .args_type
= "query-nodes:b?",
2626 .mhandler
.cmd_new
= qmp_marshal_query_blockstats
,
2633 Show CPU information
.
2635 Return a json
-array
. Each CPU is represented by a json
-object
, which contains
:
2637 - "CPU": CPU
index (json
-int
)
2638 - "current": true if this is the current CPU
, false otherwise (json
-bool
)
2639 - "halted": true if the cpu is halted
, false otherwise (json
-bool
)
2640 - "qom_path": path to the CPU object
in the QOM
tree (json
-str
)
2641 - Current program counter
. The key
's name depends on the architecture:
2642 "pc": i386/x86_64 (json-int)
2643 "nip": PPC (json-int)
2644 "pc" and "npc": sparc (json-int)
2645 "PC": mips (json-int)
2646 - "thread_id": ID of the underlying host thread (json-int)
2650 -> { "execute": "query-cpus" }
2657 "qom_path":"/machine/unattached/device[0]",
2665 "qom_path":"/machine/unattached/device[2]",
2675 .name = "query-cpus",
2677 .mhandler.cmd_new = qmp_marshal_query_cpus,
2684 Returns a list of information about each iothread.
2686 Note this list excludes the QEMU main loop thread, which is not declared
2687 using the -object iothread command-line option. It is always the main thread
2690 Return a json-array. Each iothread is represented by a json-object, which contains:
2692 - "id": name of iothread (json-str)
2693 - "thread-id": ID of the underlying host thread (json-int)
2697 -> { "execute": "query-iothreads" }
2714 .name = "query-iothreads",
2716 .mhandler.cmd_new = qmp_marshal_query_iothreads,
2723 PCI buses and devices information.
2725 The returned value is a json-array of all buses. Each bus is represented by
2726 a json-object, which has a key with a json-array of all PCI devices attached
2727 to it. Each device is represented by a json-object.
2729 The bus json-object contains the following:
2731 - "bus": bus number (json-int)
2732 - "devices": a json-array of json-objects, each json-object represents a
2735 The PCI device json-object contains the following:
2737 - "bus": identical to the parent's bus
number (json
-int
)
2738 - "slot": slot
number (json
-int
)
2739 - "function": function number (json
-int
)
2740 - "class_info": a json
-object containing
:
2741 - "desc": device
class description (json
-string
, optional
)
2742 - "class": device
class number (json
-int
)
2743 - "id": a json
-object containing
:
2744 - "device": device
ID (json
-int
)
2745 - "vendor": vendor
ID (json
-int
)
2746 - "irq": device
's IRQ if assigned (json-int, optional)
2747 - "qdev_id": qdev id string (json-string)
2748 - "pci_bridge": It's a json
-object
, only present
if this device is a
2749 PCI bridge
, contains
:
2750 - "bus": bus
number (json
-int
)
2751 - "secondary": secondary bus
number (json
-int
)
2752 - "subordinate": subordinate bus
number (json
-int
)
2753 - "io_range": I
/O memory range information
, a json
-object with the
2755 - "base": base address
, in bytes (json
-int
)
2756 - "limit": limit address
, in bytes (json
-int
)
2757 - "memory_range": memory range information
, a json
-object with the
2759 - "base": base address
, in bytes (json
-int
)
2760 - "limit": limit address
, in bytes (json
-int
)
2761 - "prefetchable_range": Prefetchable memory range information
, a
2762 json
-object with the following members
:
2763 - "base": base address
, in bytes (json
-int
)
2764 - "limit": limit address
, in bytes (json
-int
)
2765 - "devices": a json
-array of PCI devices
if there
's any attached, each
2766 each element is represented by a json-object, which contains
2767 the same members of the 'PCI device json
-object
' described
2769 - "regions": a json-array of json-objects, each json-object represents a
2770 memory region of this device
2772 The memory range json-object contains the following:
2774 - "base": base memory address (json-int)
2775 - "limit": limit value (json-int)
2777 The region json-object can be an I/O region or a memory region, an I/O region
2778 json-object contains the following:
2780 - "type": "io" (json-string, fixed)
2781 - "bar": BAR number (json-int)
2782 - "address": memory address (json-int)
2783 - "size": memory size (json-int)
2785 A memory region json-object contains the following:
2787 - "type": "memory" (json-string, fixed)
2788 - "bar": BAR number (json-int)
2789 - "address": memory address (json-int)
2790 - "size": memory size (json-int)
2791 - "mem_type_64": true or false (json-bool)
2792 - "prefetch": true or false (json-bool)
2796 -> { "execute": "query-pci" }
2808 "desc":"Host bridge"
2842 "desc":"IDE controller"
2864 "desc":"VGA controller"
2874 "mem_type_64":false,
2877 "address":4026531840,
2882 "mem_type_64":false,
2885 "address":4060086272,
2890 "mem_type_64":false,
2905 "desc":"RAM controller"
2926 Note: This example has been shortened as the real response is too long.
2931 .name = "query-pci",
2933 .mhandler.cmd_new = qmp_marshal_query_pci,
2940 Show KVM information.
2942 Return a json-object with the following information:
2944 - "enabled": true if KVM support is enabled, false otherwise (json-bool)
2945 - "present": true if QEMU has KVM support, false otherwise (json-bool)
2949 -> { "execute": "query-kvm" }
2950 <- { "return": { "enabled": true, "present": true } }
2955 .name = "query-kvm",
2957 .mhandler.cmd_new = qmp_marshal_query_kvm,
2964 Return a json-object with the following information:
2966 - "running": true if the VM is running, or false if it is paused (json-bool)
2967 - "singlestep": true if the VM is in single step mode,
2968 false otherwise (json-bool)
2969 - "status": one of the following values (json-string)
2970 "debug" - QEMU is running on a debugger
2971 "inmigrate" - guest is paused waiting for an incoming migration
2972 "internal-error" - An internal error that prevents further guest
2973 execution has occurred
2974 "io-error" - the last IOP has failed and the device is configured
2975 to pause on I/O errors
2976 "paused" - guest has been paused via the 'stop
' command
2977 "postmigrate" - guest is paused following a successful 'migrate
'
2978 "prelaunch" - QEMU was started with -S and guest has not started
2979 "finish-migrate" - guest is paused to finish the migration process
2980 "restore-vm" - guest is paused to restore VM state
2981 "running" - guest is actively running
2982 "save-vm" - guest is paused to save the VM state
2983 "shutdown" - guest is shut down (and -no-shutdown is in use)
2984 "watchdog" - the watchdog action is configured to pause and
2989 -> { "execute": "query-status" }
2990 <- { "return": { "running": true, "singlestep": false, "status": "running" } }
2995 .name = "query-status",
2997 .mhandler.cmd_new = qmp_marshal_query_status,
3004 Show VM mice information.
3006 Each mouse is represented by a json-object, the returned value is a json-array
3009 The mouse json-object contains the following:
3011 - "name": mouse's
name (json
-string
)
3012 - "index": mouse
's index (json-int)
3013 - "current": true if this mouse is receiving events, false otherwise (json-bool)
3014 - "absolute": true if the mouse generates absolute input events (json-bool)
3018 -> { "execute": "query-mice" }
3022 "name":"QEMU Microsoft Mouse",
3028 "name":"QEMU PS/2 Mouse",
3039 .name = "query-mice",
3041 .mhandler.cmd_new = qmp_marshal_query_mice,
3048 Show VNC server information.
3050 Return a json-object with server information. Connected clients are returned
3051 as a json-array of json-objects.
3053 The main json-object contains the following:
3055 - "enabled": true or false (json-bool)
3056 - "host": server's IP
address (json
-string
)
3057 - "family": address
family (json
-string
)
3058 - Possible values
: "ipv4", "ipv6", "unix", "unknown"
3059 - "service": server
's port number (json-string)
3060 - "auth": authentication method (json-string)
3061 - Possible values: "invalid", "none", "ra2", "ra2ne", "sasl", "tight",
3062 "tls", "ultra", "unknown", "vencrypt", "vencrypt",
3063 "vencrypt+plain", "vencrypt+tls+none",
3064 "vencrypt+tls+plain", "vencrypt+tls+sasl",
3065 "vencrypt+tls+vnc", "vencrypt+x509+none",
3066 "vencrypt+x509+plain", "vencrypt+x509+sasl",
3067 "vencrypt+x509+vnc", "vnc"
3068 - "clients": a json-array of all connected clients
3070 Clients are described by a json-object, each one contain the following:
3072 - "host": client's IP
address (json
-string
)
3073 - "family": address
family (json
-string
)
3074 - Possible values
: "ipv4", "ipv6", "unix", "unknown"
3075 - "service": client
's port number (json-string)
3076 - "x509_dname": TLS dname (json-string, optional)
3077 - "sasl_username": SASL username (json-string, optional)
3081 -> { "execute": "query-vnc" }
3102 .name = "query-vnc",
3104 .mhandler.cmd_new = qmp_marshal_query_vnc,
3107 .name = "query-vnc-servers",
3109 .mhandler.cmd_new = qmp_marshal_query_vnc_servers,
3116 Show SPICE server information.
3118 Return a json-object with server information. Connected clients are returned
3119 as a json-array of json-objects.
3121 The main json-object contains the following:
3123 - "enabled": true or false (json-bool)
3124 - "host": server's IP
address (json
-string
)
3125 - "port": server
's port number (json-int, optional)
3126 - "tls-port": server's port
number (json
-int
, optional
)
3127 - "auth": authentication
method (json
-string
)
3128 - Possible values
: "none", "spice"
3129 - "channels": a json
-array of all active channels clients
3131 Channels are described by a json
-object
, each one contain the following
:
3133 - "host": client
's IP address (json-string)
3134 - "family": address family (json-string)
3135 - Possible values: "ipv4", "ipv6", "unix", "unknown"
3136 - "port": client's port
number (json
-string
)
3137 - "connection-id": spice connection id
. All channels with the same id
3138 belong to the same spice
session (json
-int
)
3139 - "channel-type": channel type
. "1" is the main control channel
, filter
for
3140 this one
if you want track spice sessions
only (json
-int
)
3141 - "channel-id": channel id
. Usually
"0", might be different needed when
3142 multiple channels of the same type exist
, such as multiple
3143 display channels
in a multihead
setup (json
-int
)
3144 - "tls": whether the channel is
encrypted (json
-bool
)
3148 -> { "execute": "query-spice" }
3161 "connection-id": 1804289383,
3162 "host": "127.0.0.1",
3170 "connection-id": 1804289383,
3171 "host": "127.0.0.1",
3175 [ ... more channels follow
... ]
3182 #
if defined(CONFIG_SPICE
)
3184 .name
= "query-spice",
3186 .mhandler
.cmd_new
= qmp_marshal_query_spice
,
3196 Return a json
-object with the following information
:
3198 - "name": VM
's name (json-string, optional)
3202 -> { "execute": "query-name" }
3203 <- { "return": { "name": "qemu-name" } }
3208 .name = "query-name",
3210 .mhandler.cmd_new = qmp_marshal_query_name,
3219 Return a json-object with the following information:
3221 - "UUID": Universally Unique Identifier (json-string)
3225 -> { "execute": "query-uuid" }
3226 <- { "return": { "UUID": "550e8400-e29b-41d4-a716-446655440000" } }
3231 .name = "query-uuid",
3233 .mhandler.cmd_new = qmp_marshal_query_uuid,
3237 query-command-line-options
3238 --------------------------
3240 Show command line option schema.
3242 Return a json-array of command line option schema for all options (or for
3243 the given option), returning an error if the given option doesn't exist
.
3245 Each array entry contains the following
:
3247 - "option": option
name (json
-string
)
3248 - "parameters": a json
-array describes all parameters of the option
:
3249 - "name": parameter
name (json
-string
)
3250 - "type": parameter
type (one of
'string', 'boolean', 'number',
3252 - "help": human readable description of the parameter
3253 (json
-string
, optional
)
3254 - "default": default value string
for the parameter
3255 (json
-string
, optional
)
3259 -> { "execute": "query-command-line-options", "arguments": { "option": "option-rom" } }
3268 "name": "bootindex",
3272 "option": "option-rom"
3280 .name
= "query-command-line-options",
3281 .args_type
= "option:s?",
3282 .mhandler
.cmd_new
= qmp_marshal_query_command_line_options
,
3291 Return a json
-object
. If migration is active there will be another json
-object
3292 with RAM migration status and
if block migration is active another one with
3293 block migration status
.
3295 The main json
-object contains the following
:
3297 - "status": migration
status (json
-string
)
3298 - Possible values
: "setup", "active", "completed", "failed", "cancelled"
3299 - "total-time": total amount of ms since migration started
. If
3300 migration has ended
, it returns the total migration
3302 - "setup-time" amount of setup time
in milliseconds _before_ the
3303 iterations begin but _after_ the QMP command is issued
.
3304 This is designed to provide an accounting of any activities
3305 (such as RDMA pinning
) which may be expensive
, but
do not
3306 actually occur during the iterative migration rounds
3307 themselves
. (json
-int
)
3308 - "downtime": only present when migration has finished correctly
3309 total amount
in ms
for downtime that
happened (json
-int
)
3310 - "expected-downtime": only present
while migration is active
3311 total amount
in ms
for downtime that was calculated on
3312 the last bitmap
round (json
-int
)
3313 - "ram": only present
if "status" is
"active", it is a json
-object with the
3314 following RAM information
:
3315 - "transferred": amount transferred
in bytes (json
-int
)
3316 - "remaining": amount remaining to transfer
in bytes (json
-int
)
3317 - "total": total amount of memory
in bytes (json
-int
)
3318 - "duplicate": number of pages filled entirely with the same
3320 These are sent over the wire much more efficiently
.
3321 - "skipped": number of skipped zero
pages (json
-int
)
3322 - "normal" : number of whole pages transferred
. I
.e
. they
3323 were not sent as duplicate or xbzrle
pages (json
-int
)
3324 - "normal-bytes" : number of bytes transferred
in whole
3325 pages
. This is just normal pages times size of one page
,
3326 but
this way upper levels don
't need to care about page
3328 - "dirty-sync-count": times that dirty ram was synchronized (json-int)
3329 - "disk": only present if "status" is "active" and it is a block migration,
3330 it is a json-object with the following disk information:
3331 - "transferred": amount transferred in bytes (json-int)
3332 - "remaining": amount remaining to transfer in bytes json-int)
3333 - "total": total disk size in bytes (json-int)
3334 - "xbzrle-cache": only present if XBZRLE is active.
3335 It is a json-object with the following XBZRLE information:
3336 - "cache-size": XBZRLE cache size in bytes
3337 - "bytes": number of bytes transferred for XBZRLE compressed pages
3338 - "pages": number of XBZRLE compressed pages
3339 - "cache-miss": number of XBRZRLE page cache misses
3340 - "cache-miss-rate": rate of XBRZRLE page cache misses
3341 - "overflow": number of times XBZRLE overflows. This means
3342 that the XBZRLE encoding was bigger than just sent the
3343 whole page, and then we sent the whole page instead (as as
3348 1. Before the first migration
3350 -> { "execute": "query-migrate" }
3353 2. Migration is done and has succeeded
3355 -> { "execute": "query-migrate" }
3357 "status": "completed",
3367 "normal-bytes":123456,
3368 "dirty-sync-count":15
3373 3. Migration is done and has failed
3375 -> { "execute": "query-migrate" }
3376 <- { "return": { "status": "failed" } }
3378 4. Migration is being performed and is not a block migration:
3380 -> { "execute": "query-migrate" }
3390 "expected-downtime":12345,
3393 "normal-bytes":123456,
3394 "dirty-sync-count":15
3399 5. Migration is being performed and is a block migration:
3401 -> { "execute": "query-migrate" }
3407 "remaining":1053304,
3411 "expected-downtime":12345,
3414 "normal-bytes":123456,
3415 "dirty-sync-count":15
3419 "remaining":20880384,
3425 6. Migration is being performed and XBZRLE is active:
3427 -> { "execute": "query-migrate" }
3431 "capabilities" : [ { "capability": "xbzrle", "state" : true } ],
3434 "remaining":1053304,
3438 "expected-downtime":12345,
3441 "normal-bytes":3412992,
3442 "dirty-sync-count":15
3445 "cache-size":67108864,
3449 "cache-miss-rate":0.123,
3458 .name = "query-migrate",
3460 .mhandler.cmd_new = qmp_marshal_query_migrate,
3464 migrate-set-capabilities
3465 ------------------------
3467 Enable/Disable migration capabilities
3469 - "xbzrle": XBZRLE support
3470 - "rdma-pin-all": pin all pages when using RDMA during migration
3471 - "auto-converge": throttle down guest to help convergence of migration
3472 - "zero-blocks": compress zero blocks during block migration
3473 - "events": generate events for each migration state change
3479 -> { "execute": "migrate-set-capabilities" , "arguments":
3480 { "capabilities": [ { "capability": "xbzrle", "state": true } ] } }
3485 .name = "migrate-set-capabilities",
3486 .args_type = "capabilities:q",
3487 .params = "capability:s,state:b",
3488 .mhandler.cmd_new = qmp_marshal_migrate_set_capabilities,
3491 query-migrate-capabilities
3492 --------------------------
3494 Query current migration capabilities
3496 - "capabilities": migration capabilities state
3497 - "xbzrle" : XBZRLE state (json-bool)
3498 - "rdma-pin-all" : RDMA Pin Page state (json-bool)
3499 - "auto-converge" : Auto Converge state (json-bool)
3500 - "zero-blocks" : Zero Blocks state (json-bool)
3506 -> { "execute": "query-migrate-capabilities" }
3507 <- { "return": [ { "state": false, "capability": "xbzrle" } ] }
3512 .name = "query-migrate-capabilities",
3514 .mhandler.cmd_new = qmp_marshal_query_migrate_capabilities,
3518 migrate-set-parameters
3519 ----------------------
3521 Set migration parameters
3523 - "compress-level": set compression level during migration (json-int)
3524 - "compress-threads": set compression thread count for migration (json-int)
3525 - "decompress-threads": set decompression thread count for migration (json-int)
3531 -> { "execute": "migrate-set-parameters" , "arguments":
3532 { "compress-level": 1 } }
3537 .name = "migrate-set-parameters",
3539 "compress-level:i?,compress-threads:i?,decompress-threads:i?",
3540 .mhandler.cmd_new = qmp_marshal_migrate_set_parameters,
3543 query-migrate-parameters
3544 ------------------------
3546 Query current migration parameters
3548 - "parameters": migration parameters value
3549 - "compress-level" : compression level value (json-int)
3550 - "compress-threads" : compression thread count value (json-int)
3551 - "decompress-threads" : decompression thread count value (json-int)
3557 -> { "execute": "query-migrate-parameters" }
3560 "decompress-threads", 2,
3561 "compress-threads", 8,
3569 .name = "query-migrate-parameters",
3571 .mhandler.cmd_new = qmp_marshal_query_migrate_parameters,
3578 Show balloon information.
3580 Make an asynchronous request for balloon info. When the request completes a
3581 json-object will be returned containing the following data:
3583 - "actual": current balloon value in bytes (json-int)
3587 -> { "execute": "query-balloon" }
3590 "actual":1073741824,
3597 .name = "query-balloon",
3599 .mhandler.cmd_new = qmp_marshal_query_balloon,
3603 .name = "query-block-jobs",
3605 .mhandler.cmd_new = qmp_marshal_query_block_jobs,
3610 .args_type = "path:s",
3611 .mhandler.cmd_new = qmp_marshal_qom_list,
3616 .args_type = "path:s,property:s,value:q",
3617 .mhandler.cmd_new = qmp_marshal_qom_set,
3622 .args_type = "path:s,property:s",
3623 .mhandler.cmd_new = qmp_marshal_qom_get,
3627 .name = "nbd-server-start",
3628 .args_type = "addr:q",
3629 .mhandler.cmd_new = qmp_marshal_nbd_server_start,
3632 .name = "nbd-server-add",
3633 .args_type = "device:B,writable:b?",
3634 .mhandler.cmd_new = qmp_marshal_nbd_server_add,
3637 .name = "nbd-server-stop",
3639 .mhandler.cmd_new = qmp_marshal_nbd_server_stop,
3643 .name = "change-vnc-password",
3644 .args_type = "password:s",
3645 .mhandler.cmd_new = qmp_marshal_change_vnc_password,
3648 .name = "qom-list-types",
3649 .args_type = "implements:s?,abstract:b?",
3650 .mhandler.cmd_new = qmp_marshal_qom_list_types,
3654 .name = "device-list-properties",
3655 .args_type = "typename:s",
3656 .mhandler.cmd_new = qmp_marshal_device_list_properties,
3660 .name = "query-machines",
3662 .mhandler.cmd_new = qmp_marshal_query_machines,
3666 .name = "query-cpu-definitions",
3668 .mhandler.cmd_new = qmp_marshal_query_cpu_definitions,
3672 .name = "query-target",
3674 .mhandler.cmd_new = qmp_marshal_query_target,
3678 .name = "query-tpm",
3680 .mhandler.cmd_new = qmp_marshal_query_tpm,
3687 Return information about the TPM device.
3693 -> { "execute": "query-tpm" }
3696 { "model": "tpm-tis",
3698 { "type": "passthrough",
3700 { "cancel-path": "/sys/class/misc/tpm0/device/cancel",
3712 .name = "query-tpm-models",
3714 .mhandler.cmd_new = qmp_marshal_query_tpm_models,
3721 Return a list of supported TPM models.
3727 -> { "execute": "query-tpm-models" }
3728 <- { "return": [ "tpm-tis" ] }
3733 .name = "query-tpm-types",
3735 .mhandler.cmd_new = qmp_marshal_query_tpm_types,
3742 Return a list of supported TPM types.
3748 -> { "execute": "query-tpm-types" }
3749 <- { "return": [ "passthrough" ] }
3754 .name = "chardev-add",
3755 .args_type = "id:s,backend:q",
3756 .mhandler.cmd_new = qmp_marshal_chardev_add,
3767 - "id": the chardev's ID
, must be
unique (json
-string
)
3768 - "backend": chardev backend type
+ parameters
3772 -> { "execute" : "chardev-add",
3773 "arguments" : { "id" : "foo",
3774 "backend" : { "type" : "null", "data" : {} } } }
3777 -> { "execute" : "chardev-add",
3778 "arguments" : { "id" : "bar",
3779 "backend" : { "type" : "file",
3780 "data" : { "out" : "/tmp/bar.log" } } } }
3783 -> { "execute" : "chardev-add",
3784 "arguments" : { "id" : "baz",
3785 "backend" : { "type" : "pty", "data" : {} } } }
3786 <- { "return": { "pty" : "/dev/pty/42" } }
3791 .name
= "chardev-remove",
3792 .args_type
= "id:s",
3793 .mhandler
.cmd_new
= qmp_marshal_chardev_remove
,
3805 - "id": the chardev
's ID, must exist and not be in use (json-string)
3809 -> { "execute": "chardev-remove", "arguments": { "id" : "foo" } }
3814 .name = "query-rx-filter",
3815 .args_type = "name:s?",
3816 .mhandler.cmd_new = qmp_marshal_query_rx_filter,
3823 Show rx-filter information.
3825 Returns a json-array of rx-filter information for all NICs (or for the
3826 given NIC), returning an error if the given NIC doesn't exist
, or
3827 given NIC doesn
't support rx-filter querying, or given net client
3830 The query will clear the event notification flag of each NIC
, then qemu
3831 will start to emit event to QMP monitor
.
3833 Each array entry contains the following
:
3835 - "name": net client
name (json
-string
)
3836 - "promiscuous": promiscuous mode is
enabled (json
-bool
)
3837 - "multicast": multicast receive
state (one of
'normal', 'none', 'all')
3838 - "unicast": unicast receive
state (one of
'normal', 'none', 'all')
3839 - "vlan": vlan receive
state (one of
'normal', 'none', 'all') (Since
2.0)
3840 - "broadcast-allowed": allow to receive
broadcast (json
-bool
)
3841 - "multicast-overflow": multicast table is
overflowed (json
-bool
)
3842 - "unicast-overflow": unicast table is
overflowed (json
-bool
)
3843 - "main-mac": main macaddr
string (json
-string
)
3844 - "vlan-table": a json
-array of active vlan id
3845 - "unicast-table": a json
-array of unicast macaddr string
3846 - "multicast-table": a json
-array of multicast macaddr string
3850 -> { "execute": "query-rx-filter", "arguments": { "name": "vnet0" } }
3853 "promiscuous": true,
3855 "main-mac": "52:54:00:12:34:56",
3856 "unicast": "normal",
3864 "multicast": "normal",
3865 "multicast-overflow": false,
3866 "unicast-overflow": false,
3867 "multicast-table": [
3868 "01:00:5e:00:00:01",
3869 "33:33:00:00:00:01",
3872 "broadcast-allowed": false
3880 .name
= "blockdev-add",
3881 .args_type
= "options:q",
3882 .mhandler
.cmd_new
= qmp_marshal_blockdev_add
,
3891 This command is still a work
in progress
. It doesn
't support all
3892 block drivers, it lacks a matching blockdev-del, and more. Stay away
3893 from it unless you want to help with its development.
3897 - "options": block driver options
3901 -> { "execute": "blockdev-add",
3902 "arguments": { "options" : { "driver": "qcow2",
3903 "file": { "driver": "file",
3904 "filename": "test.qcow2" } } } }
3909 -> { "execute": "blockdev-add",
3921 "filename": "/tmp/test.qcow2"
3927 "filename": "/dev/fdset/4"
3939 .name = "query-named-block-nodes",
3941 .mhandler.cmd_new = qmp_marshal_query_named_block_nodes,
3945 @query-named-block-nodes
3946 ------------------------
3948 Return a list of BlockDeviceInfo for all the named block driver nodes
3952 -> { "execute": "query-named-block-nodes" }
3953 <- { "return": [ { "ro":false,
3956 "file":"disks/test.qcow2",
3957 "node-name": "my-node",
3958 "backing_file_depth":1,
3972 "write_threshold": 0,
3974 "filename":"disks/test.qcow2",
3976 "virtual-size":2048000,
3977 "backing_file":"base.qcow2",
3978 "full-backing-filename":"disks/base.qcow2",
3979 "backing-filename-format":"qcow2",
3983 "name": "snapshot1",
3985 "date-sec": 10000200,
3987 "vm-clock-sec": 206,
3992 "filename":"disks/base.qcow2",
3994 "virtual-size":2048000
4001 .name = "query-memdev",
4003 .mhandler.cmd_new = qmp_marshal_query_memdev,
4010 Show memory devices information.
4015 -> { "execute": "query-memdev" }
4022 "host-nodes": [0, 1],
4030 "host-nodes": [2, 3],
4031 "policy": "preferred"
4039 .name = "query-memory-devices",
4041 .mhandler.cmd_new = qmp_marshal_query_memory_devices,
4045 @query-memory-devices
4046 --------------------
4048 Return a list of memory devices.
4051 -> { "execute": "query-memory-devices" }
4052 <- { "return": [ { "data":
4053 { "addr": 5368709120,
4054 "hotpluggable": true,
4057 "memdev": "/objects/memX",
4066 .name = "query-acpi-ospm-status",
4068 .mhandler.cmd_new = qmp_marshal_query_acpi_ospm_status,
4072 @query-acpi-ospm-status
4073 --------------------
4075 Return list of ACPIOSTInfo for devices that support status reporting
4076 via ACPI _OST method.
4079 -> { "execute": "query-acpi-ospm-status" }
4080 <- { "return": [ { "device": "d1", "slot": "0", "slot-type": "DIMM", "source": 1, "status": 0},
4081 { "slot": "1", "slot-type": "DIMM", "source": 0, "status": 0},
4082 { "slot": "2", "slot-type": "DIMM", "source": 0, "status": 0},
4083 { "slot": "3", "slot-type": "DIMM", "source": 0, "status": 0}
4087 #if defined TARGET_I386
4089 .name = "rtc-reset-reinjection",
4091 .mhandler.cmd_new = qmp_marshal_rtc_reset_reinjection,
4096 rtc-reset-reinjection
4097 ---------------------
4099 Reset the RTC interrupt reinjection backlog.
4105 -> { "execute": "rtc-reset-reinjection" }
4110 .name = "trace-event-get-state",
4111 .args_type = "name:s",
4112 .mhandler.cmd_new = qmp_marshal_trace_event_get_state,
4116 trace-event-get-state
4117 ---------------------
4119 Query the state of events.
4123 -> { "execute": "trace-event-get-state", "arguments": { "name": "qemu_memalign" } }
4124 <- { "return": [ { "name": "qemu_memalign", "state": "disabled" } ] }
4128 .name = "trace-event-set-state",
4129 .args_type = "name:s,enable:b,ignore-unavailable:b?",
4130 .mhandler.cmd_new = qmp_marshal_trace_event_set_state,
4134 trace-event-set-state
4135 ---------------------
4137 Set the state of events.
4141 -> { "execute": "trace-event-set-state", "arguments": { "name": "qemu_memalign", "enable": "true" } }
4146 .name = "x-input-send-event",
4147 .args_type = "console:i?,events:q",
4148 .mhandler.cmd_new = qmp_marshal_x_input_send_event,
4155 Send input event to guest.
4159 - "console": console index. (json-int, optional)
4160 - "events": list of input events.
4162 The consoles are visible in the qom tree, under
4163 /backend/console[$index]. They have a device link and head property, so
4164 it is possible to map which console belongs to which device and display.
4166 Note: this command is experimental, and not a stable API.
4170 Press left mouse button.
4172 -> { "execute": "x-input-send-event",
4173 "arguments": { "console": 0,
4174 "events": [ { "type": "btn",
4175 "data" : { "down": true, "button": "Left" } } ] } }
4178 -> { "execute": "x-input-send-event",
4179 "arguments": { "console": 0,
4180 "events": [ { "type": "btn",
4181 "data" : { "down": false, "button": "Left" } } ] } }
4188 -> { "execute": "x-input-send-event",
4189 "arguments": { "console": 0, "events": [
4190 { "type": "key", "data" : { "down": true,
4191 "key": {"type": "qcode", "data": "ctrl" } } },
4192 { "type": "key", "data" : { "down": true,
4193 "key": {"type": "qcode", "data": "alt" } } },
4194 { "type": "key", "data" : { "down": true,
4195 "key": {"type": "qcode", "data": "delete" } } } ] } }
4200 Move mouse pointer to absolute coordinates (20000, 400).
4202 -> { "execute": "x-input-send-event" ,
4203 "arguments": { "console": 0, "events": [
4204 { "type": "abs", "data" : { "axis": "X", "value" : 20000 } },
4205 { "type": "abs", "data" : { "axis": "Y", "value" : 400 } } ] } }
4211 .name = "block-set-write-threshold",
4212 .args_type = "node-name:s,write-threshold:l",
4213 .mhandler.cmd_new = qmp_marshal_block_set_write_threshold,
4217 block-set-write-threshold
4220 Change the write threshold for a block drive. The threshold is an offset,
4221 thus must be non-negative. Default is no write threshold.
4222 Setting the threshold to zero disables it.
4226 - "node-name": the node name in the block driver state graph (json-string)
4227 - "write-threshold": the write threshold in bytes (json-int)
4231 -> { "execute": "block-set-write-threshold",
4232 "arguments": { "node-name": "mydev",
4233 "write-threshold": 17179869184 } }
4239 .name = "query-rocker",
4240 .args_type = "name:s",
4241 .mhandler.cmd_new = qmp_marshal_query_rocker,
4250 - "name": switch name
4254 -> { "execute": "query-rocker", "arguments": { "name": "sw1" } }
4255 <- { "return": {"name": "sw1", "ports": 2, "id": 1327446905938}}
4260 .name = "query-rocker-ports",
4261 .args_type = "name:s",
4262 .mhandler.cmd_new = qmp_marshal_query_rocker_ports,
4266 Show rocker switch ports
4267 ------------------------
4271 - "name": switch name
4275 -> { "execute": "query-rocker-ports", "arguments": { "name": "sw1" } }
4276 <- { "return": [ {"duplex": "full", "enabled": true, "name": "sw1.1",
4277 "autoneg": "off", "link-up": true, "speed": 10000},
4278 {"duplex": "full", "enabled": true, "name": "sw1.2",
4279 "autoneg": "off", "link-up": true, "speed": 10000}
4285 .name = "query-rocker-of-dpa-flows",
4286 .args_type = "name:s,tbl-id:i?",
4287 .mhandler.cmd_new = qmp_marshal_query_rocker_of_dpa_flows,
4291 Show rocker switch OF-DPA flow tables
4292 -------------------------------------
4296 - "name": switch name
4297 - "tbl-id": (optional) flow table ID
4301 -> { "execute": "query-rocker-of-dpa-flows", "arguments": { "name": "sw1" } }
4302 <- { "return": [ {"key": {"in-pport": 0, "priority": 1, "tbl-id": 0},
4305 "action": {"goto-tbl": 10},
4306 "mask": {"in-pport": 4294901760}
4314 .name = "query-rocker-of-dpa-groups",
4315 .args_type = "name:s,type:i?",
4316 .mhandler.cmd_new = qmp_marshal_query_rocker_of_dpa_groups,
4320 Show rocker OF-DPA group tables
4321 -------------------------------
4325 - "name": switch name
4326 - "type": (optional) group type
4330 -> { "execute": "query-rocker-of-dpa-groups", "arguments": { "name": "sw1" } }
4331 <- { "return": [ {"type": 0, "out-pport": 2, "pport": 2, "vlan-id": 3841,
4332 "pop-vlan": 1, "id": 251723778},
4333 {"type": 0, "out-pport": 0, "pport": 0, "vlan-id": 3841,
4334 "pop-vlan": 1, "id": 251723776},
4335 {"type": 0, "out-pport": 1, "pport": 1, "vlan-id": 3840,
4336 "pop-vlan": 1, "id": 251658241},
4337 {"type": 0, "out-pport": 0, "pport": 0, "vlan-id": 3840,
4338 "pop-vlan": 1, "id": 251658240}