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 .user_print
= monitor_user_noop
,
280 .mhandler
.cmd_new
= do_device_add
,
291 - "driver": the name of the
new device
's driver (json-string)
292 - "bus": the device's parent
bus (device tree path
, json
-string
, optional
)
293 - "id": the device
's ID, must be unique (json-string)
298 -> { "execute": "device_add", "arguments": { "driver": "e1000", "id": "net1" } }
303 (1) For detailed information about this command, please refer to the
304 'docs
/qdev
-device
-use
.txt
' file.
306 (2) It's possible to list device properties by running QEMU with the
307 "-device DEVICE,\?" command
-line argument
, where DEVICE is the device
's name
312 .name = "device_del",
314 .mhandler.cmd_new = qmp_marshal_input_device_del,
325 - "id": the device's
ID (json
-string
)
329 -> { "execute": "device_del", "arguments": { "id": "net1" } }
336 .args_type
= "keys:O,hold-time:i?",
337 .mhandler
.cmd_new
= qmp_marshal_input_send_key
,
349 - "key": key
sequence (a json
-array of key union values
,
350 union can be number or qcode
enum)
352 - hold
-time
: time to delay key up events
, milliseconds
. Defaults to
100
357 -> { "execute": "send-key",
358 "arguments": { "keys": [ { "type": "qcode", "data": "ctrl" },
359 { "type": "qcode", "data": "alt" },
360 { "type": "qcode", "data": "delete" } ] } }
367 .args_type
= "index:i",
368 .mhandler
.cmd_new
= qmp_marshal_input_cpu
,
379 - "index": the CPU
's index (json-int)
383 -> { "execute": "cpu", "arguments": { "index": 0 } }
386 Note: CPUs' indexes are obtained with the
'query-cpus' command
.
393 .mhandler
.cmd_new
= qmp_marshal_input_cpu_add
,
404 - "id": cpu
id (json
-int
)
408 -> { "execute": "cpu-add", "arguments": { "id": 2 } }
415 .args_type
= "val:l,size:i,filename:s,cpu:i?",
416 .mhandler
.cmd_new
= qmp_marshal_input_memsave
,
423 Save to disk virtual memory dump starting at
'val' of size
'size'.
427 - "val": the starting
address (json
-int
)
428 - "size": the memory size
, in bytes (json
-int
)
429 - "filename": file
path (json
-string
)
430 - "cpu": virtual CPU
index (json
-int
, optional
)
434 -> { "execute": "memsave",
435 "arguments": { "val": 10,
437 "filename": "/tmp/virtual-mem-dump" } }
444 .args_type
= "val:l,size:i,filename:s",
445 .mhandler
.cmd_new
= qmp_marshal_input_pmemsave
,
452 Save to disk physical memory dump starting at
'val' of size
'size'.
456 - "val": the starting
address (json
-int
)
457 - "size": the memory size
, in bytes (json
-int
)
458 - "filename": file
path (json
-string
)
462 -> { "execute": "pmemsave",
463 "arguments": { "val": 10,
465 "filename": "/tmp/physical-mem-dump" } }
471 .name
= "inject-nmi",
473 .mhandler
.cmd_new
= qmp_marshal_input_inject_nmi
,
480 Inject an NMI on the
default CPU (x86
/s390
) or all
CPUs (ppc64
).
486 -> { "execute": "inject-nmi" }
489 Note
: inject
-nmi fails when the guest doesn
't support injecting.
494 .name = "ringbuf-write",
495 .args_type = "device:s,data:s,format:s?",
496 .mhandler.cmd_new = qmp_marshal_input_ringbuf_write,
503 Write to a ring buffer character device.
507 - "device": ring buffer character device name (json-string)
508 - "data": data to write (json-string)
509 - "format": data format (json-string, optional)
510 - Possible values: "utf8" (default), "base64"
511 Bug: invalid base64 is currently not rejected.
512 Whitespace *is* invalid.
516 -> { "execute": "ringbuf-write",
517 "arguments": { "device": "foo",
525 .name = "ringbuf-read",
526 .args_type = "device:s,size:i,format:s?",
527 .mhandler.cmd_new = qmp_marshal_input_ringbuf_read,
534 Read from a ring buffer character device.
538 - "device": ring buffer character device name (json-string)
539 - "size": how many bytes to read at most (json-int)
540 - Number of data bytes, not number of characters in encoded data
541 - "format": data format (json-string, optional)
542 - Possible values: "utf8" (default), "base64"
543 - Naturally, format "utf8" works only when the ring buffer
544 contains valid UTF-8 text. Invalid UTF-8 sequences get
545 replaced. Bug: replacement doesn't work
. Bug
: can screw
546 up on encountering NUL characters
, after the ring buffer
547 lost data
, and when reading stops because the size limit
552 -> { "execute": "ringbuf-read",
553 "arguments": { "device": "foo",
556 <- {"return": "abcdefgh"}
561 .name
= "xen-save-devices-state",
562 .args_type
= "filename:F",
563 .mhandler
.cmd_new
= qmp_marshal_input_xen_save_devices_state
,
567 xen
-save
-devices
-state
570 Save the state of all devices to file
. The RAM and the block devices
571 of the VM are not saved by
this command
.
575 - "filename": the file to save the state of the devices to as binary
576 data
. See xen
-save
-devices
-state
.txt
for a description of the binary
581 -> { "execute": "xen-save-devices-state",
582 "arguments": { "filename": "/tmp/save" } }
588 .name
= "xen-set-global-dirty-log",
589 .args_type
= "enable:b",
590 .mhandler
.cmd_new
= qmp_marshal_input_xen_set_global_dirty_log
,
594 xen
-set
-global
-dirty
-log
597 Enable or disable the global dirty log mode
.
601 - "enable": Enable it or disable it
.
605 -> { "execute": "xen-set-global-dirty-log",
606 "arguments": { "enable": true } }
613 .args_type
= "detach:-d,blk:-b,inc:-i,uri:s",
614 .mhandler
.cmd_new
= qmp_marshal_input_migrate
,
625 - "blk": block migration
, full disk
copy (json
-bool
, optional
)
626 - "inc": incremental disk
copy (json
-bool
, optional
)
627 - "uri": Destination
URI (json
-string
)
631 -> { "execute": "migrate", "arguments": { "uri": "tcp:0:4446" } }
636 (1) The
'query-migrate' command should be used to check migration
's progress
637 and final result (this information is provided by the 'status
' member)
638 (2) All boolean arguments default to false
639 (3) The user Monitor's
"detach" argument is invalid
in QMP and should not
645 .name
= "migrate_cancel",
647 .mhandler
.cmd_new
= qmp_marshal_input_migrate_cancel
,
654 Cancel the current migration
.
660 -> { "execute": "migrate_cancel" }
666 .name
= "migrate-incoming",
667 .args_type
= "uri:s",
668 .mhandler
.cmd_new
= qmp_marshal_input_migrate_incoming
,
675 Continue an incoming migration
679 - "uri": Source
/listening
URI (json
-string
)
683 -> { "execute": "migrate-incoming", "arguments": { "uri": "tcp::4446" } }
688 (1) QEMU must be started with
-incoming defer to allow migrate
-incoming to
690 (2) The uri format is the same as to
-incoming
694 .name
= "migrate-set-cache-size",
695 .args_type
= "value:o",
696 .mhandler
.cmd_new
= qmp_marshal_input_migrate_set_cache_size
,
700 migrate
-set
-cache
-size
701 ----------------------
703 Set cache size to be used by XBZRLE migration
, the cache size will be rounded
704 down to the nearest power of
2
708 - "value": cache size
in bytes (json
-int
)
712 -> { "execute": "migrate-set-cache-size", "arguments": { "value": 536870912 } }
717 .name
= "query-migrate-cache-size",
719 .mhandler
.cmd_new
= qmp_marshal_input_query_migrate_cache_size
,
723 query
-migrate
-cache
-size
724 ------------------------
726 Show cache size to be used by XBZRLE migration
728 returns a json
-object with the following information
:
733 -> { "execute": "query-migrate-cache-size" }
734 <- { "return": 67108864 }
739 .name
= "migrate_set_speed",
740 .args_type
= "value:o",
741 .mhandler
.cmd_new
= qmp_marshal_input_migrate_set_speed
,
748 Set maximum speed
for migrations
.
752 - "value": maximum speed
, in bytes per
second (json
-int
)
756 -> { "execute": "migrate_set_speed", "arguments": { "value": 1024 } }
762 .name
= "migrate_set_downtime",
763 .args_type
= "value:T",
764 .mhandler
.cmd_new
= qmp_marshal_input_migrate_set_downtime
,
771 Set maximum tolerated
downtime (in seconds
) for migrations
.
775 - "value": maximum
downtime (json
-number
)
779 -> { "execute": "migrate_set_downtime", "arguments": { "value": 0.1 } }
785 .name
= "client_migrate_info",
786 .args_type
= "protocol:s,hostname:s,port:i?,tls-port:i?,cert-subject:s?",
787 .params
= "protocol hostname port tls-port cert-subject",
788 .help
= "send migration info to spice/vnc client",
789 .user_print
= monitor_user_noop
,
790 .mhandler
.cmd_async
= client_migrate_info
,
791 .flags
= MONITOR_CMD_ASYNC
,
798 Set the spice
/vnc connection info
for the migration target
. The spice
/vnc
799 server will ask the spice
/vnc client to automatically reconnect
using the
800 new parameters (if specified
) once the vm migration finished successfully
.
804 - "protocol": protocol
: "spice" or
"vnc" (json
-string
)
805 - "hostname": migration target
hostname (json
-string
)
806 - "port": spice
/vnc tcp port
for plaintext
channels (json
-int
, optional
)
807 - "tls-port": spice tcp port
for tls
-secured
channels (json
-int
, optional
)
808 - "cert-subject": server certificate
subject (json
-string
, optional
)
812 -> { "execute": "client_migrate_info",
813 "arguments": { "protocol": "spice",
814 "hostname": "virt42.lab.kraxel.org",
821 .name
= "dump-guest-memory",
822 .args_type
= "paging:b,protocol:s,begin:i?,end:i?,format:s?",
823 .params
= "-p protocol [begin] [length] [format]",
824 .help
= "dump guest memory to file",
825 .user_print
= monitor_user_noop
,
826 .mhandler
.cmd_new
= qmp_marshal_input_dump_guest_memory
,
833 Dump guest memory to file
. The file can be processed with crash or gdb
.
837 - "paging": do paging to get guest
's memory mapping (json-bool)
838 - "protocol": destination file(started with "file:") or destination file
839 descriptor (started with "fd:") (json-string)
840 - "begin": the starting physical address. It's optional
, and should be specified
841 with length
together (json
-int
)
842 - "length": the memory size
, in bytes
. It
's optional, and should be specified
843 with begin together (json-int)
844 - "format": the format of guest memory dump. It's optional
, and can be
845 elf|kdump
-zlib|kdump
-lzo|kdump
-snappy
, but non
-elf formats will
846 conflict with paging and filter
, ie
. begin and
length (json
-string
)
850 -> { "execute": "dump-guest-memory", "arguments": { "protocol": "fd:dump" } }
855 (1) All boolean arguments
default to
false
860 .name
= "query-dump-guest-memory-capability",
862 .mhandler
.cmd_new
= qmp_marshal_input_query_dump_guest_memory_capability
,
866 query
-dump
-guest
-memory
-capability
869 Show available formats
for 'dump-guest-memory'
873 -> { "execute": "query-dump-guest-memory-capability" }
874 <- { "return": { "formats":
875 ["elf", "kdump-zlib", "kdump-lzo", "kdump-snappy"] }
880 .name
= "netdev_add",
881 .args_type
= "netdev:O",
882 .mhandler
.cmd_new
= qmp_netdev_add
,
889 Add host network device
.
893 - "type": the device type
, "tap", "user", ... (json
-string
)
894 - "id": the device
's ID, must be unique (json-string)
899 -> { "execute": "netdev_add", "arguments": { "type": "user", "id": "netdev1" } }
902 Note: The supported device options are the same ones supported by the '-netdev
'
903 command-line argument, which are listed in the '-help
' output or QEMU's
909 .name
= "netdev_del",
911 .mhandler
.cmd_new
= qmp_marshal_input_netdev_del
,
918 Remove host network device
.
922 - "id": the device
's ID, must be unique (json-string)
926 -> { "execute": "netdev_del", "arguments": { "id": "netdev1" } }
933 .name = "object-add",
934 .args_type = "qom-type:s,id:s,props:q?",
935 .mhandler.cmd_new = qmp_object_add,
946 - "qom-type": the object's QOM type
, i
.e
. the
class name (json
-string
)
947 - "id": the object
's ID, must be unique (json-string)
948 - "props": a dictionary of object property values (optional, json-dict)
952 -> { "execute": "object-add", "arguments": { "qom-type": "rng-random", "id": "rng1",
953 "props": { "filename": "/dev/hwrng" } } }
959 .name = "object-del",
961 .mhandler.cmd_new = qmp_marshal_input_object_del,
972 - "id": the object's
ID (json
-string
)
976 -> { "execute": "object-del", "arguments": { "id": "rng1" } }
984 .name
= "block_resize",
985 .args_type
= "device:s?,node-name:s?,size:o",
986 .mhandler
.cmd_new
= qmp_marshal_input_block_resize
,
993 Resize a block image
while a guest is running
.
997 - "device": the device
's ID, must be unique (json-string)
998 - "node-name": the node name in the block driver state graph (json-string)
1003 -> { "execute": "block_resize", "arguments": { "device": "scratch", "size": 1073741824 } }
1009 .name = "block-stream",
1010 .args_type = "device:B,base:s?,speed:o?,backing-file:s?,on-error:s?",
1011 .mhandler.cmd_new = qmp_marshal_input_block_stream,
1015 .name = "block-commit",
1016 .args_type = "device:B,base:s?,top:s?,backing-file:s?,speed:o?",
1017 .mhandler.cmd_new = qmp_marshal_input_block_commit,
1024 Live commit of data from overlay image nodes into backing nodes - i.e., writes
1025 data between 'top
' and 'base
' into 'base
'.
1029 - "device": The device's ID
, must be
unique (json
-string
)
1030 - "base": The file name of the backing image to write data into
.
1031 If not specified
, this is the deepest backing image
1032 (json
-string
, optional
)
1033 - "top": The file name of the backing image within the image chain
,
1034 which contains the topmost data to be committed down
. If
1035 not specified
, this is the active layer
. (json
-string
, optional
)
1037 - backing
-file
: The backing file string to write into the overlay
1038 image of
'top'. If
'top' is the active layer
,
1039 specifying a backing file string is an error
. This
1040 filename is not validated
.
1042 If a pathname string is such that it cannot be
1043 resolved by QEMU
, that means that subsequent QMP or
1044 HMP commands must use node
-names
for the image
in
1045 question
, as filename lookup methods will fail
.
1047 If not specified
, QEMU will automatically determine
1048 the backing file string to use
, or error out
if
1049 there is no obvious choice
. Care should be taken
1050 when specifying the string
, to specify a valid
1051 filename or protocol
.
1052 (json
-string
, optional
) (Since
2.1)
1054 If top
== base
, that is an error
.
1055 If top
== active
, the job will not be completed by itself
,
1056 user needs to complete the job with the block
-job
-complete
1057 command after getting the ready event
. (Since
2.0)
1059 If the base image is smaller than top
, then the base image
1060 will be resized to be the same size as top
. If top is
1061 smaller than the base image
, the base will not be
1062 truncated
. If you want the base image size to match the
1063 size of the smaller top
, you can safely truncate it
1064 yourself once the commit operation successfully completes
.
1066 - "speed": the maximum speed
, in bytes per
second (json
-int
, optional
)
1071 -> { "execute": "block-commit", "arguments": { "device": "virtio0",
1072 "top": "/tmp/snap1.qcow2" } }
1078 .name
= "drive-backup",
1079 .args_type
= "sync:s,device:B,target:s,speed:i?,mode:s?,format:s?,"
1080 "on-source-error:s?,on-target-error:s?",
1081 .mhandler
.cmd_new
= qmp_marshal_input_drive_backup
,
1088 Start a point
-in-time copy of a block device to a
new destination
. The
1089 status of ongoing drive
-backup operations can be checked with
1090 query
-block
-jobs where the BlockJobInfo
.type field has the value
'backup'.
1091 The operation can be stopped before it has completed
using the
1092 block
-job
-cancel command
.
1096 - "device": the name of the device which should be copied
.
1098 - "target": the target of the
new image
. If the file exists
, or
if it is a
1099 device
, the existing file
/device will be used as the
new
1100 destination
. If it does not exist
, a
new file will be created
.
1102 - "format": the format of the
new destination
, default is to probe
if 'mode' is
1103 'existing', else the format of the source
1104 (json
-string
, optional
)
1105 - "sync": what parts of the disk image should be copied to the destination
;
1106 possibilities include
"full" for all the disk
, "top" for only the sectors
1107 allocated
in the topmost image
, or
"none" to only replicate
new I
/O
1109 - "mode": whether and how QEMU should create a
new image
1110 (NewImageMode
, optional
, default 'absolute-paths')
1111 - "speed": the maximum speed
, in bytes per
second (json
-int
, optional
)
1112 - "on-source-error": the action to take on an error on the source
, default
1113 'report'. 'stop' and
'enospc' can only be used
1114 if the block device supports io
-status
.
1115 (BlockdevOnError
, optional
)
1116 - "on-target-error": the action to take on an error on the target
, default
1117 'report' (no limitations
, since
this applies to
1118 a different block device than device
).
1119 (BlockdevOnError
, optional
)
1122 -> { "execute": "drive-backup", "arguments": { "device": "drive0",
1124 "target": "backup.img" } }
1130 .name
= "blockdev-backup",
1131 .args_type
= "sync:s,device:B,target:B,speed:i?,"
1132 "on-source-error:s?,on-target-error:s?",
1133 .mhandler
.cmd_new
= qmp_marshal_input_blockdev_backup
,
1140 The device version of drive
-backup
: this command takes an existing named device
1145 - "device": the name of the device which should be copied
.
1147 - "target": the name of the backup target device
. (json
-string
)
1148 - "sync": what parts of the disk image should be copied to the destination
;
1149 possibilities include
"full" for all the disk
, "top" for only the
1150 sectors allocated
in the topmost image
, or
"none" to only replicate
1151 new I
/O (MirrorSyncMode
).
1152 - "speed": the maximum speed
, in bytes per
second (json
-int
, optional
)
1153 - "on-source-error": the action to take on an error on the source
, default
1154 'report'. 'stop' and
'enospc' can only be used
1155 if the block device supports io
-status
.
1156 (BlockdevOnError
, optional
)
1157 - "on-target-error": the action to take on an error on the target
, default
1158 'report' (no limitations
, since
this applies to
1159 a different block device than device
).
1160 (BlockdevOnError
, optional
)
1163 -> { "execute": "blockdev-backup", "arguments": { "device": "src-id",
1165 "target": "tgt-id" } }
1171 .name
= "block-job-set-speed",
1172 .args_type
= "device:B,speed:o",
1173 .mhandler
.cmd_new
= qmp_marshal_input_block_job_set_speed
,
1177 .name
= "block-job-cancel",
1178 .args_type
= "device:B,force:b?",
1179 .mhandler
.cmd_new
= qmp_marshal_input_block_job_cancel
,
1182 .name
= "block-job-pause",
1183 .args_type
= "device:B",
1184 .mhandler
.cmd_new
= qmp_marshal_input_block_job_pause
,
1187 .name
= "block-job-resume",
1188 .args_type
= "device:B",
1189 .mhandler
.cmd_new
= qmp_marshal_input_block_job_resume
,
1192 .name
= "block-job-complete",
1193 .args_type
= "device:B",
1194 .mhandler
.cmd_new
= qmp_marshal_input_block_job_complete
,
1197 .name
= "transaction",
1198 .args_type
= "actions:q",
1199 .mhandler
.cmd_new
= qmp_marshal_input_transaction
,
1206 Atomically operate on one or more block devices
. The only supported operations
1207 for now are drive
-backup
, internal and external snapshotting
. A list of
1208 dictionaries is accepted
, that contains the actions to be performed
.
1209 If there is any failure performing any of the operations
, all operations
1210 for the group are abandoned
.
1212 For external snapshots
, the dictionary contains the device
, the file to use
for
1213 the
new snapshot
, and the format
. The
default format
, if not specified
, is
1216 Each
new snapshot defaults to being created by
QEMU (wiping any
1217 contents
if the file already exists
), but it is also possible to reuse
1218 an externally
-created file
. In the latter
case, you should ensure that
1219 the
new image file has the same contents as the current one
; QEMU cannot
1220 perform any meaningful check
. Typically
this is achieved by
using the
1221 current image file as the backing file
for the
new image
.
1223 On failure
, the original disks pre
-snapshot attempt will be used
.
1225 For internal snapshots
, the dictionary contains the device and the snapshot
's
1226 name. If an internal snapshot matching name already exists, the request will
1227 be rejected. Only some image formats support it, for example, qcow2, rbd,
1230 On failure, qemu will try delete the newly created internal snapshot in the
1231 transaction. When an I/O error occurs during deletion, the user needs to fix
1232 it later with qemu-img or other command.
1237 - "type": the operation to perform. The only supported
1238 value is "blockdev-snapshot-sync". (json-string)
1239 - "data": a dictionary. The contents depend on the value
1240 of "type". When "type" is "blockdev-snapshot-sync":
1241 - "device": device name to snapshot (json-string)
1242 - "node-name": graph node name to snapshot (json-string)
1243 - "snapshot-file": name of new image file (json-string)
1244 - "snapshot-node-name": graph node name of the new snapshot (json-string)
1245 - "format": format of new image (json-string, optional)
1246 - "mode": whether and how QEMU should create the snapshot file
1247 (NewImageMode, optional, default "absolute-paths")
1248 When "type" is "blockdev-snapshot-internal-sync":
1249 - "device": device name to snapshot (json-string)
1250 - "name": name of the new snapshot (json-string)
1254 -> { "execute": "transaction",
1255 "arguments": { "actions": [
1256 { "type": "blockdev-snapshot-sync", "data" : { "device": "ide-hd0",
1257 "snapshot-file": "/some/place/my-image",
1258 "format": "qcow2" } },
1259 { "type": "blockdev-snapshot-sync", "data" : { "node-name": "myfile",
1260 "snapshot-file": "/some/place/my-image2",
1261 "snapshot-node-name": "node3432",
1263 "format": "qcow2" } },
1264 { "type": "blockdev-snapshot-sync", "data" : { "device": "ide-hd1",
1265 "snapshot-file": "/some/place/my-image2",
1267 "format": "qcow2" } },
1268 { "type": "blockdev-snapshot-internal-sync", "data" : {
1269 "device": "ide-hd2",
1270 "name": "snapshot0" } } ] } }
1276 .name = "blockdev-snapshot-sync",
1277 .args_type = "device:s?,node-name:s?,snapshot-file:s,snapshot-node-name:s?,format:s?,mode:s?",
1278 .mhandler.cmd_new = qmp_marshal_input_blockdev_snapshot_sync,
1282 blockdev-snapshot-sync
1283 ----------------------
1285 Synchronous snapshot of a block device. snapshot-file specifies the
1286 target of the new image. If the file exists, or if it is a device, the
1287 snapshot will be created in the existing file/device. If does not
1288 exist, a new file will be created. format specifies the format of the
1289 snapshot image, default is qcow2.
1293 - "device": device name to snapshot (json-string)
1294 - "node-name": graph node name to snapshot (json-string)
1295 - "snapshot-file": name of new image file (json-string)
1296 - "snapshot-node-name": graph node name of the new snapshot (json-string)
1297 - "mode": whether and how QEMU should create the snapshot file
1298 (NewImageMode, optional, default "absolute-paths")
1299 - "format": format of new image (json-string, optional)
1303 -> { "execute": "blockdev-snapshot-sync", "arguments": { "device": "ide-hd0",
1305 "/some/place/my-image",
1306 "format": "qcow2" } }
1312 .name = "blockdev-snapshot-internal-sync",
1313 .args_type = "device:B,name:s",
1314 .mhandler.cmd_new = qmp_marshal_input_blockdev_snapshot_internal_sync,
1318 blockdev-snapshot-internal-sync
1319 -------------------------------
1321 Synchronously take an internal snapshot of a block device when the format of
1322 image used supports it. If the name is an empty string, or a snapshot with
1323 name already exists, the operation will fail.
1327 - "device": device name to snapshot (json-string)
1328 - "name": name of the new snapshot (json-string)
1332 -> { "execute": "blockdev-snapshot-internal-sync",
1333 "arguments": { "device": "ide-hd0",
1334 "name": "snapshot0" }
1341 .name = "blockdev-snapshot-delete-internal-sync",
1342 .args_type = "device:B,id:s?,name:s?",
1344 qmp_marshal_input_blockdev_snapshot_delete_internal_sync,
1348 blockdev-snapshot-delete-internal-sync
1349 --------------------------------------
1351 Synchronously delete an internal snapshot of a block device when the format of
1352 image used supports it. The snapshot is identified by name or id or both. One
1353 of name or id is required. If the snapshot is not found, the operation will
1358 - "device": device name (json-string)
1359 - "id": ID of the snapshot (json-string, optional)
1360 - "name": name of the snapshot (json-string, optional)
1364 -> { "execute": "blockdev-snapshot-delete-internal-sync",
1365 "arguments": { "device": "ide-hd0",
1366 "name": "snapshot0" }
1370 "name": "snapshot0",
1372 "date-sec": 1000012,
1374 "vm-clock-sec": 100,
1382 .name = "drive-mirror",
1383 .args_type = "sync:s,device:B,target:s,speed:i?,mode:s?,format:s?,"
1384 "node-name:s?,replaces:s?,"
1385 "on-source-error:s?,on-target-error:s?,"
1386 "granularity:i?,buf-size:i?",
1387 .mhandler.cmd_new = qmp_marshal_input_drive_mirror,
1394 Start mirroring a block device's writes to a
new destination
. target
1395 specifies the target of the
new image
. If the file exists
, or
if it is
1396 a device
, it will be used as the
new destination
for writes
. If it does not
1397 exist
, a
new file will be created
. format specifies the format of the
1398 mirror image
, default is to probe
if mode
='existing', else the format
1403 - "device": device name to operate
on (json
-string
)
1404 - "target": name of
new image
file (json
-string
)
1405 - "format": format of
new image (json
-string
, optional
)
1406 - "node-name": the name of the
new block driver state
in the node graph
1407 (json
-string
, optional
)
1408 - "replaces": the block driver node name to replace when finished
1409 (json
-string
, optional
)
1410 - "mode": how an image file should be created into the target
1411 file
/device (NewImageMode
, optional
, default 'absolute-paths')
1412 - "speed": maximum speed of the streaming job
, in bytes per second
1414 - "granularity": granularity of the dirty bitmap
, in bytes (json
-int
, optional
)
1415 - "buf_size": maximum amount of data
in flight from source to target
, in bytes
1416 (json
-int
, default 10M
)
1417 - "sync": what parts of the disk image should be copied to the destination
;
1418 possibilities include
"full" for all the disk
, "top" for only the sectors
1419 allocated
in the topmost image
, or
"none" to only replicate
new I
/O
1421 - "on-source-error": the action to take on an error on the source
1422 (BlockdevOnError
, default 'report')
1423 - "on-target-error": the action to take on an error on the target
1424 (BlockdevOnError
, default 'report')
1426 The
default value of the granularity is the image cluster size clamped
1427 between
4096 and
65536, if the image format defines one
. If the format
1428 does not define a cluster size
, the
default value of the granularity
1434 -> { "execute": "drive-mirror", "arguments": { "device": "ide-hd0",
1435 "target": "/some/place/my-image",
1437 "format": "qcow2" } }
1443 .name
= "change-backing-file",
1444 .args_type
= "device:s,image-node-name:s,backing-file:s",
1445 .mhandler
.cmd_new
= qmp_marshal_input_change_backing_file
,
1453 Change the backing file
in the image file metadata
. This does not cause
1454 QEMU to reopen the image file to reparse the backing
filename (it may
,
1455 however
, perform a reopen to change permissions from r
/o
-> r
/w
-> r
/o
,
1456 if needed
). The
new backing file string is written into the image file
1457 metadata
, and the QEMU internal strings are updated
.
1461 - "image-node-name": The name of the block driver state node of the
1462 image to modify
. The
"device" is argument is used to
1463 verify
"image-node-name" is
in the chain described by
1465 (json
-string
, optional
)
1467 - "device": The name of the device
.
1470 - "backing-file": The string to write as the backing file
. This string is
1471 not validated
, so care should be taken when specifying
1472 the string or the image chain may not be able to be
1476 Returns
: Nothing on success
1477 If
"device" does not exist or cannot be determined
, DeviceNotFound
1483 .args_type
= "value:M",
1484 .mhandler
.cmd_new
= qmp_marshal_input_balloon
,
1491 Request VM to change its memory
allocation (in bytes
).
1495 - "value": New memory
allocation (json
-int
)
1499 -> { "execute": "balloon", "arguments": { "value": 536870912 } }
1506 .args_type
= "name:s,up:b",
1507 .mhandler
.cmd_new
= qmp_marshal_input_set_link
,
1514 Change the link status of a network adapter
.
1518 - "name": network device
name (json
-string
)
1519 - "up": status is
up (json
-bool
)
1523 -> { "execute": "set_link", "arguments": { "name": "e1000.0", "up": false } }
1530 .args_type
= "fdname:s",
1531 .params
= "getfd name",
1532 .help
= "receive a file descriptor via SCM rights and assign it a name",
1533 .mhandler
.cmd_new
= qmp_marshal_input_getfd
,
1540 Receive a file descriptor via SCM rights and assign it a name
.
1544 - "fdname": file descriptor
name (json
-string
)
1548 -> { "execute": "getfd", "arguments": { "fdname": "fd1" } }
1553 (1) If the name specified by the
"fdname" argument already exists
,
1554 the file descriptor assigned to it will be closed and replaced
1555 by the received file descriptor
.
1556 (2) The
'closefd' command can be used to explicitly close the file
1557 descriptor when it is no longer needed
.
1563 .args_type
= "fdname:s",
1564 .params
= "closefd name",
1565 .help
= "close a file descriptor previously passed via SCM rights",
1566 .mhandler
.cmd_new
= qmp_marshal_input_closefd
,
1573 Close a file descriptor previously passed via SCM rights
.
1577 - "fdname": file descriptor
name (json
-string
)
1581 -> { "execute": "closefd", "arguments": { "fdname": "fd1" } }
1588 .args_type
= "fdset-id:i?,opaque:s?",
1589 .params
= "add-fd fdset-id opaque",
1590 .help
= "Add a file descriptor, that was passed via SCM rights, to an fd set",
1591 .mhandler
.cmd_new
= qmp_marshal_input_add_fd
,
1598 Add a file descriptor
, that was passed via SCM rights
, to an fd set
.
1602 - "fdset-id": The ID of the fd set to add the file descriptor to
.
1603 (json
-int
, optional
)
1604 - "opaque": A free
-form string that can be used to describe the fd
.
1605 (json
-string
, optional
)
1607 Return a json
-object with the following information
:
1609 - "fdset-id": The ID of the fd set that the fd was added to
. (json
-int
)
1610 - "fd": The file descriptor that was received via SCM rights and added to the
1615 -> { "execute": "add-fd", "arguments": { "fdset-id": 1 } }
1616 <- { "return": { "fdset-id": 1, "fd": 3 } }
1620 (1) The list of fd sets is shared by all monitor connections
.
1621 (2) If
"fdset-id" is not specified
, a
new fd set will be created
.
1626 .name
= "remove-fd",
1627 .args_type
= "fdset-id:i,fd:i?",
1628 .params
= "remove-fd fdset-id fd",
1629 .help
= "Remove a file descriptor from an fd set",
1630 .mhandler
.cmd_new
= qmp_marshal_input_remove_fd
,
1637 Remove a file descriptor from an fd set
.
1641 - "fdset-id": The ID of the fd set that the file descriptor belongs to
.
1643 - "fd": The file descriptor that is to be removed
. (json
-int
, optional
)
1647 -> { "execute": "remove-fd", "arguments": { "fdset-id": 1, "fd": 3 } }
1652 (1) The list of fd sets is shared by all monitor connections
.
1653 (2) If
"fd" is not specified
, all file descriptors
in "fdset-id" will be
1659 .name
= "query-fdsets",
1661 .help
= "Return information describing all fd sets",
1662 .mhandler
.cmd_new
= qmp_marshal_input_query_fdsets
,
1669 Return information describing all fd sets
.
1675 -> { "execute": "query-fdsets" }
1681 "opaque": "rdonly:/path/to/file"
1685 "opaque": "rdwr:/path/to/file"
1704 Note
: The list of fd sets is shared by all monitor connections
.
1709 .name
= "block_passwd",
1710 .args_type
= "device:s?,node-name:s?,password:s",
1711 .mhandler
.cmd_new
= qmp_marshal_input_block_passwd
,
1718 Set the password of encrypted block devices
.
1722 - "device": device
name (json
-string
)
1723 - "node-name": name
in the block driver state
graph (json
-string
)
1724 - "password": password (json
-string
)
1728 -> { "execute": "block_passwd", "arguments": { "device": "ide0-hd0",
1729 "password": "12345" } }
1735 .name
= "block_set_io_throttle",
1736 .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?",
1737 .mhandler
.cmd_new
= qmp_marshal_input_block_set_io_throttle
,
1741 block_set_io_throttle
1744 Change I
/O throttle limits
for a block drive
.
1748 - "device": device
name (json
-string
)
1749 - "bps": total throughput limit
in bytes per
second (json
-int
)
1750 - "bps_rd": read throughput limit
in bytes per
second (json
-int
)
1751 - "bps_wr": write throughput limit
in bytes per
second (json
-int
)
1752 - "iops": total I
/O operations per
second (json
-int
)
1753 - "iops_rd": read I
/O operations per
second (json
-int
)
1754 - "iops_wr": write I
/O operations per
second (json
-int
)
1755 - "bps_max": total max
in bytes (json
-int
)
1756 - "bps_rd_max": read max
in bytes (json
-int
)
1757 - "bps_wr_max": write max
in bytes (json
-int
)
1758 - "iops_max": total I
/O operations
max (json
-int
)
1759 - "iops_rd_max": read I
/O operations
max (json
-int
)
1760 - "iops_wr_max": write I
/O operations
max (json
-int
)
1761 - "iops_size": I
/O size
in bytes when
limiting (json
-int
)
1765 -> { "execute": "block_set_io_throttle", "arguments": { "device": "virtio0",
1784 .name
= "set_password",
1785 .args_type
= "protocol:s,password:s,connected:s?",
1786 .mhandler
.cmd_new
= qmp_marshal_input_set_password
,
1793 Set the password
for vnc
/spice protocols
.
1797 - "protocol": protocol
name (json
-string
)
1798 - "password": password (json
-string
)
1799 - "connected": [ keep | disconnect | fail
] (json
-string
, optional
)
1803 -> { "execute": "set_password", "arguments": { "protocol": "vnc",
1804 "password": "secret" } }
1810 .name
= "expire_password",
1811 .args_type
= "protocol:s,time:s",
1812 .mhandler
.cmd_new
= qmp_marshal_input_expire_password
,
1819 Set the password expire time
for vnc
/spice protocols
.
1823 - "protocol": protocol
name (json
-string
)
1824 - "time": [ now |
never |
+secs | secs
] (json
-string
)
1828 -> { "execute": "expire_password", "arguments": { "protocol": "vnc",
1835 .name
= "add_client",
1836 .args_type
= "protocol:s,fdname:s,skipauth:b?,tls:b?",
1837 .mhandler
.cmd_new
= qmp_marshal_input_add_client
,
1844 Add a graphics client
1848 - "protocol": protocol
name (json
-string
)
1849 - "fdname": file descriptor
name (json
-string
)
1850 - "skipauth": whether to skip
authentication (json
-bool
, optional
)
1851 - "tls": whether to perform
TLS (json
-bool
, optional
)
1855 -> { "execute": "add_client", "arguments": { "protocol": "vnc",
1856 "fdname": "myclient" } }
1861 .name
= "qmp_capabilities",
1864 .help
= "enable QMP capabilities",
1865 .user_print
= monitor_user_noop
,
1866 .mhandler
.cmd_new
= do_qmp_capabilities
,
1873 Enable QMP capabilities
.
1879 -> { "execute": "qmp_capabilities" }
1882 Note
: This command must be issued before issuing any other command
.
1887 .name
= "human-monitor-command",
1888 .args_type
= "command-line:s,cpu-index:i?",
1889 .mhandler
.cmd_new
= qmp_marshal_input_human_monitor_command
,
1893 human
-monitor
-command
1894 ---------------------
1896 Execute a Human Monitor command
.
1900 - command
-line
: the command name and its arguments
, just like the
1901 Human Monitor
's shell (json-string)
1902 - cpu-index: select the CPU number to be used by commands which access CPU
1903 data, like 'info registers
'. The Monitor selects CPU 0 if this
1904 argument is not provided (json-int, optional)
1908 -> { "execute": "human-monitor-command", "arguments": { "command-line": "info kvm" } }
1909 <- { "return": "kvm support: enabled\r\n" }
1913 (1) The Human Monitor is NOT an stable interface, this means that command
1914 names, arguments and responses can change or be removed at ANY time.
1915 Applications that rely on long term stability guarantees should NOT
1920 o This command is stateless, this means that commands that depend
1921 on state information (such as getfd) might not work
1923 o Commands that prompt the user for data (eg. 'cont
' when the block
1924 device is encrypted) don't currently work
1929 HXCOMM Each query command below is inside a SQMP
/EQMP section
, do NOT change
1930 HXCOMM
this! We will possibly move query commands definitions inside those
1931 HXCOMM sections
, just like regular commands
.
1941 Return a json
-object with the following information
:
1943 - "qemu": A json
-object containing three integer values
:
1944 - "major": QEMU
's major version (json-int)
1945 - "minor": QEMU's minor
version (json
-int
)
1946 - "micro": QEMU
's micro version (json-int)
1947 - "package": package's
version (json
-string
)
1951 -> { "execute": "query-version" }
1966 .name
= "query-version",
1968 .mhandler
.cmd_new
= qmp_marshal_input_query_version
,
1975 List QMP available commands
.
1977 Each command is represented by a json
-object
, the returned value is a json
-array
1980 Each json
-object contain
:
1982 - "name": command
's name (json-string)
1986 -> { "execute": "query-commands" }
1990 "name":"query-balloon"
1993 "name":"system_powerdown"
1998 Note: This example has been shortened as the real response is too long.
2003 .name = "query-commands",
2005 .mhandler.cmd_new = qmp_marshal_input_query_commands,
2012 List QMP available events.
2014 Each event is represented by a json-object, the returned value is a json-array
2017 Each json-object contains:
2019 - "name": event's
name (json
-string
)
2023 -> { "execute": "query-events" }
2035 Note
: This example has been shortened as the real response is too long
.
2040 .name
= "query-events",
2042 .mhandler
.cmd_new
= qmp_marshal_input_query_events
,
2049 Each device is represented by a json
-object
. The returned value is a json
-array
2052 Each json
-object contain the following
:
2054 - "label": device
's label (json-string)
2055 - "filename": device's
file (json
-string
)
2056 - "frontend-open": open
/closed state of the frontend device attached to
this
2061 -> { "execute": "query-chardev" }
2065 "label": "charchannel0",
2066 "filename": "unix:/var/lib/libvirt/qemu/seabios.rhel6.agent,server",
2067 "frontend-open": false
2070 "label": "charmonitor",
2071 "filename": "unix:/var/lib/libvirt/qemu/seabios.rhel6.monitor,server",
2072 "frontend-open": true
2075 "label": "charserial0",
2076 "filename": "pty:/dev/pts/2",
2077 "frontend-open": true
2085 .name
= "query-chardev",
2087 .mhandler
.cmd_new
= qmp_marshal_input_query_chardev
,
2091 query
-chardev
-backends
2094 List available character device backends
.
2096 Each backend is represented by a json
-object
, the returned value is a json
-array
2099 Each json
-object contains
:
2101 - "name": backend
name (json
-string
)
2105 -> { "execute": "query-chardev-backends" }
2126 .name
= "query-chardev-backends",
2128 .mhandler
.cmd_new
= qmp_marshal_input_query_chardev_backends
,
2135 Show the block devices
.
2137 Each block device information is stored
in a json
-object and the returned value
2138 is a json
-array of all devices
.
2140 Each json
-object contain the following
:
2142 - "device": device
name (json
-string
)
2143 - "type": device
type (json
-string
)
2144 - deprecated
, retained
for backward compatibility
2145 - Possible values
: "unknown"
2146 - "removable": true if the device is removable
, false otherwise (json
-bool
)
2147 - "locked": true if the device is locked
, false otherwise (json
-bool
)
2148 - "tray_open": only present
if removable
, true if the device has a tray
,
2149 and it is
open (json
-bool
)
2150 - "inserted": only present
if the device is inserted
, it is a json
-object
2151 containing the following
:
2152 - "file": device file
name (json
-string
)
2153 - "ro": true if read
-only
, false otherwise (json
-bool
)
2154 - "drv": driver format
name (json
-string
)
2155 - Possible values
: "blkdebug", "bochs", "cloop", "dmg",
2156 "file", "file", "ftp", "ftps", "host_cdrom",
2157 "host_device", "host_floppy", "http", "https",
2158 "nbd", "parallels", "qcow", "qcow2", "raw",
2159 "tftp", "vdi", "vmdk", "vpc", "vvfat"
2160 - "backing_file": backing file
name (json
-string
, optional
)
2161 - "backing_file_depth": number of files
in the backing file
chain (json
-int
)
2162 - "encrypted": true if encrypted
, false otherwise (json
-bool
)
2163 - "bps": limit total bytes per
second (json
-int
)
2164 - "bps_rd": limit read bytes per
second (json
-int
)
2165 - "bps_wr": limit write bytes per
second (json
-int
)
2166 - "iops": limit total I
/O operations per
second (json
-int
)
2167 - "iops_rd": limit read operations per
second (json
-int
)
2168 - "iops_wr": limit write operations per
second (json
-int
)
2169 - "bps_max": total max
in bytes (json
-int
)
2170 - "bps_rd_max": read max
in bytes (json
-int
)
2171 - "bps_wr_max": write max
in bytes (json
-int
)
2172 - "iops_max": total I
/O operations
max (json
-int
)
2173 - "iops_rd_max": read I
/O operations
max (json
-int
)
2174 - "iops_wr_max": write I
/O operations
max (json
-int
)
2175 - "iops_size": I
/O size when limiting by
iops (json
-int
)
2176 - "detect_zeroes": detect and optimize zero
writing (json
-string
)
2177 - Possible values
: "off", "on", "unmap"
2178 - "write_threshold": write offset threshold
in bytes
, a event will be
2179 emitted
if crossed
. Zero
if disabled (json
-int
)
2180 - "image": the detail of the image
, it is a json
-object containing
2182 - "filename": image file
name (json
-string
)
2183 - "format": image
format (json
-string
)
2184 - "virtual-size": image capacity
in bytes (json
-int
)
2185 - "dirty-flag": true if image is not cleanly closed
, not present
2186 means
clean (json
-bool
, optional
)
2187 - "actual-size": actual size on disk
in bytes of the image
, not
2188 present when image does not support thin
2189 provision (json
-int
, optional
)
2190 - "cluster-size": size of a cluster
in bytes
, not present
if image
2191 format does not support
it (json
-int
, optional
)
2192 - "encrypted": true if the image is encrypted
, not present means
2193 false or the image format does not support
2194 encryption (json
-bool
, optional
)
2195 - "backing_file": backing file name
, not present means no backing
2196 file is used or the image format does not
2197 support backing file chain
2198 (json
-string
, optional
)
2199 - "full-backing-filename": full path of the backing file
, not
2200 present
if it equals backing_file or no
2201 backing file is used
2202 (json
-string
, optional
)
2203 - "backing-filename-format": the format of the backing file
, not
2204 present means unknown or no backing
2205 file (json
-string
, optional
)
2206 - "snapshots": the internal snapshot info
, it is an optional list
2207 of json
-object containing the following
:
2208 - "id": unique snapshot
id (json
-string
)
2209 - "name": snapshot
name (json
-string
)
2210 - "vm-state-size": size of the VM state
in bytes (json
-int
)
2211 - "date-sec": UTC date of the snapshot
in seconds (json
-int
)
2212 - "date-nsec": fractional part
in nanoseconds to be used with
2214 - "vm-clock-sec": VM clock relative to boot
in seconds
2216 - "vm-clock-nsec": fractional part
in nanoseconds to be used
2217 with vm
-clock
-sec (json
-int
)
2218 - "backing-image": the detail of the backing image
, it is an
2219 optional json
-object only present when a
2220 backing image present
for this image
2222 - "io-status": I
/O operation status
, only present
if the device supports it
2223 and the VM is configured to stop on errors
. It
's always reset
2224 to "ok" when the "cont" command is issued (json_string, optional)
2225 - Possible values: "ok", "failed", "nospace"
2229 -> { "execute": "query-block" }
2234 "device":"ide0-hd0",
2241 "file":"disks/test.qcow2",
2242 "backing_file_depth":1,
2256 "detect_zeroes": "on",
2257 "write_threshold": 0,
2259 "filename":"disks/test.qcow2",
2261 "virtual-size":2048000,
2262 "backing_file":"base.qcow2",
2263 "full-backing-filename":"disks/base.qcow2",
2264 "backing-filename-format:"qcow2",
2268 "name": "snapshot1",
2270 "date-sec": 10000200,
2272 "vm-clock-sec": 206,
2277 "filename":"disks/base.qcow2",
2279 "virtual-size":2048000
2287 "device":"ide1-cd0",
2310 .name = "query-block",
2312 .mhandler.cmd_new = qmp_marshal_input_query_block,
2319 Show block device statistics.
2321 Each device statistic information is stored in a json-object and the returned
2322 value is a json-array of all devices.
2324 Each json-object contain the following:
2326 - "device": device name (json-string)
2327 - "stats": A json-object with the statistics information, it contains:
2328 - "rd_bytes": bytes read (json-int)
2329 - "wr_bytes": bytes written (json-int)
2330 - "rd_operations": read operations (json-int)
2331 - "wr_operations": write operations (json-int)
2332 - "flush_operations": cache flush operations (json-int)
2333 - "wr_total_time_ns": total time spend on writes in nano-seconds (json-int)
2334 - "rd_total_time_ns": total time spend on reads in nano-seconds (json-int)
2335 - "flush_total_time_ns": total time spend on cache flushes in nano-seconds (json-int)
2336 - "wr_highest_offset": Highest offset of a sector written since the
2337 BlockDriverState has been opened (json-int)
2338 - "rd_merged": number of read requests that have been merged into
2339 another request (json-int)
2340 - "wr_merged": number of write requests that have been merged into
2341 another request (json-int)
2342 - "parent": Contains recursively the statistics of the underlying
2343 protocol (e.g. the host file for a qcow2 image). If there is
2344 no underlying protocol, this field is omitted
2345 (json-object, optional)
2349 -> { "execute": "query-blockstats" }
2353 "device":"ide0-hd0",
2356 "wr_highest_offset":3686448128,
2358 "wr_operations":751,
2359 "rd_bytes":122567168,
2360 "rd_operations":36772
2361 "wr_total_times_ns":313253456
2362 "rd_total_times_ns":3465673657
2363 "flush_total_times_ns":49653
2364 "flush_operations":61,
2370 "wr_highest_offset":2821110784,
2372 "wr_operations":692,
2373 "rd_bytes":122739200,
2374 "rd_operations":36604
2375 "flush_operations":51,
2376 "wr_total_times_ns":313253456
2377 "rd_total_times_ns":3465673657
2378 "flush_total_times_ns":49653,
2384 "device":"ide1-cd0",
2386 "wr_highest_offset":0,
2391 "flush_operations":0,
2392 "wr_total_times_ns":0
2393 "rd_total_times_ns":0
2394 "flush_total_times_ns":0,
2402 "wr_highest_offset":0,
2407 "flush_operations":0,
2408 "wr_total_times_ns":0
2409 "rd_total_times_ns":0
2410 "flush_total_times_ns":0,
2418 "wr_highest_offset":0,
2423 "flush_operations":0,
2424 "wr_total_times_ns":0
2425 "rd_total_times_ns":0
2426 "flush_total_times_ns":0,
2437 .name = "query-blockstats",
2438 .args_type = "query-nodes:b?",
2439 .mhandler.cmd_new = qmp_marshal_input_query_blockstats,
2446 Show CPU information.
2448 Return a json-array. Each CPU is represented by a json-object, which contains:
2450 - "CPU": CPU index (json-int)
2451 - "current": true if this is the current CPU, false otherwise (json-bool)
2452 - "halted": true if the cpu is halted, false otherwise (json-bool)
2453 - Current program counter. The key's name depends on the architecture
:
2454 "pc": i386
/x86_64 (json
-int
)
2455 "nip": PPC (json
-int
)
2456 "pc" and
"npc": sparc (json
-int
)
2457 "PC": mips (json
-int
)
2458 - "thread_id": ID of the underlying host
thread (json
-int
)
2462 -> { "execute": "query-cpus" }
2485 .name
= "query-cpus",
2487 .mhandler
.cmd_new
= qmp_marshal_input_query_cpus
,
2494 Returns a list of information about each iothread
.
2496 Note
this list excludes the QEMU main loop thread
, which is not declared
2497 using the
-object iothread command
-line option
. It is always the main thread
2500 Return a json
-array
. Each iothread is represented by a json
-object
, which contains
:
2502 - "id": name of
iothread (json
-str
)
2503 - "thread-id": ID of the underlying host
thread (json
-int
)
2507 -> { "execute": "query-iothreads" }
2524 .name
= "query-iothreads",
2526 .mhandler
.cmd_new
= qmp_marshal_input_query_iothreads
,
2533 PCI buses and devices information
.
2535 The returned value is a json
-array of all buses
. Each bus is represented by
2536 a json
-object
, which has a key with a json
-array of all PCI devices attached
2537 to it
. Each device is represented by a json
-object
.
2539 The bus json
-object contains the following
:
2541 - "bus": bus
number (json
-int
)
2542 - "devices": a json
-array of json
-objects
, each json
-object represents a
2545 The PCI device json
-object contains the following
:
2547 - "bus": identical to the parent
's bus number (json-int)
2548 - "slot": slot number (json-int)
2549 - "function": function number (json-int)
2550 - "class_info": a json-object containing:
2551 - "desc": device class description (json-string, optional)
2552 - "class": device class number (json-int)
2553 - "id": a json-object containing:
2554 - "device": device ID (json-int)
2555 - "vendor": vendor ID (json-int)
2556 - "irq": device's IRQ
if assigned (json
-int
, optional
)
2557 - "qdev_id": qdev id
string (json
-string
)
2558 - "pci_bridge": It
's a json-object, only present if this device is a
2559 PCI bridge, contains:
2560 - "bus": bus number (json-int)
2561 - "secondary": secondary bus number (json-int)
2562 - "subordinate": subordinate bus number (json-int)
2563 - "io_range": I/O memory range information, a json-object with the
2565 - "base": base address, in bytes (json-int)
2566 - "limit": limit address, in bytes (json-int)
2567 - "memory_range": memory range information, a json-object with the
2569 - "base": base address, in bytes (json-int)
2570 - "limit": limit address, in bytes (json-int)
2571 - "prefetchable_range": Prefetchable memory range information, a
2572 json-object with the following members:
2573 - "base": base address, in bytes (json-int)
2574 - "limit": limit address, in bytes (json-int)
2575 - "devices": a json-array of PCI devices if there's any attached
, each
2576 each element is represented by a json
-object
, which contains
2577 the same members of the
'PCI device json-object' described
2579 - "regions": a json
-array of json
-objects
, each json
-object represents a
2580 memory region of
this device
2582 The memory range json
-object contains the following
:
2584 - "base": base memory
address (json
-int
)
2585 - "limit": limit
value (json
-int
)
2587 The region json
-object can be an I
/O region or a memory region
, an I
/O region
2588 json
-object contains the following
:
2590 - "type": "io" (json
-string
, fixed
)
2591 - "bar": BAR
number (json
-int
)
2592 - "address": memory
address (json
-int
)
2593 - "size": memory
size (json
-int
)
2595 A memory region json
-object contains the following
:
2597 - "type": "memory" (json
-string
, fixed
)
2598 - "bar": BAR
number (json
-int
)
2599 - "address": memory
address (json
-int
)
2600 - "size": memory
size (json
-int
)
2601 - "mem_type_64": true or
false (json
-bool
)
2602 - "prefetch": true or
false (json
-bool
)
2606 -> { "execute": "query-pci" }
2618 "desc":"Host bridge"
2652 "desc":"IDE controller"
2674 "desc":"VGA controller"
2684 "mem_type_64":false,
2687 "address":4026531840,
2692 "mem_type_64":false,
2695 "address":4060086272,
2700 "mem_type_64":false,
2715 "desc":"RAM controller"
2736 Note
: This example has been shortened as the real response is too long
.
2741 .name
= "query-pci",
2743 .mhandler
.cmd_new
= qmp_marshal_input_query_pci
,
2750 Show KVM information
.
2752 Return a json
-object with the following information
:
2754 - "enabled": true if KVM support is enabled
, false otherwise (json
-bool
)
2755 - "present": true if QEMU has KVM support
, false otherwise (json
-bool
)
2759 -> { "execute": "query-kvm" }
2760 <- { "return": { "enabled": true, "present": true } }
2765 .name
= "query-kvm",
2767 .mhandler
.cmd_new
= qmp_marshal_input_query_kvm
,
2774 Return a json
-object with the following information
:
2776 - "running": true if the VM is running
, or
false if it is
paused (json
-bool
)
2777 - "singlestep": true if the VM is
in single step mode
,
2778 false otherwise (json
-bool
)
2779 - "status": one of the following
values (json
-string
)
2780 "debug" - QEMU is running on a debugger
2781 "inmigrate" - guest is paused waiting
for an incoming migration
2782 "internal-error" - An internal error that prevents further guest
2783 execution has occurred
2784 "io-error" - the last IOP has failed and the device is configured
2785 to pause on I
/O errors
2786 "paused" - guest has been paused via the
'stop' command
2787 "postmigrate" - guest is paused following a successful
'migrate'
2788 "prelaunch" - QEMU was started with
-S and guest has not started
2789 "finish-migrate" - guest is paused to finish the migration process
2790 "restore-vm" - guest is paused to restore VM state
2791 "running" - guest is actively running
2792 "save-vm" - guest is paused to save the VM state
2793 "shutdown" - guest is shut
down (and
-no
-shutdown is
in use
)
2794 "watchdog" - the watchdog action is configured to pause and
2799 -> { "execute": "query-status" }
2800 <- { "return": { "running": true, "singlestep": false, "status": "running" } }
2805 .name
= "query-status",
2807 .mhandler
.cmd_new
= qmp_marshal_input_query_status
,
2814 Show VM mice information
.
2816 Each mouse is represented by a json
-object
, the returned value is a json
-array
2819 The mouse json
-object contains the following
:
2821 - "name": mouse
's name (json-string)
2822 - "index": mouse's
index (json
-int
)
2823 - "current": true if this mouse is receiving events
, false otherwise (json
-bool
)
2824 - "absolute": true if the mouse generates absolute input
events (json
-bool
)
2828 -> { "execute": "query-mice" }
2832 "name":"QEMU Microsoft Mouse",
2838 "name":"QEMU PS/2 Mouse",
2849 .name
= "query-mice",
2851 .mhandler
.cmd_new
= qmp_marshal_input_query_mice
,
2858 Show VNC server information
.
2860 Return a json
-object with server information
. Connected clients are returned
2861 as a json
-array of json
-objects
.
2863 The main json
-object contains the following
:
2865 - "enabled": true or
false (json
-bool
)
2866 - "host": server
's IP address (json-string)
2867 - "family": address family (json-string)
2868 - Possible values: "ipv4", "ipv6", "unix", "unknown"
2869 - "service": server's port
number (json
-string
)
2870 - "auth": authentication
method (json
-string
)
2871 - Possible values
: "invalid", "none", "ra2", "ra2ne", "sasl", "tight",
2872 "tls", "ultra", "unknown", "vencrypt", "vencrypt",
2873 "vencrypt+plain", "vencrypt+tls+none",
2874 "vencrypt+tls+plain", "vencrypt+tls+sasl",
2875 "vencrypt+tls+vnc", "vencrypt+x509+none",
2876 "vencrypt+x509+plain", "vencrypt+x509+sasl",
2877 "vencrypt+x509+vnc", "vnc"
2878 - "clients": a json
-array of all connected clients
2880 Clients are described by a json
-object
, each one contain the following
:
2882 - "host": client
's IP address (json-string)
2883 - "family": address family (json-string)
2884 - Possible values: "ipv4", "ipv6", "unix", "unknown"
2885 - "service": client's port
number (json
-string
)
2886 - "x509_dname": TLS
dname (json
-string
, optional
)
2887 - "sasl_username": SASL
username (json
-string
, optional
)
2891 -> { "execute": "query-vnc" }
2912 .name
= "query-vnc",
2914 .mhandler
.cmd_new
= qmp_marshal_input_query_vnc
,
2917 .name
= "query-vnc-servers",
2919 .mhandler
.cmd_new
= qmp_marshal_input_query_vnc_servers
,
2926 Show SPICE server information
.
2928 Return a json
-object with server information
. Connected clients are returned
2929 as a json
-array of json
-objects
.
2931 The main json
-object contains the following
:
2933 - "enabled": true or
false (json
-bool
)
2934 - "host": server
's IP address (json-string)
2935 - "port": server's port
number (json
-int
, optional
)
2936 - "tls-port": server
's port number (json-int, optional)
2937 - "auth": authentication method (json-string)
2938 - Possible values: "none", "spice"
2939 - "channels": a json-array of all active channels clients
2941 Channels are described by a json-object, each one contain the following:
2943 - "host": client's IP
address (json
-string
)
2944 - "family": address
family (json
-string
)
2945 - Possible values
: "ipv4", "ipv6", "unix", "unknown"
2946 - "port": client
's port number (json-string)
2947 - "connection-id": spice connection id. All channels with the same id
2948 belong to the same spice session (json-int)
2949 - "channel-type": channel type. "1" is the main control channel, filter for
2950 this one if you want track spice sessions only (json-int)
2951 - "channel-id": channel id. Usually "0", might be different needed when
2952 multiple channels of the same type exist, such as multiple
2953 display channels in a multihead setup (json-int)
2954 - "tls": whether the channel is encrypted (json-bool)
2958 -> { "execute": "query-spice" }
2971 "connection-id": 1804289383,
2972 "host": "127.0.0.1",
2980 "connection-id": 1804289383,
2981 "host": "127.0.0.1",
2985 [ ... more channels follow ... ]
2992 #if defined(CONFIG_SPICE)
2994 .name = "query-spice",
2996 .mhandler.cmd_new = qmp_marshal_input_query_spice,
3006 Return a json-object with the following information:
3008 - "name": VM's
name (json
-string
, optional
)
3012 -> { "execute": "query-name" }
3013 <- { "return": { "name": "qemu-name" } }
3018 .name
= "query-name",
3020 .mhandler
.cmd_new
= qmp_marshal_input_query_name
,
3029 Return a json
-object with the following information
:
3031 - "UUID": Universally Unique
Identifier (json
-string
)
3035 -> { "execute": "query-uuid" }
3036 <- { "return": { "UUID": "550e8400-e29b-41d4-a716-446655440000" } }
3041 .name
= "query-uuid",
3043 .mhandler
.cmd_new
= qmp_marshal_input_query_uuid
,
3047 query
-command
-line
-options
3048 --------------------------
3050 Show command line option schema
.
3052 Return a json
-array of command line option schema
for all
options (or
for
3053 the given option
), returning an error
if the given option doesn
't exist.
3055 Each array entry contains the following:
3057 - "option": option name (json-string)
3058 - "parameters": a json-array describes all parameters of the option:
3059 - "name": parameter name (json-string)
3060 - "type": parameter type (one of 'string
', 'boolean
', 'number
',
3062 - "help": human readable description of the parameter
3063 (json-string, optional)
3064 - "default": default value string for the parameter
3065 (json-string, optional)
3069 -> { "execute": "query-command-line-options", "arguments": { "option": "option-rom" } }
3078 "name": "bootindex",
3082 "option": "option-rom"
3090 .name = "query-command-line-options",
3091 .args_type = "option:s?",
3092 .mhandler.cmd_new = qmp_marshal_input_query_command_line_options,
3101 Return a json-object. If migration is active there will be another json-object
3102 with RAM migration status and if block migration is active another one with
3103 block migration status.
3105 The main json-object contains the following:
3107 - "status": migration status (json-string)
3108 - Possible values: "setup", "active", "completed", "failed", "cancelled"
3109 - "total-time": total amount of ms since migration started. If
3110 migration has ended, it returns the total migration
3112 - "setup-time" amount of setup time in milliseconds _before_ the
3113 iterations begin but _after_ the QMP command is issued.
3114 This is designed to provide an accounting of any activities
3115 (such as RDMA pinning) which may be expensive, but do not
3116 actually occur during the iterative migration rounds
3117 themselves. (json-int)
3118 - "downtime": only present when migration has finished correctly
3119 total amount in ms for downtime that happened (json-int)
3120 - "expected-downtime": only present while migration is active
3121 total amount in ms for downtime that was calculated on
3122 the last bitmap round (json-int)
3123 - "ram": only present if "status" is "active", it is a json-object with the
3124 following RAM information:
3125 - "transferred": amount transferred in bytes (json-int)
3126 - "remaining": amount remaining to transfer in bytes (json-int)
3127 - "total": total amount of memory in bytes (json-int)
3128 - "duplicate": number of pages filled entirely with the same
3130 These are sent over the wire much more efficiently.
3131 - "skipped": number of skipped zero pages (json-int)
3132 - "normal" : number of whole pages transferred. I.e. they
3133 were not sent as duplicate or xbzrle pages (json-int)
3134 - "normal-bytes" : number of bytes transferred in whole
3135 pages. This is just normal pages times size of one page,
3136 but this way upper levels don't need to care about page
3138 - "dirty-sync-count": times that dirty ram was
synchronized (json
-int
)
3139 - "disk": only present
if "status" is
"active" and it is a block migration
,
3140 it is a json
-object with the following disk information
:
3141 - "transferred": amount transferred
in bytes (json
-int
)
3142 - "remaining": amount remaining to transfer
in bytes json
-int
)
3143 - "total": total disk size
in bytes (json
-int
)
3144 - "xbzrle-cache": only present
if XBZRLE is active
.
3145 It is a json
-object with the following XBZRLE information
:
3146 - "cache-size": XBZRLE cache size
in bytes
3147 - "bytes": number of bytes transferred
for XBZRLE compressed pages
3148 - "pages": number of XBZRLE compressed pages
3149 - "cache-miss": number of XBRZRLE page cache misses
3150 - "cache-miss-rate": rate of XBRZRLE page cache misses
3151 - "overflow": number of times XBZRLE overflows
. This means
3152 that the XBZRLE encoding was bigger than just sent the
3153 whole page
, and then we sent the whole page
instead (as as
3158 1. Before the first migration
3160 -> { "execute": "query-migrate" }
3163 2. Migration is done and has succeeded
3165 -> { "execute": "query-migrate" }
3167 "status": "completed",
3177 "normal-bytes":123456,
3178 "dirty-sync-count":15
3183 3. Migration is done and has failed
3185 -> { "execute": "query-migrate" }
3186 <- { "return": { "status": "failed" } }
3188 4. Migration is being performed and is not a block migration
:
3190 -> { "execute": "query-migrate" }
3200 "expected-downtime":12345,
3203 "normal-bytes":123456,
3204 "dirty-sync-count":15
3209 5. Migration is being performed and is a block migration
:
3211 -> { "execute": "query-migrate" }
3217 "remaining":1053304,
3221 "expected-downtime":12345,
3224 "normal-bytes":123456,
3225 "dirty-sync-count":15
3229 "remaining":20880384,
3235 6. Migration is being performed and XBZRLE is active
:
3237 -> { "execute": "query-migrate" }
3241 "capabilities" : [ { "capability": "xbzrle", "state" : true } ],
3244 "remaining":1053304,
3248 "expected-downtime":12345,
3251 "normal-bytes":3412992,
3252 "dirty-sync-count":15
3255 "cache-size":67108864,
3259 "cache-miss-rate":0.123,
3268 .name
= "query-migrate",
3270 .mhandler
.cmd_new
= qmp_marshal_input_query_migrate
,
3274 migrate
-set
-capabilities
3275 ------------------------
3277 Enable
/Disable migration capabilities
3279 - "xbzrle": XBZRLE support
3280 - "rdma-pin-all": pin all pages when
using RDMA during migration
3281 - "auto-converge": throttle down guest to help convergence of migration
3282 - "zero-blocks": compress zero blocks during block migration
3288 -> { "execute": "migrate-set-capabilities" , "arguments":
3289 { "capabilities": [ { "capability": "xbzrle", "state": true } ] } }
3294 .name
= "migrate-set-capabilities",
3295 .args_type
= "capabilities:O",
3296 .params
= "capability:s,state:b",
3297 .mhandler
.cmd_new
= qmp_marshal_input_migrate_set_capabilities
,
3300 query
-migrate
-capabilities
3301 --------------------------
3303 Query current migration capabilities
3305 - "capabilities": migration capabilities state
3306 - "xbzrle" : XBZRLE
state (json
-bool
)
3307 - "rdma-pin-all" : RDMA Pin Page
state (json
-bool
)
3308 - "auto-converge" : Auto Converge
state (json
-bool
)
3309 - "zero-blocks" : Zero Blocks
state (json
-bool
)
3315 -> { "execute": "query-migrate-capabilities" }
3316 <- { "return": [ { "state": false, "capability": "xbzrle" } ] }
3321 .name
= "query-migrate-capabilities",
3323 .mhandler
.cmd_new
= qmp_marshal_input_query_migrate_capabilities
,
3330 Show balloon information
.
3332 Make an asynchronous request
for balloon info
. When the request completes a
3333 json
-object will be returned containing the following data
:
3335 - "actual": current balloon value
in bytes (json
-int
)
3339 -> { "execute": "query-balloon" }
3342 "actual":1073741824,
3349 .name
= "query-balloon",
3351 .mhandler
.cmd_new
= qmp_marshal_input_query_balloon
,
3355 .name
= "query-block-jobs",
3357 .mhandler
.cmd_new
= qmp_marshal_input_query_block_jobs
,
3362 .args_type
= "path:s",
3363 .mhandler
.cmd_new
= qmp_marshal_input_qom_list
,
3368 .args_type
= "path:s,property:s,value:q",
3369 .mhandler
.cmd_new
= qmp_qom_set
,
3374 .args_type
= "path:s,property:s",
3375 .mhandler
.cmd_new
= qmp_qom_get
,
3379 .name
= "nbd-server-start",
3380 .args_type
= "addr:q",
3381 .mhandler
.cmd_new
= qmp_marshal_input_nbd_server_start
,
3384 .name
= "nbd-server-add",
3385 .args_type
= "device:B,writable:b?",
3386 .mhandler
.cmd_new
= qmp_marshal_input_nbd_server_add
,
3389 .name
= "nbd-server-stop",
3391 .mhandler
.cmd_new
= qmp_marshal_input_nbd_server_stop
,
3395 .name
= "change-vnc-password",
3396 .args_type
= "password:s",
3397 .mhandler
.cmd_new
= qmp_marshal_input_change_vnc_password
,
3400 .name
= "qom-list-types",
3401 .args_type
= "implements:s?,abstract:b?",
3402 .mhandler
.cmd_new
= qmp_marshal_input_qom_list_types
,
3406 .name
= "device-list-properties",
3407 .args_type
= "typename:s",
3408 .mhandler
.cmd_new
= qmp_marshal_input_device_list_properties
,
3412 .name
= "query-machines",
3414 .mhandler
.cmd_new
= qmp_marshal_input_query_machines
,
3418 .name
= "query-cpu-definitions",
3420 .mhandler
.cmd_new
= qmp_marshal_input_query_cpu_definitions
,
3424 .name
= "query-target",
3426 .mhandler
.cmd_new
= qmp_marshal_input_query_target
,
3430 .name
= "query-tpm",
3432 .mhandler
.cmd_new
= qmp_marshal_input_query_tpm
,
3439 Return information about the TPM device
.
3445 -> { "execute": "query-tpm" }
3448 { "model": "tpm-tis",
3450 { "type": "passthrough",
3452 { "cancel-path": "/sys/class/misc/tpm0/device/cancel",
3464 .name
= "query-tpm-models",
3466 .mhandler
.cmd_new
= qmp_marshal_input_query_tpm_models
,
3473 Return a list of supported TPM models
.
3479 -> { "execute": "query-tpm-models" }
3480 <- { "return": [ "tpm-tis" ] }
3485 .name
= "query-tpm-types",
3487 .mhandler
.cmd_new
= qmp_marshal_input_query_tpm_types
,
3494 Return a list of supported TPM types
.
3500 -> { "execute": "query-tpm-types" }
3501 <- { "return": [ "passthrough" ] }
3506 .name
= "chardev-add",
3507 .args_type
= "id:s,backend:q",
3508 .mhandler
.cmd_new
= qmp_marshal_input_chardev_add
,
3519 - "id": the chardev
's ID, must be unique (json-string)
3520 - "backend": chardev backend type + parameters
3524 -> { "execute" : "chardev-add",
3525 "arguments" : { "id" : "foo",
3526 "backend" : { "type" : "null", "data" : {} } } }
3529 -> { "execute" : "chardev-add",
3530 "arguments" : { "id" : "bar",
3531 "backend" : { "type" : "file",
3532 "data" : { "out" : "/tmp/bar.log" } } } }
3535 -> { "execute" : "chardev-add",
3536 "arguments" : { "id" : "baz",
3537 "backend" : { "type" : "pty", "data" : {} } } }
3538 <- { "return": { "pty" : "/dev/pty/42" } }
3543 .name = "chardev-remove",
3544 .args_type = "id:s",
3545 .mhandler.cmd_new = qmp_marshal_input_chardev_remove,
3557 - "id": the chardev's ID
, must exist and not be
in use (json
-string
)
3561 -> { "execute": "chardev-remove", "arguments": { "id" : "foo" } }
3566 .name
= "query-rx-filter",
3567 .args_type
= "name:s?",
3568 .mhandler
.cmd_new
= qmp_marshal_input_query_rx_filter
,
3575 Show rx
-filter information
.
3577 Returns a json
-array of rx
-filter information
for all
NICs (or
for the
3578 given NIC
), returning an error
if the given NIC doesn
't exist, or
3579 given NIC doesn't support rx
-filter querying
, or given net client
3582 The query will clear the event notification flag of each NIC, then qemu
3583 will start to emit event to QMP monitor.
3585 Each array entry contains the following:
3587 - "name": net client name (json-string)
3588 - "promiscuous": promiscuous mode is enabled (json-bool)
3589 - "multicast": multicast receive state (one of 'normal
', 'none
', 'all
')
3590 - "unicast": unicast receive state (one of 'normal
', 'none
', 'all
')
3591 - "vlan": vlan receive state (one of 'normal
', 'none
', 'all
') (Since 2.0)
3592 - "broadcast-allowed": allow to receive broadcast (json-bool)
3593 - "multicast-overflow": multicast table is overflowed (json-bool)
3594 - "unicast-overflow": unicast table is overflowed (json-bool)
3595 - "main-mac": main macaddr string (json-string)
3596 - "vlan-table": a json-array of active vlan id
3597 - "unicast-table": a json-array of unicast macaddr string
3598 - "multicast-table": a json-array of multicast macaddr string
3602 -> { "execute": "query-rx-filter", "arguments": { "name": "vnet0" } }
3605 "promiscuous": true,
3607 "main-mac": "52:54:00:12:34:56",
3608 "unicast": "normal",
3616 "multicast": "normal",
3617 "multicast-overflow": false,
3618 "unicast-overflow": false,
3619 "multicast-table": [
3620 "01:00:5e:00:00:01",
3621 "33:33:00:00:00:01",
3624 "broadcast-allowed": false
3632 .name = "blockdev-add",
3633 .args_type = "options:q",
3634 .mhandler.cmd_new = qmp_marshal_input_blockdev_add,
3645 - "options": block driver options
3649 -> { "execute": "blockdev-add",
3650 "arguments": { "options" : { "driver": "qcow2",
3651 "file": { "driver": "file",
3652 "filename": "test.qcow2" } } } }
3657 -> { "execute": "blockdev-add",
3669 "filename": "/tmp/test.qcow2"
3675 "filename": "/dev/fdset/4"
3687 .name = "query-named-block-nodes",
3689 .mhandler.cmd_new = qmp_marshal_input_query_named_block_nodes,
3693 @query-named-block-nodes
3694 ------------------------
3696 Return a list of BlockDeviceInfo for all the named block driver nodes
3700 -> { "execute": "query-named-block-nodes" }
3701 <- { "return": [ { "ro":false,
3704 "file":"disks/test.qcow2",
3705 "node-name": "my-node",
3706 "backing_file_depth":1,
3720 "write_threshold": 0,
3722 "filename":"disks/test.qcow2",
3724 "virtual-size":2048000,
3725 "backing_file":"base.qcow2",
3726 "full-backing-filename":"disks/base.qcow2",
3727 "backing-filename-format:"qcow2",
3731 "name": "snapshot1",
3733 "date-sec": 10000200,
3735 "vm-clock-sec": 206,
3740 "filename":"disks/base.qcow2",
3742 "virtual-size":2048000
3749 .name = "query-memdev",
3751 .mhandler.cmd_new = qmp_marshal_input_query_memdev,
3758 Show memory devices information.
3763 -> { "execute": "query-memdev" }
3770 "host-nodes": [0, 1],
3778 "host-nodes": [2, 3],
3779 "policy": "preferred"
3787 .name = "query-memory-devices",
3789 .mhandler.cmd_new = qmp_marshal_input_query_memory_devices,
3793 @query-memory-devices
3794 --------------------
3796 Return a list of memory devices.
3799 -> { "execute": "query-memory-devices" }
3800 <- { "return": [ { "data":
3801 { "addr": 5368709120,
3802 "hotpluggable": true,
3805 "memdev": "/objects/memX",
3814 .name = "query-acpi-ospm-status",
3816 .mhandler.cmd_new = qmp_marshal_input_query_acpi_ospm_status,
3820 @query-acpi-ospm-status
3821 --------------------
3823 Return list of ACPIOSTInfo for devices that support status reporting
3824 via ACPI _OST method.
3827 -> { "execute": "query-acpi-ospm-status" }
3828 <- { "return": [ { "device": "d1", "slot": "0", "slot-type": "DIMM", "source": 1, "status": 0},
3829 { "slot": "1", "slot-type": "DIMM", "source": 0, "status": 0},
3830 { "slot": "2", "slot-type": "DIMM", "source": 0, "status": 0},
3831 { "slot": "3", "slot-type": "DIMM", "source": 0, "status": 0}
3835 #if defined TARGET_I386
3837 .name = "rtc-reset-reinjection",
3839 .mhandler.cmd_new = qmp_marshal_input_rtc_reset_reinjection,
3844 rtc-reset-reinjection
3845 ---------------------
3847 Reset the RTC interrupt reinjection backlog.
3853 -> { "execute": "rtc-reset-reinjection" }
3858 .name = "trace-event-get-state",
3859 .args_type = "name:s",
3860 .mhandler.cmd_new = qmp_marshal_input_trace_event_get_state,
3864 trace-event-get-state
3865 ---------------------
3867 Query the state of events.
3871 -> { "execute": "trace-event-get-state", "arguments": { "name": "qemu_memalign" } }
3872 <- { "return": [ { "name": "qemu_memalign", "state": "disabled" } ] }
3876 .name = "trace-event-set-state",
3877 .args_type = "name:s,enable:b,ignore-unavailable:b?",
3878 .mhandler.cmd_new = qmp_marshal_input_trace_event_set_state,
3882 trace-event-set-state
3883 ---------------------
3885 Set the state of events.
3889 -> { "execute": "trace-event-set-state", "arguments": { "name": "qemu_memalign", "enable": "true" } }
3894 .name = "x-input-send-event",
3895 .args_type = "console:i?,events:q",
3896 .mhandler.cmd_new = qmp_marshal_input_x_input_send_event,
3903 Send input event to guest.
3907 - "console": console index. (json-int, optional)
3908 - "events": list of input events.
3910 The consoles are visible in the qom tree, under
3911 /backend/console[$index]. They have a device link and head property, so
3912 it is possible to map which console belongs to which device and display.
3914 Note: this command is experimental, and not a stable API.
3918 Press left mouse button.
3920 -> { "execute": "x-input-send-event",
3921 "arguments": { "console": 0,
3922 "events": [ { "type": "btn",
3923 "data" : { "down": true, "button": "Left" } } ] } }
3926 -> { "execute": "x-input-send-event",
3927 "arguments": { "console": 0,
3928 "events": [ { "type": "btn",
3929 "data" : { "down": false, "button": "Left" } } ] } }
3936 -> { "execute": "x-input-send-event",
3937 "arguments": { "console": 0, "events": [
3938 { "type": "key", "data" : { "down": true,
3939 "key": {"type": "qcode", "data": "ctrl" } } },
3940 { "type": "key", "data" : { "down": true,
3941 "key": {"type": "qcode", "data": "alt" } } },
3942 { "type": "key", "data" : { "down": true,
3943 "key": {"type": "qcode", "data": "delete" } } } ] } }
3948 Move mouse pointer to absolute coordinates (20000, 400).
3950 -> { "execute": "x-input-send-event" ,
3951 "arguments": { "console": 0, "events": [
3952 { "type": "abs", "data" : { "axis": "X", "value" : 20000 } },
3953 { "type": "abs", "data" : { "axis": "Y", "value" : 400 } } ] } }
3959 .name = "block-set-write-threshold",
3960 .args_type = "node-name:s,write-threshold:l",
3961 .mhandler.cmd_new = qmp_marshal_input_block_set_write_threshold,
3965 block-set-write-threshold
3968 Change the write threshold for a block drive. The threshold is an offset,
3969 thus must be non-negative. Default is no write threshold.
3970 Setting the threshold to zero disables it.
3974 - "node-name": the node name in the block driver state graph (json-string)
3975 - "write-threshold": the write threshold in bytes (json-int)
3979 -> { "execute": "block-set-write-threshold",
3980 "arguments": { "node-name": "mydev",
3981 "write-threshold": 17179869184 } }