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-set-global-dirty-log",
591 .args_type
= "enable:b",
592 .mhandler
.cmd_new
= qmp_marshal_xen_set_global_dirty_log
,
596 xen
-set
-global
-dirty
-log
599 Enable or disable the global dirty log mode
.
603 - "enable": Enable it or disable it
.
607 -> { "execute": "xen-set-global-dirty-log",
608 "arguments": { "enable": true } }
615 .args_type
= "detach:-d,blk:-b,inc:-i,uri:s",
616 .mhandler
.cmd_new
= qmp_marshal_migrate
,
627 - "blk": block migration
, full disk
copy (json
-bool
, optional
)
628 - "inc": incremental disk
copy (json
-bool
, optional
)
629 - "uri": Destination
URI (json
-string
)
633 -> { "execute": "migrate", "arguments": { "uri": "tcp:0:4446" } }
638 (1) The
'query-migrate' command should be used to check migration
's progress
639 and final result (this information is provided by the 'status
' member)
640 (2) All boolean arguments default to false
641 (3) The user Monitor's
"detach" argument is invalid
in QMP and should not
647 .name
= "migrate_cancel",
649 .mhandler
.cmd_new
= qmp_marshal_migrate_cancel
,
656 Cancel the current migration
.
662 -> { "execute": "migrate_cancel" }
668 .name
= "migrate-incoming",
669 .args_type
= "uri:s",
670 .mhandler
.cmd_new
= qmp_marshal_migrate_incoming
,
677 Continue an incoming migration
681 - "uri": Source
/listening
URI (json
-string
)
685 -> { "execute": "migrate-incoming", "arguments": { "uri": "tcp::4446" } }
690 (1) QEMU must be started with
-incoming defer to allow migrate
-incoming to
692 (2) The uri format is the same as
for -incoming
696 .name
= "migrate-set-cache-size",
697 .args_type
= "value:o",
698 .mhandler
.cmd_new
= qmp_marshal_migrate_set_cache_size
,
702 migrate
-set
-cache
-size
703 ----------------------
705 Set cache size to be used by XBZRLE migration
, the cache size will be rounded
706 down to the nearest power of
2
710 - "value": cache size
in bytes (json
-int
)
714 -> { "execute": "migrate-set-cache-size", "arguments": { "value": 536870912 } }
719 .name
= "migrate-start-postcopy",
721 .mhandler
.cmd_new
= qmp_marshal_migrate_start_postcopy
,
725 migrate
-start
-postcopy
726 ----------------------
728 Switch an
in-progress migration to postcopy mode
. Ignored after the end of
729 migration (or once already
in postcopy
).
732 -> { "execute": "migrate-start-postcopy" }
738 .name
= "query-migrate-cache-size",
740 .mhandler
.cmd_new
= qmp_marshal_query_migrate_cache_size
,
744 query
-migrate
-cache
-size
745 ------------------------
747 Show cache size to be used by XBZRLE migration
749 returns a json
-object with the following information
:
754 -> { "execute": "query-migrate-cache-size" }
755 <- { "return": 67108864 }
760 .name
= "migrate_set_speed",
761 .args_type
= "value:o",
762 .mhandler
.cmd_new
= qmp_marshal_migrate_set_speed
,
769 Set maximum speed
for migrations
.
773 - "value": maximum speed
, in bytes per
second (json
-int
)
777 -> { "execute": "migrate_set_speed", "arguments": { "value": 1024 } }
783 .name
= "migrate_set_downtime",
784 .args_type
= "value:T",
785 .mhandler
.cmd_new
= qmp_marshal_migrate_set_downtime
,
792 Set maximum tolerated
downtime (in seconds
) for migrations
.
796 - "value": maximum
downtime (json
-number
)
800 -> { "execute": "migrate_set_downtime", "arguments": { "value": 0.1 } }
806 .name
= "client_migrate_info",
807 .args_type
= "protocol:s,hostname:s,port:i?,tls-port:i?,cert-subject:s?",
808 .params
= "protocol hostname port tls-port cert-subject",
809 .help
= "set migration information for remote display",
810 .mhandler
.cmd_new
= qmp_marshal_client_migrate_info
,
817 Set migration information
for remote display
. This makes the server
818 ask the client to automatically reconnect
using the
new parameters
819 once migration finished successfully
. Only implemented
for SPICE
.
823 - "protocol": must be
"spice" (json
-string
)
824 - "hostname": migration target
hostname (json
-string
)
825 - "port": spice tcp port
for plaintext
channels (json
-int
, optional
)
826 - "tls-port": spice tcp port
for tls
-secured
channels (json
-int
, optional
)
827 - "cert-subject": server certificate
subject (json
-string
, optional
)
831 -> { "execute": "client_migrate_info",
832 "arguments": { "protocol": "spice",
833 "hostname": "virt42.lab.kraxel.org",
840 .name
= "dump-guest-memory",
841 .args_type
= "paging:b,protocol:s,begin:i?,end:i?,format:s?",
842 .params
= "-p protocol [begin] [length] [format]",
843 .help
= "dump guest memory to file",
844 .mhandler
.cmd_new
= qmp_marshal_dump_guest_memory
,
851 Dump guest memory to file
. The file can be processed with crash or gdb
.
855 - "paging": do paging to get guest
's memory mapping (json-bool)
856 - "protocol": destination file(started with "file:") or destination file
857 descriptor (started with "fd:") (json-string)
858 - "begin": the starting physical address. It's optional
, and should be specified
859 with length
together (json
-int
)
860 - "length": the memory size
, in bytes
. It
's optional, and should be specified
861 with begin together (json-int)
862 - "format": the format of guest memory dump. It's optional
, and can be
863 elf|kdump
-zlib|kdump
-lzo|kdump
-snappy
, but non
-elf formats will
864 conflict with paging and filter
, ie
. begin and
length (json
-string
)
868 -> { "execute": "dump-guest-memory", "arguments": { "protocol": "fd:dump" } }
873 (1) All boolean arguments
default to
false
878 .name
= "query-dump-guest-memory-capability",
880 .mhandler
.cmd_new
= qmp_marshal_query_dump_guest_memory_capability
,
884 query
-dump
-guest
-memory
-capability
887 Show available formats
for 'dump-guest-memory'
891 -> { "execute": "query-dump-guest-memory-capability" }
892 <- { "return": { "formats":
893 ["elf", "kdump-zlib", "kdump-lzo", "kdump-snappy"] }
897 #
if defined TARGET_S390X
899 .name
= "dump-skeys",
900 .args_type
= "filename:F",
901 .mhandler
.cmd_new
= qmp_marshal_dump_skeys
,
909 Save guest storage keys to file
.
913 - "filename": file
path (json
-string
)
917 -> { "execute": "dump-skeys", "arguments": { "filename": "/tmp/skeys" } }
923 .name
= "netdev_add",
924 .args_type
= "netdev:O",
925 .mhandler
.cmd_new
= qmp_netdev_add
,
932 Add host network device
.
936 - "type": the device type
, "tap", "user", ... (json
-string
)
937 - "id": the device
's ID, must be unique (json-string)
942 -> { "execute": "netdev_add",
943 "arguments": { "type": "user", "id": "netdev1",
944 "dnssearch": "example.org" } }
947 Note: The supported device options are the same ones supported by the '-netdev
'
948 command-line argument, which are listed in the '-help
' output or QEMU's
954 .name
= "netdev_del",
956 .mhandler
.cmd_new
= qmp_marshal_netdev_del
,
963 Remove host network device
.
967 - "id": the device
's ID, must be unique (json-string)
971 -> { "execute": "netdev_del", "arguments": { "id": "netdev1" } }
978 .name = "object-add",
979 .args_type = "qom-type:s,id:s,props:q?",
980 .mhandler.cmd_new = qmp_marshal_object_add,
991 - "qom-type": the object's QOM type
, i
.e
. the
class name (json
-string
)
992 - "id": the object
's ID, must be unique (json-string)
993 - "props": a dictionary of object property values (optional, json-dict)
997 -> { "execute": "object-add", "arguments": { "qom-type": "rng-random", "id": "rng1",
998 "props": { "filename": "/dev/hwrng" } } }
1004 .name = "object-del",
1005 .args_type = "id:s",
1006 .mhandler.cmd_new = qmp_marshal_object_del,
1017 - "id": the object's
ID (json
-string
)
1021 -> { "execute": "object-del", "arguments": { "id": "rng1" } }
1029 .name
= "block_resize",
1030 .args_type
= "device:s?,node-name:s?,size:o",
1031 .mhandler
.cmd_new
= qmp_marshal_block_resize
,
1038 Resize a block image
while a guest is running
.
1042 - "device": the device
's ID, must be unique (json-string)
1043 - "node-name": the node name in the block driver state graph (json-string)
1048 -> { "execute": "block_resize", "arguments": { "device": "scratch", "size": 1073741824 } }
1054 .name = "block-stream",
1055 .args_type = "device:B,base:s?,speed:o?,backing-file:s?,on-error:s?",
1056 .mhandler.cmd_new = qmp_marshal_block_stream,
1063 Copy data from a backing file into a block device.
1067 - "device": The device's ID
, must be
unique (json
-string
)
1068 - "base": The file name of the backing image above which copying starts
1069 (json
-string
, optional
)
1070 - "backing-file": The backing file string to write into the active layer
. This
1071 filename is not validated
.
1073 If a pathname string is such that it cannot be resolved by
1074 QEMU
, that means that subsequent QMP or HMP commands must use
1075 node
-names
for the image
in question
, as filename lookup
1078 If not specified
, QEMU will automatically determine the
1079 backing file string to use
, or error out
if there is no
1080 obvious choice
. Care should be taken when specifying the
1081 string
, to specify a valid filename or protocol
.
1082 (json
-string
, optional
) (Since
2.1)
1083 - "speed": the maximum speed
, in bytes per
second (json
-int
, optional
)
1084 - "on-error": the action to take on an
error (default 'report'). 'stop' and
1085 'enospc' can only be used
if the block device supports io
-status
.
1086 (json
-string
, optional
) (Since
2.1)
1090 -> { "execute": "block-stream", "arguments": { "device": "virtio0",
1091 "base": "/tmp/master.qcow2" } }
1097 .name
= "block-commit",
1098 .args_type
= "device:B,base:s?,top:s?,backing-file:s?,speed:o?",
1099 .mhandler
.cmd_new
= qmp_marshal_block_commit
,
1106 Live commit of data from overlay image nodes into backing nodes
- i
.e
., writes
1107 data between
'top' and
'base' into
'base'.
1111 - "device": The device
's ID, must be unique (json-string)
1112 - "base": The file name of the backing image to write data into.
1113 If not specified, this is the deepest backing image
1114 (json-string, optional)
1115 - "top": The file name of the backing image within the image chain,
1116 which contains the topmost data to be committed down. If
1117 not specified, this is the active layer. (json-string, optional)
1119 - backing-file: The backing file string to write into the overlay
1120 image of 'top
'. If 'top
' is the active layer,
1121 specifying a backing file string is an error. This
1122 filename is not validated.
1124 If a pathname string is such that it cannot be
1125 resolved by QEMU, that means that subsequent QMP or
1126 HMP commands must use node-names for the image in
1127 question, as filename lookup methods will fail.
1129 If not specified, QEMU will automatically determine
1130 the backing file string to use, or error out if
1131 there is no obvious choice. Care should be taken
1132 when specifying the string, to specify a valid
1133 filename or protocol.
1134 (json-string, optional) (Since 2.1)
1136 If top == base, that is an error.
1137 If top == active, the job will not be completed by itself,
1138 user needs to complete the job with the block-job-complete
1139 command after getting the ready event. (Since 2.0)
1141 If the base image is smaller than top, then the base image
1142 will be resized to be the same size as top. If top is
1143 smaller than the base image, the base will not be
1144 truncated. If you want the base image size to match the
1145 size of the smaller top, you can safely truncate it
1146 yourself once the commit operation successfully completes.
1148 - "speed": the maximum speed, in bytes per second (json-int, optional)
1153 -> { "execute": "block-commit", "arguments": { "device": "virtio0",
1154 "top": "/tmp/snap1.qcow2" } }
1160 .name = "drive-backup",
1161 .args_type = "sync:s,device:B,target:s,speed:i?,mode:s?,format:s?,"
1162 "bitmap:s?,on-source-error:s?,on-target-error:s?",
1163 .mhandler.cmd_new = qmp_marshal_drive_backup,
1170 Start a point-in-time copy of a block device to a new destination. The
1171 status of ongoing drive-backup operations can be checked with
1172 query-block-jobs where the BlockJobInfo.type field has the value 'backup
'.
1173 The operation can be stopped before it has completed using the
1174 block-job-cancel command.
1178 - "device": the name of the device which should be copied.
1180 - "target": the target of the new image. If the file exists, or if it is a
1181 device, the existing file/device will be used as the new
1182 destination. If it does not exist, a new file will be created.
1184 - "format": the format of the new destination, default is to probe if 'mode
' is
1185 'existing
', else the format of the source
1186 (json-string, optional)
1187 - "sync": what parts of the disk image should be copied to the destination;
1188 possibilities include "full" for all the disk, "top" for only the sectors
1189 allocated in the topmost image, "incremental" for only the dirty sectors in
1190 the bitmap, or "none" to only replicate new I/O (MirrorSyncMode).
1191 - "bitmap": dirty bitmap name for sync==incremental. Must be present if sync
1192 is "incremental", must NOT be present otherwise.
1193 - "mode": whether and how QEMU should create a new image
1194 (NewImageMode, optional, default 'absolute
-paths
')
1195 - "speed": the maximum speed, in bytes per second (json-int, optional)
1196 - "on-source-error": the action to take on an error on the source, default
1197 'report
'. 'stop
' and 'enospc
' can only be used
1198 if the block device supports io-status.
1199 (BlockdevOnError, optional)
1200 - "on-target-error": the action to take on an error on the target, default
1201 'report
' (no limitations, since this applies to
1202 a different block device than device).
1203 (BlockdevOnError, optional)
1206 -> { "execute": "drive-backup", "arguments": { "device": "drive0",
1208 "target": "backup.img" } }
1214 .name = "blockdev-backup",
1215 .args_type = "sync:s,device:B,target:B,speed:i?,"
1216 "on-source-error:s?,on-target-error:s?",
1217 .mhandler.cmd_new = qmp_marshal_blockdev_backup,
1224 The device version of drive-backup: this command takes an existing named device
1229 - "device": the name of the device which should be copied.
1231 - "target": the name of the backup target device. (json-string)
1232 - "sync": what parts of the disk image should be copied to the destination;
1233 possibilities include "full" for all the disk, "top" for only the
1234 sectors allocated in the topmost image, or "none" to only replicate
1235 new I/O (MirrorSyncMode).
1236 - "speed": the maximum speed, in bytes per second (json-int, optional)
1237 - "on-source-error": the action to take on an error on the source, default
1238 'report
'. 'stop
' and 'enospc
' can only be used
1239 if the block device supports io-status.
1240 (BlockdevOnError, optional)
1241 - "on-target-error": the action to take on an error on the target, default
1242 'report
' (no limitations, since this applies to
1243 a different block device than device).
1244 (BlockdevOnError, optional)
1247 -> { "execute": "blockdev-backup", "arguments": { "device": "src-id",
1249 "target": "tgt-id" } }
1255 .name = "block-job-set-speed",
1256 .args_type = "device:B,speed:o",
1257 .mhandler.cmd_new = qmp_marshal_block_job_set_speed,
1261 .name = "block-job-cancel",
1262 .args_type = "device:B,force:b?",
1263 .mhandler.cmd_new = qmp_marshal_block_job_cancel,
1266 .name = "block-job-pause",
1267 .args_type = "device:B",
1268 .mhandler.cmd_new = qmp_marshal_block_job_pause,
1271 .name = "block-job-resume",
1272 .args_type = "device:B",
1273 .mhandler.cmd_new = qmp_marshal_block_job_resume,
1276 .name = "block-job-complete",
1277 .args_type = "device:B",
1278 .mhandler.cmd_new = qmp_marshal_block_job_complete,
1281 .name = "transaction",
1282 .args_type = "actions:q,properties:q?",
1283 .mhandler.cmd_new = qmp_marshal_transaction,
1290 Atomically operate on one or more block devices. Operations that are
1291 currently supported:
1295 - blockdev-snapshot-sync
1296 - blockdev-snapshot-internal-sync
1298 - block-dirty-bitmap-add
1299 - block-dirty-bitmap-clear
1301 Refer to the qemu/qapi-schema.json file for minimum required QEMU
1302 versions for these operations. A list of dictionaries is accepted,
1303 that contains the actions to be performed. If there is any failure
1304 performing any of the operations, all operations for the group are
1307 For external snapshots, the dictionary contains the device, the file to use for
1308 the new snapshot, and the format. The default format, if not specified, is
1311 Each new snapshot defaults to being created by QEMU (wiping any
1312 contents if the file already exists), but it is also possible to reuse
1313 an externally-created file. In the latter case, you should ensure that
1314 the new image file has the same contents as the current one; QEMU cannot
1315 perform any meaningful check. Typically this is achieved by using the
1316 current image file as the backing file for the new image.
1318 On failure, the original disks pre-snapshot attempt will be used.
1320 For internal snapshots, the dictionary contains the device and the snapshot's
1321 name
. If an internal snapshot matching name already exists
, the request will
1322 be rejected
. Only some image formats support it
, for example
, qcow2
, rbd
,
1325 On failure
, qemu will
try delete the newly created internal snapshot
in the
1326 transaction
. When an I
/O error occurs during deletion
, the user needs to fix
1327 it later with qemu
-img or other command
.
1332 - "type": the operation to
perform (json
-string
). Possible
1333 values
: "drive-backup", "blockdev-backup",
1334 "blockdev-snapshot-sync",
1335 "blockdev-snapshot-internal-sync",
1336 "abort", "block-dirty-bitmap-add",
1337 "block-dirty-bitmap-clear"
1338 - "data": a dictionary
. The contents depend on the value
1339 of
"type". When
"type" is
"blockdev-snapshot-sync":
1340 - "device": device name to
snapshot (json
-string
)
1341 - "node-name": graph node name to
snapshot (json
-string
)
1342 - "snapshot-file": name of
new image
file (json
-string
)
1343 - "snapshot-node-name": graph node name of the
new snapshot (json
-string
)
1344 - "format": format of
new image (json
-string
, optional
)
1345 - "mode": whether and how QEMU should create the snapshot file
1346 (NewImageMode
, optional
, default "absolute-paths")
1347 When
"type" is
"blockdev-snapshot-internal-sync":
1348 - "device": device name to
snapshot (json
-string
)
1349 - "name": name of the
new snapshot (json
-string
)
1353 -> { "execute": "transaction",
1354 "arguments": { "actions": [
1355 { "type": "blockdev-snapshot-sync", "data" : { "device": "ide-hd0",
1356 "snapshot-file": "/some/place/my-image",
1357 "format": "qcow2" } },
1358 { "type": "blockdev-snapshot-sync", "data" : { "node-name": "myfile",
1359 "snapshot-file": "/some/place/my-image2",
1360 "snapshot-node-name": "node3432",
1362 "format": "qcow2" } },
1363 { "type": "blockdev-snapshot-sync", "data" : { "device": "ide-hd1",
1364 "snapshot-file": "/some/place/my-image2",
1366 "format": "qcow2" } },
1367 { "type": "blockdev-snapshot-internal-sync", "data" : {
1368 "device": "ide-hd2",
1369 "name": "snapshot0" } } ] } }
1375 .name
= "block-dirty-bitmap-add",
1376 .args_type
= "node:B,name:s,granularity:i?",
1377 .mhandler
.cmd_new
= qmp_marshal_block_dirty_bitmap_add
,
1382 block
-dirty
-bitmap
-add
1383 ----------------------
1386 Create a dirty bitmap with a name on the device
, and start tracking the writes
.
1390 - "node": device
/node on which to create dirty
bitmap (json
-string
)
1391 - "name": name of the
new dirty
bitmap (json
-string
)
1392 - "granularity": granularity to track writes
with (int
, optional
)
1396 -> { "execute": "block-dirty-bitmap-add", "arguments": { "node": "drive0",
1397 "name": "bitmap0" } }
1403 .name
= "block-dirty-bitmap-remove",
1404 .args_type
= "node:B,name:s",
1405 .mhandler
.cmd_new
= qmp_marshal_block_dirty_bitmap_remove
,
1410 block
-dirty
-bitmap
-remove
1411 -------------------------
1414 Stop write tracking and remove the dirty bitmap that was created with
1415 block
-dirty
-bitmap
-add
.
1419 - "node": device
/node on which to remove dirty
bitmap (json
-string
)
1420 - "name": name of the dirty bitmap to
remove (json
-string
)
1424 -> { "execute": "block-dirty-bitmap-remove", "arguments": { "node": "drive0",
1425 "name": "bitmap0" } }
1431 .name
= "block-dirty-bitmap-clear",
1432 .args_type
= "node:B,name:s",
1433 .mhandler
.cmd_new
= qmp_marshal_block_dirty_bitmap_clear
,
1438 block
-dirty
-bitmap
-clear
1439 ------------------------
1442 Reset the dirty bitmap associated with a node so that an incremental backup
1443 from
this point
in time forward will only backup clusters modified after
this
1448 - "node": device
/node on which to remove dirty
bitmap (json
-string
)
1449 - "name": name of the dirty bitmap to
remove (json
-string
)
1453 -> { "execute": "block-dirty-bitmap-clear", "arguments": { "node": "drive0",
1454 "name": "bitmap0" } }
1460 .name
= "blockdev-snapshot-sync",
1461 .args_type
= "device:s?,node-name:s?,snapshot-file:s,snapshot-node-name:s?,format:s?,mode:s?",
1462 .mhandler
.cmd_new
= qmp_marshal_blockdev_snapshot_sync
,
1466 blockdev
-snapshot
-sync
1467 ----------------------
1469 Synchronous snapshot of a block device
. snapshot
-file specifies the
1470 target of the
new image
. If the file exists
, or
if it is a device
, the
1471 snapshot will be created
in the existing file
/device
. If does not
1472 exist
, a
new file will be created
. format specifies the format of the
1473 snapshot image
, default is qcow2
.
1477 - "device": device name to
snapshot (json
-string
)
1478 - "node-name": graph node name to
snapshot (json
-string
)
1479 - "snapshot-file": name of
new image
file (json
-string
)
1480 - "snapshot-node-name": graph node name of the
new snapshot (json
-string
)
1481 - "mode": whether and how QEMU should create the snapshot file
1482 (NewImageMode
, optional
, default "absolute-paths")
1483 - "format": format of
new image (json
-string
, optional
)
1487 -> { "execute": "blockdev-snapshot-sync", "arguments": { "device": "ide-hd0",
1489 "/some/place/my-image",
1490 "format": "qcow2" } }
1496 .name
= "blockdev-snapshot",
1497 .args_type
= "node:s,overlay:s",
1498 .mhandler
.cmd_new
= qmp_marshal_blockdev_snapshot
,
1506 Create a snapshot
, by installing
'node' as the backing image of
1507 'overlay'. Additionally
, if 'node' is associated with a block
1508 device
, the block device changes to
using 'overlay' as its
new active
1513 - "node": device that will have a snapshot
created (json
-string
)
1514 - "overlay": device that will have
'node' as its backing
image (json
-string
)
1518 -> { "execute": "blockdev-add",
1519 "arguments": { "options": { "driver": "qcow2",
1520 "node-name": "node1534",
1521 "file": { "driver": "file",
1522 "filename": "hd1.qcow2" },
1527 -> { "execute": "blockdev-snapshot", "arguments": { "node": "ide-hd0",
1528 "overlay": "node1534" } }
1534 .name
= "blockdev-snapshot-internal-sync",
1535 .args_type
= "device:B,name:s",
1536 .mhandler
.cmd_new
= qmp_marshal_blockdev_snapshot_internal_sync
,
1540 blockdev
-snapshot
-internal
-sync
1541 -------------------------------
1543 Synchronously take an internal snapshot of a block device when the format of
1544 image used supports it
. If the name is an empty string
, or a snapshot with
1545 name already exists
, the operation will fail
.
1549 - "device": device name to
snapshot (json
-string
)
1550 - "name": name of the
new snapshot (json
-string
)
1554 -> { "execute": "blockdev-snapshot-internal-sync",
1555 "arguments": { "device": "ide-hd0",
1556 "name": "snapshot0" }
1563 .name
= "blockdev-snapshot-delete-internal-sync",
1564 .args_type
= "device:B,id:s?,name:s?",
1566 qmp_marshal_blockdev_snapshot_delete_internal_sync
,
1570 blockdev
-snapshot
-delete
-internal
-sync
1571 --------------------------------------
1573 Synchronously delete an internal snapshot of a block device when the format of
1574 image used supports it
. The snapshot is identified by name or id or both
. One
1575 of name or id is required
. If the snapshot is not found
, the operation will
1580 - "device": device
name (json
-string
)
1581 - "id": ID of the
snapshot (json
-string
, optional
)
1582 - "name": name of the
snapshot (json
-string
, optional
)
1586 -> { "execute": "blockdev-snapshot-delete-internal-sync",
1587 "arguments": { "device": "ide-hd0",
1588 "name": "snapshot0" }
1592 "name": "snapshot0",
1594 "date-sec": 1000012,
1596 "vm-clock-sec": 100,
1604 .name
= "drive-mirror",
1605 .args_type
= "sync:s,device:B,target:s,speed:i?,mode:s?,format:s?,"
1606 "node-name:s?,replaces:s?,"
1607 "on-source-error:s?,on-target-error:s?,"
1609 "granularity:i?,buf-size:i?",
1610 .mhandler
.cmd_new
= qmp_marshal_drive_mirror
,
1617 Start mirroring a block device
's writes to a new destination. target
1618 specifies the target of the new image. If the file exists, or if it is
1619 a device, it will be used as the new destination for writes. If it does not
1620 exist, a new file will be created. format specifies the format of the
1621 mirror image, default is to probe if mode='existing
', else the format
1626 - "device": device name to operate on (json-string)
1627 - "target": name of new image file (json-string)
1628 - "format": format of new image (json-string, optional)
1629 - "node-name": the name of the new block driver state in the node graph
1630 (json-string, optional)
1631 - "replaces": the block driver node name to replace when finished
1632 (json-string, optional)
1633 - "mode": how an image file should be created into the target
1634 file/device (NewImageMode, optional, default 'absolute
-paths
')
1635 - "speed": maximum speed of the streaming job, in bytes per second
1637 - "granularity": granularity of the dirty bitmap, in bytes (json-int, optional)
1638 - "buf-size": maximum amount of data in flight from source to target, in bytes
1639 (json-int, default 10M)
1640 - "sync": what parts of the disk image should be copied to the destination;
1641 possibilities include "full" for all the disk, "top" for only the sectors
1642 allocated in the topmost image, or "none" to only replicate new I/O
1644 - "on-source-error": the action to take on an error on the source
1645 (BlockdevOnError, default 'report
')
1646 - "on-target-error": the action to take on an error on the target
1647 (BlockdevOnError, default 'report
')
1648 - "unmap": whether the target sectors should be discarded where source has only
1649 zeroes. (json-bool, optional, default true)
1651 The default value of the granularity is the image cluster size clamped
1652 between 4096 and 65536, if the image format defines one. If the format
1653 does not define a cluster size, the default value of the granularity
1659 -> { "execute": "drive-mirror", "arguments": { "device": "ide-hd0",
1660 "target": "/some/place/my-image",
1662 "format": "qcow2" } }
1668 .name = "blockdev-mirror",
1669 .args_type = "sync:s,device:B,target:B,replaces:s?,speed:i?,"
1670 "on-source-error:s?,on-target-error:s?,"
1671 "granularity:i?,buf-size:i?",
1672 .mhandler.cmd_new = qmp_marshal_blockdev_mirror,
1679 Start mirroring a block device's writes to another block device
. target
1680 specifies the target of mirror operation
.
1684 - "device": device name to operate
on (json
-string
)
1685 - "target": device name to mirror
to (json
-string
)
1686 - "replaces": the block driver node name to replace when finished
1687 (json
-string
, optional
)
1688 - "speed": maximum speed of the streaming job
, in bytes per second
1690 - "granularity": granularity of the dirty bitmap
, in bytes (json
-int
, optional
)
1691 - "buf_size": maximum amount of data
in flight from source to target
, in bytes
1692 (json
-int
, default 10M
)
1693 - "sync": what parts of the disk image should be copied to the destination
;
1694 possibilities include
"full" for all the disk
, "top" for only the sectors
1695 allocated
in the topmost image
, or
"none" to only replicate
new I
/O
1697 - "on-source-error": the action to take on an error on the source
1698 (BlockdevOnError
, default 'report')
1699 - "on-target-error": the action to take on an error on the target
1700 (BlockdevOnError
, default 'report')
1702 The
default value of the granularity is the image cluster size clamped
1703 between
4096 and
65536, if the image format defines one
. If the format
1704 does not define a cluster size
, the
default value of the granularity
1709 -> { "execute": "blockdev-mirror", "arguments": { "device": "ide-hd0",
1710 "target": "target0",
1716 .name
= "change-backing-file",
1717 .args_type
= "device:s,image-node-name:s,backing-file:s",
1718 .mhandler
.cmd_new
= qmp_marshal_change_backing_file
,
1726 Change the backing file
in the image file metadata
. This does not cause
1727 QEMU to reopen the image file to reparse the backing
filename (it may
,
1728 however
, perform a reopen to change permissions from r
/o
-> r
/w
-> r
/o
,
1729 if needed
). The
new backing file string is written into the image file
1730 metadata
, and the QEMU internal strings are updated
.
1734 - "image-node-name": The name of the block driver state node of the
1735 image to modify
. The
"device" is argument is used to
1736 verify
"image-node-name" is
in the chain described by
1738 (json
-string
, optional
)
1740 - "device": The name of the device
.
1743 - "backing-file": The string to write as the backing file
. This string is
1744 not validated
, so care should be taken when specifying
1745 the string or the image chain may not be able to be
1749 Returns
: Nothing on success
1750 If
"device" does not exist or cannot be determined
, DeviceNotFound
1756 .args_type
= "value:M",
1757 .mhandler
.cmd_new
= qmp_marshal_balloon
,
1764 Request VM to change its memory
allocation (in bytes
).
1768 - "value": New memory
allocation (json
-int
)
1772 -> { "execute": "balloon", "arguments": { "value": 536870912 } }
1779 .args_type
= "name:s,up:b",
1780 .mhandler
.cmd_new
= qmp_marshal_set_link
,
1787 Change the link status of a network adapter
.
1791 - "name": network device
name (json
-string
)
1792 - "up": status is
up (json
-bool
)
1796 -> { "execute": "set_link", "arguments": { "name": "e1000.0", "up": false } }
1803 .args_type
= "fdname:s",
1804 .params
= "getfd name",
1805 .help
= "receive a file descriptor via SCM rights and assign it a name",
1806 .mhandler
.cmd_new
= qmp_marshal_getfd
,
1813 Receive a file descriptor via SCM rights and assign it a name
.
1817 - "fdname": file descriptor
name (json
-string
)
1821 -> { "execute": "getfd", "arguments": { "fdname": "fd1" } }
1826 (1) If the name specified by the
"fdname" argument already exists
,
1827 the file descriptor assigned to it will be closed and replaced
1828 by the received file descriptor
.
1829 (2) The
'closefd' command can be used to explicitly close the file
1830 descriptor when it is no longer needed
.
1836 .args_type
= "fdname:s",
1837 .params
= "closefd name",
1838 .help
= "close a file descriptor previously passed via SCM rights",
1839 .mhandler
.cmd_new
= qmp_marshal_closefd
,
1846 Close a file descriptor previously passed via SCM rights
.
1850 - "fdname": file descriptor
name (json
-string
)
1854 -> { "execute": "closefd", "arguments": { "fdname": "fd1" } }
1861 .args_type
= "fdset-id:i?,opaque:s?",
1862 .params
= "add-fd fdset-id opaque",
1863 .help
= "Add a file descriptor, that was passed via SCM rights, to an fd set",
1864 .mhandler
.cmd_new
= qmp_marshal_add_fd
,
1871 Add a file descriptor
, that was passed via SCM rights
, to an fd set
.
1875 - "fdset-id": The ID of the fd set to add the file descriptor to
.
1876 (json
-int
, optional
)
1877 - "opaque": A free
-form string that can be used to describe the fd
.
1878 (json
-string
, optional
)
1880 Return a json
-object with the following information
:
1882 - "fdset-id": The ID of the fd set that the fd was added to
. (json
-int
)
1883 - "fd": The file descriptor that was received via SCM rights and added to the
1888 -> { "execute": "add-fd", "arguments": { "fdset-id": 1 } }
1889 <- { "return": { "fdset-id": 1, "fd": 3 } }
1893 (1) The list of fd sets is shared by all monitor connections
.
1894 (2) If
"fdset-id" is not specified
, a
new fd set will be created
.
1899 .name
= "remove-fd",
1900 .args_type
= "fdset-id:i,fd:i?",
1901 .params
= "remove-fd fdset-id fd",
1902 .help
= "Remove a file descriptor from an fd set",
1903 .mhandler
.cmd_new
= qmp_marshal_remove_fd
,
1910 Remove a file descriptor from an fd set
.
1914 - "fdset-id": The ID of the fd set that the file descriptor belongs to
.
1916 - "fd": The file descriptor that is to be removed
. (json
-int
, optional
)
1920 -> { "execute": "remove-fd", "arguments": { "fdset-id": 1, "fd": 3 } }
1925 (1) The list of fd sets is shared by all monitor connections
.
1926 (2) If
"fd" is not specified
, all file descriptors
in "fdset-id" will be
1932 .name
= "query-fdsets",
1934 .help
= "Return information describing all fd sets",
1935 .mhandler
.cmd_new
= qmp_marshal_query_fdsets
,
1942 Return information describing all fd sets
.
1948 -> { "execute": "query-fdsets" }
1954 "opaque": "rdonly:/path/to/file"
1958 "opaque": "rdwr:/path/to/file"
1977 Note
: The list of fd sets is shared by all monitor connections
.
1982 .name
= "block_passwd",
1983 .args_type
= "device:s?,node-name:s?,password:s",
1984 .mhandler
.cmd_new
= qmp_marshal_block_passwd
,
1991 Set the password of encrypted block devices
.
1995 - "device": device
name (json
-string
)
1996 - "node-name": name
in the block driver state
graph (json
-string
)
1997 - "password": password (json
-string
)
2001 -> { "execute": "block_passwd", "arguments": { "device": "ide0-hd0",
2002 "password": "12345" } }
2008 .name
= "block_set_io_throttle",
2009 .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?",
2010 .mhandler
.cmd_new
= qmp_marshal_block_set_io_throttle
,
2014 block_set_io_throttle
2017 Change I
/O throttle limits
for a block drive
.
2021 - "device": device
name (json
-string
)
2022 - "bps": total throughput limit
in bytes per
second (json
-int
)
2023 - "bps_rd": read throughput limit
in bytes per
second (json
-int
)
2024 - "bps_wr": write throughput limit
in bytes per
second (json
-int
)
2025 - "iops": total I
/O operations per
second (json
-int
)
2026 - "iops_rd": read I
/O operations per
second (json
-int
)
2027 - "iops_wr": write I
/O operations per
second (json
-int
)
2028 - "bps_max": total throughput limit during bursts
, in bytes (json
-int
, optional
)
2029 - "bps_rd_max": read throughput limit during bursts
, in bytes (json
-int
, optional
)
2030 - "bps_wr_max": write throughput limit during bursts
, in bytes (json
-int
, optional
)
2031 - "iops_max": total I
/O operations per second during
bursts (json
-int
, optional
)
2032 - "iops_rd_max": read I
/O operations per second during
bursts (json
-int
, optional
)
2033 - "iops_wr_max": write I
/O operations per second during
bursts (json
-int
, optional
)
2034 - "bps_max_length": maximum length of the @bps_max burst period
, in seconds (json
-int
, optional
)
2035 - "bps_rd_max_length": maximum length of the @bps_rd_max burst period
, in seconds (json
-int
, optional
)
2036 - "bps_wr_max_length": maximum length of the @bps_wr_max burst period
, in seconds (json
-int
, optional
)
2037 - "iops_max_length": maximum length of the @iops_max burst period
, in seconds (json
-int
, optional
)
2038 - "iops_rd_max_length": maximum length of the @iops_rd_max burst period
, in seconds (json
-int
, optional
)
2039 - "iops_wr_max_length": maximum length of the @iops_wr_max burst period
, in seconds (json
-int
, optional
)
2040 - "iops_size": I
/O size
in bytes when
limiting (json
-int
, optional
)
2041 - "group": throttle group
name (json
-string
, optional
)
2045 -> { "execute": "block_set_io_throttle", "arguments": { "device": "virtio0",
2058 "bps_max_length": 60,
2065 .name
= "set_password",
2066 .args_type
= "protocol:s,password:s,connected:s?",
2067 .mhandler
.cmd_new
= qmp_marshal_set_password
,
2074 Set the password
for vnc
/spice protocols
.
2078 - "protocol": protocol
name (json
-string
)
2079 - "password": password (json
-string
)
2080 - "connected": [ keep | disconnect | fail
] (json
-string
, optional
)
2084 -> { "execute": "set_password", "arguments": { "protocol": "vnc",
2085 "password": "secret" } }
2091 .name
= "expire_password",
2092 .args_type
= "protocol:s,time:s",
2093 .mhandler
.cmd_new
= qmp_marshal_expire_password
,
2100 Set the password expire time
for vnc
/spice protocols
.
2104 - "protocol": protocol
name (json
-string
)
2105 - "time": [ now |
never |
+secs | secs
] (json
-string
)
2109 -> { "execute": "expire_password", "arguments": { "protocol": "vnc",
2116 .name
= "add_client",
2117 .args_type
= "protocol:s,fdname:s,skipauth:b?,tls:b?",
2118 .mhandler
.cmd_new
= qmp_marshal_add_client
,
2125 Add a graphics client
2129 - "protocol": protocol
name (json
-string
)
2130 - "fdname": file descriptor
name (json
-string
)
2131 - "skipauth": whether to skip
authentication (json
-bool
, optional
)
2132 - "tls": whether to perform
TLS (json
-bool
, optional
)
2136 -> { "execute": "add_client", "arguments": { "protocol": "vnc",
2137 "fdname": "myclient" } }
2142 .name
= "qmp_capabilities",
2145 .help
= "enable QMP capabilities",
2146 .mhandler
.cmd_new
= qmp_capabilities
,
2153 Enable QMP capabilities
.
2159 -> { "execute": "qmp_capabilities" }
2162 Note
: This command must be issued before issuing any other command
.
2167 .name
= "human-monitor-command",
2168 .args_type
= "command-line:s,cpu-index:i?",
2169 .mhandler
.cmd_new
= qmp_marshal_human_monitor_command
,
2173 human
-monitor
-command
2174 ---------------------
2176 Execute a Human Monitor command
.
2180 - command
-line
: the command name and its arguments
, just like the
2181 Human Monitor
's shell (json-string)
2182 - cpu-index: select the CPU number to be used by commands which access CPU
2183 data, like 'info registers
'. The Monitor selects CPU 0 if this
2184 argument is not provided (json-int, optional)
2188 -> { "execute": "human-monitor-command", "arguments": { "command-line": "info kvm" } }
2189 <- { "return": "kvm support: enabled\r\n" }
2193 (1) The Human Monitor is NOT an stable interface, this means that command
2194 names, arguments and responses can change or be removed at ANY time.
2195 Applications that rely on long term stability guarantees should NOT
2200 o This command is stateless, this means that commands that depend
2201 on state information (such as getfd) might not work
2203 o Commands that prompt the user for data (eg. 'cont
' when the block
2204 device is encrypted) don't currently work
2209 HXCOMM Each query command below is inside a SQMP
/EQMP section
, do NOT change
2210 HXCOMM
this! We will possibly move query commands definitions inside those
2211 HXCOMM sections
, just like regular commands
.
2221 Return a json
-object with the following information
:
2223 - "qemu": A json
-object containing three integer values
:
2224 - "major": QEMU
's major version (json-int)
2225 - "minor": QEMU's minor
version (json
-int
)
2226 - "micro": QEMU
's micro version (json-int)
2227 - "package": package's
version (json
-string
)
2231 -> { "execute": "query-version" }
2246 .name
= "query-version",
2248 .mhandler
.cmd_new
= qmp_marshal_query_version
,
2255 List QMP available commands
.
2257 Each command is represented by a json
-object
, the returned value is a json
-array
2260 Each json
-object contain
:
2262 - "name": command
's name (json-string)
2266 -> { "execute": "query-commands" }
2270 "name":"query-balloon"
2273 "name":"system_powerdown"
2278 Note: This example has been shortened as the real response is too long.
2283 .name = "query-commands",
2285 .mhandler.cmd_new = qmp_marshal_query_commands,
2292 List QMP available events.
2294 Each event is represented by a json-object, the returned value is a json-array
2297 Each json-object contains:
2299 - "name": event's
name (json
-string
)
2303 -> { "execute": "query-events" }
2315 Note
: This example has been shortened as the real response is too long
.
2320 .name
= "query-events",
2322 .mhandler
.cmd_new
= qmp_marshal_query_events
,
2329 Return the QMP wire schema
. The returned value is a json
-array of
2330 named schema entities
. Entities are commands
, events and various
2331 types
. See docs
/qapi
-code
-gen
.txt
for information on their structure
2337 .name
= "query-qmp-schema",
2339 .mhandler
.cmd_new
= qmp_query_qmp_schema
,
2346 Each device is represented by a json
-object
. The returned value is a json
-array
2349 Each json
-object contain the following
:
2351 - "label": device
's label (json-string)
2352 - "filename": device's
file (json
-string
)
2353 - "frontend-open": open
/closed state of the frontend device attached to
this
2358 -> { "execute": "query-chardev" }
2362 "label": "charchannel0",
2363 "filename": "unix:/var/lib/libvirt/qemu/seabios.rhel6.agent,server",
2364 "frontend-open": false
2367 "label": "charmonitor",
2368 "filename": "unix:/var/lib/libvirt/qemu/seabios.rhel6.monitor,server",
2369 "frontend-open": true
2372 "label": "charserial0",
2373 "filename": "pty:/dev/pts/2",
2374 "frontend-open": true
2382 .name
= "query-chardev",
2384 .mhandler
.cmd_new
= qmp_marshal_query_chardev
,
2388 query
-chardev
-backends
2391 List available character device backends
.
2393 Each backend is represented by a json
-object
, the returned value is a json
-array
2396 Each json
-object contains
:
2398 - "name": backend
name (json
-string
)
2402 -> { "execute": "query-chardev-backends" }
2423 .name
= "query-chardev-backends",
2425 .mhandler
.cmd_new
= qmp_marshal_query_chardev_backends
,
2432 Show the block devices
.
2434 Each block device information is stored
in a json
-object and the returned value
2435 is a json
-array of all devices
.
2437 Each json
-object contain the following
:
2439 - "device": device
name (json
-string
)
2440 - "type": device
type (json
-string
)
2441 - deprecated
, retained
for backward compatibility
2442 - Possible values
: "unknown"
2443 - "removable": true if the device is removable
, false otherwise (json
-bool
)
2444 - "locked": true if the device is locked
, false otherwise (json
-bool
)
2445 - "tray_open": only present
if removable
, true if the device has a tray
,
2446 and it is
open (json
-bool
)
2447 - "inserted": only present
if the device is inserted
, it is a json
-object
2448 containing the following
:
2449 - "file": device file
name (json
-string
)
2450 - "ro": true if read
-only
, false otherwise (json
-bool
)
2451 - "drv": driver format
name (json
-string
)
2452 - Possible values
: "blkdebug", "bochs", "cloop", "dmg",
2453 "file", "file", "ftp", "ftps", "host_cdrom",
2454 "host_device", "http", "https",
2455 "nbd", "parallels", "qcow", "qcow2", "raw",
2456 "tftp", "vdi", "vmdk", "vpc", "vvfat"
2457 - "backing_file": backing file
name (json
-string
, optional
)
2458 - "backing_file_depth": number of files
in the backing file
chain (json
-int
)
2459 - "encrypted": true if encrypted
, false otherwise (json
-bool
)
2460 - "bps": limit total bytes per
second (json
-int
)
2461 - "bps_rd": limit read bytes per
second (json
-int
)
2462 - "bps_wr": limit write bytes per
second (json
-int
)
2463 - "iops": limit total I
/O operations per
second (json
-int
)
2464 - "iops_rd": limit read operations per
second (json
-int
)
2465 - "iops_wr": limit write operations per
second (json
-int
)
2466 - "bps_max": total max
in bytes (json
-int
)
2467 - "bps_rd_max": read max
in bytes (json
-int
)
2468 - "bps_wr_max": write max
in bytes (json
-int
)
2469 - "iops_max": total I
/O operations
max (json
-int
)
2470 - "iops_rd_max": read I
/O operations
max (json
-int
)
2471 - "iops_wr_max": write I
/O operations
max (json
-int
)
2472 - "iops_size": I
/O size when limiting by
iops (json
-int
)
2473 - "detect_zeroes": detect and optimize zero
writing (json
-string
)
2474 - Possible values
: "off", "on", "unmap"
2475 - "write_threshold": write offset threshold
in bytes
, a event will be
2476 emitted
if crossed
. Zero
if disabled (json
-int
)
2477 - "image": the detail of the image
, it is a json
-object containing
2479 - "filename": image file
name (json
-string
)
2480 - "format": image
format (json
-string
)
2481 - "virtual-size": image capacity
in bytes (json
-int
)
2482 - "dirty-flag": true if image is not cleanly closed
, not present
2483 means
clean (json
-bool
, optional
)
2484 - "actual-size": actual size on disk
in bytes of the image
, not
2485 present when image does not support thin
2486 provision (json
-int
, optional
)
2487 - "cluster-size": size of a cluster
in bytes
, not present
if image
2488 format does not support
it (json
-int
, optional
)
2489 - "encrypted": true if the image is encrypted
, not present means
2490 false or the image format does not support
2491 encryption (json
-bool
, optional
)
2492 - "backing_file": backing file name
, not present means no backing
2493 file is used or the image format does not
2494 support backing file chain
2495 (json
-string
, optional
)
2496 - "full-backing-filename": full path of the backing file
, not
2497 present
if it equals backing_file or no
2498 backing file is used
2499 (json
-string
, optional
)
2500 - "backing-filename-format": the format of the backing file
, not
2501 present means unknown or no backing
2502 file (json
-string
, optional
)
2503 - "snapshots": the internal snapshot info
, it is an optional list
2504 of json
-object containing the following
:
2505 - "id": unique snapshot
id (json
-string
)
2506 - "name": snapshot
name (json
-string
)
2507 - "vm-state-size": size of the VM state
in bytes (json
-int
)
2508 - "date-sec": UTC date of the snapshot
in seconds (json
-int
)
2509 - "date-nsec": fractional part
in nanoseconds to be used with
2511 - "vm-clock-sec": VM clock relative to boot
in seconds
2513 - "vm-clock-nsec": fractional part
in nanoseconds to be used
2514 with vm
-clock
-sec (json
-int
)
2515 - "backing-image": the detail of the backing image
, it is an
2516 optional json
-object only present when a
2517 backing image present
for this image
2519 - "io-status": I
/O operation status
, only present
if the device supports it
2520 and the VM is configured to stop on errors
. It
's always reset
2521 to "ok" when the "cont" command is issued (json_string, optional)
2522 - Possible values: "ok", "failed", "nospace"
2526 -> { "execute": "query-block" }
2531 "device":"ide0-hd0",
2538 "file":"disks/test.qcow2",
2539 "backing_file_depth":1,
2553 "detect_zeroes": "on",
2554 "write_threshold": 0,
2556 "filename":"disks/test.qcow2",
2558 "virtual-size":2048000,
2559 "backing_file":"base.qcow2",
2560 "full-backing-filename":"disks/base.qcow2",
2561 "backing-filename-format":"qcow2",
2565 "name": "snapshot1",
2567 "date-sec": 10000200,
2569 "vm-clock-sec": 206,
2574 "filename":"disks/base.qcow2",
2576 "virtual-size":2048000
2584 "device":"ide1-cd0",
2607 .name = "query-block",
2609 .mhandler.cmd_new = qmp_marshal_query_block,
2616 Show block device statistics.
2618 Each device statistic information is stored in a json-object and the returned
2619 value is a json-array of all devices.
2621 Each json-object contain the following:
2623 - "device": device name (json-string)
2624 - "stats": A json-object with the statistics information, it contains:
2625 - "rd_bytes": bytes read (json-int)
2626 - "wr_bytes": bytes written (json-int)
2627 - "rd_operations": read operations (json-int)
2628 - "wr_operations": write operations (json-int)
2629 - "flush_operations": cache flush operations (json-int)
2630 - "wr_total_time_ns": total time spend on writes in nano-seconds (json-int)
2631 - "rd_total_time_ns": total time spend on reads in nano-seconds (json-int)
2632 - "flush_total_time_ns": total time spend on cache flushes in nano-seconds (json-int)
2633 - "wr_highest_offset": The offset after the greatest byte written to the
2634 BlockDriverState since it has been opened (json-int)
2635 - "rd_merged": number of read requests that have been merged into
2636 another request (json-int)
2637 - "wr_merged": number of write requests that have been merged into
2638 another request (json-int)
2639 - "idle_time_ns": time since the last I/O operation, in
2640 nanoseconds. If the field is absent it means
2641 that there haven't been any operations yet
2642 (json
-int
, optional
)
2643 - "failed_rd_operations": number of failed read operations
2645 - "failed_wr_operations": number of failed write operations
2647 - "failed_flush_operations": number of failed flush operations
2649 - "invalid_rd_operations": number of invalid read operations
2651 - "invalid_wr_operations": number of invalid write operations
2653 - "invalid_flush_operations": number of invalid flush operations
2655 - "account_invalid": whether invalid operations are included
in
2656 the last access
statistics (json
-bool
)
2657 - "account_failed": whether failed operations are included
in the
2658 latency and last access statistics
2660 - "timed_stats": A json
-array containing statistics collected
in
2661 specific intervals
, with the following members
:
2662 - "interval_length": interval used
for calculating the
2663 statistics
, in seconds (json
-int
)
2664 - "min_rd_latency_ns": minimum latency of read operations
in
2665 the defined interval
, in nanoseconds
2667 - "min_wr_latency_ns": minimum latency of write operations
in
2668 the defined interval
, in nanoseconds
2670 - "min_flush_latency_ns": minimum latency of flush operations
2671 in the defined interval
, in
2672 nanoseconds (json
-int
)
2673 - "max_rd_latency_ns": maximum latency of read operations
in
2674 the defined interval
, in nanoseconds
2676 - "max_wr_latency_ns": maximum latency of write operations
in
2677 the defined interval
, in nanoseconds
2679 - "max_flush_latency_ns": maximum latency of flush operations
2680 in the defined interval
, in
2681 nanoseconds (json
-int
)
2682 - "avg_rd_latency_ns": average latency of read operations
in
2683 the defined interval
, in nanoseconds
2685 - "avg_wr_latency_ns": average latency of write operations
in
2686 the defined interval
, in nanoseconds
2688 - "avg_flush_latency_ns": average latency of flush operations
2689 in the defined interval
, in
2690 nanoseconds (json
-int
)
2691 - "avg_rd_queue_depth": average number of pending read
2692 operations
in the defined interval
2694 - "avg_wr_queue_depth": average number of pending write
2695 operations
in the defined interval
2697 - "parent": Contains recursively the statistics of the underlying
2698 protocol (e
.g
. the host file
for a qcow2 image
). If there is
2699 no underlying protocol
, this field is omitted
2700 (json
-object
, optional
)
2704 -> { "execute": "query-blockstats" }
2708 "device":"ide0-hd0",
2711 "wr_highest_offset":3686448128,
2713 "wr_operations":751,
2714 "rd_bytes":122567168,
2715 "rd_operations":36772
2716 "wr_total_times_ns":313253456
2717 "rd_total_times_ns":3465673657
2718 "flush_total_times_ns":49653
2719 "flush_operations":61,
2722 "idle_time_ns":2953431879,
2723 "account_invalid":true,
2724 "account_failed":false
2728 "wr_highest_offset":2821110784,
2730 "wr_operations":692,
2731 "rd_bytes":122739200,
2732 "rd_operations":36604
2733 "flush_operations":51,
2734 "wr_total_times_ns":313253456
2735 "rd_total_times_ns":3465673657
2736 "flush_total_times_ns":49653,
2739 "idle_time_ns":2953431879,
2740 "account_invalid":true,
2741 "account_failed":false
2745 "device":"ide1-cd0",
2747 "wr_highest_offset":0,
2752 "flush_operations":0,
2753 "wr_total_times_ns":0
2754 "rd_total_times_ns":0
2755 "flush_total_times_ns":0,
2758 "account_invalid":false,
2759 "account_failed":false
2765 "wr_highest_offset":0,
2770 "flush_operations":0,
2771 "wr_total_times_ns":0
2772 "rd_total_times_ns":0
2773 "flush_total_times_ns":0,
2776 "account_invalid":false,
2777 "account_failed":false
2783 "wr_highest_offset":0,
2788 "flush_operations":0,
2789 "wr_total_times_ns":0
2790 "rd_total_times_ns":0
2791 "flush_total_times_ns":0,
2794 "account_invalid":false,
2795 "account_failed":false
2804 .name
= "query-blockstats",
2805 .args_type
= "query-nodes:b?",
2806 .mhandler
.cmd_new
= qmp_marshal_query_blockstats
,
2813 Show CPU information
.
2815 Return a json
-array
. Each CPU is represented by a json
-object
, which contains
:
2817 - "CPU": CPU
index (json
-int
)
2818 - "current": true if this is the current CPU
, false otherwise (json
-bool
)
2819 - "halted": true if the cpu is halted
, false otherwise (json
-bool
)
2820 - "qom_path": path to the CPU object
in the QOM
tree (json
-str
)
2821 - "arch": architecture of the cpu
, which determines what additional
2822 keys will be
present (json
-str
)
2823 - Current program counter
. The key
's name depends on the architecture:
2824 "pc": i386/x86_64 (json-int)
2825 "nip": PPC (json-int)
2826 "pc" and "npc": sparc (json-int)
2827 "PC": mips (json-int)
2828 - "thread_id": ID of the underlying host thread (json-int)
2832 -> { "execute": "query-cpus" }
2839 "qom_path":"/machine/unattached/device[0]",
2848 "qom_path":"/machine/unattached/device[2]",
2859 .name = "query-cpus",
2861 .mhandler.cmd_new = qmp_marshal_query_cpus,
2868 Returns a list of information about each iothread.
2870 Note this list excludes the QEMU main loop thread, which is not declared
2871 using the -object iothread command-line option. It is always the main thread
2874 Return a json-array. Each iothread is represented by a json-object, which contains:
2876 - "id": name of iothread (json-str)
2877 - "thread-id": ID of the underlying host thread (json-int)
2881 -> { "execute": "query-iothreads" }
2898 .name = "query-iothreads",
2900 .mhandler.cmd_new = qmp_marshal_query_iothreads,
2907 PCI buses and devices information.
2909 The returned value is a json-array of all buses. Each bus is represented by
2910 a json-object, which has a key with a json-array of all PCI devices attached
2911 to it. Each device is represented by a json-object.
2913 The bus json-object contains the following:
2915 - "bus": bus number (json-int)
2916 - "devices": a json-array of json-objects, each json-object represents a
2919 The PCI device json-object contains the following:
2921 - "bus": identical to the parent's bus
number (json
-int
)
2922 - "slot": slot
number (json
-int
)
2923 - "function": function number (json
-int
)
2924 - "class_info": a json
-object containing
:
2925 - "desc": device
class description (json
-string
, optional
)
2926 - "class": device
class number (json
-int
)
2927 - "id": a json
-object containing
:
2928 - "device": device
ID (json
-int
)
2929 - "vendor": vendor
ID (json
-int
)
2930 - "irq": device
's IRQ if assigned (json-int, optional)
2931 - "qdev_id": qdev id string (json-string)
2932 - "pci_bridge": It's a json
-object
, only present
if this device is a
2933 PCI bridge
, contains
:
2934 - "bus": bus
number (json
-int
)
2935 - "secondary": secondary bus
number (json
-int
)
2936 - "subordinate": subordinate bus
number (json
-int
)
2937 - "io_range": I
/O memory range information
, a json
-object with the
2939 - "base": base address
, in bytes (json
-int
)
2940 - "limit": limit address
, in bytes (json
-int
)
2941 - "memory_range": memory range information
, a json
-object with the
2943 - "base": base address
, in bytes (json
-int
)
2944 - "limit": limit address
, in bytes (json
-int
)
2945 - "prefetchable_range": Prefetchable memory range information
, a
2946 json
-object with the following members
:
2947 - "base": base address
, in bytes (json
-int
)
2948 - "limit": limit address
, in bytes (json
-int
)
2949 - "devices": a json
-array of PCI devices
if there
's any attached, each
2950 each element is represented by a json-object, which contains
2951 the same members of the 'PCI device json
-object
' described
2953 - "regions": a json-array of json-objects, each json-object represents a
2954 memory region of this device
2956 The memory range json-object contains the following:
2958 - "base": base memory address (json-int)
2959 - "limit": limit value (json-int)
2961 The region json-object can be an I/O region or a memory region, an I/O region
2962 json-object contains the following:
2964 - "type": "io" (json-string, fixed)
2965 - "bar": BAR number (json-int)
2966 - "address": memory address (json-int)
2967 - "size": memory size (json-int)
2969 A memory region json-object contains the following:
2971 - "type": "memory" (json-string, fixed)
2972 - "bar": BAR number (json-int)
2973 - "address": memory address (json-int)
2974 - "size": memory size (json-int)
2975 - "mem_type_64": true or false (json-bool)
2976 - "prefetch": true or false (json-bool)
2980 -> { "execute": "query-pci" }
2992 "desc":"Host bridge"
3026 "desc":"IDE controller"
3048 "desc":"VGA controller"
3058 "mem_type_64":false,
3061 "address":4026531840,
3066 "mem_type_64":false,
3069 "address":4060086272,
3074 "mem_type_64":false,
3089 "desc":"RAM controller"
3110 Note: This example has been shortened as the real response is too long.
3115 .name = "query-pci",
3117 .mhandler.cmd_new = qmp_marshal_query_pci,
3124 Show KVM information.
3126 Return a json-object with the following information:
3128 - "enabled": true if KVM support is enabled, false otherwise (json-bool)
3129 - "present": true if QEMU has KVM support, false otherwise (json-bool)
3133 -> { "execute": "query-kvm" }
3134 <- { "return": { "enabled": true, "present": true } }
3139 .name = "query-kvm",
3141 .mhandler.cmd_new = qmp_marshal_query_kvm,
3148 Return a json-object with the following information:
3150 - "running": true if the VM is running, or false if it is paused (json-bool)
3151 - "singlestep": true if the VM is in single step mode,
3152 false otherwise (json-bool)
3153 - "status": one of the following values (json-string)
3154 "debug" - QEMU is running on a debugger
3155 "inmigrate" - guest is paused waiting for an incoming migration
3156 "internal-error" - An internal error that prevents further guest
3157 execution has occurred
3158 "io-error" - the last IOP has failed and the device is configured
3159 to pause on I/O errors
3160 "paused" - guest has been paused via the 'stop
' command
3161 "postmigrate" - guest is paused following a successful 'migrate
'
3162 "prelaunch" - QEMU was started with -S and guest has not started
3163 "finish-migrate" - guest is paused to finish the migration process
3164 "restore-vm" - guest is paused to restore VM state
3165 "running" - guest is actively running
3166 "save-vm" - guest is paused to save the VM state
3167 "shutdown" - guest is shut down (and -no-shutdown is in use)
3168 "watchdog" - the watchdog action is configured to pause and
3173 -> { "execute": "query-status" }
3174 <- { "return": { "running": true, "singlestep": false, "status": "running" } }
3179 .name = "query-status",
3181 .mhandler.cmd_new = qmp_marshal_query_status,
3188 Show VM mice information.
3190 Each mouse is represented by a json-object, the returned value is a json-array
3193 The mouse json-object contains the following:
3195 - "name": mouse's
name (json
-string
)
3196 - "index": mouse
's index (json-int)
3197 - "current": true if this mouse is receiving events, false otherwise (json-bool)
3198 - "absolute": true if the mouse generates absolute input events (json-bool)
3202 -> { "execute": "query-mice" }
3206 "name":"QEMU Microsoft Mouse",
3212 "name":"QEMU PS/2 Mouse",
3223 .name = "query-mice",
3225 .mhandler.cmd_new = qmp_marshal_query_mice,
3232 Show VNC server information.
3234 Return a json-object with server information. Connected clients are returned
3235 as a json-array of json-objects.
3237 The main json-object contains the following:
3239 - "enabled": true or false (json-bool)
3240 - "host": server's IP
address (json
-string
)
3241 - "family": address
family (json
-string
)
3242 - Possible values
: "ipv4", "ipv6", "unix", "unknown"
3243 - "service": server
's port number (json-string)
3244 - "auth": authentication method (json-string)
3245 - Possible values: "invalid", "none", "ra2", "ra2ne", "sasl", "tight",
3246 "tls", "ultra", "unknown", "vencrypt", "vencrypt",
3247 "vencrypt+plain", "vencrypt+tls+none",
3248 "vencrypt+tls+plain", "vencrypt+tls+sasl",
3249 "vencrypt+tls+vnc", "vencrypt+x509+none",
3250 "vencrypt+x509+plain", "vencrypt+x509+sasl",
3251 "vencrypt+x509+vnc", "vnc"
3252 - "clients": a json-array of all connected clients
3254 Clients are described by a json-object, each one contain the following:
3256 - "host": client's IP
address (json
-string
)
3257 - "family": address
family (json
-string
)
3258 - Possible values
: "ipv4", "ipv6", "unix", "unknown"
3259 - "service": client
's port number (json-string)
3260 - "x509_dname": TLS dname (json-string, optional)
3261 - "sasl_username": SASL username (json-string, optional)
3265 -> { "execute": "query-vnc" }
3286 .name = "query-vnc",
3288 .mhandler.cmd_new = qmp_marshal_query_vnc,
3291 .name = "query-vnc-servers",
3293 .mhandler.cmd_new = qmp_marshal_query_vnc_servers,
3300 Show SPICE server information.
3302 Return a json-object with server information. Connected clients are returned
3303 as a json-array of json-objects.
3305 The main json-object contains the following:
3307 - "enabled": true or false (json-bool)
3308 - "host": server's IP
address (json
-string
)
3309 - "port": server
's port number (json-int, optional)
3310 - "tls-port": server's port
number (json
-int
, optional
)
3311 - "auth": authentication
method (json
-string
)
3312 - Possible values
: "none", "spice"
3313 - "channels": a json
-array of all active channels clients
3315 Channels are described by a json
-object
, each one contain the following
:
3317 - "host": client
's IP address (json-string)
3318 - "family": address family (json-string)
3319 - Possible values: "ipv4", "ipv6", "unix", "unknown"
3320 - "port": client's port
number (json
-string
)
3321 - "connection-id": spice connection id
. All channels with the same id
3322 belong to the same spice
session (json
-int
)
3323 - "channel-type": channel type
. "1" is the main control channel
, filter
for
3324 this one
if you want track spice sessions
only (json
-int
)
3325 - "channel-id": channel id
. Usually
"0", might be different needed when
3326 multiple channels of the same type exist
, such as multiple
3327 display channels
in a multihead
setup (json
-int
)
3328 - "tls": whether the channel is
encrypted (json
-bool
)
3332 -> { "execute": "query-spice" }
3345 "connection-id": 1804289383,
3346 "host": "127.0.0.1",
3354 "connection-id": 1804289383,
3355 "host": "127.0.0.1",
3359 [ ... more channels follow
... ]
3366 #
if defined(CONFIG_SPICE
)
3368 .name
= "query-spice",
3370 .mhandler
.cmd_new
= qmp_marshal_query_spice
,
3380 Return a json
-object with the following information
:
3382 - "name": VM
's name (json-string, optional)
3386 -> { "execute": "query-name" }
3387 <- { "return": { "name": "qemu-name" } }
3392 .name = "query-name",
3394 .mhandler.cmd_new = qmp_marshal_query_name,
3403 Return a json-object with the following information:
3405 - "UUID": Universally Unique Identifier (json-string)
3409 -> { "execute": "query-uuid" }
3410 <- { "return": { "UUID": "550e8400-e29b-41d4-a716-446655440000" } }
3415 .name = "query-uuid",
3417 .mhandler.cmd_new = qmp_marshal_query_uuid,
3421 query-command-line-options
3422 --------------------------
3424 Show command line option schema.
3426 Return a json-array of command line option schema for all options (or for
3427 the given option), returning an error if the given option doesn't exist
.
3429 Each array entry contains the following
:
3431 - "option": option
name (json
-string
)
3432 - "parameters": a json
-array describes all parameters of the option
:
3433 - "name": parameter
name (json
-string
)
3434 - "type": parameter
type (one of
'string', 'boolean', 'number',
3436 - "help": human readable description of the parameter
3437 (json
-string
, optional
)
3438 - "default": default value string
for the parameter
3439 (json
-string
, optional
)
3443 -> { "execute": "query-command-line-options", "arguments": { "option": "option-rom" } }
3452 "name": "bootindex",
3456 "option": "option-rom"
3464 .name
= "query-command-line-options",
3465 .args_type
= "option:s?",
3466 .mhandler
.cmd_new
= qmp_marshal_query_command_line_options
,
3475 Return a json
-object
. If migration is active there will be another json
-object
3476 with RAM migration status and
if block migration is active another one with
3477 block migration status
.
3479 The main json
-object contains the following
:
3481 - "status": migration
status (json
-string
)
3482 - Possible values
: "setup", "active", "completed", "failed", "cancelled"
3483 - "total-time": total amount of ms since migration started
. If
3484 migration has ended
, it returns the total migration
3486 - "setup-time" amount of setup time
in milliseconds _before_ the
3487 iterations begin but _after_ the QMP command is issued
.
3488 This is designed to provide an accounting of any activities
3489 (such as RDMA pinning
) which may be expensive
, but
do not
3490 actually occur during the iterative migration rounds
3491 themselves
. (json
-int
)
3492 - "downtime": only present when migration has finished correctly
3493 total amount
in ms
for downtime that
happened (json
-int
)
3494 - "expected-downtime": only present
while migration is active
3495 total amount
in ms
for downtime that was calculated on
3496 the last bitmap
round (json
-int
)
3497 - "ram": only present
if "status" is
"active", it is a json
-object with the
3498 following RAM information
:
3499 - "transferred": amount transferred
in bytes (json
-int
)
3500 - "remaining": amount remaining to transfer
in bytes (json
-int
)
3501 - "total": total amount of memory
in bytes (json
-int
)
3502 - "duplicate": number of pages filled entirely with the same
3504 These are sent over the wire much more efficiently
.
3505 - "skipped": number of skipped zero
pages (json
-int
)
3506 - "normal" : number of whole pages transferred
. I
.e
. they
3507 were not sent as duplicate or xbzrle
pages (json
-int
)
3508 - "normal-bytes" : number of bytes transferred
in whole
3509 pages
. This is just normal pages times size of one page
,
3510 but
this way upper levels don
't need to care about page
3512 - "dirty-sync-count": times that dirty ram was synchronized (json-int)
3513 - "disk": only present if "status" is "active" and it is a block migration,
3514 it is a json-object with the following disk information:
3515 - "transferred": amount transferred in bytes (json-int)
3516 - "remaining": amount remaining to transfer in bytes json-int)
3517 - "total": total disk size in bytes (json-int)
3518 - "xbzrle-cache": only present if XBZRLE is active.
3519 It is a json-object with the following XBZRLE information:
3520 - "cache-size": XBZRLE cache size in bytes
3521 - "bytes": number of bytes transferred for XBZRLE compressed pages
3522 - "pages": number of XBZRLE compressed pages
3523 - "cache-miss": number of XBRZRLE page cache misses
3524 - "cache-miss-rate": rate of XBRZRLE page cache misses
3525 - "overflow": number of times XBZRLE overflows. This means
3526 that the XBZRLE encoding was bigger than just sent the
3527 whole page, and then we sent the whole page instead (as as
3532 1. Before the first migration
3534 -> { "execute": "query-migrate" }
3537 2. Migration is done and has succeeded
3539 -> { "execute": "query-migrate" }
3541 "status": "completed",
3551 "normal-bytes":123456,
3552 "dirty-sync-count":15
3557 3. Migration is done and has failed
3559 -> { "execute": "query-migrate" }
3560 <- { "return": { "status": "failed" } }
3562 4. Migration is being performed and is not a block migration:
3564 -> { "execute": "query-migrate" }
3574 "expected-downtime":12345,
3577 "normal-bytes":123456,
3578 "dirty-sync-count":15
3583 5. Migration is being performed and is a block migration:
3585 -> { "execute": "query-migrate" }
3591 "remaining":1053304,
3595 "expected-downtime":12345,
3598 "normal-bytes":123456,
3599 "dirty-sync-count":15
3603 "remaining":20880384,
3609 6. Migration is being performed and XBZRLE is active:
3611 -> { "execute": "query-migrate" }
3615 "capabilities" : [ { "capability": "xbzrle", "state" : true } ],
3618 "remaining":1053304,
3622 "expected-downtime":12345,
3625 "normal-bytes":3412992,
3626 "dirty-sync-count":15
3629 "cache-size":67108864,
3633 "cache-miss-rate":0.123,
3642 .name = "query-migrate",
3644 .mhandler.cmd_new = qmp_marshal_query_migrate,
3648 migrate-set-capabilities
3649 ------------------------
3651 Enable/Disable migration capabilities
3653 - "xbzrle": XBZRLE support
3654 - "rdma-pin-all": pin all pages when using RDMA during migration
3655 - "auto-converge": throttle down guest to help convergence of migration
3656 - "zero-blocks": compress zero blocks during block migration
3657 - "compress": use multiple compression threads to accelerate live migration
3658 - "events": generate events for each migration state change
3659 - "x-postcopy-ram": postcopy mode for live migration
3665 -> { "execute": "migrate-set-capabilities" , "arguments":
3666 { "capabilities": [ { "capability": "xbzrle", "state": true } ] } }
3671 .name = "migrate-set-capabilities",
3672 .args_type = "capabilities:q",
3673 .params = "capability:s,state:b",
3674 .mhandler.cmd_new = qmp_marshal_migrate_set_capabilities,
3677 query-migrate-capabilities
3678 --------------------------
3680 Query current migration capabilities
3682 - "capabilities": migration capabilities state
3683 - "xbzrle" : XBZRLE state (json-bool)
3684 - "rdma-pin-all" : RDMA Pin Page state (json-bool)
3685 - "auto-converge" : Auto Converge state (json-bool)
3686 - "zero-blocks" : Zero Blocks state (json-bool)
3687 - "compress": Multiple compression threads state (json-bool)
3688 - "events": Migration state change event state (json-bool)
3689 - "x-postcopy-ram": postcopy ram state (json-bool)
3695 -> { "execute": "query-migrate-capabilities" }
3697 {"state": false, "capability": "xbzrle"},
3698 {"state": false, "capability": "rdma-pin-all"},
3699 {"state": false, "capability": "auto-converge"},
3700 {"state": false, "capability": "zero-blocks"},
3701 {"state": false, "capability": "compress"},
3702 {"state": true, "capability": "events"},
3703 {"state": false, "capability": "x-postcopy-ram"}
3709 .name = "query-migrate-capabilities",
3711 .mhandler.cmd_new = qmp_marshal_query_migrate_capabilities,
3715 migrate-set-parameters
3716 ----------------------
3718 Set migration parameters
3720 - "compress-level": set compression level during migration (json-int)
3721 - "compress-threads": set compression thread count for migration (json-int)
3722 - "decompress-threads": set decompression thread count for migration (json-int)
3723 - "x-cpu-throttle-initial": set initial percentage of time guest cpus are
3724 throttled for auto-converge (json-int)
3725 - "x-cpu-throttle-increment": set throttle increasing percentage for
3726 auto-converge (json-int)
3732 -> { "execute": "migrate-set-parameters" , "arguments":
3733 { "compress-level": 1 } }
3738 .name = "migrate-set-parameters",
3740 "compress-level:i?,compress-threads:i?,decompress-threads:i?,x-cpu-throttle-initial:i?,x-cpu-throttle-increment:i?",
3741 .mhandler.cmd_new = qmp_marshal_migrate_set_parameters,
3744 query-migrate-parameters
3745 ------------------------
3747 Query current migration parameters
3749 - "parameters": migration parameters value
3750 - "compress-level" : compression level value (json-int)
3751 - "compress-threads" : compression thread count value (json-int)
3752 - "decompress-threads" : decompression thread count value (json-int)
3753 - "x-cpu-throttle-initial" : initial percentage of time guest cpus are
3754 throttled (json-int)
3755 - "x-cpu-throttle-increment" : throttle increasing percentage for
3756 auto-converge (json-int)
3762 -> { "execute": "query-migrate-parameters" }
3765 "decompress-threads": 2,
3766 "x-cpu-throttle-increment": 10,
3767 "compress-threads": 8,
3768 "compress-level": 1,
3769 "x-cpu-throttle-initial": 20
3776 .name = "query-migrate-parameters",
3778 .mhandler.cmd_new = qmp_marshal_query_migrate_parameters,
3785 Show balloon information.
3787 Make an asynchronous request for balloon info. When the request completes a
3788 json-object will be returned containing the following data:
3790 - "actual": current balloon value in bytes (json-int)
3794 -> { "execute": "query-balloon" }
3797 "actual":1073741824,
3804 .name = "query-balloon",
3806 .mhandler.cmd_new = qmp_marshal_query_balloon,
3810 .name = "query-block-jobs",
3812 .mhandler.cmd_new = qmp_marshal_query_block_jobs,
3817 .args_type = "path:s",
3818 .mhandler.cmd_new = qmp_marshal_qom_list,
3823 .args_type = "path:s,property:s,value:q",
3824 .mhandler.cmd_new = qmp_marshal_qom_set,
3829 .args_type = "path:s,property:s",
3830 .mhandler.cmd_new = qmp_marshal_qom_get,
3834 .name = "nbd-server-start",
3835 .args_type = "addr:q,tls-creds:s?",
3836 .mhandler.cmd_new = qmp_marshal_nbd_server_start,
3839 .name = "nbd-server-add",
3840 .args_type = "device:B,writable:b?",
3841 .mhandler.cmd_new = qmp_marshal_nbd_server_add,
3844 .name = "nbd-server-stop",
3846 .mhandler.cmd_new = qmp_marshal_nbd_server_stop,
3850 .name = "change-vnc-password",
3851 .args_type = "password:s",
3852 .mhandler.cmd_new = qmp_marshal_change_vnc_password,
3855 .name = "qom-list-types",
3856 .args_type = "implements:s?,abstract:b?",
3857 .mhandler.cmd_new = qmp_marshal_qom_list_types,
3861 .name = "device-list-properties",
3862 .args_type = "typename:s",
3863 .mhandler.cmd_new = qmp_marshal_device_list_properties,
3867 .name = "query-machines",
3869 .mhandler.cmd_new = qmp_marshal_query_machines,
3873 .name = "query-cpu-definitions",
3875 .mhandler.cmd_new = qmp_marshal_query_cpu_definitions,
3879 .name = "query-target",
3881 .mhandler.cmd_new = qmp_marshal_query_target,
3885 .name = "query-tpm",
3887 .mhandler.cmd_new = qmp_marshal_query_tpm,
3894 Return information about the TPM device.
3900 -> { "execute": "query-tpm" }
3903 { "model": "tpm-tis",
3905 { "type": "passthrough",
3907 { "cancel-path": "/sys/class/misc/tpm0/device/cancel",
3919 .name = "query-tpm-models",
3921 .mhandler.cmd_new = qmp_marshal_query_tpm_models,
3928 Return a list of supported TPM models.
3934 -> { "execute": "query-tpm-models" }
3935 <- { "return": [ "tpm-tis" ] }
3940 .name = "query-tpm-types",
3942 .mhandler.cmd_new = qmp_marshal_query_tpm_types,
3949 Return a list of supported TPM types.
3955 -> { "execute": "query-tpm-types" }
3956 <- { "return": [ "passthrough" ] }
3961 .name = "chardev-add",
3962 .args_type = "id:s,backend:q",
3963 .mhandler.cmd_new = qmp_marshal_chardev_add,
3974 - "id": the chardev's ID
, must be
unique (json
-string
)
3975 - "backend": chardev backend type
+ parameters
3979 -> { "execute" : "chardev-add",
3980 "arguments" : { "id" : "foo",
3981 "backend" : { "type" : "null", "data" : {} } } }
3984 -> { "execute" : "chardev-add",
3985 "arguments" : { "id" : "bar",
3986 "backend" : { "type" : "file",
3987 "data" : { "out" : "/tmp/bar.log" } } } }
3990 -> { "execute" : "chardev-add",
3991 "arguments" : { "id" : "baz",
3992 "backend" : { "type" : "pty", "data" : {} } } }
3993 <- { "return": { "pty" : "/dev/pty/42" } }
3998 .name
= "chardev-remove",
3999 .args_type
= "id:s",
4000 .mhandler
.cmd_new
= qmp_marshal_chardev_remove
,
4012 - "id": the chardev
's ID, must exist and not be in use (json-string)
4016 -> { "execute": "chardev-remove", "arguments": { "id" : "foo" } }
4021 .name = "query-rx-filter",
4022 .args_type = "name:s?",
4023 .mhandler.cmd_new = qmp_marshal_query_rx_filter,
4030 Show rx-filter information.
4032 Returns a json-array of rx-filter information for all NICs (or for the
4033 given NIC), returning an error if the given NIC doesn't exist
, or
4034 given NIC doesn
't support rx-filter querying, or given net client
4037 The query will clear the event notification flag of each NIC
, then qemu
4038 will start to emit event to QMP monitor
.
4040 Each array entry contains the following
:
4042 - "name": net client
name (json
-string
)
4043 - "promiscuous": promiscuous mode is
enabled (json
-bool
)
4044 - "multicast": multicast receive
state (one of
'normal', 'none', 'all')
4045 - "unicast": unicast receive
state (one of
'normal', 'none', 'all')
4046 - "vlan": vlan receive
state (one of
'normal', 'none', 'all') (Since
2.0)
4047 - "broadcast-allowed": allow to receive
broadcast (json
-bool
)
4048 - "multicast-overflow": multicast table is
overflowed (json
-bool
)
4049 - "unicast-overflow": unicast table is
overflowed (json
-bool
)
4050 - "main-mac": main macaddr
string (json
-string
)
4051 - "vlan-table": a json
-array of active vlan id
4052 - "unicast-table": a json
-array of unicast macaddr string
4053 - "multicast-table": a json
-array of multicast macaddr string
4057 -> { "execute": "query-rx-filter", "arguments": { "name": "vnet0" } }
4060 "promiscuous": true,
4062 "main-mac": "52:54:00:12:34:56",
4063 "unicast": "normal",
4071 "multicast": "normal",
4072 "multicast-overflow": false,
4073 "unicast-overflow": false,
4074 "multicast-table": [
4075 "01:00:5e:00:00:01",
4076 "33:33:00:00:00:01",
4079 "broadcast-allowed": false
4087 .name
= "blockdev-add",
4088 .args_type
= "options:q",
4089 .mhandler
.cmd_new
= qmp_marshal_blockdev_add
,
4098 This command is still a work
in progress
. It doesn
't support all
4099 block drivers among other things. Stay away from it unless you want
4100 to help with its development.
4104 - "options": block driver options
4108 -> { "execute": "blockdev-add",
4109 "arguments": { "options" : { "driver": "qcow2",
4110 "file": { "driver": "file",
4111 "filename": "test.qcow2" } } } }
4116 -> { "execute": "blockdev-add",
4128 "filename": "/tmp/test.qcow2"
4134 "filename": "/dev/fdset/4"
4146 .name = "x-blockdev-del",
4147 .args_type = "id:s?,node-name:s?",
4148 .mhandler.cmd_new = qmp_marshal_x_blockdev_del,
4156 Deletes a block device thas has been added using blockdev-add.
4157 The selected device can be either a block backend or a graph node.
4159 In the former case the backend will be destroyed, along with its
4160 inserted medium if there's any
. The command will fail
if the backend
4161 or its medium are
in use
.
4163 In the latter
case the node will be destroyed
. The command will fail
4164 if the node is attached to a block backend or is otherwise being
4167 One of
"id" or
"node-name" must be specified
, but not both
.
4169 This command is still a work
in progress and is considered
4170 experimental
. Stay away from it unless you want to help with its
4175 - "id": Name of the block backend device to
delete (json
-string
, optional
)
4176 - "node-name": Name of the graph node to
delete (json
-string
, optional
)
4180 -> { "execute": "blockdev-add",
4187 "filename": "test.qcow2"
4195 -> { "execute": "x-blockdev-del",
4196 "arguments": { "id": "drive0" }
4203 .name
= "blockdev-open-tray",
4204 .args_type
= "device:s,force:b?",
4205 .mhandler
.cmd_new
= qmp_marshal_blockdev_open_tray
,
4212 Opens a block device
's tray. If there is a block driver state tree inserted as a
4213 medium, it will become inaccessible to the guest (but it will remain associated
4214 to the block device, so closing the tray will make it accessible again).
4216 If the tray was already open before, this will be a no-op.
4218 Once the tray opens, a DEVICE_TRAY_MOVED event is emitted. There are cases in
4219 which no such event will be generated, these include:
4220 - if the guest has locked the tray, @force is false and the guest does not
4221 respond to the eject request
4222 - if the BlockBackend denoted by @device does not have a guest device attached
4224 - if the guest device does not have an actual tray and is empty, for instance
4225 for floppy disk drives
4229 - "device": block device name (json-string)
4230 - "force": if false (the default), an eject request will be sent to the guest if
4231 it has locked the tray (and the tray will not be opened immediately);
4232 if true, the tray will be opened regardless of whether it is locked
4233 (json-bool, optional)
4237 -> { "execute": "blockdev-open-tray",
4238 "arguments": { "device": "ide1-cd0" } }
4240 <- { "timestamp": { "seconds": 1418751016,
4241 "microseconds": 716996 },
4242 "event": "DEVICE_TRAY_MOVED",
4243 "data": { "device": "ide1-cd0",
4244 "tray-open": true } }
4251 .name = "blockdev-close-tray",
4252 .args_type = "device:s",
4253 .mhandler.cmd_new = qmp_marshal_blockdev_close_tray,
4260 Closes a block device's tray
. If there is a block driver state tree associated
4261 with the block
device (which is currently ejected
), that tree will be loaded as
4264 If the tray was already closed before
, this will be a no
-op
.
4268 - "device": block device
name (json
-string
)
4272 -> { "execute": "blockdev-close-tray",
4273 "arguments": { "device": "ide1-cd0" } }
4275 <- { "timestamp": { "seconds": 1418751345,
4276 "microseconds": 272147 },
4277 "event": "DEVICE_TRAY_MOVED",
4278 "data": { "device": "ide1-cd0",
4279 "tray-open": false } }
4286 .name
= "x-blockdev-remove-medium",
4287 .args_type
= "device:s",
4288 .mhandler
.cmd_new
= qmp_marshal_x_blockdev_remove_medium
,
4292 x
-blockdev
-remove
-medium
4293 ------------------------
4295 Removes a
medium (a block driver state tree
) from a block device
. That block
4296 device
's tray must currently be open (unless there is no attached guest device).
4298 If the tray is open and there is no medium inserted, this will be a no-op.
4300 This command is still a work in progress and is considered experimental.
4301 Stay away from it unless you want to help with its development.
4305 - "device": block device name (json-string)
4309 -> { "execute": "x-blockdev-remove-medium",
4310 "arguments": { "device": "ide1-cd0" } }
4312 <- { "error": { "class": "GenericError",
4313 "desc": "Tray of device 'ide1
-cd0
' is not open" } }
4315 -> { "execute": "blockdev-open-tray",
4316 "arguments": { "device": "ide1-cd0" } }
4318 <- { "timestamp": { "seconds": 1418751627,
4319 "microseconds": 549958 },
4320 "event": "DEVICE_TRAY_MOVED",
4321 "data": { "device": "ide1-cd0",
4322 "tray-open": true } }
4326 -> { "execute": "x-blockdev-remove-medium",
4327 "arguments": { "device": "ide1-cd0" } }
4334 .name = "x-blockdev-insert-medium",
4335 .args_type = "device:s,node-name:s",
4336 .mhandler.cmd_new = qmp_marshal_x_blockdev_insert_medium,
4340 x-blockdev-insert-medium
4341 ------------------------
4343 Inserts a medium (a block driver state tree) into a block device. That block
4344 device's tray must currently be
open (unless there is no attached guest device
)
4345 and there must be no medium inserted already
.
4347 This command is still a work
in progress and is considered experimental
.
4348 Stay away from it unless you want to help with its development
.
4352 - "device": block device
name (json
-string
)
4353 - "node-name": root node of the BDS tree to insert into the block device
4357 -> { "execute": "blockdev-add",
4358 "arguments": { "options": { "node-name": "node0",
4360 "file": { "driver": "file",
4361 "filename": "fedora.iso" } } } }
4365 -> { "execute": "x-blockdev-insert-medium",
4366 "arguments": { "device": "ide1-cd0",
4367 "node-name": "node0" } }
4374 .name
= "query-named-block-nodes",
4376 .mhandler
.cmd_new
= qmp_marshal_query_named_block_nodes
,
4380 @query
-named
-block
-nodes
4381 ------------------------
4383 Return a list of BlockDeviceInfo
for all the named block driver nodes
4387 -> { "execute": "query-named-block-nodes" }
4388 <- { "return": [ { "ro":false,
4391 "file":"disks/test.qcow2",
4392 "node-name": "my-node",
4393 "backing_file_depth":1,
4407 "write_threshold": 0,
4409 "filename":"disks/test.qcow2",
4411 "virtual-size":2048000,
4412 "backing_file":"base.qcow2",
4413 "full-backing-filename":"disks/base.qcow2",
4414 "backing-filename-format":"qcow2",
4418 "name": "snapshot1",
4420 "date-sec": 10000200,
4422 "vm-clock-sec": 206,
4427 "filename":"disks/base.qcow2",
4429 "virtual-size":2048000
4436 .name
= "blockdev-change-medium",
4437 .args_type
= "device:B,filename:F,format:s?,read-only-mode:s?",
4438 .mhandler
.cmd_new
= qmp_marshal_blockdev_change_medium
,
4442 blockdev
-change
-medium
4443 ----------------------
4445 Changes the medium inserted into a block device by ejecting the current medium
4446 and loading a
new image file which is inserted as the
new medium
.
4450 - "device": device
name (json
-string
)
4451 - "filename": filename of the
new image (json
-string
)
4452 - "format": format of the
new image (json
-string
, optional
)
4453 - "read-only-mode": new read
-only
mode (json
-string
, optional
)
4454 - Possible values
: "retain" (default), "read-only", "read-write"
4458 1. Change a removable medium
4460 -> { "execute": "blockdev-change-medium",
4461 "arguments": { "device": "ide1-cd0",
4462 "filename": "/srv/images/Fedora-12-x86_64-DVD.iso",
4466 2. Load a read
-only medium into a writable drive
4468 -> { "execute": "blockdev-change-medium",
4469 "arguments": { "device": "isa-fd0",
4470 "filename": "/srv/images/ro.img",
4472 "read-only-mode": "retain" } }
4475 { "class": "GenericError",
4476 "desc": "Could not open '/srv/images/ro.img': Permission denied" } }
4478 -> { "execute": "blockdev-change-medium",
4479 "arguments": { "device": "isa-fd0",
4480 "filename": "/srv/images/ro.img",
4482 "read-only-mode": "read-only" } }
4489 .name
= "query-memdev",
4491 .mhandler
.cmd_new
= qmp_marshal_query_memdev
,
4498 Show memory devices information
.
4503 -> { "execute": "query-memdev" }
4510 "host-nodes": [0, 1],
4518 "host-nodes": [2, 3],
4519 "policy": "preferred"
4527 .name
= "query-memory-devices",
4529 .mhandler
.cmd_new
= qmp_marshal_query_memory_devices
,
4533 @query
-memory
-devices
4534 --------------------
4536 Return a list of memory devices
.
4539 -> { "execute": "query-memory-devices" }
4540 <- { "return": [ { "data":
4541 { "addr": 5368709120,
4542 "hotpluggable": true,
4545 "memdev": "/objects/memX",
4554 .name
= "query-acpi-ospm-status",
4556 .mhandler
.cmd_new
= qmp_marshal_query_acpi_ospm_status
,
4560 @query
-acpi
-ospm
-status
4561 --------------------
4563 Return list of ACPIOSTInfo
for devices that support status reporting
4564 via ACPI _OST method
.
4567 -> { "execute": "query-acpi-ospm-status" }
4568 <- { "return": [ { "device": "d1", "slot": "0", "slot-type": "DIMM", "source": 1, "status": 0},
4569 { "slot": "1", "slot-type": "DIMM", "source": 0, "status": 0},
4570 { "slot": "2", "slot-type": "DIMM", "source": 0, "status": 0},
4571 { "slot": "3", "slot-type": "DIMM", "source": 0, "status": 0}
4575 #
if defined TARGET_I386
4577 .name
= "rtc-reset-reinjection",
4579 .mhandler
.cmd_new
= qmp_marshal_rtc_reset_reinjection
,
4584 rtc
-reset
-reinjection
4585 ---------------------
4587 Reset the RTC interrupt reinjection backlog
.
4593 -> { "execute": "rtc-reset-reinjection" }
4598 .name
= "trace-event-get-state",
4599 .args_type
= "name:s",
4600 .mhandler
.cmd_new
= qmp_marshal_trace_event_get_state
,
4604 trace-event
-get
-state
4605 ---------------------
4607 Query the state of events
.
4611 -> { "execute": "trace-event-get-state", "arguments": { "name": "qemu_memalign" } }
4612 <- { "return": [ { "name": "qemu_memalign", "state": "disabled" } ] }
4616 .name
= "trace-event-set-state",
4617 .args_type
= "name:s,enable:b,ignore-unavailable:b?",
4618 .mhandler
.cmd_new
= qmp_marshal_trace_event_set_state
,
4622 trace-event
-set
-state
4623 ---------------------
4625 Set the state of events
.
4629 -> { "execute": "trace-event-set-state", "arguments": { "name": "qemu_memalign", "enable": "true" } }
4634 .name
= "x-input-send-event",
4635 .args_type
= "console:i?,events:q",
4636 .mhandler
.cmd_new
= qmp_marshal_x_input_send_event
,
4643 Send input event to guest
.
4647 - "console": console index
. (json
-int
, optional
)
4648 - "events": list of input events
.
4650 The consoles are visible
in the qom tree
, under
4651 /backend
/console
[$index
]. They have a device link and head property
, so
4652 it is possible to map which console belongs to which device and display
.
4654 Note
: this command is experimental
, and not a stable API
.
4658 Press left mouse button
.
4660 -> { "execute": "x-input-send-event",
4661 "arguments": { "console": 0,
4662 "events": [ { "type": "btn",
4663 "data" : { "down": true, "button": "Left" } } ] } }
4666 -> { "execute": "x-input-send-event",
4667 "arguments": { "console": 0,
4668 "events": [ { "type": "btn",
4669 "data" : { "down": false, "button": "Left" } } ] } }
4676 -> { "execute": "x-input-send-event",
4677 "arguments": { "console": 0, "events": [
4678 { "type": "key", "data" : { "down": true,
4679 "key": {"type": "qcode", "data": "ctrl" } } },
4680 { "type": "key", "data" : { "down": true,
4681 "key": {"type": "qcode", "data": "alt" } } },
4682 { "type": "key", "data" : { "down": true,
4683 "key": {"type": "qcode", "data": "delete" } } } ] } }
4688 Move mouse pointer to absolute
coordinates (20000, 400).
4690 -> { "execute": "x-input-send-event" ,
4691 "arguments": { "console": 0, "events": [
4692 { "type": "abs", "data" : { "axis": "X", "value" : 20000 } },
4693 { "type": "abs", "data" : { "axis": "Y", "value" : 400 } } ] } }
4699 .name
= "block-set-write-threshold",
4700 .args_type
= "node-name:s,write-threshold:l",
4701 .mhandler
.cmd_new
= qmp_marshal_block_set_write_threshold
,
4705 block
-set
-write
-threshold
4708 Change the write threshold
for a block drive
. The threshold is an offset
,
4709 thus must be non
-negative
. Default is no write threshold
.
4710 Setting the threshold to zero disables it
.
4714 - "node-name": the node name
in the block driver state
graph (json
-string
)
4715 - "write-threshold": the write threshold
in bytes (json
-int
)
4719 -> { "execute": "block-set-write-threshold",
4720 "arguments": { "node-name": "mydev",
4721 "write-threshold": 17179869184 } }
4727 .name
= "query-rocker",
4728 .args_type
= "name:s",
4729 .mhandler
.cmd_new
= qmp_marshal_query_rocker
,
4738 - "name": switch name
4742 -> { "execute": "query-rocker", "arguments": { "name": "sw1" } }
4743 <- { "return": {"name": "sw1", "ports": 2, "id": 1327446905938}}
4748 .name
= "query-rocker-ports",
4749 .args_type
= "name:s",
4750 .mhandler
.cmd_new
= qmp_marshal_query_rocker_ports
,
4754 Show rocker
switch ports
4755 ------------------------
4759 - "name": switch name
4763 -> { "execute": "query-rocker-ports", "arguments": { "name": "sw1" } }
4764 <- { "return": [ {"duplex": "full", "enabled": true, "name": "sw1.1",
4765 "autoneg": "off", "link-up": true, "speed": 10000},
4766 {"duplex": "full", "enabled": true, "name": "sw1.2",
4767 "autoneg": "off", "link-up": true, "speed": 10000}
4773 .name
= "query-rocker-of-dpa-flows",
4774 .args_type
= "name:s,tbl-id:i?",
4775 .mhandler
.cmd_new
= qmp_marshal_query_rocker_of_dpa_flows
,
4779 Show rocker
switch OF
-DPA flow tables
4780 -------------------------------------
4784 - "name": switch name
4785 - "tbl-id": (optional
) flow table ID
4789 -> { "execute": "query-rocker-of-dpa-flows", "arguments": { "name": "sw1" } }
4790 <- { "return": [ {"key": {"in-pport": 0, "priority": 1, "tbl-id": 0},
4793 "action": {"goto-tbl": 10},
4794 "mask": {"in-pport": 4294901760}
4802 .name
= "query-rocker-of-dpa-groups",
4803 .args_type
= "name:s,type:i?",
4804 .mhandler
.cmd_new
= qmp_marshal_query_rocker_of_dpa_groups
,
4808 Show rocker OF
-DPA group tables
4809 -------------------------------
4813 - "name": switch name
4814 - "type": (optional
) group type
4818 -> { "execute": "query-rocker-of-dpa-groups", "arguments": { "name": "sw1" } }
4819 <- { "return": [ {"type": 0, "out-pport": 2, "pport": 2, "vlan-id": 3841,
4820 "pop-vlan": 1, "id": 251723778},
4821 {"type": 0, "out-pport": 0, "pport": 0, "vlan-id": 3841,
4822 "pop-vlan": 1, "id": 251723776},
4823 {"type": 0, "out-pport": 1, "pport": 1, "vlan-id": 3840,
4824 "pop-vlan": 1, "id": 251658241},
4825 {"type": 0, "out-pport": 0, "pport": 0, "vlan-id": 3840,
4826 "pop-vlan": 1, "id": 251658240}