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_input_quit
,
79 -> { "execute": "quit" }
86 .args_type
= "force:-f,device:B",
87 .mhandler
.cmd_new
= qmp_marshal_input_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_input_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_input_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_input_stop
,
185 -> { "execute": "stop" }
193 .mhandler
.cmd_new
= qmp_marshal_input_cont
,
206 -> { "execute": "cont" }
212 .name
= "system_wakeup",
214 .mhandler
.cmd_new
= qmp_marshal_input_system_wakeup
,
221 Wakeup guest from suspend
.
227 -> { "execute": "system_wakeup" }
233 .name
= "system_reset",
235 .mhandler
.cmd_new
= qmp_marshal_input_system_reset
,
248 -> { "execute": "system_reset" }
254 .name
= "system_powerdown",
256 .mhandler
.cmd_new
= qmp_marshal_input_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_input_device_del,
324 - "id": the device's
ID (json
-string
)
328 -> { "execute": "device_del", "arguments": { "id": "net1" } }
335 .args_type
= "keys:q,hold-time:i?",
336 .mhandler
.cmd_new
= qmp_marshal_input_send_key
,
348 - "key": key
sequence (a json
-array of key union values
,
349 union can be number or qcode
enum)
351 - hold
-time
: time to delay key up events
, milliseconds
. Defaults to
100
356 -> { "execute": "send-key",
357 "arguments": { "keys": [ { "type": "qcode", "data": "ctrl" },
358 { "type": "qcode", "data": "alt" },
359 { "type": "qcode", "data": "delete" } ] } }
366 .args_type
= "index:i",
367 .mhandler
.cmd_new
= qmp_marshal_input_cpu
,
378 - "index": the CPU
's index (json-int)
382 -> { "execute": "cpu", "arguments": { "index": 0 } }
385 Note: CPUs' indexes are obtained with the
'query-cpus' command
.
392 .mhandler
.cmd_new
= qmp_marshal_input_cpu_add
,
403 - "id": cpu
id (json
-int
)
407 -> { "execute": "cpu-add", "arguments": { "id": 2 } }
414 .args_type
= "val:l,size:i,filename:s,cpu:i?",
415 .mhandler
.cmd_new
= qmp_marshal_input_memsave
,
422 Save to disk virtual memory dump starting at
'val' of size
'size'.
426 - "val": the starting
address (json
-int
)
427 - "size": the memory size
, in bytes (json
-int
)
428 - "filename": file
path (json
-string
)
429 - "cpu": virtual CPU
index (json
-int
, optional
)
433 -> { "execute": "memsave",
434 "arguments": { "val": 10,
436 "filename": "/tmp/virtual-mem-dump" } }
443 .args_type
= "val:l,size:i,filename:s",
444 .mhandler
.cmd_new
= qmp_marshal_input_pmemsave
,
451 Save to disk physical memory dump starting at
'val' of size
'size'.
455 - "val": the starting
address (json
-int
)
456 - "size": the memory size
, in bytes (json
-int
)
457 - "filename": file
path (json
-string
)
461 -> { "execute": "pmemsave",
462 "arguments": { "val": 10,
464 "filename": "/tmp/physical-mem-dump" } }
470 .name
= "inject-nmi",
472 .mhandler
.cmd_new
= qmp_marshal_input_inject_nmi
,
479 Inject an NMI on the
default CPU (x86
/s390
) or all
CPUs (ppc64
).
485 -> { "execute": "inject-nmi" }
488 Note
: inject
-nmi fails when the guest doesn
't support injecting.
493 .name = "ringbuf-write",
494 .args_type = "device:s,data:s,format:s?",
495 .mhandler.cmd_new = qmp_marshal_input_ringbuf_write,
502 Write to a ring buffer character device.
506 - "device": ring buffer character device name (json-string)
507 - "data": data to write (json-string)
508 - "format": data format (json-string, optional)
509 - Possible values: "utf8" (default), "base64"
510 Bug: invalid base64 is currently not rejected.
511 Whitespace *is* invalid.
515 -> { "execute": "ringbuf-write",
516 "arguments": { "device": "foo",
524 .name = "ringbuf-read",
525 .args_type = "device:s,size:i,format:s?",
526 .mhandler.cmd_new = qmp_marshal_input_ringbuf_read,
533 Read from a ring buffer character device.
537 - "device": ring buffer character device name (json-string)
538 - "size": how many bytes to read at most (json-int)
539 - Number of data bytes, not number of characters in encoded data
540 - "format": data format (json-string, optional)
541 - Possible values: "utf8" (default), "base64"
542 - Naturally, format "utf8" works only when the ring buffer
543 contains valid UTF-8 text. Invalid UTF-8 sequences get
544 replaced. Bug: replacement doesn't work
. Bug
: can screw
545 up on encountering NUL characters
, after the ring buffer
546 lost data
, and when reading stops because the size limit
551 -> { "execute": "ringbuf-read",
552 "arguments": { "device": "foo",
555 <- {"return": "abcdefgh"}
560 .name
= "xen-save-devices-state",
561 .args_type
= "filename:F",
562 .mhandler
.cmd_new
= qmp_marshal_input_xen_save_devices_state
,
566 xen
-save
-devices
-state
569 Save the state of all devices to file
. The RAM and the block devices
570 of the VM are not saved by
this command
.
574 - "filename": the file to save the state of the devices to as binary
575 data
. See xen
-save
-devices
-state
.txt
for a description of the binary
580 -> { "execute": "xen-save-devices-state",
581 "arguments": { "filename": "/tmp/save" } }
587 .name
= "xen-set-global-dirty-log",
588 .args_type
= "enable:b",
589 .mhandler
.cmd_new
= qmp_marshal_input_xen_set_global_dirty_log
,
593 xen
-set
-global
-dirty
-log
596 Enable or disable the global dirty log mode
.
600 - "enable": Enable it or disable it
.
604 -> { "execute": "xen-set-global-dirty-log",
605 "arguments": { "enable": true } }
612 .args_type
= "detach:-d,blk:-b,inc:-i,uri:s",
613 .mhandler
.cmd_new
= qmp_marshal_input_migrate
,
624 - "blk": block migration
, full disk
copy (json
-bool
, optional
)
625 - "inc": incremental disk
copy (json
-bool
, optional
)
626 - "uri": Destination
URI (json
-string
)
630 -> { "execute": "migrate", "arguments": { "uri": "tcp:0:4446" } }
635 (1) The
'query-migrate' command should be used to check migration
's progress
636 and final result (this information is provided by the 'status
' member)
637 (2) All boolean arguments default to false
638 (3) The user Monitor's
"detach" argument is invalid
in QMP and should not
644 .name
= "migrate_cancel",
646 .mhandler
.cmd_new
= qmp_marshal_input_migrate_cancel
,
653 Cancel the current migration
.
659 -> { "execute": "migrate_cancel" }
665 .name
= "migrate-incoming",
666 .args_type
= "uri:s",
667 .mhandler
.cmd_new
= qmp_marshal_input_migrate_incoming
,
674 Continue an incoming migration
678 - "uri": Source
/listening
URI (json
-string
)
682 -> { "execute": "migrate-incoming", "arguments": { "uri": "tcp::4446" } }
687 (1) QEMU must be started with
-incoming defer to allow migrate
-incoming to
689 (2) The uri format is the same as
for -incoming
693 .name
= "migrate-set-cache-size",
694 .args_type
= "value:o",
695 .mhandler
.cmd_new
= qmp_marshal_input_migrate_set_cache_size
,
699 migrate
-set
-cache
-size
700 ----------------------
702 Set cache size to be used by XBZRLE migration
, the cache size will be rounded
703 down to the nearest power of
2
707 - "value": cache size
in bytes (json
-int
)
711 -> { "execute": "migrate-set-cache-size", "arguments": { "value": 536870912 } }
716 .name
= "query-migrate-cache-size",
718 .mhandler
.cmd_new
= qmp_marshal_input_query_migrate_cache_size
,
722 query
-migrate
-cache
-size
723 ------------------------
725 Show cache size to be used by XBZRLE migration
727 returns a json
-object with the following information
:
732 -> { "execute": "query-migrate-cache-size" }
733 <- { "return": 67108864 }
738 .name
= "migrate_set_speed",
739 .args_type
= "value:o",
740 .mhandler
.cmd_new
= qmp_marshal_input_migrate_set_speed
,
747 Set maximum speed
for migrations
.
751 - "value": maximum speed
, in bytes per
second (json
-int
)
755 -> { "execute": "migrate_set_speed", "arguments": { "value": 1024 } }
761 .name
= "migrate_set_downtime",
762 .args_type
= "value:T",
763 .mhandler
.cmd_new
= qmp_marshal_input_migrate_set_downtime
,
770 Set maximum tolerated
downtime (in seconds
) for migrations
.
774 - "value": maximum
downtime (json
-number
)
778 -> { "execute": "migrate_set_downtime", "arguments": { "value": 0.1 } }
784 .name
= "client_migrate_info",
785 .args_type
= "protocol:s,hostname:s,port:i?,tls-port:i?,cert-subject:s?",
786 .params
= "protocol hostname port tls-port cert-subject",
787 .help
= "set migration information for remote display",
788 .mhandler
.cmd_new
= qmp_marshal_input_client_migrate_info
,
795 Set migration information
for remote display
. This makes the server
796 ask the client to automatically reconnect
using the
new parameters
797 once migration finished successfully
. Only implemented
for SPICE
.
801 - "protocol": must be
"spice" (json
-string
)
802 - "hostname": migration target
hostname (json
-string
)
803 - "port": spice tcp port
for plaintext
channels (json
-int
, optional
)
804 - "tls-port": spice tcp port
for tls
-secured
channels (json
-int
, optional
)
805 - "cert-subject": server certificate
subject (json
-string
, optional
)
809 -> { "execute": "client_migrate_info",
810 "arguments": { "protocol": "spice",
811 "hostname": "virt42.lab.kraxel.org",
818 .name
= "dump-guest-memory",
819 .args_type
= "paging:b,protocol:s,begin:i?,end:i?,format:s?",
820 .params
= "-p protocol [begin] [length] [format]",
821 .help
= "dump guest memory to file",
822 .mhandler
.cmd_new
= qmp_marshal_input_dump_guest_memory
,
829 Dump guest memory to file
. The file can be processed with crash or gdb
.
833 - "paging": do paging to get guest
's memory mapping (json-bool)
834 - "protocol": destination file(started with "file:") or destination file
835 descriptor (started with "fd:") (json-string)
836 - "begin": the starting physical address. It's optional
, and should be specified
837 with length
together (json
-int
)
838 - "length": the memory size
, in bytes
. It
's optional, and should be specified
839 with begin together (json-int)
840 - "format": the format of guest memory dump. It's optional
, and can be
841 elf|kdump
-zlib|kdump
-lzo|kdump
-snappy
, but non
-elf formats will
842 conflict with paging and filter
, ie
. begin and
length (json
-string
)
846 -> { "execute": "dump-guest-memory", "arguments": { "protocol": "fd:dump" } }
851 (1) All boolean arguments
default to
false
856 .name
= "query-dump-guest-memory-capability",
858 .mhandler
.cmd_new
= qmp_marshal_input_query_dump_guest_memory_capability
,
862 query
-dump
-guest
-memory
-capability
865 Show available formats
for 'dump-guest-memory'
869 -> { "execute": "query-dump-guest-memory-capability" }
870 <- { "return": { "formats":
871 ["elf", "kdump-zlib", "kdump-lzo", "kdump-snappy"] }
875 #
if defined TARGET_S390X
877 .name
= "dump-skeys",
878 .args_type
= "filename:F",
879 .mhandler
.cmd_new
= qmp_marshal_input_dump_skeys
,
887 Save guest storage keys to file
.
891 - "filename": file
path (json
-string
)
895 -> { "execute": "dump-skeys", "arguments": { "filename": "/tmp/skeys" } }
901 .name
= "netdev_add",
902 .args_type
= "netdev:O",
903 .mhandler
.cmd_new
= qmp_netdev_add
,
910 Add host network device
.
914 - "type": the device type
, "tap", "user", ... (json
-string
)
915 - "id": the device
's ID, must be unique (json-string)
920 -> { "execute": "netdev_add", "arguments": { "type": "user", "id": "netdev1" } }
923 Note: The supported device options are the same ones supported by the '-netdev
'
924 command-line argument, which are listed in the '-help
' output or QEMU's
930 .name
= "netdev_del",
932 .mhandler
.cmd_new
= qmp_marshal_input_netdev_del
,
939 Remove host network device
.
943 - "id": the device
's ID, must be unique (json-string)
947 -> { "execute": "netdev_del", "arguments": { "id": "netdev1" } }
954 .name = "object-add",
955 .args_type = "qom-type:s,id:s,props:q?",
956 .mhandler.cmd_new = qmp_object_add,
967 - "qom-type": the object's QOM type
, i
.e
. the
class name (json
-string
)
968 - "id": the object
's ID, must be unique (json-string)
969 - "props": a dictionary of object property values (optional, json-dict)
973 -> { "execute": "object-add", "arguments": { "qom-type": "rng-random", "id": "rng1",
974 "props": { "filename": "/dev/hwrng" } } }
980 .name = "object-del",
982 .mhandler.cmd_new = qmp_marshal_input_object_del,
993 - "id": the object's
ID (json
-string
)
997 -> { "execute": "object-del", "arguments": { "id": "rng1" } }
1005 .name
= "block_resize",
1006 .args_type
= "device:s?,node-name:s?,size:o",
1007 .mhandler
.cmd_new
= qmp_marshal_input_block_resize
,
1014 Resize a block image
while a guest is running
.
1018 - "device": the device
's ID, must be unique (json-string)
1019 - "node-name": the node name in the block driver state graph (json-string)
1024 -> { "execute": "block_resize", "arguments": { "device": "scratch", "size": 1073741824 } }
1030 .name = "block-stream",
1031 .args_type = "device:B,base:s?,speed:o?,backing-file:s?,on-error:s?",
1032 .mhandler.cmd_new = qmp_marshal_input_block_stream,
1039 Copy data from a backing file into a block device.
1043 - "device": The device's ID
, must be
unique (json
-string
)
1044 - "base": The file name of the backing image above which copying starts
1045 (json
-string
, optional
)
1046 - "backing-file": The backing file string to write into the active layer
. This
1047 filename is not validated
.
1049 If a pathname string is such that it cannot be resolved by
1050 QEMU
, that means that subsequent QMP or HMP commands must use
1051 node
-names
for the image
in question
, as filename lookup
1054 If not specified
, QEMU will automatically determine the
1055 backing file string to use
, or error out
if there is no
1056 obvious choice
. Care should be taken when specifying the
1057 string
, to specify a valid filename or protocol
.
1058 (json
-string
, optional
) (Since
2.1)
1059 - "speed": the maximum speed
, in bytes per
second (json
-int
, optional
)
1060 - "on-error": the action to take on an
error (default 'report'). 'stop' and
1061 'enospc' can only be used
if the block device supports io
-status
.
1062 (json
-string
, optional
) (Since
2.1)
1066 -> { "execute": "block-stream", "arguments": { "device": "virtio0",
1067 "base": "/tmp/master.qcow2" } }
1073 .name
= "block-commit",
1074 .args_type
= "device:B,base:s?,top:s?,backing-file:s?,speed:o?",
1075 .mhandler
.cmd_new
= qmp_marshal_input_block_commit
,
1082 Live commit of data from overlay image nodes into backing nodes
- i
.e
., writes
1083 data between
'top' and
'base' into
'base'.
1087 - "device": The device
's ID, must be unique (json-string)
1088 - "base": The file name of the backing image to write data into.
1089 If not specified, this is the deepest backing image
1090 (json-string, optional)
1091 - "top": The file name of the backing image within the image chain,
1092 which contains the topmost data to be committed down. If
1093 not specified, this is the active layer. (json-string, optional)
1095 - backing-file: The backing file string to write into the overlay
1096 image of 'top
'. If 'top
' is the active layer,
1097 specifying a backing file string is an error. This
1098 filename is not validated.
1100 If a pathname string is such that it cannot be
1101 resolved by QEMU, that means that subsequent QMP or
1102 HMP commands must use node-names for the image in
1103 question, as filename lookup methods will fail.
1105 If not specified, QEMU will automatically determine
1106 the backing file string to use, or error out if
1107 there is no obvious choice. Care should be taken
1108 when specifying the string, to specify a valid
1109 filename or protocol.
1110 (json-string, optional) (Since 2.1)
1112 If top == base, that is an error.
1113 If top == active, the job will not be completed by itself,
1114 user needs to complete the job with the block-job-complete
1115 command after getting the ready event. (Since 2.0)
1117 If the base image is smaller than top, then the base image
1118 will be resized to be the same size as top. If top is
1119 smaller than the base image, the base will not be
1120 truncated. If you want the base image size to match the
1121 size of the smaller top, you can safely truncate it
1122 yourself once the commit operation successfully completes.
1124 - "speed": the maximum speed, in bytes per second (json-int, optional)
1129 -> { "execute": "block-commit", "arguments": { "device": "virtio0",
1130 "top": "/tmp/snap1.qcow2" } }
1136 .name = "drive-backup",
1137 .args_type = "sync:s,device:B,target:s,speed:i?,mode:s?,format:s?,"
1138 "bitmap:s?,on-source-error:s?,on-target-error:s?",
1139 .mhandler.cmd_new = qmp_marshal_input_drive_backup,
1146 Start a point-in-time copy of a block device to a new destination. The
1147 status of ongoing drive-backup operations can be checked with
1148 query-block-jobs where the BlockJobInfo.type field has the value 'backup
'.
1149 The operation can be stopped before it has completed using the
1150 block-job-cancel command.
1154 - "device": the name of the device which should be copied.
1156 - "target": the target of the new image. If the file exists, or if it is a
1157 device, the existing file/device will be used as the new
1158 destination. If it does not exist, a new file will be created.
1160 - "format": the format of the new destination, default is to probe if 'mode
' is
1161 'existing
', else the format of the source
1162 (json-string, optional)
1163 - "sync": what parts of the disk image should be copied to the destination;
1164 possibilities include "full" for all the disk, "top" for only the sectors
1165 allocated in the topmost image, "incremental" for only the dirty sectors in
1166 the bitmap, or "none" to only replicate new I/O (MirrorSyncMode).
1167 - "bitmap": dirty bitmap name for sync==incremental. Must be present if sync
1168 is "incremental", must NOT be present otherwise.
1169 - "mode": whether and how QEMU should create a new image
1170 (NewImageMode, optional, default 'absolute
-paths
')
1171 - "speed": the maximum speed, in bytes per second (json-int, optional)
1172 - "on-source-error": the action to take on an error on the source, default
1173 'report
'. 'stop
' and 'enospc
' can only be used
1174 if the block device supports io-status.
1175 (BlockdevOnError, optional)
1176 - "on-target-error": the action to take on an error on the target, default
1177 'report
' (no limitations, since this applies to
1178 a different block device than device).
1179 (BlockdevOnError, optional)
1182 -> { "execute": "drive-backup", "arguments": { "device": "drive0",
1184 "target": "backup.img" } }
1190 .name = "blockdev-backup",
1191 .args_type = "sync:s,device:B,target:B,speed:i?,"
1192 "on-source-error:s?,on-target-error:s?",
1193 .mhandler.cmd_new = qmp_marshal_input_blockdev_backup,
1200 The device version of drive-backup: this command takes an existing named device
1205 - "device": the name of the device which should be copied.
1207 - "target": the name of the backup target device. (json-string)
1208 - "sync": what parts of the disk image should be copied to the destination;
1209 possibilities include "full" for all the disk, "top" for only the
1210 sectors allocated in the topmost image, or "none" to only replicate
1211 new I/O (MirrorSyncMode).
1212 - "speed": the maximum speed, in bytes per second (json-int, optional)
1213 - "on-source-error": the action to take on an error on the source, default
1214 'report
'. 'stop
' and 'enospc
' can only be used
1215 if the block device supports io-status.
1216 (BlockdevOnError, optional)
1217 - "on-target-error": the action to take on an error on the target, default
1218 'report
' (no limitations, since this applies to
1219 a different block device than device).
1220 (BlockdevOnError, optional)
1223 -> { "execute": "blockdev-backup", "arguments": { "device": "src-id",
1225 "target": "tgt-id" } }
1231 .name = "block-job-set-speed",
1232 .args_type = "device:B,speed:o",
1233 .mhandler.cmd_new = qmp_marshal_input_block_job_set_speed,
1237 .name = "block-job-cancel",
1238 .args_type = "device:B,force:b?",
1239 .mhandler.cmd_new = qmp_marshal_input_block_job_cancel,
1242 .name = "block-job-pause",
1243 .args_type = "device:B",
1244 .mhandler.cmd_new = qmp_marshal_input_block_job_pause,
1247 .name = "block-job-resume",
1248 .args_type = "device:B",
1249 .mhandler.cmd_new = qmp_marshal_input_block_job_resume,
1252 .name = "block-job-complete",
1253 .args_type = "device:B",
1254 .mhandler.cmd_new = qmp_marshal_input_block_job_complete,
1257 .name = "transaction",
1258 .args_type = "actions:q",
1259 .mhandler.cmd_new = qmp_marshal_input_transaction,
1266 Atomically operate on one or more block devices. The only supported operations
1267 for now are drive-backup, internal and external snapshotting. A list of
1268 dictionaries is accepted, that contains the actions to be performed.
1269 If there is any failure performing any of the operations, all operations
1270 for the group are abandoned.
1272 For external snapshots, the dictionary contains the device, the file to use for
1273 the new snapshot, and the format. The default format, if not specified, is
1276 Each new snapshot defaults to being created by QEMU (wiping any
1277 contents if the file already exists), but it is also possible to reuse
1278 an externally-created file. In the latter case, you should ensure that
1279 the new image file has the same contents as the current one; QEMU cannot
1280 perform any meaningful check. Typically this is achieved by using the
1281 current image file as the backing file for the new image.
1283 On failure, the original disks pre-snapshot attempt will be used.
1285 For internal snapshots, the dictionary contains the device and the snapshot's
1286 name
. If an internal snapshot matching name already exists
, the request will
1287 be rejected
. Only some image formats support it
, for example
, qcow2
, rbd
,
1290 On failure
, qemu will
try delete the newly created internal snapshot
in the
1291 transaction
. When an I
/O error occurs during deletion
, the user needs to fix
1292 it later with qemu
-img or other command
.
1297 - "type": the operation to perform
. The only supported
1298 value is
"blockdev-snapshot-sync". (json
-string
)
1299 - "data": a dictionary
. The contents depend on the value
1300 of
"type". When
"type" is
"blockdev-snapshot-sync":
1301 - "device": device name to
snapshot (json
-string
)
1302 - "node-name": graph node name to
snapshot (json
-string
)
1303 - "snapshot-file": name of
new image
file (json
-string
)
1304 - "snapshot-node-name": graph node name of the
new snapshot (json
-string
)
1305 - "format": format of
new image (json
-string
, optional
)
1306 - "mode": whether and how QEMU should create the snapshot file
1307 (NewImageMode
, optional
, default "absolute-paths")
1308 When
"type" is
"blockdev-snapshot-internal-sync":
1309 - "device": device name to
snapshot (json
-string
)
1310 - "name": name of the
new snapshot (json
-string
)
1314 -> { "execute": "transaction",
1315 "arguments": { "actions": [
1316 { "type": "blockdev-snapshot-sync", "data" : { "device": "ide-hd0",
1317 "snapshot-file": "/some/place/my-image",
1318 "format": "qcow2" } },
1319 { "type": "blockdev-snapshot-sync", "data" : { "node-name": "myfile",
1320 "snapshot-file": "/some/place/my-image2",
1321 "snapshot-node-name": "node3432",
1323 "format": "qcow2" } },
1324 { "type": "blockdev-snapshot-sync", "data" : { "device": "ide-hd1",
1325 "snapshot-file": "/some/place/my-image2",
1327 "format": "qcow2" } },
1328 { "type": "blockdev-snapshot-internal-sync", "data" : {
1329 "device": "ide-hd2",
1330 "name": "snapshot0" } } ] } }
1336 .name
= "block-dirty-bitmap-add",
1337 .args_type
= "node:B,name:s,granularity:i?",
1338 .mhandler
.cmd_new
= qmp_marshal_input_block_dirty_bitmap_add
,
1343 block
-dirty
-bitmap
-add
1344 ----------------------
1347 Create a dirty bitmap with a name on the device
, and start tracking the writes
.
1351 - "node": device
/node on which to create dirty
bitmap (json
-string
)
1352 - "name": name of the
new dirty
bitmap (json
-string
)
1353 - "granularity": granularity to track writes
with (int
, optional
)
1357 -> { "execute": "block-dirty-bitmap-add", "arguments": { "node": "drive0",
1358 "name": "bitmap0" } }
1364 .name
= "block-dirty-bitmap-remove",
1365 .args_type
= "node:B,name:s",
1366 .mhandler
.cmd_new
= qmp_marshal_input_block_dirty_bitmap_remove
,
1371 block
-dirty
-bitmap
-remove
1372 -------------------------
1375 Stop write tracking and remove the dirty bitmap that was created with
1376 block
-dirty
-bitmap
-add
.
1380 - "node": device
/node on which to remove dirty
bitmap (json
-string
)
1381 - "name": name of the dirty bitmap to
remove (json
-string
)
1385 -> { "execute": "block-dirty-bitmap-remove", "arguments": { "node": "drive0",
1386 "name": "bitmap0" } }
1392 .name
= "block-dirty-bitmap-clear",
1393 .args_type
= "node:B,name:s",
1394 .mhandler
.cmd_new
= qmp_marshal_input_block_dirty_bitmap_clear
,
1399 block
-dirty
-bitmap
-clear
1400 ------------------------
1403 Reset the dirty bitmap associated with a node so that an incremental backup
1404 from
this point
in time forward will only backup clusters modified after
this
1409 - "node": device
/node on which to remove dirty
bitmap (json
-string
)
1410 - "name": name of the dirty bitmap to
remove (json
-string
)
1414 -> { "execute": "block-dirty-bitmap-clear", "arguments": { "node": "drive0",
1415 "name": "bitmap0" } }
1421 .name
= "blockdev-snapshot-sync",
1422 .args_type
= "device:s?,node-name:s?,snapshot-file:s,snapshot-node-name:s?,format:s?,mode:s?",
1423 .mhandler
.cmd_new
= qmp_marshal_input_blockdev_snapshot_sync
,
1427 blockdev
-snapshot
-sync
1428 ----------------------
1430 Synchronous snapshot of a block device
. snapshot
-file specifies the
1431 target of the
new image
. If the file exists
, or
if it is a device
, the
1432 snapshot will be created
in the existing file
/device
. If does not
1433 exist
, a
new file will be created
. format specifies the format of the
1434 snapshot image
, default is qcow2
.
1438 - "device": device name to
snapshot (json
-string
)
1439 - "node-name": graph node name to
snapshot (json
-string
)
1440 - "snapshot-file": name of
new image
file (json
-string
)
1441 - "snapshot-node-name": graph node name of the
new snapshot (json
-string
)
1442 - "mode": whether and how QEMU should create the snapshot file
1443 (NewImageMode
, optional
, default "absolute-paths")
1444 - "format": format of
new image (json
-string
, optional
)
1448 -> { "execute": "blockdev-snapshot-sync", "arguments": { "device": "ide-hd0",
1450 "/some/place/my-image",
1451 "format": "qcow2" } }
1457 .name
= "blockdev-snapshot-internal-sync",
1458 .args_type
= "device:B,name:s",
1459 .mhandler
.cmd_new
= qmp_marshal_input_blockdev_snapshot_internal_sync
,
1463 blockdev
-snapshot
-internal
-sync
1464 -------------------------------
1466 Synchronously take an internal snapshot of a block device when the format of
1467 image used supports it
. If the name is an empty string
, or a snapshot with
1468 name already exists
, the operation will fail
.
1472 - "device": device name to
snapshot (json
-string
)
1473 - "name": name of the
new snapshot (json
-string
)
1477 -> { "execute": "blockdev-snapshot-internal-sync",
1478 "arguments": { "device": "ide-hd0",
1479 "name": "snapshot0" }
1486 .name
= "blockdev-snapshot-delete-internal-sync",
1487 .args_type
= "device:B,id:s?,name:s?",
1489 qmp_marshal_input_blockdev_snapshot_delete_internal_sync
,
1493 blockdev
-snapshot
-delete
-internal
-sync
1494 --------------------------------------
1496 Synchronously delete an internal snapshot of a block device when the format of
1497 image used supports it
. The snapshot is identified by name or id or both
. One
1498 of name or id is required
. If the snapshot is not found
, the operation will
1503 - "device": device
name (json
-string
)
1504 - "id": ID of the
snapshot (json
-string
, optional
)
1505 - "name": name of the
snapshot (json
-string
, optional
)
1509 -> { "execute": "blockdev-snapshot-delete-internal-sync",
1510 "arguments": { "device": "ide-hd0",
1511 "name": "snapshot0" }
1515 "name": "snapshot0",
1517 "date-sec": 1000012,
1519 "vm-clock-sec": 100,
1527 .name
= "drive-mirror",
1528 .args_type
= "sync:s,device:B,target:s,speed:i?,mode:s?,format:s?,"
1529 "node-name:s?,replaces:s?,"
1530 "on-source-error:s?,on-target-error:s?,"
1532 "granularity:i?,buf-size:i?",
1533 .mhandler
.cmd_new
= qmp_marshal_input_drive_mirror
,
1540 Start mirroring a block device
's writes to a new destination. target
1541 specifies the target of the new image. If the file exists, or if it is
1542 a device, it will be used as the new destination for writes. If it does not
1543 exist, a new file will be created. format specifies the format of the
1544 mirror image, default is to probe if mode='existing
', else the format
1549 - "device": device name to operate on (json-string)
1550 - "target": name of new image file (json-string)
1551 - "format": format of new image (json-string, optional)
1552 - "node-name": the name of the new block driver state in the node graph
1553 (json-string, optional)
1554 - "replaces": the block driver node name to replace when finished
1555 (json-string, optional)
1556 - "mode": how an image file should be created into the target
1557 file/device (NewImageMode, optional, default 'absolute
-paths
')
1558 - "speed": maximum speed of the streaming job, in bytes per second
1560 - "granularity": granularity of the dirty bitmap, in bytes (json-int, optional)
1561 - "buf_size": maximum amount of data in flight from source to target, in bytes
1562 (json-int, default 10M)
1563 - "sync": what parts of the disk image should be copied to the destination;
1564 possibilities include "full" for all the disk, "top" for only the sectors
1565 allocated in the topmost image, or "none" to only replicate new I/O
1567 - "on-source-error": the action to take on an error on the source
1568 (BlockdevOnError, default 'report
')
1569 - "on-target-error": the action to take on an error on the target
1570 (BlockdevOnError, default 'report
')
1571 - "unmap": whether the target sectors should be discarded where source has only
1572 zeroes. (json-bool, optional, default true)
1574 The default value of the granularity is the image cluster size clamped
1575 between 4096 and 65536, if the image format defines one. If the format
1576 does not define a cluster size, the default value of the granularity
1582 -> { "execute": "drive-mirror", "arguments": { "device": "ide-hd0",
1583 "target": "/some/place/my-image",
1585 "format": "qcow2" } }
1591 .name = "change-backing-file",
1592 .args_type = "device:s,image-node-name:s,backing-file:s",
1593 .mhandler.cmd_new = qmp_marshal_input_change_backing_file,
1601 Change the backing file in the image file metadata. This does not cause
1602 QEMU to reopen the image file to reparse the backing filename (it may,
1603 however, perform a reopen to change permissions from r/o -> r/w -> r/o,
1604 if needed). The new backing file string is written into the image file
1605 metadata, and the QEMU internal strings are updated.
1609 - "image-node-name": The name of the block driver state node of the
1610 image to modify. The "device" is argument is used to
1611 verify "image-node-name" is in the chain described by
1613 (json-string, optional)
1615 - "device": The name of the device.
1618 - "backing-file": The string to write as the backing file. This string is
1619 not validated, so care should be taken when specifying
1620 the string or the image chain may not be able to be
1624 Returns: Nothing on success
1625 If "device" does not exist or cannot be determined, DeviceNotFound
1631 .args_type = "value:M",
1632 .mhandler.cmd_new = qmp_marshal_input_balloon,
1639 Request VM to change its memory allocation (in bytes).
1643 - "value": New memory allocation (json-int)
1647 -> { "execute": "balloon", "arguments": { "value": 536870912 } }
1654 .args_type = "name:s,up:b",
1655 .mhandler.cmd_new = qmp_marshal_input_set_link,
1662 Change the link status of a network adapter.
1666 - "name": network device name (json-string)
1667 - "up": status is up (json-bool)
1671 -> { "execute": "set_link", "arguments": { "name": "e1000.0", "up": false } }
1678 .args_type = "fdname:s",
1679 .params = "getfd name",
1680 .help = "receive a file descriptor via SCM rights and assign it a name",
1681 .mhandler.cmd_new = qmp_marshal_input_getfd,
1688 Receive a file descriptor via SCM rights and assign it a name.
1692 - "fdname": file descriptor name (json-string)
1696 -> { "execute": "getfd", "arguments": { "fdname": "fd1" } }
1701 (1) If the name specified by the "fdname" argument already exists,
1702 the file descriptor assigned to it will be closed and replaced
1703 by the received file descriptor.
1704 (2) The 'closefd
' command can be used to explicitly close the file
1705 descriptor when it is no longer needed.
1711 .args_type = "fdname:s",
1712 .params = "closefd name",
1713 .help = "close a file descriptor previously passed via SCM rights",
1714 .mhandler.cmd_new = qmp_marshal_input_closefd,
1721 Close a file descriptor previously passed via SCM rights.
1725 - "fdname": file descriptor name (json-string)
1729 -> { "execute": "closefd", "arguments": { "fdname": "fd1" } }
1736 .args_type = "fdset-id:i?,opaque:s?",
1737 .params = "add-fd fdset-id opaque",
1738 .help = "Add a file descriptor, that was passed via SCM rights, to an fd set",
1739 .mhandler.cmd_new = qmp_marshal_input_add_fd,
1746 Add a file descriptor, that was passed via SCM rights, to an fd set.
1750 - "fdset-id": The ID of the fd set to add the file descriptor to.
1751 (json-int, optional)
1752 - "opaque": A free-form string that can be used to describe the fd.
1753 (json-string, optional)
1755 Return a json-object with the following information:
1757 - "fdset-id": The ID of the fd set that the fd was added to. (json-int)
1758 - "fd": The file descriptor that was received via SCM rights and added to the
1763 -> { "execute": "add-fd", "arguments": { "fdset-id": 1 } }
1764 <- { "return": { "fdset-id": 1, "fd": 3 } }
1768 (1) The list of fd sets is shared by all monitor connections.
1769 (2) If "fdset-id" is not specified, a new fd set will be created.
1774 .name = "remove-fd",
1775 .args_type = "fdset-id:i,fd:i?",
1776 .params = "remove-fd fdset-id fd",
1777 .help = "Remove a file descriptor from an fd set",
1778 .mhandler.cmd_new = qmp_marshal_input_remove_fd,
1785 Remove a file descriptor from an fd set.
1789 - "fdset-id": The ID of the fd set that the file descriptor belongs to.
1791 - "fd": The file descriptor that is to be removed. (json-int, optional)
1795 -> { "execute": "remove-fd", "arguments": { "fdset-id": 1, "fd": 3 } }
1800 (1) The list of fd sets is shared by all monitor connections.
1801 (2) If "fd" is not specified, all file descriptors in "fdset-id" will be
1807 .name = "query-fdsets",
1809 .help = "Return information describing all fd sets",
1810 .mhandler.cmd_new = qmp_marshal_input_query_fdsets,
1817 Return information describing all fd sets.
1823 -> { "execute": "query-fdsets" }
1829 "opaque": "rdonly:/path/to/file"
1833 "opaque": "rdwr:/path/to/file"
1852 Note: The list of fd sets is shared by all monitor connections.
1857 .name = "block_passwd",
1858 .args_type = "device:s?,node-name:s?,password:s",
1859 .mhandler.cmd_new = qmp_marshal_input_block_passwd,
1866 Set the password of encrypted block devices.
1870 - "device": device name (json-string)
1871 - "node-name": name in the block driver state graph (json-string)
1872 - "password": password (json-string)
1876 -> { "execute": "block_passwd", "arguments": { "device": "ide0-hd0",
1877 "password": "12345" } }
1883 .name = "block_set_io_throttle",
1884 .args_type = "device:B,bps:l,bps_rd:l,bps_wr:l,iops:l,iops_rd:l,iops_wr:l,bps_max:l?,bps_rd_max:l?,bps_wr_max:l?,iops_max:l?,iops_rd_max:l?,iops_wr_max:l?,iops_size:l?,group:s?",
1885 .mhandler.cmd_new = qmp_marshal_input_block_set_io_throttle,
1889 block_set_io_throttle
1892 Change I/O throttle limits for a block drive.
1896 - "device": device name (json-string)
1897 - "bps": total throughput limit in bytes per second (json-int)
1898 - "bps_rd": read throughput limit in bytes per second (json-int)
1899 - "bps_wr": write throughput limit in bytes per second (json-int)
1900 - "iops": total I/O operations per second (json-int)
1901 - "iops_rd": read I/O operations per second (json-int)
1902 - "iops_wr": write I/O operations per second (json-int)
1903 - "bps_max": total max in bytes (json-int)
1904 - "bps_rd_max": read max in bytes (json-int)
1905 - "bps_wr_max": write max in bytes (json-int)
1906 - "iops_max": total I/O operations max (json-int)
1907 - "iops_rd_max": read I/O operations max (json-int)
1908 - "iops_wr_max": write I/O operations max (json-int)
1909 - "iops_size": I/O size in bytes when limiting (json-int)
1910 - "group": throttle group name (json-string)
1914 -> { "execute": "block_set_io_throttle", "arguments": { "device": "virtio0",
1933 .name = "set_password",
1934 .args_type = "protocol:s,password:s,connected:s?",
1935 .mhandler.cmd_new = qmp_marshal_input_set_password,
1942 Set the password for vnc/spice protocols.
1946 - "protocol": protocol name (json-string)
1947 - "password": password (json-string)
1948 - "connected": [ keep | disconnect | fail ] (json-string, optional)
1952 -> { "execute": "set_password", "arguments": { "protocol": "vnc",
1953 "password": "secret" } }
1959 .name = "expire_password",
1960 .args_type = "protocol:s,time:s",
1961 .mhandler.cmd_new = qmp_marshal_input_expire_password,
1968 Set the password expire time for vnc/spice protocols.
1972 - "protocol": protocol name (json-string)
1973 - "time": [ now | never | +secs | secs ] (json-string)
1977 -> { "execute": "expire_password", "arguments": { "protocol": "vnc",
1984 .name = "add_client",
1985 .args_type = "protocol:s,fdname:s,skipauth:b?,tls:b?",
1986 .mhandler.cmd_new = qmp_marshal_input_add_client,
1993 Add a graphics client
1997 - "protocol": protocol name (json-string)
1998 - "fdname": file descriptor name (json-string)
1999 - "skipauth": whether to skip authentication (json-bool, optional)
2000 - "tls": whether to perform TLS (json-bool, optional)
2004 -> { "execute": "add_client", "arguments": { "protocol": "vnc",
2005 "fdname": "myclient" } }
2010 .name = "qmp_capabilities",
2013 .help = "enable QMP capabilities",
2014 .mhandler.cmd_new = qmp_capabilities,
2021 Enable QMP capabilities.
2027 -> { "execute": "qmp_capabilities" }
2030 Note: This command must be issued before issuing any other command.
2035 .name = "human-monitor-command",
2036 .args_type = "command-line:s,cpu-index:i?",
2037 .mhandler.cmd_new = qmp_marshal_input_human_monitor_command,
2041 human-monitor-command
2042 ---------------------
2044 Execute a Human Monitor command.
2048 - command-line: the command name and its arguments, just like the
2049 Human Monitor's
shell (json
-string
)
2050 - cpu
-index
: select the CPU number to be used by commands which access CPU
2051 data
, like
'info registers'. The Monitor selects CPU
0 if this
2052 argument is not
provided (json
-int
, optional
)
2056 -> { "execute": "human-monitor-command", "arguments": { "command-line": "info kvm" } }
2057 <- { "return": "kvm support: enabled\r\n" }
2061 (1) The Human Monitor is NOT an stable
interface, this means that command
2062 names
, arguments and responses can change or be removed at ANY time
.
2063 Applications that rely on long term stability guarantees should NOT
2068 o This command is stateless
, this means that commands that depend
2069 on state
information (such as getfd
) might not work
2071 o Commands that prompt the user
for data (eg
. 'cont' when the block
2072 device is encrypted
) don
't currently work
2077 HXCOMM Each query command below is inside a SQMP/EQMP section, do NOT change
2078 HXCOMM this! We will possibly move query commands definitions inside those
2079 HXCOMM sections, just like regular commands.
2089 Return a json-object with the following information:
2091 - "qemu": A json-object containing three integer values:
2092 - "major": QEMU's major
version (json
-int
)
2093 - "minor": QEMU
's minor version (json-int)
2094 - "micro": QEMU's micro
version (json
-int
)
2095 - "package": package's version (json-string)
2099 -> { "execute": "query-version" }
2114 .name = "query-version",
2116 .mhandler.cmd_new = qmp_marshal_input_query_version,
2123 List QMP available commands.
2125 Each command is represented by a json-object, the returned value is a json-array
2128 Each json-object contain:
2130 - "name": command's
name (json
-string
)
2134 -> { "execute": "query-commands" }
2138 "name":"query-balloon"
2141 "name":"system_powerdown"
2146 Note
: This example has been shortened as the real response is too long
.
2151 .name
= "query-commands",
2153 .mhandler
.cmd_new
= qmp_marshal_input_query_commands
,
2160 List QMP available events
.
2162 Each event is represented by a json
-object
, the returned value is a json
-array
2165 Each json
-object contains
:
2167 - "name": event
's name (json-string)
2171 -> { "execute": "query-events" }
2183 Note: This example has been shortened as the real response is too long.
2188 .name = "query-events",
2190 .mhandler.cmd_new = qmp_marshal_input_query_events,
2197 Each device is represented by a json-object. The returned value is a json-array
2200 Each json-object contain the following:
2202 - "label": device's
label (json
-string
)
2203 - "filename": device
's file (json-string)
2204 - "frontend-open": open/closed state of the frontend device attached to this
2209 -> { "execute": "query-chardev" }
2213 "label": "charchannel0",
2214 "filename": "unix:/var/lib/libvirt/qemu/seabios.rhel6.agent,server",
2215 "frontend-open": false
2218 "label": "charmonitor",
2219 "filename": "unix:/var/lib/libvirt/qemu/seabios.rhel6.monitor,server",
2220 "frontend-open": true
2223 "label": "charserial0",
2224 "filename": "pty:/dev/pts/2",
2225 "frontend-open": true
2233 .name = "query-chardev",
2235 .mhandler.cmd_new = qmp_marshal_input_query_chardev,
2239 query-chardev-backends
2242 List available character device backends.
2244 Each backend is represented by a json-object, the returned value is a json-array
2247 Each json-object contains:
2249 - "name": backend name (json-string)
2253 -> { "execute": "query-chardev-backends" }
2274 .name = "query-chardev-backends",
2276 .mhandler.cmd_new = qmp_marshal_input_query_chardev_backends,
2283 Show the block devices.
2285 Each block device information is stored in a json-object and the returned value
2286 is a json-array of all devices.
2288 Each json-object contain the following:
2290 - "device": device name (json-string)
2291 - "type": device type (json-string)
2292 - deprecated, retained for backward compatibility
2293 - Possible values: "unknown"
2294 - "removable": true if the device is removable, false otherwise (json-bool)
2295 - "locked": true if the device is locked, false otherwise (json-bool)
2296 - "tray_open": only present if removable, true if the device has a tray,
2297 and it is open (json-bool)
2298 - "inserted": only present if the device is inserted, it is a json-object
2299 containing the following:
2300 - "file": device file name (json-string)
2301 - "ro": true if read-only, false otherwise (json-bool)
2302 - "drv": driver format name (json-string)
2303 - Possible values: "blkdebug", "bochs", "cloop", "dmg",
2304 "file", "file", "ftp", "ftps", "host_cdrom",
2305 "host_device", "http", "https",
2306 "nbd", "parallels", "qcow", "qcow2", "raw",
2307 "tftp", "vdi", "vmdk", "vpc", "vvfat"
2308 - "backing_file": backing file name (json-string, optional)
2309 - "backing_file_depth": number of files in the backing file chain (json-int)
2310 - "encrypted": true if encrypted, false otherwise (json-bool)
2311 - "bps": limit total bytes per second (json-int)
2312 - "bps_rd": limit read bytes per second (json-int)
2313 - "bps_wr": limit write bytes per second (json-int)
2314 - "iops": limit total I/O operations per second (json-int)
2315 - "iops_rd": limit read operations per second (json-int)
2316 - "iops_wr": limit write operations per second (json-int)
2317 - "bps_max": total max in bytes (json-int)
2318 - "bps_rd_max": read max in bytes (json-int)
2319 - "bps_wr_max": write max in bytes (json-int)
2320 - "iops_max": total I/O operations max (json-int)
2321 - "iops_rd_max": read I/O operations max (json-int)
2322 - "iops_wr_max": write I/O operations max (json-int)
2323 - "iops_size": I/O size when limiting by iops (json-int)
2324 - "detect_zeroes": detect and optimize zero writing (json-string)
2325 - Possible values: "off", "on", "unmap"
2326 - "write_threshold": write offset threshold in bytes, a event will be
2327 emitted if crossed. Zero if disabled (json-int)
2328 - "image": the detail of the image, it is a json-object containing
2330 - "filename": image file name (json-string)
2331 - "format": image format (json-string)
2332 - "virtual-size": image capacity in bytes (json-int)
2333 - "dirty-flag": true if image is not cleanly closed, not present
2334 means clean (json-bool, optional)
2335 - "actual-size": actual size on disk in bytes of the image, not
2336 present when image does not support thin
2337 provision (json-int, optional)
2338 - "cluster-size": size of a cluster in bytes, not present if image
2339 format does not support it (json-int, optional)
2340 - "encrypted": true if the image is encrypted, not present means
2341 false or the image format does not support
2342 encryption (json-bool, optional)
2343 - "backing_file": backing file name, not present means no backing
2344 file is used or the image format does not
2345 support backing file chain
2346 (json-string, optional)
2347 - "full-backing-filename": full path of the backing file, not
2348 present if it equals backing_file or no
2349 backing file is used
2350 (json-string, optional)
2351 - "backing-filename-format": the format of the backing file, not
2352 present means unknown or no backing
2353 file (json-string, optional)
2354 - "snapshots": the internal snapshot info, it is an optional list
2355 of json-object containing the following:
2356 - "id": unique snapshot id (json-string)
2357 - "name": snapshot name (json-string)
2358 - "vm-state-size": size of the VM state in bytes (json-int)
2359 - "date-sec": UTC date of the snapshot in seconds (json-int)
2360 - "date-nsec": fractional part in nanoseconds to be used with
2362 - "vm-clock-sec": VM clock relative to boot in seconds
2364 - "vm-clock-nsec": fractional part in nanoseconds to be used
2365 with vm-clock-sec (json-int)
2366 - "backing-image": the detail of the backing image, it is an
2367 optional json-object only present when a
2368 backing image present for this image
2370 - "io-status": I/O operation status, only present if the device supports it
2371 and the VM is configured to stop on errors. It's always reset
2372 to
"ok" when the
"cont" command is
issued (json_string
, optional
)
2373 - Possible values
: "ok", "failed", "nospace"
2377 -> { "execute": "query-block" }
2382 "device":"ide0-hd0",
2389 "file":"disks/test.qcow2",
2390 "backing_file_depth":1,
2404 "detect_zeroes": "on",
2405 "write_threshold": 0,
2407 "filename":"disks/test.qcow2",
2409 "virtual-size":2048000,
2410 "backing_file":"base.qcow2",
2411 "full-backing-filename":"disks/base.qcow2",
2412 "backing-filename-format":"qcow2",
2416 "name": "snapshot1",
2418 "date-sec": 10000200,
2420 "vm-clock-sec": 206,
2425 "filename":"disks/base.qcow2",
2427 "virtual-size":2048000
2435 "device":"ide1-cd0",
2458 .name
= "query-block",
2460 .mhandler
.cmd_new
= qmp_marshal_input_query_block
,
2467 Show block device statistics
.
2469 Each device statistic information is stored
in a json
-object and the returned
2470 value is a json
-array of all devices
.
2472 Each json
-object contain the following
:
2474 - "device": device
name (json
-string
)
2475 - "stats": A json
-object with the statistics information
, it contains
:
2476 - "rd_bytes": bytes
read (json
-int
)
2477 - "wr_bytes": bytes
written (json
-int
)
2478 - "rd_operations": read
operations (json
-int
)
2479 - "wr_operations": write
operations (json
-int
)
2480 - "flush_operations": cache flush
operations (json
-int
)
2481 - "wr_total_time_ns": total time spend on writes
in nano
-seconds (json
-int
)
2482 - "rd_total_time_ns": total time spend on reads
in nano
-seconds (json
-int
)
2483 - "flush_total_time_ns": total time spend on cache flushes
in nano
-seconds (json
-int
)
2484 - "wr_highest_offset": Highest offset of a sector written since the
2485 BlockDriverState has been
opened (json
-int
)
2486 - "rd_merged": number of read requests that have been merged into
2487 another
request (json
-int
)
2488 - "wr_merged": number of write requests that have been merged into
2489 another
request (json
-int
)
2490 - "parent": Contains recursively the statistics of the underlying
2491 protocol (e
.g
. the host file
for a qcow2 image
). If there is
2492 no underlying protocol
, this field is omitted
2493 (json
-object
, optional
)
2497 -> { "execute": "query-blockstats" }
2501 "device":"ide0-hd0",
2504 "wr_highest_offset":3686448128,
2506 "wr_operations":751,
2507 "rd_bytes":122567168,
2508 "rd_operations":36772
2509 "wr_total_times_ns":313253456
2510 "rd_total_times_ns":3465673657
2511 "flush_total_times_ns":49653
2512 "flush_operations":61,
2518 "wr_highest_offset":2821110784,
2520 "wr_operations":692,
2521 "rd_bytes":122739200,
2522 "rd_operations":36604
2523 "flush_operations":51,
2524 "wr_total_times_ns":313253456
2525 "rd_total_times_ns":3465673657
2526 "flush_total_times_ns":49653,
2532 "device":"ide1-cd0",
2534 "wr_highest_offset":0,
2539 "flush_operations":0,
2540 "wr_total_times_ns":0
2541 "rd_total_times_ns":0
2542 "flush_total_times_ns":0,
2550 "wr_highest_offset":0,
2555 "flush_operations":0,
2556 "wr_total_times_ns":0
2557 "rd_total_times_ns":0
2558 "flush_total_times_ns":0,
2566 "wr_highest_offset":0,
2571 "flush_operations":0,
2572 "wr_total_times_ns":0
2573 "rd_total_times_ns":0
2574 "flush_total_times_ns":0,
2585 .name
= "query-blockstats",
2586 .args_type
= "query-nodes:b?",
2587 .mhandler
.cmd_new
= qmp_marshal_input_query_blockstats
,
2594 Show CPU information
.
2596 Return a json
-array
. Each CPU is represented by a json
-object
, which contains
:
2598 - "CPU": CPU
index (json
-int
)
2599 - "current": true if this is the current CPU
, false otherwise (json
-bool
)
2600 - "halted": true if the cpu is halted
, false otherwise (json
-bool
)
2601 - "qom_path": path to the CPU object
in the QOM
tree (json
-str
)
2602 - Current program counter
. The key
's name depends on the architecture:
2603 "pc": i386/x86_64 (json-int)
2604 "nip": PPC (json-int)
2605 "pc" and "npc": sparc (json-int)
2606 "PC": mips (json-int)
2607 - "thread_id": ID of the underlying host thread (json-int)
2611 -> { "execute": "query-cpus" }
2618 "qom_path":"/machine/unattached/device[0]",
2626 "qom_path":"/machine/unattached/device[2]",
2636 .name = "query-cpus",
2638 .mhandler.cmd_new = qmp_marshal_input_query_cpus,
2645 Returns a list of information about each iothread.
2647 Note this list excludes the QEMU main loop thread, which is not declared
2648 using the -object iothread command-line option. It is always the main thread
2651 Return a json-array. Each iothread is represented by a json-object, which contains:
2653 - "id": name of iothread (json-str)
2654 - "thread-id": ID of the underlying host thread (json-int)
2658 -> { "execute": "query-iothreads" }
2675 .name = "query-iothreads",
2677 .mhandler.cmd_new = qmp_marshal_input_query_iothreads,
2684 PCI buses and devices information.
2686 The returned value is a json-array of all buses. Each bus is represented by
2687 a json-object, which has a key with a json-array of all PCI devices attached
2688 to it. Each device is represented by a json-object.
2690 The bus json-object contains the following:
2692 - "bus": bus number (json-int)
2693 - "devices": a json-array of json-objects, each json-object represents a
2696 The PCI device json-object contains the following:
2698 - "bus": identical to the parent's bus
number (json
-int
)
2699 - "slot": slot
number (json
-int
)
2700 - "function": function number (json
-int
)
2701 - "class_info": a json
-object containing
:
2702 - "desc": device
class description (json
-string
, optional
)
2703 - "class": device
class number (json
-int
)
2704 - "id": a json
-object containing
:
2705 - "device": device
ID (json
-int
)
2706 - "vendor": vendor
ID (json
-int
)
2707 - "irq": device
's IRQ if assigned (json-int, optional)
2708 - "qdev_id": qdev id string (json-string)
2709 - "pci_bridge": It's a json
-object
, only present
if this device is a
2710 PCI bridge
, contains
:
2711 - "bus": bus
number (json
-int
)
2712 - "secondary": secondary bus
number (json
-int
)
2713 - "subordinate": subordinate bus
number (json
-int
)
2714 - "io_range": I
/O memory range information
, a json
-object with the
2716 - "base": base address
, in bytes (json
-int
)
2717 - "limit": limit address
, in bytes (json
-int
)
2718 - "memory_range": memory range information
, a json
-object with the
2720 - "base": base address
, in bytes (json
-int
)
2721 - "limit": limit address
, in bytes (json
-int
)
2722 - "prefetchable_range": Prefetchable memory range information
, a
2723 json
-object with the following members
:
2724 - "base": base address
, in bytes (json
-int
)
2725 - "limit": limit address
, in bytes (json
-int
)
2726 - "devices": a json
-array of PCI devices
if there
's any attached, each
2727 each element is represented by a json-object, which contains
2728 the same members of the 'PCI device json
-object
' described
2730 - "regions": a json-array of json-objects, each json-object represents a
2731 memory region of this device
2733 The memory range json-object contains the following:
2735 - "base": base memory address (json-int)
2736 - "limit": limit value (json-int)
2738 The region json-object can be an I/O region or a memory region, an I/O region
2739 json-object contains the following:
2741 - "type": "io" (json-string, fixed)
2742 - "bar": BAR number (json-int)
2743 - "address": memory address (json-int)
2744 - "size": memory size (json-int)
2746 A memory region json-object contains the following:
2748 - "type": "memory" (json-string, fixed)
2749 - "bar": BAR number (json-int)
2750 - "address": memory address (json-int)
2751 - "size": memory size (json-int)
2752 - "mem_type_64": true or false (json-bool)
2753 - "prefetch": true or false (json-bool)
2757 -> { "execute": "query-pci" }
2769 "desc":"Host bridge"
2803 "desc":"IDE controller"
2825 "desc":"VGA controller"
2835 "mem_type_64":false,
2838 "address":4026531840,
2843 "mem_type_64":false,
2846 "address":4060086272,
2851 "mem_type_64":false,
2866 "desc":"RAM controller"
2887 Note: This example has been shortened as the real response is too long.
2892 .name = "query-pci",
2894 .mhandler.cmd_new = qmp_marshal_input_query_pci,
2901 Show KVM information.
2903 Return a json-object with the following information:
2905 - "enabled": true if KVM support is enabled, false otherwise (json-bool)
2906 - "present": true if QEMU has KVM support, false otherwise (json-bool)
2910 -> { "execute": "query-kvm" }
2911 <- { "return": { "enabled": true, "present": true } }
2916 .name = "query-kvm",
2918 .mhandler.cmd_new = qmp_marshal_input_query_kvm,
2925 Return a json-object with the following information:
2927 - "running": true if the VM is running, or false if it is paused (json-bool)
2928 - "singlestep": true if the VM is in single step mode,
2929 false otherwise (json-bool)
2930 - "status": one of the following values (json-string)
2931 "debug" - QEMU is running on a debugger
2932 "inmigrate" - guest is paused waiting for an incoming migration
2933 "internal-error" - An internal error that prevents further guest
2934 execution has occurred
2935 "io-error" - the last IOP has failed and the device is configured
2936 to pause on I/O errors
2937 "paused" - guest has been paused via the 'stop
' command
2938 "postmigrate" - guest is paused following a successful 'migrate
'
2939 "prelaunch" - QEMU was started with -S and guest has not started
2940 "finish-migrate" - guest is paused to finish the migration process
2941 "restore-vm" - guest is paused to restore VM state
2942 "running" - guest is actively running
2943 "save-vm" - guest is paused to save the VM state
2944 "shutdown" - guest is shut down (and -no-shutdown is in use)
2945 "watchdog" - the watchdog action is configured to pause and
2950 -> { "execute": "query-status" }
2951 <- { "return": { "running": true, "singlestep": false, "status": "running" } }
2956 .name = "query-status",
2958 .mhandler.cmd_new = qmp_marshal_input_query_status,
2965 Show VM mice information.
2967 Each mouse is represented by a json-object, the returned value is a json-array
2970 The mouse json-object contains the following:
2972 - "name": mouse's
name (json
-string
)
2973 - "index": mouse
's index (json-int)
2974 - "current": true if this mouse is receiving events, false otherwise (json-bool)
2975 - "absolute": true if the mouse generates absolute input events (json-bool)
2979 -> { "execute": "query-mice" }
2983 "name":"QEMU Microsoft Mouse",
2989 "name":"QEMU PS/2 Mouse",
3000 .name = "query-mice",
3002 .mhandler.cmd_new = qmp_marshal_input_query_mice,
3009 Show VNC server information.
3011 Return a json-object with server information. Connected clients are returned
3012 as a json-array of json-objects.
3014 The main json-object contains the following:
3016 - "enabled": true or false (json-bool)
3017 - "host": server's IP
address (json
-string
)
3018 - "family": address
family (json
-string
)
3019 - Possible values
: "ipv4", "ipv6", "unix", "unknown"
3020 - "service": server
's port number (json-string)
3021 - "auth": authentication method (json-string)
3022 - Possible values: "invalid", "none", "ra2", "ra2ne", "sasl", "tight",
3023 "tls", "ultra", "unknown", "vencrypt", "vencrypt",
3024 "vencrypt+plain", "vencrypt+tls+none",
3025 "vencrypt+tls+plain", "vencrypt+tls+sasl",
3026 "vencrypt+tls+vnc", "vencrypt+x509+none",
3027 "vencrypt+x509+plain", "vencrypt+x509+sasl",
3028 "vencrypt+x509+vnc", "vnc"
3029 - "clients": a json-array of all connected clients
3031 Clients are described by a json-object, each one contain the following:
3033 - "host": client's IP
address (json
-string
)
3034 - "family": address
family (json
-string
)
3035 - Possible values
: "ipv4", "ipv6", "unix", "unknown"
3036 - "service": client
's port number (json-string)
3037 - "x509_dname": TLS dname (json-string, optional)
3038 - "sasl_username": SASL username (json-string, optional)
3042 -> { "execute": "query-vnc" }
3063 .name = "query-vnc",
3065 .mhandler.cmd_new = qmp_marshal_input_query_vnc,
3068 .name = "query-vnc-servers",
3070 .mhandler.cmd_new = qmp_marshal_input_query_vnc_servers,
3077 Show SPICE server information.
3079 Return a json-object with server information. Connected clients are returned
3080 as a json-array of json-objects.
3082 The main json-object contains the following:
3084 - "enabled": true or false (json-bool)
3085 - "host": server's IP
address (json
-string
)
3086 - "port": server
's port number (json-int, optional)
3087 - "tls-port": server's port
number (json
-int
, optional
)
3088 - "auth": authentication
method (json
-string
)
3089 - Possible values
: "none", "spice"
3090 - "channels": a json
-array of all active channels clients
3092 Channels are described by a json
-object
, each one contain the following
:
3094 - "host": client
's IP address (json-string)
3095 - "family": address family (json-string)
3096 - Possible values: "ipv4", "ipv6", "unix", "unknown"
3097 - "port": client's port
number (json
-string
)
3098 - "connection-id": spice connection id
. All channels with the same id
3099 belong to the same spice
session (json
-int
)
3100 - "channel-type": channel type
. "1" is the main control channel
, filter
for
3101 this one
if you want track spice sessions
only (json
-int
)
3102 - "channel-id": channel id
. Usually
"0", might be different needed when
3103 multiple channels of the same type exist
, such as multiple
3104 display channels
in a multihead
setup (json
-int
)
3105 - "tls": whether the channel is
encrypted (json
-bool
)
3109 -> { "execute": "query-spice" }
3122 "connection-id": 1804289383,
3123 "host": "127.0.0.1",
3131 "connection-id": 1804289383,
3132 "host": "127.0.0.1",
3136 [ ... more channels follow
... ]
3143 #
if defined(CONFIG_SPICE
)
3145 .name
= "query-spice",
3147 .mhandler
.cmd_new
= qmp_marshal_input_query_spice
,
3157 Return a json
-object with the following information
:
3159 - "name": VM
's name (json-string, optional)
3163 -> { "execute": "query-name" }
3164 <- { "return": { "name": "qemu-name" } }
3169 .name = "query-name",
3171 .mhandler.cmd_new = qmp_marshal_input_query_name,
3180 Return a json-object with the following information:
3182 - "UUID": Universally Unique Identifier (json-string)
3186 -> { "execute": "query-uuid" }
3187 <- { "return": { "UUID": "550e8400-e29b-41d4-a716-446655440000" } }
3192 .name = "query-uuid",
3194 .mhandler.cmd_new = qmp_marshal_input_query_uuid,
3198 query-command-line-options
3199 --------------------------
3201 Show command line option schema.
3203 Return a json-array of command line option schema for all options (or for
3204 the given option), returning an error if the given option doesn't exist
.
3206 Each array entry contains the following
:
3208 - "option": option
name (json
-string
)
3209 - "parameters": a json
-array describes all parameters of the option
:
3210 - "name": parameter
name (json
-string
)
3211 - "type": parameter
type (one of
'string', 'boolean', 'number',
3213 - "help": human readable description of the parameter
3214 (json
-string
, optional
)
3215 - "default": default value string
for the parameter
3216 (json
-string
, optional
)
3220 -> { "execute": "query-command-line-options", "arguments": { "option": "option-rom" } }
3229 "name": "bootindex",
3233 "option": "option-rom"
3241 .name
= "query-command-line-options",
3242 .args_type
= "option:s?",
3243 .mhandler
.cmd_new
= qmp_marshal_input_query_command_line_options
,
3252 Return a json
-object
. If migration is active there will be another json
-object
3253 with RAM migration status and
if block migration is active another one with
3254 block migration status
.
3256 The main json
-object contains the following
:
3258 - "status": migration
status (json
-string
)
3259 - Possible values
: "setup", "active", "completed", "failed", "cancelled"
3260 - "total-time": total amount of ms since migration started
. If
3261 migration has ended
, it returns the total migration
3263 - "setup-time" amount of setup time
in milliseconds _before_ the
3264 iterations begin but _after_ the QMP command is issued
.
3265 This is designed to provide an accounting of any activities
3266 (such as RDMA pinning
) which may be expensive
, but
do not
3267 actually occur during the iterative migration rounds
3268 themselves
. (json
-int
)
3269 - "downtime": only present when migration has finished correctly
3270 total amount
in ms
for downtime that
happened (json
-int
)
3271 - "expected-downtime": only present
while migration is active
3272 total amount
in ms
for downtime that was calculated on
3273 the last bitmap
round (json
-int
)
3274 - "ram": only present
if "status" is
"active", it is a json
-object with the
3275 following RAM information
:
3276 - "transferred": amount transferred
in bytes (json
-int
)
3277 - "remaining": amount remaining to transfer
in bytes (json
-int
)
3278 - "total": total amount of memory
in bytes (json
-int
)
3279 - "duplicate": number of pages filled entirely with the same
3281 These are sent over the wire much more efficiently
.
3282 - "skipped": number of skipped zero
pages (json
-int
)
3283 - "normal" : number of whole pages transferred
. I
.e
. they
3284 were not sent as duplicate or xbzrle
pages (json
-int
)
3285 - "normal-bytes" : number of bytes transferred
in whole
3286 pages
. This is just normal pages times size of one page
,
3287 but
this way upper levels don
't need to care about page
3289 - "dirty-sync-count": times that dirty ram was synchronized (json-int)
3290 - "disk": only present if "status" is "active" and it is a block migration,
3291 it is a json-object with the following disk information:
3292 - "transferred": amount transferred in bytes (json-int)
3293 - "remaining": amount remaining to transfer in bytes json-int)
3294 - "total": total disk size in bytes (json-int)
3295 - "xbzrle-cache": only present if XBZRLE is active.
3296 It is a json-object with the following XBZRLE information:
3297 - "cache-size": XBZRLE cache size in bytes
3298 - "bytes": number of bytes transferred for XBZRLE compressed pages
3299 - "pages": number of XBZRLE compressed pages
3300 - "cache-miss": number of XBRZRLE page cache misses
3301 - "cache-miss-rate": rate of XBRZRLE page cache misses
3302 - "overflow": number of times XBZRLE overflows. This means
3303 that the XBZRLE encoding was bigger than just sent the
3304 whole page, and then we sent the whole page instead (as as
3309 1. Before the first migration
3311 -> { "execute": "query-migrate" }
3314 2. Migration is done and has succeeded
3316 -> { "execute": "query-migrate" }
3318 "status": "completed",
3328 "normal-bytes":123456,
3329 "dirty-sync-count":15
3334 3. Migration is done and has failed
3336 -> { "execute": "query-migrate" }
3337 <- { "return": { "status": "failed" } }
3339 4. Migration is being performed and is not a block migration:
3341 -> { "execute": "query-migrate" }
3351 "expected-downtime":12345,
3354 "normal-bytes":123456,
3355 "dirty-sync-count":15
3360 5. Migration is being performed and is a block migration:
3362 -> { "execute": "query-migrate" }
3368 "remaining":1053304,
3372 "expected-downtime":12345,
3375 "normal-bytes":123456,
3376 "dirty-sync-count":15
3380 "remaining":20880384,
3386 6. Migration is being performed and XBZRLE is active:
3388 -> { "execute": "query-migrate" }
3392 "capabilities" : [ { "capability": "xbzrle", "state" : true } ],
3395 "remaining":1053304,
3399 "expected-downtime":12345,
3402 "normal-bytes":3412992,
3403 "dirty-sync-count":15
3406 "cache-size":67108864,
3410 "cache-miss-rate":0.123,
3419 .name = "query-migrate",
3421 .mhandler.cmd_new = qmp_marshal_input_query_migrate,
3425 migrate-set-capabilities
3426 ------------------------
3428 Enable/Disable migration capabilities
3430 - "xbzrle": XBZRLE support
3431 - "rdma-pin-all": pin all pages when using RDMA during migration
3432 - "auto-converge": throttle down guest to help convergence of migration
3433 - "zero-blocks": compress zero blocks during block migration
3434 - "events": generate events for each migration state change
3440 -> { "execute": "migrate-set-capabilities" , "arguments":
3441 { "capabilities": [ { "capability": "xbzrle", "state": true } ] } }
3446 .name = "migrate-set-capabilities",
3447 .args_type = "capabilities:q",
3448 .params = "capability:s,state:b",
3449 .mhandler.cmd_new = qmp_marshal_input_migrate_set_capabilities,
3452 query-migrate-capabilities
3453 --------------------------
3455 Query current migration capabilities
3457 - "capabilities": migration capabilities state
3458 - "xbzrle" : XBZRLE state (json-bool)
3459 - "rdma-pin-all" : RDMA Pin Page state (json-bool)
3460 - "auto-converge" : Auto Converge state (json-bool)
3461 - "zero-blocks" : Zero Blocks state (json-bool)
3467 -> { "execute": "query-migrate-capabilities" }
3468 <- { "return": [ { "state": false, "capability": "xbzrle" } ] }
3473 .name = "query-migrate-capabilities",
3475 .mhandler.cmd_new = qmp_marshal_input_query_migrate_capabilities,
3479 migrate-set-parameters
3480 ----------------------
3482 Set migration parameters
3484 - "compress-level": set compression level during migration (json-int)
3485 - "compress-threads": set compression thread count for migration (json-int)
3486 - "decompress-threads": set decompression thread count for migration (json-int)
3492 -> { "execute": "migrate-set-parameters" , "arguments":
3493 { "compress-level": 1 } }
3498 .name = "migrate-set-parameters",
3500 "compress-level:i?,compress-threads:i?,decompress-threads:i?",
3501 .mhandler.cmd_new = qmp_marshal_input_migrate_set_parameters,
3504 query-migrate-parameters
3505 ------------------------
3507 Query current migration parameters
3509 - "parameters": migration parameters value
3510 - "compress-level" : compression level value (json-int)
3511 - "compress-threads" : compression thread count value (json-int)
3512 - "decompress-threads" : decompression thread count value (json-int)
3518 -> { "execute": "query-migrate-parameters" }
3521 "decompress-threads", 2,
3522 "compress-threads", 8,
3530 .name = "query-migrate-parameters",
3532 .mhandler.cmd_new = qmp_marshal_input_query_migrate_parameters,
3539 Show balloon information.
3541 Make an asynchronous request for balloon info. When the request completes a
3542 json-object will be returned containing the following data:
3544 - "actual": current balloon value in bytes (json-int)
3548 -> { "execute": "query-balloon" }
3551 "actual":1073741824,
3558 .name = "query-balloon",
3560 .mhandler.cmd_new = qmp_marshal_input_query_balloon,
3564 .name = "query-block-jobs",
3566 .mhandler.cmd_new = qmp_marshal_input_query_block_jobs,
3571 .args_type = "path:s",
3572 .mhandler.cmd_new = qmp_marshal_input_qom_list,
3577 .args_type = "path:s,property:s,value:q",
3578 .mhandler.cmd_new = qmp_qom_set,
3583 .args_type = "path:s,property:s",
3584 .mhandler.cmd_new = qmp_qom_get,
3588 .name = "nbd-server-start",
3589 .args_type = "addr:q",
3590 .mhandler.cmd_new = qmp_marshal_input_nbd_server_start,
3593 .name = "nbd-server-add",
3594 .args_type = "device:B,writable:b?",
3595 .mhandler.cmd_new = qmp_marshal_input_nbd_server_add,
3598 .name = "nbd-server-stop",
3600 .mhandler.cmd_new = qmp_marshal_input_nbd_server_stop,
3604 .name = "change-vnc-password",
3605 .args_type = "password:s",
3606 .mhandler.cmd_new = qmp_marshal_input_change_vnc_password,
3609 .name = "qom-list-types",
3610 .args_type = "implements:s?,abstract:b?",
3611 .mhandler.cmd_new = qmp_marshal_input_qom_list_types,
3615 .name = "device-list-properties",
3616 .args_type = "typename:s",
3617 .mhandler.cmd_new = qmp_marshal_input_device_list_properties,
3621 .name = "query-machines",
3623 .mhandler.cmd_new = qmp_marshal_input_query_machines,
3627 .name = "query-cpu-definitions",
3629 .mhandler.cmd_new = qmp_marshal_input_query_cpu_definitions,
3633 .name = "query-target",
3635 .mhandler.cmd_new = qmp_marshal_input_query_target,
3639 .name = "query-tpm",
3641 .mhandler.cmd_new = qmp_marshal_input_query_tpm,
3648 Return information about the TPM device.
3654 -> { "execute": "query-tpm" }
3657 { "model": "tpm-tis",
3659 { "type": "passthrough",
3661 { "cancel-path": "/sys/class/misc/tpm0/device/cancel",
3673 .name = "query-tpm-models",
3675 .mhandler.cmd_new = qmp_marshal_input_query_tpm_models,
3682 Return a list of supported TPM models.
3688 -> { "execute": "query-tpm-models" }
3689 <- { "return": [ "tpm-tis" ] }
3694 .name = "query-tpm-types",
3696 .mhandler.cmd_new = qmp_marshal_input_query_tpm_types,
3703 Return a list of supported TPM types.
3709 -> { "execute": "query-tpm-types" }
3710 <- { "return": [ "passthrough" ] }
3715 .name = "chardev-add",
3716 .args_type = "id:s,backend:q",
3717 .mhandler.cmd_new = qmp_marshal_input_chardev_add,
3728 - "id": the chardev's ID
, must be
unique (json
-string
)
3729 - "backend": chardev backend type
+ parameters
3733 -> { "execute" : "chardev-add",
3734 "arguments" : { "id" : "foo",
3735 "backend" : { "type" : "null", "data" : {} } } }
3738 -> { "execute" : "chardev-add",
3739 "arguments" : { "id" : "bar",
3740 "backend" : { "type" : "file",
3741 "data" : { "out" : "/tmp/bar.log" } } } }
3744 -> { "execute" : "chardev-add",
3745 "arguments" : { "id" : "baz",
3746 "backend" : { "type" : "pty", "data" : {} } } }
3747 <- { "return": { "pty" : "/dev/pty/42" } }
3752 .name
= "chardev-remove",
3753 .args_type
= "id:s",
3754 .mhandler
.cmd_new
= qmp_marshal_input_chardev_remove
,
3766 - "id": the chardev
's ID, must exist and not be in use (json-string)
3770 -> { "execute": "chardev-remove", "arguments": { "id" : "foo" } }
3775 .name = "query-rx-filter",
3776 .args_type = "name:s?",
3777 .mhandler.cmd_new = qmp_marshal_input_query_rx_filter,
3784 Show rx-filter information.
3786 Returns a json-array of rx-filter information for all NICs (or for the
3787 given NIC), returning an error if the given NIC doesn't exist
, or
3788 given NIC doesn
't support rx-filter querying, or given net client
3791 The query will clear the event notification flag of each NIC
, then qemu
3792 will start to emit event to QMP monitor
.
3794 Each array entry contains the following
:
3796 - "name": net client
name (json
-string
)
3797 - "promiscuous": promiscuous mode is
enabled (json
-bool
)
3798 - "multicast": multicast receive
state (one of
'normal', 'none', 'all')
3799 - "unicast": unicast receive
state (one of
'normal', 'none', 'all')
3800 - "vlan": vlan receive
state (one of
'normal', 'none', 'all') (Since
2.0)
3801 - "broadcast-allowed": allow to receive
broadcast (json
-bool
)
3802 - "multicast-overflow": multicast table is
overflowed (json
-bool
)
3803 - "unicast-overflow": unicast table is
overflowed (json
-bool
)
3804 - "main-mac": main macaddr
string (json
-string
)
3805 - "vlan-table": a json
-array of active vlan id
3806 - "unicast-table": a json
-array of unicast macaddr string
3807 - "multicast-table": a json
-array of multicast macaddr string
3811 -> { "execute": "query-rx-filter", "arguments": { "name": "vnet0" } }
3814 "promiscuous": true,
3816 "main-mac": "52:54:00:12:34:56",
3817 "unicast": "normal",
3825 "multicast": "normal",
3826 "multicast-overflow": false,
3827 "unicast-overflow": false,
3828 "multicast-table": [
3829 "01:00:5e:00:00:01",
3830 "33:33:00:00:00:01",
3833 "broadcast-allowed": false
3841 .name
= "blockdev-add",
3842 .args_type
= "options:q",
3843 .mhandler
.cmd_new
= qmp_marshal_input_blockdev_add
,
3852 This command is still a work
in progress
. It doesn
't support all
3853 block drivers, it lacks a matching blockdev-del, and more. Stay away
3854 from it unless you want to help with its development.
3858 - "options": block driver options
3862 -> { "execute": "blockdev-add",
3863 "arguments": { "options" : { "driver": "qcow2",
3864 "file": { "driver": "file",
3865 "filename": "test.qcow2" } } } }
3870 -> { "execute": "blockdev-add",
3882 "filename": "/tmp/test.qcow2"
3888 "filename": "/dev/fdset/4"
3900 .name = "query-named-block-nodes",
3902 .mhandler.cmd_new = qmp_marshal_input_query_named_block_nodes,
3906 @query-named-block-nodes
3907 ------------------------
3909 Return a list of BlockDeviceInfo for all the named block driver nodes
3913 -> { "execute": "query-named-block-nodes" }
3914 <- { "return": [ { "ro":false,
3917 "file":"disks/test.qcow2",
3918 "node-name": "my-node",
3919 "backing_file_depth":1,
3933 "write_threshold": 0,
3935 "filename":"disks/test.qcow2",
3937 "virtual-size":2048000,
3938 "backing_file":"base.qcow2",
3939 "full-backing-filename":"disks/base.qcow2",
3940 "backing-filename-format":"qcow2",
3944 "name": "snapshot1",
3946 "date-sec": 10000200,
3948 "vm-clock-sec": 206,
3953 "filename":"disks/base.qcow2",
3955 "virtual-size":2048000
3962 .name = "query-memdev",
3964 .mhandler.cmd_new = qmp_marshal_input_query_memdev,
3971 Show memory devices information.
3976 -> { "execute": "query-memdev" }
3983 "host-nodes": [0, 1],
3991 "host-nodes": [2, 3],
3992 "policy": "preferred"
4000 .name = "query-memory-devices",
4002 .mhandler.cmd_new = qmp_marshal_input_query_memory_devices,
4006 @query-memory-devices
4007 --------------------
4009 Return a list of memory devices.
4012 -> { "execute": "query-memory-devices" }
4013 <- { "return": [ { "data":
4014 { "addr": 5368709120,
4015 "hotpluggable": true,
4018 "memdev": "/objects/memX",
4027 .name = "query-acpi-ospm-status",
4029 .mhandler.cmd_new = qmp_marshal_input_query_acpi_ospm_status,
4033 @query-acpi-ospm-status
4034 --------------------
4036 Return list of ACPIOSTInfo for devices that support status reporting
4037 via ACPI _OST method.
4040 -> { "execute": "query-acpi-ospm-status" }
4041 <- { "return": [ { "device": "d1", "slot": "0", "slot-type": "DIMM", "source": 1, "status": 0},
4042 { "slot": "1", "slot-type": "DIMM", "source": 0, "status": 0},
4043 { "slot": "2", "slot-type": "DIMM", "source": 0, "status": 0},
4044 { "slot": "3", "slot-type": "DIMM", "source": 0, "status": 0}
4048 #if defined TARGET_I386
4050 .name = "rtc-reset-reinjection",
4052 .mhandler.cmd_new = qmp_marshal_input_rtc_reset_reinjection,
4057 rtc-reset-reinjection
4058 ---------------------
4060 Reset the RTC interrupt reinjection backlog.
4066 -> { "execute": "rtc-reset-reinjection" }
4071 .name = "trace-event-get-state",
4072 .args_type = "name:s",
4073 .mhandler.cmd_new = qmp_marshal_input_trace_event_get_state,
4077 trace-event-get-state
4078 ---------------------
4080 Query the state of events.
4084 -> { "execute": "trace-event-get-state", "arguments": { "name": "qemu_memalign" } }
4085 <- { "return": [ { "name": "qemu_memalign", "state": "disabled" } ] }
4089 .name = "trace-event-set-state",
4090 .args_type = "name:s,enable:b,ignore-unavailable:b?",
4091 .mhandler.cmd_new = qmp_marshal_input_trace_event_set_state,
4095 trace-event-set-state
4096 ---------------------
4098 Set the state of events.
4102 -> { "execute": "trace-event-set-state", "arguments": { "name": "qemu_memalign", "enable": "true" } }
4107 .name = "x-input-send-event",
4108 .args_type = "console:i?,events:q",
4109 .mhandler.cmd_new = qmp_marshal_input_x_input_send_event,
4116 Send input event to guest.
4120 - "console": console index. (json-int, optional)
4121 - "events": list of input events.
4123 The consoles are visible in the qom tree, under
4124 /backend/console[$index]. They have a device link and head property, so
4125 it is possible to map which console belongs to which device and display.
4127 Note: this command is experimental, and not a stable API.
4131 Press left mouse button.
4133 -> { "execute": "x-input-send-event",
4134 "arguments": { "console": 0,
4135 "events": [ { "type": "btn",
4136 "data" : { "down": true, "button": "Left" } } ] } }
4139 -> { "execute": "x-input-send-event",
4140 "arguments": { "console": 0,
4141 "events": [ { "type": "btn",
4142 "data" : { "down": false, "button": "Left" } } ] } }
4149 -> { "execute": "x-input-send-event",
4150 "arguments": { "console": 0, "events": [
4151 { "type": "key", "data" : { "down": true,
4152 "key": {"type": "qcode", "data": "ctrl" } } },
4153 { "type": "key", "data" : { "down": true,
4154 "key": {"type": "qcode", "data": "alt" } } },
4155 { "type": "key", "data" : { "down": true,
4156 "key": {"type": "qcode", "data": "delete" } } } ] } }
4161 Move mouse pointer to absolute coordinates (20000, 400).
4163 -> { "execute": "x-input-send-event" ,
4164 "arguments": { "console": 0, "events": [
4165 { "type": "abs", "data" : { "axis": "X", "value" : 20000 } },
4166 { "type": "abs", "data" : { "axis": "Y", "value" : 400 } } ] } }
4172 .name = "block-set-write-threshold",
4173 .args_type = "node-name:s,write-threshold:l",
4174 .mhandler.cmd_new = qmp_marshal_input_block_set_write_threshold,
4178 block-set-write-threshold
4181 Change the write threshold for a block drive. The threshold is an offset,
4182 thus must be non-negative. Default is no write threshold.
4183 Setting the threshold to zero disables it.
4187 - "node-name": the node name in the block driver state graph (json-string)
4188 - "write-threshold": the write threshold in bytes (json-int)
4192 -> { "execute": "block-set-write-threshold",
4193 "arguments": { "node-name": "mydev",
4194 "write-threshold": 17179869184 } }
4200 .name = "query-rocker",
4201 .args_type = "name:s",
4202 .mhandler.cmd_new = qmp_marshal_input_query_rocker,
4211 - "name": switch name
4215 -> { "execute": "query-rocker", "arguments": { "name": "sw1" } }
4216 <- { "return": {"name": "sw1", "ports": 2, "id": 1327446905938}}
4221 .name = "query-rocker-ports",
4222 .args_type = "name:s",
4223 .mhandler.cmd_new = qmp_marshal_input_query_rocker_ports,
4227 Show rocker switch ports
4228 ------------------------
4232 - "name": switch name
4236 -> { "execute": "query-rocker-ports", "arguments": { "name": "sw1" } }
4237 <- { "return": [ {"duplex": "full", "enabled": true, "name": "sw1.1",
4238 "autoneg": "off", "link-up": true, "speed": 10000},
4239 {"duplex": "full", "enabled": true, "name": "sw1.2",
4240 "autoneg": "off", "link-up": true, "speed": 10000}
4246 .name = "query-rocker-of-dpa-flows",
4247 .args_type = "name:s,tbl-id:i?",
4248 .mhandler.cmd_new = qmp_marshal_input_query_rocker_of_dpa_flows,
4252 Show rocker switch OF-DPA flow tables
4253 -------------------------------------
4257 - "name": switch name
4258 - "tbl-id": (optional) flow table ID
4262 -> { "execute": "query-rocker-of-dpa-flows", "arguments": { "name": "sw1" } }
4263 <- { "return": [ {"key": {"in-pport": 0, "priority": 1, "tbl-id": 0},
4266 "action": {"goto-tbl": 10},
4267 "mask": {"in-pport": 4294901760}
4275 .name = "query-rocker-of-dpa-groups",
4276 .args_type = "name:s,type:i?",
4277 .mhandler.cmd_new = qmp_marshal_input_query_rocker_of_dpa_groups,
4281 Show rocker OF-DPA group tables
4282 -------------------------------
4286 - "name": switch name
4287 - "type": (optional) group type
4291 -> { "execute": "query-rocker-of-dpa-groups", "arguments": { "name": "sw1" } }
4292 <- { "return": [ {"type": 0, "out-pport": 2, "pport": 2, "vlan-id": 3841,
4293 "pop-vlan": 1, "id": 251723778},
4294 {"type": 0, "out-pport": 0, "pport": 0, "vlan-id": 3841,
4295 "pop-vlan": 1, "id": 251723776},
4296 {"type": 0, "out-pport": 1, "pport": 1, "vlan-id": 3840,
4297 "pop-vlan": 1, "id": 251658241},
4298 {"type": 0, "out-pport": 0, "pport": 0, "vlan-id": 3840,
4299 "pop-vlan": 1, "id": 251658240}