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
= do_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 to
-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
= "send migration info to spice/vnc client",
788 .mhandler
.cmd_new
= client_migrate_info
,
795 Set the spice
/vnc connection info
for the migration target
. The spice
/vnc
796 server will ask the spice
/vnc client to automatically reconnect
using the
797 new parameters (if specified
) once the vm migration finished successfully
.
801 - "protocol": protocol
: "spice" or
"vnc" (json
-string
)
802 - "hostname": migration target
hostname (json
-string
)
803 - "port": spice
/vnc 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"] }
876 .name
= "netdev_add",
877 .args_type
= "netdev:O",
878 .mhandler
.cmd_new
= qmp_netdev_add
,
885 Add host network device
.
889 - "type": the device type
, "tap", "user", ... (json
-string
)
890 - "id": the device
's ID, must be unique (json-string)
895 -> { "execute": "netdev_add", "arguments": { "type": "user", "id": "netdev1" } }
898 Note: The supported device options are the same ones supported by the '-netdev
'
899 command-line argument, which are listed in the '-help
' output or QEMU's
905 .name
= "netdev_del",
907 .mhandler
.cmd_new
= qmp_marshal_input_netdev_del
,
914 Remove host network device
.
918 - "id": the device
's ID, must be unique (json-string)
922 -> { "execute": "netdev_del", "arguments": { "id": "netdev1" } }
929 .name = "object-add",
930 .args_type = "qom-type:s,id:s,props:q?",
931 .mhandler.cmd_new = qmp_object_add,
942 - "qom-type": the object's QOM type
, i
.e
. the
class name (json
-string
)
943 - "id": the object
's ID, must be unique (json-string)
944 - "props": a dictionary of object property values (optional, json-dict)
948 -> { "execute": "object-add", "arguments": { "qom-type": "rng-random", "id": "rng1",
949 "props": { "filename": "/dev/hwrng" } } }
955 .name = "object-del",
957 .mhandler.cmd_new = qmp_marshal_input_object_del,
968 - "id": the object's
ID (json
-string
)
972 -> { "execute": "object-del", "arguments": { "id": "rng1" } }
980 .name
= "block_resize",
981 .args_type
= "device:s?,node-name:s?,size:o",
982 .mhandler
.cmd_new
= qmp_marshal_input_block_resize
,
989 Resize a block image
while a guest is running
.
993 - "device": the device
's ID, must be unique (json-string)
994 - "node-name": the node name in the block driver state graph (json-string)
999 -> { "execute": "block_resize", "arguments": { "device": "scratch", "size": 1073741824 } }
1005 .name = "block-stream",
1006 .args_type = "device:B,base:s?,speed:o?,backing-file:s?,on-error:s?",
1007 .mhandler.cmd_new = qmp_marshal_input_block_stream,
1011 .name = "block-commit",
1012 .args_type = "device:B,base:s?,top:s?,backing-file:s?,speed:o?",
1013 .mhandler.cmd_new = qmp_marshal_input_block_commit,
1020 Live commit of data from overlay image nodes into backing nodes - i.e., writes
1021 data between 'top
' and 'base
' into 'base
'.
1025 - "device": The device's ID
, must be
unique (json
-string
)
1026 - "base": The file name of the backing image to write data into
.
1027 If not specified
, this is the deepest backing image
1028 (json
-string
, optional
)
1029 - "top": The file name of the backing image within the image chain
,
1030 which contains the topmost data to be committed down
. If
1031 not specified
, this is the active layer
. (json
-string
, optional
)
1033 - backing
-file
: The backing file string to write into the overlay
1034 image of
'top'. If
'top' is the active layer
,
1035 specifying a backing file string is an error
. This
1036 filename is not validated
.
1038 If a pathname string is such that it cannot be
1039 resolved by QEMU
, that means that subsequent QMP or
1040 HMP commands must use node
-names
for the image
in
1041 question
, as filename lookup methods will fail
.
1043 If not specified
, QEMU will automatically determine
1044 the backing file string to use
, or error out
if
1045 there is no obvious choice
. Care should be taken
1046 when specifying the string
, to specify a valid
1047 filename or protocol
.
1048 (json
-string
, optional
) (Since
2.1)
1050 If top
== base
, that is an error
.
1051 If top
== active
, the job will not be completed by itself
,
1052 user needs to complete the job with the block
-job
-complete
1053 command after getting the ready event
. (Since
2.0)
1055 If the base image is smaller than top
, then the base image
1056 will be resized to be the same size as top
. If top is
1057 smaller than the base image
, the base will not be
1058 truncated
. If you want the base image size to match the
1059 size of the smaller top
, you can safely truncate it
1060 yourself once the commit operation successfully completes
.
1062 - "speed": the maximum speed
, in bytes per
second (json
-int
, optional
)
1067 -> { "execute": "block-commit", "arguments": { "device": "virtio0",
1068 "top": "/tmp/snap1.qcow2" } }
1074 .name
= "drive-backup",
1075 .args_type
= "sync:s,device:B,target:s,speed:i?,mode:s?,format:s?,"
1076 "on-source-error:s?,on-target-error:s?",
1077 .mhandler
.cmd_new
= qmp_marshal_input_drive_backup
,
1084 Start a point
-in-time copy of a block device to a
new destination
. The
1085 status of ongoing drive
-backup operations can be checked with
1086 query
-block
-jobs where the BlockJobInfo
.type field has the value
'backup'.
1087 The operation can be stopped before it has completed
using the
1088 block
-job
-cancel command
.
1092 - "device": the name of the device which should be copied
.
1094 - "target": the target of the
new image
. If the file exists
, or
if it is a
1095 device
, the existing file
/device will be used as the
new
1096 destination
. If it does not exist
, a
new file will be created
.
1098 - "format": the format of the
new destination
, default is to probe
if 'mode' is
1099 'existing', else the format of the source
1100 (json
-string
, optional
)
1101 - "sync": what parts of the disk image should be copied to the destination
;
1102 possibilities include
"full" for all the disk
, "top" for only the sectors
1103 allocated
in the topmost image
, or
"none" to only replicate
new I
/O
1105 - "mode": whether and how QEMU should create a
new image
1106 (NewImageMode
, optional
, default 'absolute-paths')
1107 - "speed": the maximum speed
, in bytes per
second (json
-int
, optional
)
1108 - "on-source-error": the action to take on an error on the source
, default
1109 'report'. 'stop' and
'enospc' can only be used
1110 if the block device supports io
-status
.
1111 (BlockdevOnError
, optional
)
1112 - "on-target-error": the action to take on an error on the target
, default
1113 'report' (no limitations
, since
this applies to
1114 a different block device than device
).
1115 (BlockdevOnError
, optional
)
1118 -> { "execute": "drive-backup", "arguments": { "device": "drive0",
1120 "target": "backup.img" } }
1126 .name
= "blockdev-backup",
1127 .args_type
= "sync:s,device:B,target:B,speed:i?,"
1128 "on-source-error:s?,on-target-error:s?",
1129 .mhandler
.cmd_new
= qmp_marshal_input_blockdev_backup
,
1136 The device version of drive
-backup
: this command takes an existing named device
1141 - "device": the name of the device which should be copied
.
1143 - "target": the name of the backup target device
. (json
-string
)
1144 - "sync": what parts of the disk image should be copied to the destination
;
1145 possibilities include
"full" for all the disk
, "top" for only the
1146 sectors allocated
in the topmost image
, or
"none" to only replicate
1147 new I
/O (MirrorSyncMode
).
1148 - "speed": the maximum speed
, in bytes per
second (json
-int
, optional
)
1149 - "on-source-error": the action to take on an error on the source
, default
1150 'report'. 'stop' and
'enospc' can only be used
1151 if the block device supports io
-status
.
1152 (BlockdevOnError
, optional
)
1153 - "on-target-error": the action to take on an error on the target
, default
1154 'report' (no limitations
, since
this applies to
1155 a different block device than device
).
1156 (BlockdevOnError
, optional
)
1159 -> { "execute": "blockdev-backup", "arguments": { "device": "src-id",
1161 "target": "tgt-id" } }
1167 .name
= "block-job-set-speed",
1168 .args_type
= "device:B,speed:o",
1169 .mhandler
.cmd_new
= qmp_marshal_input_block_job_set_speed
,
1173 .name
= "block-job-cancel",
1174 .args_type
= "device:B,force:b?",
1175 .mhandler
.cmd_new
= qmp_marshal_input_block_job_cancel
,
1178 .name
= "block-job-pause",
1179 .args_type
= "device:B",
1180 .mhandler
.cmd_new
= qmp_marshal_input_block_job_pause
,
1183 .name
= "block-job-resume",
1184 .args_type
= "device:B",
1185 .mhandler
.cmd_new
= qmp_marshal_input_block_job_resume
,
1188 .name
= "block-job-complete",
1189 .args_type
= "device:B",
1190 .mhandler
.cmd_new
= qmp_marshal_input_block_job_complete
,
1193 .name
= "transaction",
1194 .args_type
= "actions:q",
1195 .mhandler
.cmd_new
= qmp_marshal_input_transaction
,
1202 Atomically operate on one or more block devices
. The only supported operations
1203 for now are drive
-backup
, internal and external snapshotting
. A list of
1204 dictionaries is accepted
, that contains the actions to be performed
.
1205 If there is any failure performing any of the operations
, all operations
1206 for the group are abandoned
.
1208 For external snapshots
, the dictionary contains the device
, the file to use
for
1209 the
new snapshot
, and the format
. The
default format
, if not specified
, is
1212 Each
new snapshot defaults to being created by
QEMU (wiping any
1213 contents
if the file already exists
), but it is also possible to reuse
1214 an externally
-created file
. In the latter
case, you should ensure that
1215 the
new image file has the same contents as the current one
; QEMU cannot
1216 perform any meaningful check
. Typically
this is achieved by
using the
1217 current image file as the backing file
for the
new image
.
1219 On failure
, the original disks pre
-snapshot attempt will be used
.
1221 For internal snapshots
, the dictionary contains the device and the snapshot
's
1222 name. If an internal snapshot matching name already exists, the request will
1223 be rejected. Only some image formats support it, for example, qcow2, rbd,
1226 On failure, qemu will try delete the newly created internal snapshot in the
1227 transaction. When an I/O error occurs during deletion, the user needs to fix
1228 it later with qemu-img or other command.
1233 - "type": the operation to perform. The only supported
1234 value is "blockdev-snapshot-sync". (json-string)
1235 - "data": a dictionary. The contents depend on the value
1236 of "type". When "type" is "blockdev-snapshot-sync":
1237 - "device": device name to snapshot (json-string)
1238 - "node-name": graph node name to snapshot (json-string)
1239 - "snapshot-file": name of new image file (json-string)
1240 - "snapshot-node-name": graph node name of the new snapshot (json-string)
1241 - "format": format of new image (json-string, optional)
1242 - "mode": whether and how QEMU should create the snapshot file
1243 (NewImageMode, optional, default "absolute-paths")
1244 When "type" is "blockdev-snapshot-internal-sync":
1245 - "device": device name to snapshot (json-string)
1246 - "name": name of the new snapshot (json-string)
1250 -> { "execute": "transaction",
1251 "arguments": { "actions": [
1252 { "type": "blockdev-snapshot-sync", "data" : { "device": "ide-hd0",
1253 "snapshot-file": "/some/place/my-image",
1254 "format": "qcow2" } },
1255 { "type": "blockdev-snapshot-sync", "data" : { "node-name": "myfile",
1256 "snapshot-file": "/some/place/my-image2",
1257 "snapshot-node-name": "node3432",
1259 "format": "qcow2" } },
1260 { "type": "blockdev-snapshot-sync", "data" : { "device": "ide-hd1",
1261 "snapshot-file": "/some/place/my-image2",
1263 "format": "qcow2" } },
1264 { "type": "blockdev-snapshot-internal-sync", "data" : {
1265 "device": "ide-hd2",
1266 "name": "snapshot0" } } ] } }
1272 .name = "blockdev-snapshot-sync",
1273 .args_type = "device:s?,node-name:s?,snapshot-file:s,snapshot-node-name:s?,format:s?,mode:s?",
1274 .mhandler.cmd_new = qmp_marshal_input_blockdev_snapshot_sync,
1278 blockdev-snapshot-sync
1279 ----------------------
1281 Synchronous snapshot of a block device. snapshot-file specifies the
1282 target of the new image. If the file exists, or if it is a device, the
1283 snapshot will be created in the existing file/device. If does not
1284 exist, a new file will be created. format specifies the format of the
1285 snapshot image, default is qcow2.
1289 - "device": device name to snapshot (json-string)
1290 - "node-name": graph node name to snapshot (json-string)
1291 - "snapshot-file": name of new image file (json-string)
1292 - "snapshot-node-name": graph node name of the new snapshot (json-string)
1293 - "mode": whether and how QEMU should create the snapshot file
1294 (NewImageMode, optional, default "absolute-paths")
1295 - "format": format of new image (json-string, optional)
1299 -> { "execute": "blockdev-snapshot-sync", "arguments": { "device": "ide-hd0",
1301 "/some/place/my-image",
1302 "format": "qcow2" } }
1308 .name = "blockdev-snapshot-internal-sync",
1309 .args_type = "device:B,name:s",
1310 .mhandler.cmd_new = qmp_marshal_input_blockdev_snapshot_internal_sync,
1314 blockdev-snapshot-internal-sync
1315 -------------------------------
1317 Synchronously take an internal snapshot of a block device when the format of
1318 image used supports it. If the name is an empty string, or a snapshot with
1319 name already exists, the operation will fail.
1323 - "device": device name to snapshot (json-string)
1324 - "name": name of the new snapshot (json-string)
1328 -> { "execute": "blockdev-snapshot-internal-sync",
1329 "arguments": { "device": "ide-hd0",
1330 "name": "snapshot0" }
1337 .name = "blockdev-snapshot-delete-internal-sync",
1338 .args_type = "device:B,id:s?,name:s?",
1340 qmp_marshal_input_blockdev_snapshot_delete_internal_sync,
1344 blockdev-snapshot-delete-internal-sync
1345 --------------------------------------
1347 Synchronously delete an internal snapshot of a block device when the format of
1348 image used supports it. The snapshot is identified by name or id or both. One
1349 of name or id is required. If the snapshot is not found, the operation will
1354 - "device": device name (json-string)
1355 - "id": ID of the snapshot (json-string, optional)
1356 - "name": name of the snapshot (json-string, optional)
1360 -> { "execute": "blockdev-snapshot-delete-internal-sync",
1361 "arguments": { "device": "ide-hd0",
1362 "name": "snapshot0" }
1366 "name": "snapshot0",
1368 "date-sec": 1000012,
1370 "vm-clock-sec": 100,
1378 .name = "drive-mirror",
1379 .args_type = "sync:s,device:B,target:s,speed:i?,mode:s?,format:s?,"
1380 "node-name:s?,replaces:s?,"
1381 "on-source-error:s?,on-target-error:s?,"
1382 "granularity:i?,buf-size:i?",
1383 .mhandler.cmd_new = qmp_marshal_input_drive_mirror,
1390 Start mirroring a block device's writes to a
new destination
. target
1391 specifies the target of the
new image
. If the file exists
, or
if it is
1392 a device
, it will be used as the
new destination
for writes
. If it does not
1393 exist
, a
new file will be created
. format specifies the format of the
1394 mirror image
, default is to probe
if mode
='existing', else the format
1399 - "device": device name to operate
on (json
-string
)
1400 - "target": name of
new image
file (json
-string
)
1401 - "format": format of
new image (json
-string
, optional
)
1402 - "node-name": the name of the
new block driver state
in the node graph
1403 (json
-string
, optional
)
1404 - "replaces": the block driver node name to replace when finished
1405 (json
-string
, optional
)
1406 - "mode": how an image file should be created into the target
1407 file
/device (NewImageMode
, optional
, default 'absolute-paths')
1408 - "speed": maximum speed of the streaming job
, in bytes per second
1410 - "granularity": granularity of the dirty bitmap
, in bytes (json
-int
, optional
)
1411 - "buf_size": maximum amount of data
in flight from source to target
, in bytes
1412 (json
-int
, default 10M
)
1413 - "sync": what parts of the disk image should be copied to the destination
;
1414 possibilities include
"full" for all the disk
, "top" for only the sectors
1415 allocated
in the topmost image
, or
"none" to only replicate
new I
/O
1417 - "on-source-error": the action to take on an error on the source
1418 (BlockdevOnError
, default 'report')
1419 - "on-target-error": the action to take on an error on the target
1420 (BlockdevOnError
, default 'report')
1422 The
default value of the granularity is the image cluster size clamped
1423 between
4096 and
65536, if the image format defines one
. If the format
1424 does not define a cluster size
, the
default value of the granularity
1430 -> { "execute": "drive-mirror", "arguments": { "device": "ide-hd0",
1431 "target": "/some/place/my-image",
1433 "format": "qcow2" } }
1439 .name
= "change-backing-file",
1440 .args_type
= "device:s,image-node-name:s,backing-file:s",
1441 .mhandler
.cmd_new
= qmp_marshal_input_change_backing_file
,
1449 Change the backing file
in the image file metadata
. This does not cause
1450 QEMU to reopen the image file to reparse the backing
filename (it may
,
1451 however
, perform a reopen to change permissions from r
/o
-> r
/w
-> r
/o
,
1452 if needed
). The
new backing file string is written into the image file
1453 metadata
, and the QEMU internal strings are updated
.
1457 - "image-node-name": The name of the block driver state node of the
1458 image to modify
. The
"device" is argument is used to
1459 verify
"image-node-name" is
in the chain described by
1461 (json
-string
, optional
)
1463 - "device": The name of the device
.
1466 - "backing-file": The string to write as the backing file
. This string is
1467 not validated
, so care should be taken when specifying
1468 the string or the image chain may not be able to be
1472 Returns
: Nothing on success
1473 If
"device" does not exist or cannot be determined
, DeviceNotFound
1479 .args_type
= "value:M",
1480 .mhandler
.cmd_new
= qmp_marshal_input_balloon
,
1487 Request VM to change its memory
allocation (in bytes
).
1491 - "value": New memory
allocation (json
-int
)
1495 -> { "execute": "balloon", "arguments": { "value": 536870912 } }
1502 .args_type
= "name:s,up:b",
1503 .mhandler
.cmd_new
= qmp_marshal_input_set_link
,
1510 Change the link status of a network adapter
.
1514 - "name": network device
name (json
-string
)
1515 - "up": status is
up (json
-bool
)
1519 -> { "execute": "set_link", "arguments": { "name": "e1000.0", "up": false } }
1526 .args_type
= "fdname:s",
1527 .params
= "getfd name",
1528 .help
= "receive a file descriptor via SCM rights and assign it a name",
1529 .mhandler
.cmd_new
= qmp_marshal_input_getfd
,
1536 Receive a file descriptor via SCM rights and assign it a name
.
1540 - "fdname": file descriptor
name (json
-string
)
1544 -> { "execute": "getfd", "arguments": { "fdname": "fd1" } }
1549 (1) If the name specified by the
"fdname" argument already exists
,
1550 the file descriptor assigned to it will be closed and replaced
1551 by the received file descriptor
.
1552 (2) The
'closefd' command can be used to explicitly close the file
1553 descriptor when it is no longer needed
.
1559 .args_type
= "fdname:s",
1560 .params
= "closefd name",
1561 .help
= "close a file descriptor previously passed via SCM rights",
1562 .mhandler
.cmd_new
= qmp_marshal_input_closefd
,
1569 Close a file descriptor previously passed via SCM rights
.
1573 - "fdname": file descriptor
name (json
-string
)
1577 -> { "execute": "closefd", "arguments": { "fdname": "fd1" } }
1584 .args_type
= "fdset-id:i?,opaque:s?",
1585 .params
= "add-fd fdset-id opaque",
1586 .help
= "Add a file descriptor, that was passed via SCM rights, to an fd set",
1587 .mhandler
.cmd_new
= qmp_marshal_input_add_fd
,
1594 Add a file descriptor
, that was passed via SCM rights
, to an fd set
.
1598 - "fdset-id": The ID of the fd set to add the file descriptor to
.
1599 (json
-int
, optional
)
1600 - "opaque": A free
-form string that can be used to describe the fd
.
1601 (json
-string
, optional
)
1603 Return a json
-object with the following information
:
1605 - "fdset-id": The ID of the fd set that the fd was added to
. (json
-int
)
1606 - "fd": The file descriptor that was received via SCM rights and added to the
1611 -> { "execute": "add-fd", "arguments": { "fdset-id": 1 } }
1612 <- { "return": { "fdset-id": 1, "fd": 3 } }
1616 (1) The list of fd sets is shared by all monitor connections
.
1617 (2) If
"fdset-id" is not specified
, a
new fd set will be created
.
1622 .name
= "remove-fd",
1623 .args_type
= "fdset-id:i,fd:i?",
1624 .params
= "remove-fd fdset-id fd",
1625 .help
= "Remove a file descriptor from an fd set",
1626 .mhandler
.cmd_new
= qmp_marshal_input_remove_fd
,
1633 Remove a file descriptor from an fd set
.
1637 - "fdset-id": The ID of the fd set that the file descriptor belongs to
.
1639 - "fd": The file descriptor that is to be removed
. (json
-int
, optional
)
1643 -> { "execute": "remove-fd", "arguments": { "fdset-id": 1, "fd": 3 } }
1648 (1) The list of fd sets is shared by all monitor connections
.
1649 (2) If
"fd" is not specified
, all file descriptors
in "fdset-id" will be
1655 .name
= "query-fdsets",
1657 .help
= "Return information describing all fd sets",
1658 .mhandler
.cmd_new
= qmp_marshal_input_query_fdsets
,
1665 Return information describing all fd sets
.
1671 -> { "execute": "query-fdsets" }
1677 "opaque": "rdonly:/path/to/file"
1681 "opaque": "rdwr:/path/to/file"
1700 Note
: The list of fd sets is shared by all monitor connections
.
1705 .name
= "block_passwd",
1706 .args_type
= "device:s?,node-name:s?,password:s",
1707 .mhandler
.cmd_new
= qmp_marshal_input_block_passwd
,
1714 Set the password of encrypted block devices
.
1718 - "device": device
name (json
-string
)
1719 - "node-name": name
in the block driver state
graph (json
-string
)
1720 - "password": password (json
-string
)
1724 -> { "execute": "block_passwd", "arguments": { "device": "ide0-hd0",
1725 "password": "12345" } }
1731 .name
= "block_set_io_throttle",
1732 .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?",
1733 .mhandler
.cmd_new
= qmp_marshal_input_block_set_io_throttle
,
1737 block_set_io_throttle
1740 Change I
/O throttle limits
for a block drive
.
1744 - "device": device
name (json
-string
)
1745 - "bps": total throughput limit
in bytes per
second (json
-int
)
1746 - "bps_rd": read throughput limit
in bytes per
second (json
-int
)
1747 - "bps_wr": write throughput limit
in bytes per
second (json
-int
)
1748 - "iops": total I
/O operations per
second (json
-int
)
1749 - "iops_rd": read I
/O operations per
second (json
-int
)
1750 - "iops_wr": write I
/O operations per
second (json
-int
)
1751 - "bps_max": total max
in bytes (json
-int
)
1752 - "bps_rd_max": read max
in bytes (json
-int
)
1753 - "bps_wr_max": write max
in bytes (json
-int
)
1754 - "iops_max": total I
/O operations
max (json
-int
)
1755 - "iops_rd_max": read I
/O operations
max (json
-int
)
1756 - "iops_wr_max": write I
/O operations
max (json
-int
)
1757 - "iops_size": I
/O size
in bytes when
limiting (json
-int
)
1761 -> { "execute": "block_set_io_throttle", "arguments": { "device": "virtio0",
1780 .name
= "set_password",
1781 .args_type
= "protocol:s,password:s,connected:s?",
1782 .mhandler
.cmd_new
= qmp_marshal_input_set_password
,
1789 Set the password
for vnc
/spice protocols
.
1793 - "protocol": protocol
name (json
-string
)
1794 - "password": password (json
-string
)
1795 - "connected": [ keep | disconnect | fail
] (json
-string
, optional
)
1799 -> { "execute": "set_password", "arguments": { "protocol": "vnc",
1800 "password": "secret" } }
1806 .name
= "expire_password",
1807 .args_type
= "protocol:s,time:s",
1808 .mhandler
.cmd_new
= qmp_marshal_input_expire_password
,
1815 Set the password expire time
for vnc
/spice protocols
.
1819 - "protocol": protocol
name (json
-string
)
1820 - "time": [ now |
never |
+secs | secs
] (json
-string
)
1824 -> { "execute": "expire_password", "arguments": { "protocol": "vnc",
1831 .name
= "add_client",
1832 .args_type
= "protocol:s,fdname:s,skipauth:b?,tls:b?",
1833 .mhandler
.cmd_new
= qmp_marshal_input_add_client
,
1840 Add a graphics client
1844 - "protocol": protocol
name (json
-string
)
1845 - "fdname": file descriptor
name (json
-string
)
1846 - "skipauth": whether to skip
authentication (json
-bool
, optional
)
1847 - "tls": whether to perform
TLS (json
-bool
, optional
)
1851 -> { "execute": "add_client", "arguments": { "protocol": "vnc",
1852 "fdname": "myclient" } }
1857 .name
= "qmp_capabilities",
1860 .help
= "enable QMP capabilities",
1861 .mhandler
.cmd_new
= do_qmp_capabilities
,
1868 Enable QMP capabilities
.
1874 -> { "execute": "qmp_capabilities" }
1877 Note
: This command must be issued before issuing any other command
.
1882 .name
= "human-monitor-command",
1883 .args_type
= "command-line:s,cpu-index:i?",
1884 .mhandler
.cmd_new
= qmp_marshal_input_human_monitor_command
,
1888 human
-monitor
-command
1889 ---------------------
1891 Execute a Human Monitor command
.
1895 - command
-line
: the command name and its arguments
, just like the
1896 Human Monitor
's shell (json-string)
1897 - cpu-index: select the CPU number to be used by commands which access CPU
1898 data, like 'info registers
'. The Monitor selects CPU 0 if this
1899 argument is not provided (json-int, optional)
1903 -> { "execute": "human-monitor-command", "arguments": { "command-line": "info kvm" } }
1904 <- { "return": "kvm support: enabled\r\n" }
1908 (1) The Human Monitor is NOT an stable interface, this means that command
1909 names, arguments and responses can change or be removed at ANY time.
1910 Applications that rely on long term stability guarantees should NOT
1915 o This command is stateless, this means that commands that depend
1916 on state information (such as getfd) might not work
1918 o Commands that prompt the user for data (eg. 'cont
' when the block
1919 device is encrypted) don't currently work
1924 HXCOMM Each query command below is inside a SQMP
/EQMP section
, do NOT change
1925 HXCOMM
this! We will possibly move query commands definitions inside those
1926 HXCOMM sections
, just like regular commands
.
1936 Return a json
-object with the following information
:
1938 - "qemu": A json
-object containing three integer values
:
1939 - "major": QEMU
's major version (json-int)
1940 - "minor": QEMU's minor
version (json
-int
)
1941 - "micro": QEMU
's micro version (json-int)
1942 - "package": package's
version (json
-string
)
1946 -> { "execute": "query-version" }
1961 .name
= "query-version",
1963 .mhandler
.cmd_new
= qmp_marshal_input_query_version
,
1970 List QMP available commands
.
1972 Each command is represented by a json
-object
, the returned value is a json
-array
1975 Each json
-object contain
:
1977 - "name": command
's name (json-string)
1981 -> { "execute": "query-commands" }
1985 "name":"query-balloon"
1988 "name":"system_powerdown"
1993 Note: This example has been shortened as the real response is too long.
1998 .name = "query-commands",
2000 .mhandler.cmd_new = qmp_marshal_input_query_commands,
2007 List QMP available events.
2009 Each event is represented by a json-object, the returned value is a json-array
2012 Each json-object contains:
2014 - "name": event's
name (json
-string
)
2018 -> { "execute": "query-events" }
2030 Note
: This example has been shortened as the real response is too long
.
2035 .name
= "query-events",
2037 .mhandler
.cmd_new
= qmp_marshal_input_query_events
,
2044 Each device is represented by a json
-object
. The returned value is a json
-array
2047 Each json
-object contain the following
:
2049 - "label": device
's label (json-string)
2050 - "filename": device's
file (json
-string
)
2051 - "frontend-open": open
/closed state of the frontend device attached to
this
2056 -> { "execute": "query-chardev" }
2060 "label": "charchannel0",
2061 "filename": "unix:/var/lib/libvirt/qemu/seabios.rhel6.agent,server",
2062 "frontend-open": false
2065 "label": "charmonitor",
2066 "filename": "unix:/var/lib/libvirt/qemu/seabios.rhel6.monitor,server",
2067 "frontend-open": true
2070 "label": "charserial0",
2071 "filename": "pty:/dev/pts/2",
2072 "frontend-open": true
2080 .name
= "query-chardev",
2082 .mhandler
.cmd_new
= qmp_marshal_input_query_chardev
,
2086 query
-chardev
-backends
2089 List available character device backends
.
2091 Each backend is represented by a json
-object
, the returned value is a json
-array
2094 Each json
-object contains
:
2096 - "name": backend
name (json
-string
)
2100 -> { "execute": "query-chardev-backends" }
2121 .name
= "query-chardev-backends",
2123 .mhandler
.cmd_new
= qmp_marshal_input_query_chardev_backends
,
2130 Show the block devices
.
2132 Each block device information is stored
in a json
-object and the returned value
2133 is a json
-array of all devices
.
2135 Each json
-object contain the following
:
2137 - "device": device
name (json
-string
)
2138 - "type": device
type (json
-string
)
2139 - deprecated
, retained
for backward compatibility
2140 - Possible values
: "unknown"
2141 - "removable": true if the device is removable
, false otherwise (json
-bool
)
2142 - "locked": true if the device is locked
, false otherwise (json
-bool
)
2143 - "tray_open": only present
if removable
, true if the device has a tray
,
2144 and it is
open (json
-bool
)
2145 - "inserted": only present
if the device is inserted
, it is a json
-object
2146 containing the following
:
2147 - "file": device file
name (json
-string
)
2148 - "ro": true if read
-only
, false otherwise (json
-bool
)
2149 - "drv": driver format
name (json
-string
)
2150 - Possible values
: "blkdebug", "bochs", "cloop", "dmg",
2151 "file", "file", "ftp", "ftps", "host_cdrom",
2152 "host_device", "http", "https",
2153 "nbd", "parallels", "qcow", "qcow2", "raw",
2154 "tftp", "vdi", "vmdk", "vpc", "vvfat"
2155 - "backing_file": backing file
name (json
-string
, optional
)
2156 - "backing_file_depth": number of files
in the backing file
chain (json
-int
)
2157 - "encrypted": true if encrypted
, false otherwise (json
-bool
)
2158 - "bps": limit total bytes per
second (json
-int
)
2159 - "bps_rd": limit read bytes per
second (json
-int
)
2160 - "bps_wr": limit write bytes per
second (json
-int
)
2161 - "iops": limit total I
/O operations per
second (json
-int
)
2162 - "iops_rd": limit read operations per
second (json
-int
)
2163 - "iops_wr": limit write operations per
second (json
-int
)
2164 - "bps_max": total max
in bytes (json
-int
)
2165 - "bps_rd_max": read max
in bytes (json
-int
)
2166 - "bps_wr_max": write max
in bytes (json
-int
)
2167 - "iops_max": total I
/O operations
max (json
-int
)
2168 - "iops_rd_max": read I
/O operations
max (json
-int
)
2169 - "iops_wr_max": write I
/O operations
max (json
-int
)
2170 - "iops_size": I
/O size when limiting by
iops (json
-int
)
2171 - "detect_zeroes": detect and optimize zero
writing (json
-string
)
2172 - Possible values
: "off", "on", "unmap"
2173 - "write_threshold": write offset threshold
in bytes
, a event will be
2174 emitted
if crossed
. Zero
if disabled (json
-int
)
2175 - "image": the detail of the image
, it is a json
-object containing
2177 - "filename": image file
name (json
-string
)
2178 - "format": image
format (json
-string
)
2179 - "virtual-size": image capacity
in bytes (json
-int
)
2180 - "dirty-flag": true if image is not cleanly closed
, not present
2181 means
clean (json
-bool
, optional
)
2182 - "actual-size": actual size on disk
in bytes of the image
, not
2183 present when image does not support thin
2184 provision (json
-int
, optional
)
2185 - "cluster-size": size of a cluster
in bytes
, not present
if image
2186 format does not support
it (json
-int
, optional
)
2187 - "encrypted": true if the image is encrypted
, not present means
2188 false or the image format does not support
2189 encryption (json
-bool
, optional
)
2190 - "backing_file": backing file name
, not present means no backing
2191 file is used or the image format does not
2192 support backing file chain
2193 (json
-string
, optional
)
2194 - "full-backing-filename": full path of the backing file
, not
2195 present
if it equals backing_file or no
2196 backing file is used
2197 (json
-string
, optional
)
2198 - "backing-filename-format": the format of the backing file
, not
2199 present means unknown or no backing
2200 file (json
-string
, optional
)
2201 - "snapshots": the internal snapshot info
, it is an optional list
2202 of json
-object containing the following
:
2203 - "id": unique snapshot
id (json
-string
)
2204 - "name": snapshot
name (json
-string
)
2205 - "vm-state-size": size of the VM state
in bytes (json
-int
)
2206 - "date-sec": UTC date of the snapshot
in seconds (json
-int
)
2207 - "date-nsec": fractional part
in nanoseconds to be used with
2209 - "vm-clock-sec": VM clock relative to boot
in seconds
2211 - "vm-clock-nsec": fractional part
in nanoseconds to be used
2212 with vm
-clock
-sec (json
-int
)
2213 - "backing-image": the detail of the backing image
, it is an
2214 optional json
-object only present when a
2215 backing image present
for this image
2217 - "io-status": I
/O operation status
, only present
if the device supports it
2218 and the VM is configured to stop on errors
. It
's always reset
2219 to "ok" when the "cont" command is issued (json_string, optional)
2220 - Possible values: "ok", "failed", "nospace"
2224 -> { "execute": "query-block" }
2229 "device":"ide0-hd0",
2236 "file":"disks/test.qcow2",
2237 "backing_file_depth":1,
2251 "detect_zeroes": "on",
2252 "write_threshold": 0,
2254 "filename":"disks/test.qcow2",
2256 "virtual-size":2048000,
2257 "backing_file":"base.qcow2",
2258 "full-backing-filename":"disks/base.qcow2",
2259 "backing-filename-format:"qcow2",
2263 "name": "snapshot1",
2265 "date-sec": 10000200,
2267 "vm-clock-sec": 206,
2272 "filename":"disks/base.qcow2",
2274 "virtual-size":2048000
2282 "device":"ide1-cd0",
2305 .name = "query-block",
2307 .mhandler.cmd_new = qmp_marshal_input_query_block,
2314 Show block device statistics.
2316 Each device statistic information is stored in a json-object and the returned
2317 value is a json-array of all devices.
2319 Each json-object contain the following:
2321 - "device": device name (json-string)
2322 - "stats": A json-object with the statistics information, it contains:
2323 - "rd_bytes": bytes read (json-int)
2324 - "wr_bytes": bytes written (json-int)
2325 - "rd_operations": read operations (json-int)
2326 - "wr_operations": write operations (json-int)
2327 - "flush_operations": cache flush operations (json-int)
2328 - "wr_total_time_ns": total time spend on writes in nano-seconds (json-int)
2329 - "rd_total_time_ns": total time spend on reads in nano-seconds (json-int)
2330 - "flush_total_time_ns": total time spend on cache flushes in nano-seconds (json-int)
2331 - "wr_highest_offset": Highest offset of a sector written since the
2332 BlockDriverState has been opened (json-int)
2333 - "rd_merged": number of read requests that have been merged into
2334 another request (json-int)
2335 - "wr_merged": number of write requests that have been merged into
2336 another request (json-int)
2337 - "parent": Contains recursively the statistics of the underlying
2338 protocol (e.g. the host file for a qcow2 image). If there is
2339 no underlying protocol, this field is omitted
2340 (json-object, optional)
2344 -> { "execute": "query-blockstats" }
2348 "device":"ide0-hd0",
2351 "wr_highest_offset":3686448128,
2353 "wr_operations":751,
2354 "rd_bytes":122567168,
2355 "rd_operations":36772
2356 "wr_total_times_ns":313253456
2357 "rd_total_times_ns":3465673657
2358 "flush_total_times_ns":49653
2359 "flush_operations":61,
2365 "wr_highest_offset":2821110784,
2367 "wr_operations":692,
2368 "rd_bytes":122739200,
2369 "rd_operations":36604
2370 "flush_operations":51,
2371 "wr_total_times_ns":313253456
2372 "rd_total_times_ns":3465673657
2373 "flush_total_times_ns":49653,
2379 "device":"ide1-cd0",
2381 "wr_highest_offset":0,
2386 "flush_operations":0,
2387 "wr_total_times_ns":0
2388 "rd_total_times_ns":0
2389 "flush_total_times_ns":0,
2397 "wr_highest_offset":0,
2402 "flush_operations":0,
2403 "wr_total_times_ns":0
2404 "rd_total_times_ns":0
2405 "flush_total_times_ns":0,
2413 "wr_highest_offset":0,
2418 "flush_operations":0,
2419 "wr_total_times_ns":0
2420 "rd_total_times_ns":0
2421 "flush_total_times_ns":0,
2432 .name = "query-blockstats",
2433 .args_type = "query-nodes:b?",
2434 .mhandler.cmd_new = qmp_marshal_input_query_blockstats,
2441 Show CPU information.
2443 Return a json-array. Each CPU is represented by a json-object, which contains:
2445 - "CPU": CPU index (json-int)
2446 - "current": true if this is the current CPU, false otherwise (json-bool)
2447 - "halted": true if the cpu is halted, false otherwise (json-bool)
2448 - Current program counter. The key's name depends on the architecture
:
2449 "pc": i386
/x86_64 (json
-int
)
2450 "nip": PPC (json
-int
)
2451 "pc" and
"npc": sparc (json
-int
)
2452 "PC": mips (json
-int
)
2453 - "thread_id": ID of the underlying host
thread (json
-int
)
2457 -> { "execute": "query-cpus" }
2480 .name
= "query-cpus",
2482 .mhandler
.cmd_new
= qmp_marshal_input_query_cpus
,
2489 Returns a list of information about each iothread
.
2491 Note
this list excludes the QEMU main loop thread
, which is not declared
2492 using the
-object iothread command
-line option
. It is always the main thread
2495 Return a json
-array
. Each iothread is represented by a json
-object
, which contains
:
2497 - "id": name of
iothread (json
-str
)
2498 - "thread-id": ID of the underlying host
thread (json
-int
)
2502 -> { "execute": "query-iothreads" }
2519 .name
= "query-iothreads",
2521 .mhandler
.cmd_new
= qmp_marshal_input_query_iothreads
,
2528 PCI buses and devices information
.
2530 The returned value is a json
-array of all buses
. Each bus is represented by
2531 a json
-object
, which has a key with a json
-array of all PCI devices attached
2532 to it
. Each device is represented by a json
-object
.
2534 The bus json
-object contains the following
:
2536 - "bus": bus
number (json
-int
)
2537 - "devices": a json
-array of json
-objects
, each json
-object represents a
2540 The PCI device json
-object contains the following
:
2542 - "bus": identical to the parent
's bus number (json-int)
2543 - "slot": slot number (json-int)
2544 - "function": function number (json-int)
2545 - "class_info": a json-object containing:
2546 - "desc": device class description (json-string, optional)
2547 - "class": device class number (json-int)
2548 - "id": a json-object containing:
2549 - "device": device ID (json-int)
2550 - "vendor": vendor ID (json-int)
2551 - "irq": device's IRQ
if assigned (json
-int
, optional
)
2552 - "qdev_id": qdev id
string (json
-string
)
2553 - "pci_bridge": It
's a json-object, only present if this device is a
2554 PCI bridge, contains:
2555 - "bus": bus number (json-int)
2556 - "secondary": secondary bus number (json-int)
2557 - "subordinate": subordinate bus number (json-int)
2558 - "io_range": I/O memory range information, a json-object with the
2560 - "base": base address, in bytes (json-int)
2561 - "limit": limit address, in bytes (json-int)
2562 - "memory_range": memory range information, a json-object with the
2564 - "base": base address, in bytes (json-int)
2565 - "limit": limit address, in bytes (json-int)
2566 - "prefetchable_range": Prefetchable memory range information, a
2567 json-object with the following members:
2568 - "base": base address, in bytes (json-int)
2569 - "limit": limit address, in bytes (json-int)
2570 - "devices": a json-array of PCI devices if there's any attached
, each
2571 each element is represented by a json
-object
, which contains
2572 the same members of the
'PCI device json-object' described
2574 - "regions": a json
-array of json
-objects
, each json
-object represents a
2575 memory region of
this device
2577 The memory range json
-object contains the following
:
2579 - "base": base memory
address (json
-int
)
2580 - "limit": limit
value (json
-int
)
2582 The region json
-object can be an I
/O region or a memory region
, an I
/O region
2583 json
-object contains the following
:
2585 - "type": "io" (json
-string
, fixed
)
2586 - "bar": BAR
number (json
-int
)
2587 - "address": memory
address (json
-int
)
2588 - "size": memory
size (json
-int
)
2590 A memory region json
-object contains the following
:
2592 - "type": "memory" (json
-string
, fixed
)
2593 - "bar": BAR
number (json
-int
)
2594 - "address": memory
address (json
-int
)
2595 - "size": memory
size (json
-int
)
2596 - "mem_type_64": true or
false (json
-bool
)
2597 - "prefetch": true or
false (json
-bool
)
2601 -> { "execute": "query-pci" }
2613 "desc":"Host bridge"
2647 "desc":"IDE controller"
2669 "desc":"VGA controller"
2679 "mem_type_64":false,
2682 "address":4026531840,
2687 "mem_type_64":false,
2690 "address":4060086272,
2695 "mem_type_64":false,
2710 "desc":"RAM controller"
2731 Note
: This example has been shortened as the real response is too long
.
2736 .name
= "query-pci",
2738 .mhandler
.cmd_new
= qmp_marshal_input_query_pci
,
2745 Show KVM information
.
2747 Return a json
-object with the following information
:
2749 - "enabled": true if KVM support is enabled
, false otherwise (json
-bool
)
2750 - "present": true if QEMU has KVM support
, false otherwise (json
-bool
)
2754 -> { "execute": "query-kvm" }
2755 <- { "return": { "enabled": true, "present": true } }
2760 .name
= "query-kvm",
2762 .mhandler
.cmd_new
= qmp_marshal_input_query_kvm
,
2769 Return a json
-object with the following information
:
2771 - "running": true if the VM is running
, or
false if it is
paused (json
-bool
)
2772 - "singlestep": true if the VM is
in single step mode
,
2773 false otherwise (json
-bool
)
2774 - "status": one of the following
values (json
-string
)
2775 "debug" - QEMU is running on a debugger
2776 "inmigrate" - guest is paused waiting
for an incoming migration
2777 "internal-error" - An internal error that prevents further guest
2778 execution has occurred
2779 "io-error" - the last IOP has failed and the device is configured
2780 to pause on I
/O errors
2781 "paused" - guest has been paused via the
'stop' command
2782 "postmigrate" - guest is paused following a successful
'migrate'
2783 "prelaunch" - QEMU was started with
-S and guest has not started
2784 "finish-migrate" - guest is paused to finish the migration process
2785 "restore-vm" - guest is paused to restore VM state
2786 "running" - guest is actively running
2787 "save-vm" - guest is paused to save the VM state
2788 "shutdown" - guest is shut
down (and
-no
-shutdown is
in use
)
2789 "watchdog" - the watchdog action is configured to pause and
2794 -> { "execute": "query-status" }
2795 <- { "return": { "running": true, "singlestep": false, "status": "running" } }
2800 .name
= "query-status",
2802 .mhandler
.cmd_new
= qmp_marshal_input_query_status
,
2809 Show VM mice information
.
2811 Each mouse is represented by a json
-object
, the returned value is a json
-array
2814 The mouse json
-object contains the following
:
2816 - "name": mouse
's name (json-string)
2817 - "index": mouse's
index (json
-int
)
2818 - "current": true if this mouse is receiving events
, false otherwise (json
-bool
)
2819 - "absolute": true if the mouse generates absolute input
events (json
-bool
)
2823 -> { "execute": "query-mice" }
2827 "name":"QEMU Microsoft Mouse",
2833 "name":"QEMU PS/2 Mouse",
2844 .name
= "query-mice",
2846 .mhandler
.cmd_new
= qmp_marshal_input_query_mice
,
2853 Show VNC server information
.
2855 Return a json
-object with server information
. Connected clients are returned
2856 as a json
-array of json
-objects
.
2858 The main json
-object contains the following
:
2860 - "enabled": true or
false (json
-bool
)
2861 - "host": server
's IP address (json-string)
2862 - "family": address family (json-string)
2863 - Possible values: "ipv4", "ipv6", "unix", "unknown"
2864 - "service": server's port
number (json
-string
)
2865 - "auth": authentication
method (json
-string
)
2866 - Possible values
: "invalid", "none", "ra2", "ra2ne", "sasl", "tight",
2867 "tls", "ultra", "unknown", "vencrypt", "vencrypt",
2868 "vencrypt+plain", "vencrypt+tls+none",
2869 "vencrypt+tls+plain", "vencrypt+tls+sasl",
2870 "vencrypt+tls+vnc", "vencrypt+x509+none",
2871 "vencrypt+x509+plain", "vencrypt+x509+sasl",
2872 "vencrypt+x509+vnc", "vnc"
2873 - "clients": a json
-array of all connected clients
2875 Clients are described by a json
-object
, each one contain the following
:
2877 - "host": client
's IP address (json-string)
2878 - "family": address family (json-string)
2879 - Possible values: "ipv4", "ipv6", "unix", "unknown"
2880 - "service": client's port
number (json
-string
)
2881 - "x509_dname": TLS
dname (json
-string
, optional
)
2882 - "sasl_username": SASL
username (json
-string
, optional
)
2886 -> { "execute": "query-vnc" }
2907 .name
= "query-vnc",
2909 .mhandler
.cmd_new
= qmp_marshal_input_query_vnc
,
2912 .name
= "query-vnc-servers",
2914 .mhandler
.cmd_new
= qmp_marshal_input_query_vnc_servers
,
2921 Show SPICE server information
.
2923 Return a json
-object with server information
. Connected clients are returned
2924 as a json
-array of json
-objects
.
2926 The main json
-object contains the following
:
2928 - "enabled": true or
false (json
-bool
)
2929 - "host": server
's IP address (json-string)
2930 - "port": server's port
number (json
-int
, optional
)
2931 - "tls-port": server
's port number (json-int, optional)
2932 - "auth": authentication method (json-string)
2933 - Possible values: "none", "spice"
2934 - "channels": a json-array of all active channels clients
2936 Channels are described by a json-object, each one contain the following:
2938 - "host": client's IP
address (json
-string
)
2939 - "family": address
family (json
-string
)
2940 - Possible values
: "ipv4", "ipv6", "unix", "unknown"
2941 - "port": client
's port number (json-string)
2942 - "connection-id": spice connection id. All channels with the same id
2943 belong to the same spice session (json-int)
2944 - "channel-type": channel type. "1" is the main control channel, filter for
2945 this one if you want track spice sessions only (json-int)
2946 - "channel-id": channel id. Usually "0", might be different needed when
2947 multiple channels of the same type exist, such as multiple
2948 display channels in a multihead setup (json-int)
2949 - "tls": whether the channel is encrypted (json-bool)
2953 -> { "execute": "query-spice" }
2966 "connection-id": 1804289383,
2967 "host": "127.0.0.1",
2975 "connection-id": 1804289383,
2976 "host": "127.0.0.1",
2980 [ ... more channels follow ... ]
2987 #if defined(CONFIG_SPICE)
2989 .name = "query-spice",
2991 .mhandler.cmd_new = qmp_marshal_input_query_spice,
3001 Return a json-object with the following information:
3003 - "name": VM's
name (json
-string
, optional
)
3007 -> { "execute": "query-name" }
3008 <- { "return": { "name": "qemu-name" } }
3013 .name
= "query-name",
3015 .mhandler
.cmd_new
= qmp_marshal_input_query_name
,
3024 Return a json
-object with the following information
:
3026 - "UUID": Universally Unique
Identifier (json
-string
)
3030 -> { "execute": "query-uuid" }
3031 <- { "return": { "UUID": "550e8400-e29b-41d4-a716-446655440000" } }
3036 .name
= "query-uuid",
3038 .mhandler
.cmd_new
= qmp_marshal_input_query_uuid
,
3042 query
-command
-line
-options
3043 --------------------------
3045 Show command line option schema
.
3047 Return a json
-array of command line option schema
for all
options (or
for
3048 the given option
), returning an error
if the given option doesn
't exist.
3050 Each array entry contains the following:
3052 - "option": option name (json-string)
3053 - "parameters": a json-array describes all parameters of the option:
3054 - "name": parameter name (json-string)
3055 - "type": parameter type (one of 'string
', 'boolean
', 'number
',
3057 - "help": human readable description of the parameter
3058 (json-string, optional)
3059 - "default": default value string for the parameter
3060 (json-string, optional)
3064 -> { "execute": "query-command-line-options", "arguments": { "option": "option-rom" } }
3073 "name": "bootindex",
3077 "option": "option-rom"
3085 .name = "query-command-line-options",
3086 .args_type = "option:s?",
3087 .mhandler.cmd_new = qmp_marshal_input_query_command_line_options,
3096 Return a json-object. If migration is active there will be another json-object
3097 with RAM migration status and if block migration is active another one with
3098 block migration status.
3100 The main json-object contains the following:
3102 - "status": migration status (json-string)
3103 - Possible values: "setup", "active", "completed", "failed", "cancelled"
3104 - "total-time": total amount of ms since migration started. If
3105 migration has ended, it returns the total migration
3107 - "setup-time" amount of setup time in milliseconds _before_ the
3108 iterations begin but _after_ the QMP command is issued.
3109 This is designed to provide an accounting of any activities
3110 (such as RDMA pinning) which may be expensive, but do not
3111 actually occur during the iterative migration rounds
3112 themselves. (json-int)
3113 - "downtime": only present when migration has finished correctly
3114 total amount in ms for downtime that happened (json-int)
3115 - "expected-downtime": only present while migration is active
3116 total amount in ms for downtime that was calculated on
3117 the last bitmap round (json-int)
3118 - "ram": only present if "status" is "active", it is a json-object with the
3119 following RAM information:
3120 - "transferred": amount transferred in bytes (json-int)
3121 - "remaining": amount remaining to transfer in bytes (json-int)
3122 - "total": total amount of memory in bytes (json-int)
3123 - "duplicate": number of pages filled entirely with the same
3125 These are sent over the wire much more efficiently.
3126 - "skipped": number of skipped zero pages (json-int)
3127 - "normal" : number of whole pages transferred. I.e. they
3128 were not sent as duplicate or xbzrle pages (json-int)
3129 - "normal-bytes" : number of bytes transferred in whole
3130 pages. This is just normal pages times size of one page,
3131 but this way upper levels don't need to care about page
3133 - "dirty-sync-count": times that dirty ram was
synchronized (json
-int
)
3134 - "disk": only present
if "status" is
"active" and it is a block migration
,
3135 it is a json
-object with the following disk information
:
3136 - "transferred": amount transferred
in bytes (json
-int
)
3137 - "remaining": amount remaining to transfer
in bytes json
-int
)
3138 - "total": total disk size
in bytes (json
-int
)
3139 - "xbzrle-cache": only present
if XBZRLE is active
.
3140 It is a json
-object with the following XBZRLE information
:
3141 - "cache-size": XBZRLE cache size
in bytes
3142 - "bytes": number of bytes transferred
for XBZRLE compressed pages
3143 - "pages": number of XBZRLE compressed pages
3144 - "cache-miss": number of XBRZRLE page cache misses
3145 - "cache-miss-rate": rate of XBRZRLE page cache misses
3146 - "overflow": number of times XBZRLE overflows
. This means
3147 that the XBZRLE encoding was bigger than just sent the
3148 whole page
, and then we sent the whole page
instead (as as
3153 1. Before the first migration
3155 -> { "execute": "query-migrate" }
3158 2. Migration is done and has succeeded
3160 -> { "execute": "query-migrate" }
3162 "status": "completed",
3172 "normal-bytes":123456,
3173 "dirty-sync-count":15
3178 3. Migration is done and has failed
3180 -> { "execute": "query-migrate" }
3181 <- { "return": { "status": "failed" } }
3183 4. Migration is being performed and is not a block migration
:
3185 -> { "execute": "query-migrate" }
3195 "expected-downtime":12345,
3198 "normal-bytes":123456,
3199 "dirty-sync-count":15
3204 5. Migration is being performed and is a block migration
:
3206 -> { "execute": "query-migrate" }
3212 "remaining":1053304,
3216 "expected-downtime":12345,
3219 "normal-bytes":123456,
3220 "dirty-sync-count":15
3224 "remaining":20880384,
3230 6. Migration is being performed and XBZRLE is active
:
3232 -> { "execute": "query-migrate" }
3236 "capabilities" : [ { "capability": "xbzrle", "state" : true } ],
3239 "remaining":1053304,
3243 "expected-downtime":12345,
3246 "normal-bytes":3412992,
3247 "dirty-sync-count":15
3250 "cache-size":67108864,
3254 "cache-miss-rate":0.123,
3263 .name
= "query-migrate",
3265 .mhandler
.cmd_new
= qmp_marshal_input_query_migrate
,
3269 migrate
-set
-capabilities
3270 ------------------------
3272 Enable
/Disable migration capabilities
3274 - "xbzrle": XBZRLE support
3275 - "rdma-pin-all": pin all pages when
using RDMA during migration
3276 - "auto-converge": throttle down guest to help convergence of migration
3277 - "zero-blocks": compress zero blocks during block migration
3283 -> { "execute": "migrate-set-capabilities" , "arguments":
3284 { "capabilities": [ { "capability": "xbzrle", "state": true } ] } }
3289 .name
= "migrate-set-capabilities",
3290 .args_type
= "capabilities:q",
3291 .params
= "capability:s,state:b",
3292 .mhandler
.cmd_new
= qmp_marshal_input_migrate_set_capabilities
,
3295 query
-migrate
-capabilities
3296 --------------------------
3298 Query current migration capabilities
3300 - "capabilities": migration capabilities state
3301 - "xbzrle" : XBZRLE
state (json
-bool
)
3302 - "rdma-pin-all" : RDMA Pin Page
state (json
-bool
)
3303 - "auto-converge" : Auto Converge
state (json
-bool
)
3304 - "zero-blocks" : Zero Blocks
state (json
-bool
)
3310 -> { "execute": "query-migrate-capabilities" }
3311 <- { "return": [ { "state": false, "capability": "xbzrle" } ] }
3316 .name
= "query-migrate-capabilities",
3318 .mhandler
.cmd_new
= qmp_marshal_input_query_migrate_capabilities
,
3325 Show balloon information
.
3327 Make an asynchronous request
for balloon info
. When the request completes a
3328 json
-object will be returned containing the following data
:
3330 - "actual": current balloon value
in bytes (json
-int
)
3334 -> { "execute": "query-balloon" }
3337 "actual":1073741824,
3344 .name
= "query-balloon",
3346 .mhandler
.cmd_new
= qmp_marshal_input_query_balloon
,
3350 .name
= "query-block-jobs",
3352 .mhandler
.cmd_new
= qmp_marshal_input_query_block_jobs
,
3357 .args_type
= "path:s",
3358 .mhandler
.cmd_new
= qmp_marshal_input_qom_list
,
3363 .args_type
= "path:s,property:s,value:q",
3364 .mhandler
.cmd_new
= qmp_qom_set
,
3369 .args_type
= "path:s,property:s",
3370 .mhandler
.cmd_new
= qmp_qom_get
,
3374 .name
= "nbd-server-start",
3375 .args_type
= "addr:q",
3376 .mhandler
.cmd_new
= qmp_marshal_input_nbd_server_start
,
3379 .name
= "nbd-server-add",
3380 .args_type
= "device:B,writable:b?",
3381 .mhandler
.cmd_new
= qmp_marshal_input_nbd_server_add
,
3384 .name
= "nbd-server-stop",
3386 .mhandler
.cmd_new
= qmp_marshal_input_nbd_server_stop
,
3390 .name
= "change-vnc-password",
3391 .args_type
= "password:s",
3392 .mhandler
.cmd_new
= qmp_marshal_input_change_vnc_password
,
3395 .name
= "qom-list-types",
3396 .args_type
= "implements:s?,abstract:b?",
3397 .mhandler
.cmd_new
= qmp_marshal_input_qom_list_types
,
3401 .name
= "device-list-properties",
3402 .args_type
= "typename:s",
3403 .mhandler
.cmd_new
= qmp_marshal_input_device_list_properties
,
3407 .name
= "query-machines",
3409 .mhandler
.cmd_new
= qmp_marshal_input_query_machines
,
3413 .name
= "query-cpu-definitions",
3415 .mhandler
.cmd_new
= qmp_marshal_input_query_cpu_definitions
,
3419 .name
= "query-target",
3421 .mhandler
.cmd_new
= qmp_marshal_input_query_target
,
3425 .name
= "query-tpm",
3427 .mhandler
.cmd_new
= qmp_marshal_input_query_tpm
,
3434 Return information about the TPM device
.
3440 -> { "execute": "query-tpm" }
3443 { "model": "tpm-tis",
3445 { "type": "passthrough",
3447 { "cancel-path": "/sys/class/misc/tpm0/device/cancel",
3459 .name
= "query-tpm-models",
3461 .mhandler
.cmd_new
= qmp_marshal_input_query_tpm_models
,
3468 Return a list of supported TPM models
.
3474 -> { "execute": "query-tpm-models" }
3475 <- { "return": [ "tpm-tis" ] }
3480 .name
= "query-tpm-types",
3482 .mhandler
.cmd_new
= qmp_marshal_input_query_tpm_types
,
3489 Return a list of supported TPM types
.
3495 -> { "execute": "query-tpm-types" }
3496 <- { "return": [ "passthrough" ] }
3501 .name
= "chardev-add",
3502 .args_type
= "id:s,backend:q",
3503 .mhandler
.cmd_new
= qmp_marshal_input_chardev_add
,
3514 - "id": the chardev
's ID, must be unique (json-string)
3515 - "backend": chardev backend type + parameters
3519 -> { "execute" : "chardev-add",
3520 "arguments" : { "id" : "foo",
3521 "backend" : { "type" : "null", "data" : {} } } }
3524 -> { "execute" : "chardev-add",
3525 "arguments" : { "id" : "bar",
3526 "backend" : { "type" : "file",
3527 "data" : { "out" : "/tmp/bar.log" } } } }
3530 -> { "execute" : "chardev-add",
3531 "arguments" : { "id" : "baz",
3532 "backend" : { "type" : "pty", "data" : {} } } }
3533 <- { "return": { "pty" : "/dev/pty/42" } }
3538 .name = "chardev-remove",
3539 .args_type = "id:s",
3540 .mhandler.cmd_new = qmp_marshal_input_chardev_remove,
3552 - "id": the chardev's ID
, must exist and not be
in use (json
-string
)
3556 -> { "execute": "chardev-remove", "arguments": { "id" : "foo" } }
3561 .name
= "query-rx-filter",
3562 .args_type
= "name:s?",
3563 .mhandler
.cmd_new
= qmp_marshal_input_query_rx_filter
,
3570 Show rx
-filter information
.
3572 Returns a json
-array of rx
-filter information
for all
NICs (or
for the
3573 given NIC
), returning an error
if the given NIC doesn
't exist, or
3574 given NIC doesn't support rx
-filter querying
, or given net client
3577 The query will clear the event notification flag of each NIC, then qemu
3578 will start to emit event to QMP monitor.
3580 Each array entry contains the following:
3582 - "name": net client name (json-string)
3583 - "promiscuous": promiscuous mode is enabled (json-bool)
3584 - "multicast": multicast receive state (one of 'normal
', 'none
', 'all
')
3585 - "unicast": unicast receive state (one of 'normal
', 'none
', 'all
')
3586 - "vlan": vlan receive state (one of 'normal
', 'none
', 'all
') (Since 2.0)
3587 - "broadcast-allowed": allow to receive broadcast (json-bool)
3588 - "multicast-overflow": multicast table is overflowed (json-bool)
3589 - "unicast-overflow": unicast table is overflowed (json-bool)
3590 - "main-mac": main macaddr string (json-string)
3591 - "vlan-table": a json-array of active vlan id
3592 - "unicast-table": a json-array of unicast macaddr string
3593 - "multicast-table": a json-array of multicast macaddr string
3597 -> { "execute": "query-rx-filter", "arguments": { "name": "vnet0" } }
3600 "promiscuous": true,
3602 "main-mac": "52:54:00:12:34:56",
3603 "unicast": "normal",
3611 "multicast": "normal",
3612 "multicast-overflow": false,
3613 "unicast-overflow": false,
3614 "multicast-table": [
3615 "01:00:5e:00:00:01",
3616 "33:33:00:00:00:01",
3619 "broadcast-allowed": false
3627 .name = "blockdev-add",
3628 .args_type = "options:q",
3629 .mhandler.cmd_new = qmp_marshal_input_blockdev_add,
3638 This command is still a work in progress. It doesn't support all
3639 block drivers
, it lacks a matching blockdev
-del
, and more
. Stay away
3640 from it unless you want to help with its development
.
3644 - "options": block driver options
3648 -> { "execute": "blockdev-add",
3649 "arguments": { "options" : { "driver": "qcow2",
3650 "file": { "driver": "file",
3651 "filename": "test.qcow2" } } } }
3656 -> { "execute": "blockdev-add",
3668 "filename": "/tmp/test.qcow2"
3674 "filename": "/dev/fdset/4"
3686 .name
= "query-named-block-nodes",
3688 .mhandler
.cmd_new
= qmp_marshal_input_query_named_block_nodes
,
3692 @query
-named
-block
-nodes
3693 ------------------------
3695 Return a list of BlockDeviceInfo
for all the named block driver nodes
3699 -> { "execute": "query-named-block-nodes" }
3700 <- { "return": [ { "ro":false,
3703 "file":"disks/test.qcow2",
3704 "node-name": "my-node",
3705 "backing_file_depth":1,
3719 "write_threshold": 0,
3721 "filename":"disks/test.qcow2",
3723 "virtual-size":2048000,
3724 "backing_file":"base.qcow2",
3725 "full-backing-filename":"disks/base.qcow2",
3726 "backing-filename-format:"qcow2
",
3730 "name
": "snapshot1
",
3732 "date
-sec
": 10000200,
3734 "vm
-clock
-sec
": 206,
3739 "filename
":"disks
/base
.qcow2
",
3741 "virtual
-size
":2048000
3748 .name = "query
-memdev
",
3750 .mhandler.cmd_new = qmp_marshal_input_query_memdev,
3757 Show memory devices information.
3762 -> { "execute
": "query
-memdev
" }
3769 "host
-nodes
": [0, 1],
3777 "host
-nodes
": [2, 3],
3778 "policy
": "preferred
"
3786 .name = "query
-memory
-devices
",
3788 .mhandler.cmd_new = qmp_marshal_input_query_memory_devices,
3792 @query-memory-devices
3793 --------------------
3795 Return a list of memory devices.
3798 -> { "execute
": "query
-memory
-devices
" }
3799 <- { "return": [ { "data
":
3800 { "addr
": 5368709120,
3801 "hotpluggable
": true,
3804 "memdev
": "/objects
/memX
",
3813 .name = "query
-acpi
-ospm
-status
",
3815 .mhandler.cmd_new = qmp_marshal_input_query_acpi_ospm_status,
3819 @query-acpi-ospm-status
3820 --------------------
3822 Return list of ACPIOSTInfo for devices that support status reporting
3823 via ACPI _OST method.
3826 -> { "execute
": "query
-acpi
-ospm
-status
" }
3827 <- { "return": [ { "device
": "d1
", "slot
": "0", "slot
-type
": "DIMM
", "source
": 1, "status
": 0},
3828 { "slot
": "1", "slot
-type
": "DIMM
", "source
": 0, "status
": 0},
3829 { "slot
": "2", "slot
-type
": "DIMM
", "source
": 0, "status
": 0},
3830 { "slot
": "3", "slot
-type
": "DIMM
", "source
": 0, "status
": 0}
3834 #if defined TARGET_I386
3836 .name = "rtc
-reset
-reinjection
",
3838 .mhandler.cmd_new = qmp_marshal_input_rtc_reset_reinjection,
3843 rtc-reset-reinjection
3844 ---------------------
3846 Reset the RTC interrupt reinjection backlog.
3852 -> { "execute
": "rtc
-reset
-reinjection
" }
3857 .name = "trace-event
-get
-state
",
3858 .args_type = "name
:s
",
3859 .mhandler.cmd_new = qmp_marshal_input_trace_event_get_state,
3863 trace-event-get-state
3864 ---------------------
3866 Query the state of events.
3870 -> { "execute
": "trace-event
-get
-state
", "arguments
": { "name
": "qemu_memalign
" } }
3871 <- { "return": [ { "name
": "qemu_memalign
", "state
": "disabled
" } ] }
3875 .name = "trace-event
-set
-state
",
3876 .args_type = "name
:s
,enable
:b
,ignore
-unavailable
:b?
",
3877 .mhandler.cmd_new = qmp_marshal_input_trace_event_set_state,
3881 trace-event-set-state
3882 ---------------------
3884 Set the state of events.
3888 -> { "execute
": "trace-event
-set
-state
", "arguments
": { "name
": "qemu_memalign
", "enable
": "true" } }
3893 .name = "x
-input
-send
-event
",
3894 .args_type = "console
:i?
,events
:q
",
3895 .mhandler.cmd_new = qmp_marshal_input_x_input_send_event,
3902 Send input event to guest.
3906 - "console
": console index. (json-int, optional)
3907 - "events
": list of input events.
3909 The consoles are visible in the qom tree, under
3910 /backend/console[$index]. They have a device link and head property, so
3911 it is possible to map which console belongs to which device and display.
3913 Note: this command is experimental, and not a stable API.
3917 Press left mouse button.
3919 -> { "execute
": "x
-input
-send
-event
",
3920 "arguments
": { "console
": 0,
3921 "events
": [ { "type
": "btn
",
3922 "data
" : { "down
": true, "button
": "Left
" } } ] } }
3925 -> { "execute
": "x
-input
-send
-event
",
3926 "arguments
": { "console
": 0,
3927 "events
": [ { "type
": "btn
",
3928 "data
" : { "down
": false, "button
": "Left
" } } ] } }
3935 -> { "execute
": "x
-input
-send
-event
",
3936 "arguments
": { "console
": 0, "events
": [
3937 { "type
": "key
", "data
" : { "down
": true,
3938 "key
": {"type
": "qcode
", "data
": "ctrl
" } } },
3939 { "type
": "key
", "data
" : { "down
": true,
3940 "key
": {"type
": "qcode
", "data
": "alt
" } } },
3941 { "type
": "key
", "data
" : { "down
": true,
3942 "key
": {"type
": "qcode
", "data
": "delete
" } } } ] } }
3947 Move mouse pointer to absolute coordinates (20000, 400).
3949 -> { "execute
": "x
-input
-send
-event
" ,
3950 "arguments
": { "console
": 0, "events
": [
3951 { "type
": "abs
", "data
" : { "axis
": "X
", "value
" : 20000 } },
3952 { "type
": "abs
", "data
" : { "axis
": "Y
", "value
" : 400 } } ] } }
3958 .name = "block
-set
-write
-threshold
",
3959 .args_type = "node
-name
:s
,write
-threshold
:l
",
3960 .mhandler.cmd_new = qmp_marshal_input_block_set_write_threshold,
3964 block-set-write-threshold
3967 Change the write threshold for a block drive. The threshold is an offset,
3968 thus must be non-negative. Default is no write threshold.
3969 Setting the threshold to zero disables it.
3973 - "node
-name
": the node name in the block driver state graph (json-string)
3974 - "write
-threshold
": the write threshold in bytes (json-int)
3978 -> { "execute
": "block
-set
-write
-threshold
",
3979 "arguments
": { "node
-name
": "mydev
",
3980 "write
-threshold
": 17179869184 } }