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:O,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_async
= client_migrate_info
,
789 .flags
= MONITOR_CMD_ASYNC
,
796 Set the spice
/vnc connection info
for the migration target
. The spice
/vnc
797 server will ask the spice
/vnc client to automatically reconnect
using the
798 new parameters (if specified
) once the vm migration finished successfully
.
802 - "protocol": protocol
: "spice" or
"vnc" (json
-string
)
803 - "hostname": migration target
hostname (json
-string
)
804 - "port": spice
/vnc tcp port
for plaintext
channels (json
-int
, optional
)
805 - "tls-port": spice tcp port
for tls
-secured
channels (json
-int
, optional
)
806 - "cert-subject": server certificate
subject (json
-string
, optional
)
810 -> { "execute": "client_migrate_info",
811 "arguments": { "protocol": "spice",
812 "hostname": "virt42.lab.kraxel.org",
819 .name
= "dump-guest-memory",
820 .args_type
= "paging:b,protocol:s,begin:i?,end:i?,format:s?",
821 .params
= "-p protocol [begin] [length] [format]",
822 .help
= "dump guest memory to file",
823 .mhandler
.cmd_new
= qmp_marshal_input_dump_guest_memory
,
830 Dump guest memory to file
. The file can be processed with crash or gdb
.
834 - "paging": do paging to get guest
's memory mapping (json-bool)
835 - "protocol": destination file(started with "file:") or destination file
836 descriptor (started with "fd:") (json-string)
837 - "begin": the starting physical address. It's optional
, and should be specified
838 with length
together (json
-int
)
839 - "length": the memory size
, in bytes
. It
's optional, and should be specified
840 with begin together (json-int)
841 - "format": the format of guest memory dump. It's optional
, and can be
842 elf|kdump
-zlib|kdump
-lzo|kdump
-snappy
, but non
-elf formats will
843 conflict with paging and filter
, ie
. begin and
length (json
-string
)
847 -> { "execute": "dump-guest-memory", "arguments": { "protocol": "fd:dump" } }
852 (1) All boolean arguments
default to
false
857 .name
= "query-dump-guest-memory-capability",
859 .mhandler
.cmd_new
= qmp_marshal_input_query_dump_guest_memory_capability
,
863 query
-dump
-guest
-memory
-capability
866 Show available formats
for 'dump-guest-memory'
870 -> { "execute": "query-dump-guest-memory-capability" }
871 <- { "return": { "formats":
872 ["elf", "kdump-zlib", "kdump-lzo", "kdump-snappy"] }
877 .name
= "netdev_add",
878 .args_type
= "netdev:O",
879 .mhandler
.cmd_new
= qmp_netdev_add
,
886 Add host network device
.
890 - "type": the device type
, "tap", "user", ... (json
-string
)
891 - "id": the device
's ID, must be unique (json-string)
896 -> { "execute": "netdev_add", "arguments": { "type": "user", "id": "netdev1" } }
899 Note: The supported device options are the same ones supported by the '-netdev
'
900 command-line argument, which are listed in the '-help
' output or QEMU's
906 .name
= "netdev_del",
908 .mhandler
.cmd_new
= qmp_marshal_input_netdev_del
,
915 Remove host network device
.
919 - "id": the device
's ID, must be unique (json-string)
923 -> { "execute": "netdev_del", "arguments": { "id": "netdev1" } }
930 .name = "object-add",
931 .args_type = "qom-type:s,id:s,props:q?",
932 .mhandler.cmd_new = qmp_object_add,
943 - "qom-type": the object's QOM type
, i
.e
. the
class name (json
-string
)
944 - "id": the object
's ID, must be unique (json-string)
945 - "props": a dictionary of object property values (optional, json-dict)
949 -> { "execute": "object-add", "arguments": { "qom-type": "rng-random", "id": "rng1",
950 "props": { "filename": "/dev/hwrng" } } }
956 .name = "object-del",
958 .mhandler.cmd_new = qmp_marshal_input_object_del,
969 - "id": the object's
ID (json
-string
)
973 -> { "execute": "object-del", "arguments": { "id": "rng1" } }
981 .name
= "block_resize",
982 .args_type
= "device:s?,node-name:s?,size:o",
983 .mhandler
.cmd_new
= qmp_marshal_input_block_resize
,
990 Resize a block image
while a guest is running
.
994 - "device": the device
's ID, must be unique (json-string)
995 - "node-name": the node name in the block driver state graph (json-string)
1000 -> { "execute": "block_resize", "arguments": { "device": "scratch", "size": 1073741824 } }
1006 .name = "block-stream",
1007 .args_type = "device:B,base:s?,speed:o?,backing-file:s?,on-error:s?",
1008 .mhandler.cmd_new = qmp_marshal_input_block_stream,
1012 .name = "block-commit",
1013 .args_type = "device:B,base:s?,top:s?,backing-file:s?,speed:o?",
1014 .mhandler.cmd_new = qmp_marshal_input_block_commit,
1021 Live commit of data from overlay image nodes into backing nodes - i.e., writes
1022 data between 'top
' and 'base
' into 'base
'.
1026 - "device": The device's ID
, must be
unique (json
-string
)
1027 - "base": The file name of the backing image to write data into
.
1028 If not specified
, this is the deepest backing image
1029 (json
-string
, optional
)
1030 - "top": The file name of the backing image within the image chain
,
1031 which contains the topmost data to be committed down
. If
1032 not specified
, this is the active layer
. (json
-string
, optional
)
1034 - backing
-file
: The backing file string to write into the overlay
1035 image of
'top'. If
'top' is the active layer
,
1036 specifying a backing file string is an error
. This
1037 filename is not validated
.
1039 If a pathname string is such that it cannot be
1040 resolved by QEMU
, that means that subsequent QMP or
1041 HMP commands must use node
-names
for the image
in
1042 question
, as filename lookup methods will fail
.
1044 If not specified
, QEMU will automatically determine
1045 the backing file string to use
, or error out
if
1046 there is no obvious choice
. Care should be taken
1047 when specifying the string
, to specify a valid
1048 filename or protocol
.
1049 (json
-string
, optional
) (Since
2.1)
1051 If top
== base
, that is an error
.
1052 If top
== active
, the job will not be completed by itself
,
1053 user needs to complete the job with the block
-job
-complete
1054 command after getting the ready event
. (Since
2.0)
1056 If the base image is smaller than top
, then the base image
1057 will be resized to be the same size as top
. If top is
1058 smaller than the base image
, the base will not be
1059 truncated
. If you want the base image size to match the
1060 size of the smaller top
, you can safely truncate it
1061 yourself once the commit operation successfully completes
.
1063 - "speed": the maximum speed
, in bytes per
second (json
-int
, optional
)
1068 -> { "execute": "block-commit", "arguments": { "device": "virtio0",
1069 "top": "/tmp/snap1.qcow2" } }
1075 .name
= "drive-backup",
1076 .args_type
= "sync:s,device:B,target:s,speed:i?,mode:s?,format:s?,"
1077 "on-source-error:s?,on-target-error:s?",
1078 .mhandler
.cmd_new
= qmp_marshal_input_drive_backup
,
1085 Start a point
-in-time copy of a block device to a
new destination
. The
1086 status of ongoing drive
-backup operations can be checked with
1087 query
-block
-jobs where the BlockJobInfo
.type field has the value
'backup'.
1088 The operation can be stopped before it has completed
using the
1089 block
-job
-cancel command
.
1093 - "device": the name of the device which should be copied
.
1095 - "target": the target of the
new image
. If the file exists
, or
if it is a
1096 device
, the existing file
/device will be used as the
new
1097 destination
. If it does not exist
, a
new file will be created
.
1099 - "format": the format of the
new destination
, default is to probe
if 'mode' is
1100 'existing', else the format of the source
1101 (json
-string
, optional
)
1102 - "sync": what parts of the disk image should be copied to the destination
;
1103 possibilities include
"full" for all the disk
, "top" for only the sectors
1104 allocated
in the topmost image
, or
"none" to only replicate
new I
/O
1106 - "mode": whether and how QEMU should create a
new image
1107 (NewImageMode
, optional
, default 'absolute-paths')
1108 - "speed": the maximum speed
, in bytes per
second (json
-int
, optional
)
1109 - "on-source-error": the action to take on an error on the source
, default
1110 'report'. 'stop' and
'enospc' can only be used
1111 if the block device supports io
-status
.
1112 (BlockdevOnError
, optional
)
1113 - "on-target-error": the action to take on an error on the target
, default
1114 'report' (no limitations
, since
this applies to
1115 a different block device than device
).
1116 (BlockdevOnError
, optional
)
1119 -> { "execute": "drive-backup", "arguments": { "device": "drive0",
1121 "target": "backup.img" } }
1127 .name
= "blockdev-backup",
1128 .args_type
= "sync:s,device:B,target:B,speed:i?,"
1129 "on-source-error:s?,on-target-error:s?",
1130 .mhandler
.cmd_new
= qmp_marshal_input_blockdev_backup
,
1137 The device version of drive
-backup
: this command takes an existing named device
1142 - "device": the name of the device which should be copied
.
1144 - "target": the name of the backup target device
. (json
-string
)
1145 - "sync": what parts of the disk image should be copied to the destination
;
1146 possibilities include
"full" for all the disk
, "top" for only the
1147 sectors allocated
in the topmost image
, or
"none" to only replicate
1148 new I
/O (MirrorSyncMode
).
1149 - "speed": the maximum speed
, in bytes per
second (json
-int
, optional
)
1150 - "on-source-error": the action to take on an error on the source
, default
1151 'report'. 'stop' and
'enospc' can only be used
1152 if the block device supports io
-status
.
1153 (BlockdevOnError
, optional
)
1154 - "on-target-error": the action to take on an error on the target
, default
1155 'report' (no limitations
, since
this applies to
1156 a different block device than device
).
1157 (BlockdevOnError
, optional
)
1160 -> { "execute": "blockdev-backup", "arguments": { "device": "src-id",
1162 "target": "tgt-id" } }
1168 .name
= "block-job-set-speed",
1169 .args_type
= "device:B,speed:o",
1170 .mhandler
.cmd_new
= qmp_marshal_input_block_job_set_speed
,
1174 .name
= "block-job-cancel",
1175 .args_type
= "device:B,force:b?",
1176 .mhandler
.cmd_new
= qmp_marshal_input_block_job_cancel
,
1179 .name
= "block-job-pause",
1180 .args_type
= "device:B",
1181 .mhandler
.cmd_new
= qmp_marshal_input_block_job_pause
,
1184 .name
= "block-job-resume",
1185 .args_type
= "device:B",
1186 .mhandler
.cmd_new
= qmp_marshal_input_block_job_resume
,
1189 .name
= "block-job-complete",
1190 .args_type
= "device:B",
1191 .mhandler
.cmd_new
= qmp_marshal_input_block_job_complete
,
1194 .name
= "transaction",
1195 .args_type
= "actions:q",
1196 .mhandler
.cmd_new
= qmp_marshal_input_transaction
,
1203 Atomically operate on one or more block devices
. The only supported operations
1204 for now are drive
-backup
, internal and external snapshotting
. A list of
1205 dictionaries is accepted
, that contains the actions to be performed
.
1206 If there is any failure performing any of the operations
, all operations
1207 for the group are abandoned
.
1209 For external snapshots
, the dictionary contains the device
, the file to use
for
1210 the
new snapshot
, and the format
. The
default format
, if not specified
, is
1213 Each
new snapshot defaults to being created by
QEMU (wiping any
1214 contents
if the file already exists
), but it is also possible to reuse
1215 an externally
-created file
. In the latter
case, you should ensure that
1216 the
new image file has the same contents as the current one
; QEMU cannot
1217 perform any meaningful check
. Typically
this is achieved by
using the
1218 current image file as the backing file
for the
new image
.
1220 On failure
, the original disks pre
-snapshot attempt will be used
.
1222 For internal snapshots
, the dictionary contains the device and the snapshot
's
1223 name. If an internal snapshot matching name already exists, the request will
1224 be rejected. Only some image formats support it, for example, qcow2, rbd,
1227 On failure, qemu will try delete the newly created internal snapshot in the
1228 transaction. When an I/O error occurs during deletion, the user needs to fix
1229 it later with qemu-img or other command.
1234 - "type": the operation to perform. The only supported
1235 value is "blockdev-snapshot-sync". (json-string)
1236 - "data": a dictionary. The contents depend on the value
1237 of "type". When "type" is "blockdev-snapshot-sync":
1238 - "device": device name to snapshot (json-string)
1239 - "node-name": graph node name to snapshot (json-string)
1240 - "snapshot-file": name of new image file (json-string)
1241 - "snapshot-node-name": graph node name of the new snapshot (json-string)
1242 - "format": format of new image (json-string, optional)
1243 - "mode": whether and how QEMU should create the snapshot file
1244 (NewImageMode, optional, default "absolute-paths")
1245 When "type" is "blockdev-snapshot-internal-sync":
1246 - "device": device name to snapshot (json-string)
1247 - "name": name of the new snapshot (json-string)
1251 -> { "execute": "transaction",
1252 "arguments": { "actions": [
1253 { "type": "blockdev-snapshot-sync", "data" : { "device": "ide-hd0",
1254 "snapshot-file": "/some/place/my-image",
1255 "format": "qcow2" } },
1256 { "type": "blockdev-snapshot-sync", "data" : { "node-name": "myfile",
1257 "snapshot-file": "/some/place/my-image2",
1258 "snapshot-node-name": "node3432",
1260 "format": "qcow2" } },
1261 { "type": "blockdev-snapshot-sync", "data" : { "device": "ide-hd1",
1262 "snapshot-file": "/some/place/my-image2",
1264 "format": "qcow2" } },
1265 { "type": "blockdev-snapshot-internal-sync", "data" : {
1266 "device": "ide-hd2",
1267 "name": "snapshot0" } } ] } }
1273 .name = "blockdev-snapshot-sync",
1274 .args_type = "device:s?,node-name:s?,snapshot-file:s,snapshot-node-name:s?,format:s?,mode:s?",
1275 .mhandler.cmd_new = qmp_marshal_input_blockdev_snapshot_sync,
1279 blockdev-snapshot-sync
1280 ----------------------
1282 Synchronous snapshot of a block device. snapshot-file specifies the
1283 target of the new image. If the file exists, or if it is a device, the
1284 snapshot will be created in the existing file/device. If does not
1285 exist, a new file will be created. format specifies the format of the
1286 snapshot image, default is qcow2.
1290 - "device": device name to snapshot (json-string)
1291 - "node-name": graph node name to snapshot (json-string)
1292 - "snapshot-file": name of new image file (json-string)
1293 - "snapshot-node-name": graph node name of the new snapshot (json-string)
1294 - "mode": whether and how QEMU should create the snapshot file
1295 (NewImageMode, optional, default "absolute-paths")
1296 - "format": format of new image (json-string, optional)
1300 -> { "execute": "blockdev-snapshot-sync", "arguments": { "device": "ide-hd0",
1302 "/some/place/my-image",
1303 "format": "qcow2" } }
1309 .name = "blockdev-snapshot-internal-sync",
1310 .args_type = "device:B,name:s",
1311 .mhandler.cmd_new = qmp_marshal_input_blockdev_snapshot_internal_sync,
1315 blockdev-snapshot-internal-sync
1316 -------------------------------
1318 Synchronously take an internal snapshot of a block device when the format of
1319 image used supports it. If the name is an empty string, or a snapshot with
1320 name already exists, the operation will fail.
1324 - "device": device name to snapshot (json-string)
1325 - "name": name of the new snapshot (json-string)
1329 -> { "execute": "blockdev-snapshot-internal-sync",
1330 "arguments": { "device": "ide-hd0",
1331 "name": "snapshot0" }
1338 .name = "blockdev-snapshot-delete-internal-sync",
1339 .args_type = "device:B,id:s?,name:s?",
1341 qmp_marshal_input_blockdev_snapshot_delete_internal_sync,
1345 blockdev-snapshot-delete-internal-sync
1346 --------------------------------------
1348 Synchronously delete an internal snapshot of a block device when the format of
1349 image used supports it. The snapshot is identified by name or id or both. One
1350 of name or id is required. If the snapshot is not found, the operation will
1355 - "device": device name (json-string)
1356 - "id": ID of the snapshot (json-string, optional)
1357 - "name": name of the snapshot (json-string, optional)
1361 -> { "execute": "blockdev-snapshot-delete-internal-sync",
1362 "arguments": { "device": "ide-hd0",
1363 "name": "snapshot0" }
1367 "name": "snapshot0",
1369 "date-sec": 1000012,
1371 "vm-clock-sec": 100,
1379 .name = "drive-mirror",
1380 .args_type = "sync:s,device:B,target:s,speed:i?,mode:s?,format:s?,"
1381 "node-name:s?,replaces:s?,"
1382 "on-source-error:s?,on-target-error:s?,"
1383 "granularity:i?,buf-size:i?",
1384 .mhandler.cmd_new = qmp_marshal_input_drive_mirror,
1391 Start mirroring a block device's writes to a
new destination
. target
1392 specifies the target of the
new image
. If the file exists
, or
if it is
1393 a device
, it will be used as the
new destination
for writes
. If it does not
1394 exist
, a
new file will be created
. format specifies the format of the
1395 mirror image
, default is to probe
if mode
='existing', else the format
1400 - "device": device name to operate
on (json
-string
)
1401 - "target": name of
new image
file (json
-string
)
1402 - "format": format of
new image (json
-string
, optional
)
1403 - "node-name": the name of the
new block driver state
in the node graph
1404 (json
-string
, optional
)
1405 - "replaces": the block driver node name to replace when finished
1406 (json
-string
, optional
)
1407 - "mode": how an image file should be created into the target
1408 file
/device (NewImageMode
, optional
, default 'absolute-paths')
1409 - "speed": maximum speed of the streaming job
, in bytes per second
1411 - "granularity": granularity of the dirty bitmap
, in bytes (json
-int
, optional
)
1412 - "buf_size": maximum amount of data
in flight from source to target
, in bytes
1413 (json
-int
, default 10M
)
1414 - "sync": what parts of the disk image should be copied to the destination
;
1415 possibilities include
"full" for all the disk
, "top" for only the sectors
1416 allocated
in the topmost image
, or
"none" to only replicate
new I
/O
1418 - "on-source-error": the action to take on an error on the source
1419 (BlockdevOnError
, default 'report')
1420 - "on-target-error": the action to take on an error on the target
1421 (BlockdevOnError
, default 'report')
1423 The
default value of the granularity is the image cluster size clamped
1424 between
4096 and
65536, if the image format defines one
. If the format
1425 does not define a cluster size
, the
default value of the granularity
1431 -> { "execute": "drive-mirror", "arguments": { "device": "ide-hd0",
1432 "target": "/some/place/my-image",
1434 "format": "qcow2" } }
1440 .name
= "change-backing-file",
1441 .args_type
= "device:s,image-node-name:s,backing-file:s",
1442 .mhandler
.cmd_new
= qmp_marshal_input_change_backing_file
,
1450 Change the backing file
in the image file metadata
. This does not cause
1451 QEMU to reopen the image file to reparse the backing
filename (it may
,
1452 however
, perform a reopen to change permissions from r
/o
-> r
/w
-> r
/o
,
1453 if needed
). The
new backing file string is written into the image file
1454 metadata
, and the QEMU internal strings are updated
.
1458 - "image-node-name": The name of the block driver state node of the
1459 image to modify
. The
"device" is argument is used to
1460 verify
"image-node-name" is
in the chain described by
1462 (json
-string
, optional
)
1464 - "device": The name of the device
.
1467 - "backing-file": The string to write as the backing file
. This string is
1468 not validated
, so care should be taken when specifying
1469 the string or the image chain may not be able to be
1473 Returns
: Nothing on success
1474 If
"device" does not exist or cannot be determined
, DeviceNotFound
1480 .args_type
= "value:M",
1481 .mhandler
.cmd_new
= qmp_marshal_input_balloon
,
1488 Request VM to change its memory
allocation (in bytes
).
1492 - "value": New memory
allocation (json
-int
)
1496 -> { "execute": "balloon", "arguments": { "value": 536870912 } }
1503 .args_type
= "name:s,up:b",
1504 .mhandler
.cmd_new
= qmp_marshal_input_set_link
,
1511 Change the link status of a network adapter
.
1515 - "name": network device
name (json
-string
)
1516 - "up": status is
up (json
-bool
)
1520 -> { "execute": "set_link", "arguments": { "name": "e1000.0", "up": false } }
1527 .args_type
= "fdname:s",
1528 .params
= "getfd name",
1529 .help
= "receive a file descriptor via SCM rights and assign it a name",
1530 .mhandler
.cmd_new
= qmp_marshal_input_getfd
,
1537 Receive a file descriptor via SCM rights and assign it a name
.
1541 - "fdname": file descriptor
name (json
-string
)
1545 -> { "execute": "getfd", "arguments": { "fdname": "fd1" } }
1550 (1) If the name specified by the
"fdname" argument already exists
,
1551 the file descriptor assigned to it will be closed and replaced
1552 by the received file descriptor
.
1553 (2) The
'closefd' command can be used to explicitly close the file
1554 descriptor when it is no longer needed
.
1560 .args_type
= "fdname:s",
1561 .params
= "closefd name",
1562 .help
= "close a file descriptor previously passed via SCM rights",
1563 .mhandler
.cmd_new
= qmp_marshal_input_closefd
,
1570 Close a file descriptor previously passed via SCM rights
.
1574 - "fdname": file descriptor
name (json
-string
)
1578 -> { "execute": "closefd", "arguments": { "fdname": "fd1" } }
1585 .args_type
= "fdset-id:i?,opaque:s?",
1586 .params
= "add-fd fdset-id opaque",
1587 .help
= "Add a file descriptor, that was passed via SCM rights, to an fd set",
1588 .mhandler
.cmd_new
= qmp_marshal_input_add_fd
,
1595 Add a file descriptor
, that was passed via SCM rights
, to an fd set
.
1599 - "fdset-id": The ID of the fd set to add the file descriptor to
.
1600 (json
-int
, optional
)
1601 - "opaque": A free
-form string that can be used to describe the fd
.
1602 (json
-string
, optional
)
1604 Return a json
-object with the following information
:
1606 - "fdset-id": The ID of the fd set that the fd was added to
. (json
-int
)
1607 - "fd": The file descriptor that was received via SCM rights and added to the
1612 -> { "execute": "add-fd", "arguments": { "fdset-id": 1 } }
1613 <- { "return": { "fdset-id": 1, "fd": 3 } }
1617 (1) The list of fd sets is shared by all monitor connections
.
1618 (2) If
"fdset-id" is not specified
, a
new fd set will be created
.
1623 .name
= "remove-fd",
1624 .args_type
= "fdset-id:i,fd:i?",
1625 .params
= "remove-fd fdset-id fd",
1626 .help
= "Remove a file descriptor from an fd set",
1627 .mhandler
.cmd_new
= qmp_marshal_input_remove_fd
,
1634 Remove a file descriptor from an fd set
.
1638 - "fdset-id": The ID of the fd set that the file descriptor belongs to
.
1640 - "fd": The file descriptor that is to be removed
. (json
-int
, optional
)
1644 -> { "execute": "remove-fd", "arguments": { "fdset-id": 1, "fd": 3 } }
1649 (1) The list of fd sets is shared by all monitor connections
.
1650 (2) If
"fd" is not specified
, all file descriptors
in "fdset-id" will be
1656 .name
= "query-fdsets",
1658 .help
= "Return information describing all fd sets",
1659 .mhandler
.cmd_new
= qmp_marshal_input_query_fdsets
,
1666 Return information describing all fd sets
.
1672 -> { "execute": "query-fdsets" }
1678 "opaque": "rdonly:/path/to/file"
1682 "opaque": "rdwr:/path/to/file"
1701 Note
: The list of fd sets is shared by all monitor connections
.
1706 .name
= "block_passwd",
1707 .args_type
= "device:s?,node-name:s?,password:s",
1708 .mhandler
.cmd_new
= qmp_marshal_input_block_passwd
,
1715 Set the password of encrypted block devices
.
1719 - "device": device
name (json
-string
)
1720 - "node-name": name
in the block driver state
graph (json
-string
)
1721 - "password": password (json
-string
)
1725 -> { "execute": "block_passwd", "arguments": { "device": "ide0-hd0",
1726 "password": "12345" } }
1732 .name
= "block_set_io_throttle",
1733 .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?",
1734 .mhandler
.cmd_new
= qmp_marshal_input_block_set_io_throttle
,
1738 block_set_io_throttle
1741 Change I
/O throttle limits
for a block drive
.
1745 - "device": device
name (json
-string
)
1746 - "bps": total throughput limit
in bytes per
second (json
-int
)
1747 - "bps_rd": read throughput limit
in bytes per
second (json
-int
)
1748 - "bps_wr": write throughput limit
in bytes per
second (json
-int
)
1749 - "iops": total I
/O operations per
second (json
-int
)
1750 - "iops_rd": read I
/O operations per
second (json
-int
)
1751 - "iops_wr": write I
/O operations per
second (json
-int
)
1752 - "bps_max": total max
in bytes (json
-int
)
1753 - "bps_rd_max": read max
in bytes (json
-int
)
1754 - "bps_wr_max": write max
in bytes (json
-int
)
1755 - "iops_max": total I
/O operations
max (json
-int
)
1756 - "iops_rd_max": read I
/O operations
max (json
-int
)
1757 - "iops_wr_max": write I
/O operations
max (json
-int
)
1758 - "iops_size": I
/O size
in bytes when
limiting (json
-int
)
1762 -> { "execute": "block_set_io_throttle", "arguments": { "device": "virtio0",
1781 .name
= "set_password",
1782 .args_type
= "protocol:s,password:s,connected:s?",
1783 .mhandler
.cmd_new
= qmp_marshal_input_set_password
,
1790 Set the password
for vnc
/spice protocols
.
1794 - "protocol": protocol
name (json
-string
)
1795 - "password": password (json
-string
)
1796 - "connected": [ keep | disconnect | fail
] (json
-string
, optional
)
1800 -> { "execute": "set_password", "arguments": { "protocol": "vnc",
1801 "password": "secret" } }
1807 .name
= "expire_password",
1808 .args_type
= "protocol:s,time:s",
1809 .mhandler
.cmd_new
= qmp_marshal_input_expire_password
,
1816 Set the password expire time
for vnc
/spice protocols
.
1820 - "protocol": protocol
name (json
-string
)
1821 - "time": [ now |
never |
+secs | secs
] (json
-string
)
1825 -> { "execute": "expire_password", "arguments": { "protocol": "vnc",
1832 .name
= "add_client",
1833 .args_type
= "protocol:s,fdname:s,skipauth:b?,tls:b?",
1834 .mhandler
.cmd_new
= qmp_marshal_input_add_client
,
1841 Add a graphics client
1845 - "protocol": protocol
name (json
-string
)
1846 - "fdname": file descriptor
name (json
-string
)
1847 - "skipauth": whether to skip
authentication (json
-bool
, optional
)
1848 - "tls": whether to perform
TLS (json
-bool
, optional
)
1852 -> { "execute": "add_client", "arguments": { "protocol": "vnc",
1853 "fdname": "myclient" } }
1858 .name
= "qmp_capabilities",
1861 .help
= "enable QMP capabilities",
1862 .mhandler
.cmd_new
= do_qmp_capabilities
,
1869 Enable QMP capabilities
.
1875 -> { "execute": "qmp_capabilities" }
1878 Note
: This command must be issued before issuing any other command
.
1883 .name
= "human-monitor-command",
1884 .args_type
= "command-line:s,cpu-index:i?",
1885 .mhandler
.cmd_new
= qmp_marshal_input_human_monitor_command
,
1889 human
-monitor
-command
1890 ---------------------
1892 Execute a Human Monitor command
.
1896 - command
-line
: the command name and its arguments
, just like the
1897 Human Monitor
's shell (json-string)
1898 - cpu-index: select the CPU number to be used by commands which access CPU
1899 data, like 'info registers
'. The Monitor selects CPU 0 if this
1900 argument is not provided (json-int, optional)
1904 -> { "execute": "human-monitor-command", "arguments": { "command-line": "info kvm" } }
1905 <- { "return": "kvm support: enabled\r\n" }
1909 (1) The Human Monitor is NOT an stable interface, this means that command
1910 names, arguments and responses can change or be removed at ANY time.
1911 Applications that rely on long term stability guarantees should NOT
1916 o This command is stateless, this means that commands that depend
1917 on state information (such as getfd) might not work
1919 o Commands that prompt the user for data (eg. 'cont
' when the block
1920 device is encrypted) don't currently work
1925 HXCOMM Each query command below is inside a SQMP
/EQMP section
, do NOT change
1926 HXCOMM
this! We will possibly move query commands definitions inside those
1927 HXCOMM sections
, just like regular commands
.
1937 Return a json
-object with the following information
:
1939 - "qemu": A json
-object containing three integer values
:
1940 - "major": QEMU
's major version (json-int)
1941 - "minor": QEMU's minor
version (json
-int
)
1942 - "micro": QEMU
's micro version (json-int)
1943 - "package": package's
version (json
-string
)
1947 -> { "execute": "query-version" }
1962 .name
= "query-version",
1964 .mhandler
.cmd_new
= qmp_marshal_input_query_version
,
1971 List QMP available commands
.
1973 Each command is represented by a json
-object
, the returned value is a json
-array
1976 Each json
-object contain
:
1978 - "name": command
's name (json-string)
1982 -> { "execute": "query-commands" }
1986 "name":"query-balloon"
1989 "name":"system_powerdown"
1994 Note: This example has been shortened as the real response is too long.
1999 .name = "query-commands",
2001 .mhandler.cmd_new = qmp_marshal_input_query_commands,
2008 List QMP available events.
2010 Each event is represented by a json-object, the returned value is a json-array
2013 Each json-object contains:
2015 - "name": event's
name (json
-string
)
2019 -> { "execute": "query-events" }
2031 Note
: This example has been shortened as the real response is too long
.
2036 .name
= "query-events",
2038 .mhandler
.cmd_new
= qmp_marshal_input_query_events
,
2045 Each device is represented by a json
-object
. The returned value is a json
-array
2048 Each json
-object contain the following
:
2050 - "label": device
's label (json-string)
2051 - "filename": device's
file (json
-string
)
2052 - "frontend-open": open
/closed state of the frontend device attached to
this
2057 -> { "execute": "query-chardev" }
2061 "label": "charchannel0",
2062 "filename": "unix:/var/lib/libvirt/qemu/seabios.rhel6.agent,server",
2063 "frontend-open": false
2066 "label": "charmonitor",
2067 "filename": "unix:/var/lib/libvirt/qemu/seabios.rhel6.monitor,server",
2068 "frontend-open": true
2071 "label": "charserial0",
2072 "filename": "pty:/dev/pts/2",
2073 "frontend-open": true
2081 .name
= "query-chardev",
2083 .mhandler
.cmd_new
= qmp_marshal_input_query_chardev
,
2087 query
-chardev
-backends
2090 List available character device backends
.
2092 Each backend is represented by a json
-object
, the returned value is a json
-array
2095 Each json
-object contains
:
2097 - "name": backend
name (json
-string
)
2101 -> { "execute": "query-chardev-backends" }
2122 .name
= "query-chardev-backends",
2124 .mhandler
.cmd_new
= qmp_marshal_input_query_chardev_backends
,
2131 Show the block devices
.
2133 Each block device information is stored
in a json
-object and the returned value
2134 is a json
-array of all devices
.
2136 Each json
-object contain the following
:
2138 - "device": device
name (json
-string
)
2139 - "type": device
type (json
-string
)
2140 - deprecated
, retained
for backward compatibility
2141 - Possible values
: "unknown"
2142 - "removable": true if the device is removable
, false otherwise (json
-bool
)
2143 - "locked": true if the device is locked
, false otherwise (json
-bool
)
2144 - "tray_open": only present
if removable
, true if the device has a tray
,
2145 and it is
open (json
-bool
)
2146 - "inserted": only present
if the device is inserted
, it is a json
-object
2147 containing the following
:
2148 - "file": device file
name (json
-string
)
2149 - "ro": true if read
-only
, false otherwise (json
-bool
)
2150 - "drv": driver format
name (json
-string
)
2151 - Possible values
: "blkdebug", "bochs", "cloop", "dmg",
2152 "file", "file", "ftp", "ftps", "host_cdrom",
2153 "host_device", "host_floppy", "http", "https",
2154 "nbd", "parallels", "qcow", "qcow2", "raw",
2155 "tftp", "vdi", "vmdk", "vpc", "vvfat"
2156 - "backing_file": backing file
name (json
-string
, optional
)
2157 - "backing_file_depth": number of files
in the backing file
chain (json
-int
)
2158 - "encrypted": true if encrypted
, false otherwise (json
-bool
)
2159 - "bps": limit total bytes per
second (json
-int
)
2160 - "bps_rd": limit read bytes per
second (json
-int
)
2161 - "bps_wr": limit write bytes per
second (json
-int
)
2162 - "iops": limit total I
/O operations per
second (json
-int
)
2163 - "iops_rd": limit read operations per
second (json
-int
)
2164 - "iops_wr": limit write operations per
second (json
-int
)
2165 - "bps_max": total max
in bytes (json
-int
)
2166 - "bps_rd_max": read max
in bytes (json
-int
)
2167 - "bps_wr_max": write max
in bytes (json
-int
)
2168 - "iops_max": total I
/O operations
max (json
-int
)
2169 - "iops_rd_max": read I
/O operations
max (json
-int
)
2170 - "iops_wr_max": write I
/O operations
max (json
-int
)
2171 - "iops_size": I
/O size when limiting by
iops (json
-int
)
2172 - "detect_zeroes": detect and optimize zero
writing (json
-string
)
2173 - Possible values
: "off", "on", "unmap"
2174 - "write_threshold": write offset threshold
in bytes
, a event will be
2175 emitted
if crossed
. Zero
if disabled (json
-int
)
2176 - "image": the detail of the image
, it is a json
-object containing
2178 - "filename": image file
name (json
-string
)
2179 - "format": image
format (json
-string
)
2180 - "virtual-size": image capacity
in bytes (json
-int
)
2181 - "dirty-flag": true if image is not cleanly closed
, not present
2182 means
clean (json
-bool
, optional
)
2183 - "actual-size": actual size on disk
in bytes of the image
, not
2184 present when image does not support thin
2185 provision (json
-int
, optional
)
2186 - "cluster-size": size of a cluster
in bytes
, not present
if image
2187 format does not support
it (json
-int
, optional
)
2188 - "encrypted": true if the image is encrypted
, not present means
2189 false or the image format does not support
2190 encryption (json
-bool
, optional
)
2191 - "backing_file": backing file name
, not present means no backing
2192 file is used or the image format does not
2193 support backing file chain
2194 (json
-string
, optional
)
2195 - "full-backing-filename": full path of the backing file
, not
2196 present
if it equals backing_file or no
2197 backing file is used
2198 (json
-string
, optional
)
2199 - "backing-filename-format": the format of the backing file
, not
2200 present means unknown or no backing
2201 file (json
-string
, optional
)
2202 - "snapshots": the internal snapshot info
, it is an optional list
2203 of json
-object containing the following
:
2204 - "id": unique snapshot
id (json
-string
)
2205 - "name": snapshot
name (json
-string
)
2206 - "vm-state-size": size of the VM state
in bytes (json
-int
)
2207 - "date-sec": UTC date of the snapshot
in seconds (json
-int
)
2208 - "date-nsec": fractional part
in nanoseconds to be used with
2210 - "vm-clock-sec": VM clock relative to boot
in seconds
2212 - "vm-clock-nsec": fractional part
in nanoseconds to be used
2213 with vm
-clock
-sec (json
-int
)
2214 - "backing-image": the detail of the backing image
, it is an
2215 optional json
-object only present when a
2216 backing image present
for this image
2218 - "io-status": I
/O operation status
, only present
if the device supports it
2219 and the VM is configured to stop on errors
. It
's always reset
2220 to "ok" when the "cont" command is issued (json_string, optional)
2221 - Possible values: "ok", "failed", "nospace"
2225 -> { "execute": "query-block" }
2230 "device":"ide0-hd0",
2237 "file":"disks/test.qcow2",
2238 "backing_file_depth":1,
2252 "detect_zeroes": "on",
2253 "write_threshold": 0,
2255 "filename":"disks/test.qcow2",
2257 "virtual-size":2048000,
2258 "backing_file":"base.qcow2",
2259 "full-backing-filename":"disks/base.qcow2",
2260 "backing-filename-format:"qcow2",
2264 "name": "snapshot1",
2266 "date-sec": 10000200,
2268 "vm-clock-sec": 206,
2273 "filename":"disks/base.qcow2",
2275 "virtual-size":2048000
2283 "device":"ide1-cd0",
2306 .name = "query-block",
2308 .mhandler.cmd_new = qmp_marshal_input_query_block,
2315 Show block device statistics.
2317 Each device statistic information is stored in a json-object and the returned
2318 value is a json-array of all devices.
2320 Each json-object contain the following:
2322 - "device": device name (json-string)
2323 - "stats": A json-object with the statistics information, it contains:
2324 - "rd_bytes": bytes read (json-int)
2325 - "wr_bytes": bytes written (json-int)
2326 - "rd_operations": read operations (json-int)
2327 - "wr_operations": write operations (json-int)
2328 - "flush_operations": cache flush operations (json-int)
2329 - "wr_total_time_ns": total time spend on writes in nano-seconds (json-int)
2330 - "rd_total_time_ns": total time spend on reads in nano-seconds (json-int)
2331 - "flush_total_time_ns": total time spend on cache flushes in nano-seconds (json-int)
2332 - "wr_highest_offset": Highest offset of a sector written since the
2333 BlockDriverState has been opened (json-int)
2334 - "rd_merged": number of read requests that have been merged into
2335 another request (json-int)
2336 - "wr_merged": number of write requests that have been merged into
2337 another request (json-int)
2338 - "parent": Contains recursively the statistics of the underlying
2339 protocol (e.g. the host file for a qcow2 image). If there is
2340 no underlying protocol, this field is omitted
2341 (json-object, optional)
2345 -> { "execute": "query-blockstats" }
2349 "device":"ide0-hd0",
2352 "wr_highest_offset":3686448128,
2354 "wr_operations":751,
2355 "rd_bytes":122567168,
2356 "rd_operations":36772
2357 "wr_total_times_ns":313253456
2358 "rd_total_times_ns":3465673657
2359 "flush_total_times_ns":49653
2360 "flush_operations":61,
2366 "wr_highest_offset":2821110784,
2368 "wr_operations":692,
2369 "rd_bytes":122739200,
2370 "rd_operations":36604
2371 "flush_operations":51,
2372 "wr_total_times_ns":313253456
2373 "rd_total_times_ns":3465673657
2374 "flush_total_times_ns":49653,
2380 "device":"ide1-cd0",
2382 "wr_highest_offset":0,
2387 "flush_operations":0,
2388 "wr_total_times_ns":0
2389 "rd_total_times_ns":0
2390 "flush_total_times_ns":0,
2398 "wr_highest_offset":0,
2403 "flush_operations":0,
2404 "wr_total_times_ns":0
2405 "rd_total_times_ns":0
2406 "flush_total_times_ns":0,
2414 "wr_highest_offset":0,
2419 "flush_operations":0,
2420 "wr_total_times_ns":0
2421 "rd_total_times_ns":0
2422 "flush_total_times_ns":0,
2433 .name = "query-blockstats",
2434 .args_type = "query-nodes:b?",
2435 .mhandler.cmd_new = qmp_marshal_input_query_blockstats,
2442 Show CPU information.
2444 Return a json-array. Each CPU is represented by a json-object, which contains:
2446 - "CPU": CPU index (json-int)
2447 - "current": true if this is the current CPU, false otherwise (json-bool)
2448 - "halted": true if the cpu is halted, false otherwise (json-bool)
2449 - Current program counter. The key's name depends on the architecture
:
2450 "pc": i386
/x86_64 (json
-int
)
2451 "nip": PPC (json
-int
)
2452 "pc" and
"npc": sparc (json
-int
)
2453 "PC": mips (json
-int
)
2454 - "thread_id": ID of the underlying host
thread (json
-int
)
2458 -> { "execute": "query-cpus" }
2481 .name
= "query-cpus",
2483 .mhandler
.cmd_new
= qmp_marshal_input_query_cpus
,
2490 Returns a list of information about each iothread
.
2492 Note
this list excludes the QEMU main loop thread
, which is not declared
2493 using the
-object iothread command
-line option
. It is always the main thread
2496 Return a json
-array
. Each iothread is represented by a json
-object
, which contains
:
2498 - "id": name of
iothread (json
-str
)
2499 - "thread-id": ID of the underlying host
thread (json
-int
)
2503 -> { "execute": "query-iothreads" }
2520 .name
= "query-iothreads",
2522 .mhandler
.cmd_new
= qmp_marshal_input_query_iothreads
,
2529 PCI buses and devices information
.
2531 The returned value is a json
-array of all buses
. Each bus is represented by
2532 a json
-object
, which has a key with a json
-array of all PCI devices attached
2533 to it
. Each device is represented by a json
-object
.
2535 The bus json
-object contains the following
:
2537 - "bus": bus
number (json
-int
)
2538 - "devices": a json
-array of json
-objects
, each json
-object represents a
2541 The PCI device json
-object contains the following
:
2543 - "bus": identical to the parent
's bus number (json-int)
2544 - "slot": slot number (json-int)
2545 - "function": function number (json-int)
2546 - "class_info": a json-object containing:
2547 - "desc": device class description (json-string, optional)
2548 - "class": device class number (json-int)
2549 - "id": a json-object containing:
2550 - "device": device ID (json-int)
2551 - "vendor": vendor ID (json-int)
2552 - "irq": device's IRQ
if assigned (json
-int
, optional
)
2553 - "qdev_id": qdev id
string (json
-string
)
2554 - "pci_bridge": It
's a json-object, only present if this device is a
2555 PCI bridge, contains:
2556 - "bus": bus number (json-int)
2557 - "secondary": secondary bus number (json-int)
2558 - "subordinate": subordinate bus number (json-int)
2559 - "io_range": I/O memory range information, a json-object with the
2561 - "base": base address, in bytes (json-int)
2562 - "limit": limit address, in bytes (json-int)
2563 - "memory_range": 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 - "prefetchable_range": Prefetchable memory range information, a
2568 json-object with the following members:
2569 - "base": base address, in bytes (json-int)
2570 - "limit": limit address, in bytes (json-int)
2571 - "devices": a json-array of PCI devices if there's any attached
, each
2572 each element is represented by a json
-object
, which contains
2573 the same members of the
'PCI device json-object' described
2575 - "regions": a json
-array of json
-objects
, each json
-object represents a
2576 memory region of
this device
2578 The memory range json
-object contains the following
:
2580 - "base": base memory
address (json
-int
)
2581 - "limit": limit
value (json
-int
)
2583 The region json
-object can be an I
/O region or a memory region
, an I
/O region
2584 json
-object contains the following
:
2586 - "type": "io" (json
-string
, fixed
)
2587 - "bar": BAR
number (json
-int
)
2588 - "address": memory
address (json
-int
)
2589 - "size": memory
size (json
-int
)
2591 A memory region json
-object contains the following
:
2593 - "type": "memory" (json
-string
, fixed
)
2594 - "bar": BAR
number (json
-int
)
2595 - "address": memory
address (json
-int
)
2596 - "size": memory
size (json
-int
)
2597 - "mem_type_64": true or
false (json
-bool
)
2598 - "prefetch": true or
false (json
-bool
)
2602 -> { "execute": "query-pci" }
2614 "desc":"Host bridge"
2648 "desc":"IDE controller"
2670 "desc":"VGA controller"
2680 "mem_type_64":false,
2683 "address":4026531840,
2688 "mem_type_64":false,
2691 "address":4060086272,
2696 "mem_type_64":false,
2711 "desc":"RAM controller"
2732 Note
: This example has been shortened as the real response is too long
.
2737 .name
= "query-pci",
2739 .mhandler
.cmd_new
= qmp_marshal_input_query_pci
,
2746 Show KVM information
.
2748 Return a json
-object with the following information
:
2750 - "enabled": true if KVM support is enabled
, false otherwise (json
-bool
)
2751 - "present": true if QEMU has KVM support
, false otherwise (json
-bool
)
2755 -> { "execute": "query-kvm" }
2756 <- { "return": { "enabled": true, "present": true } }
2761 .name
= "query-kvm",
2763 .mhandler
.cmd_new
= qmp_marshal_input_query_kvm
,
2770 Return a json
-object with the following information
:
2772 - "running": true if the VM is running
, or
false if it is
paused (json
-bool
)
2773 - "singlestep": true if the VM is
in single step mode
,
2774 false otherwise (json
-bool
)
2775 - "status": one of the following
values (json
-string
)
2776 "debug" - QEMU is running on a debugger
2777 "inmigrate" - guest is paused waiting
for an incoming migration
2778 "internal-error" - An internal error that prevents further guest
2779 execution has occurred
2780 "io-error" - the last IOP has failed and the device is configured
2781 to pause on I
/O errors
2782 "paused" - guest has been paused via the
'stop' command
2783 "postmigrate" - guest is paused following a successful
'migrate'
2784 "prelaunch" - QEMU was started with
-S and guest has not started
2785 "finish-migrate" - guest is paused to finish the migration process
2786 "restore-vm" - guest is paused to restore VM state
2787 "running" - guest is actively running
2788 "save-vm" - guest is paused to save the VM state
2789 "shutdown" - guest is shut
down (and
-no
-shutdown is
in use
)
2790 "watchdog" - the watchdog action is configured to pause and
2795 -> { "execute": "query-status" }
2796 <- { "return": { "running": true, "singlestep": false, "status": "running" } }
2801 .name
= "query-status",
2803 .mhandler
.cmd_new
= qmp_marshal_input_query_status
,
2810 Show VM mice information
.
2812 Each mouse is represented by a json
-object
, the returned value is a json
-array
2815 The mouse json
-object contains the following
:
2817 - "name": mouse
's name (json-string)
2818 - "index": mouse's
index (json
-int
)
2819 - "current": true if this mouse is receiving events
, false otherwise (json
-bool
)
2820 - "absolute": true if the mouse generates absolute input
events (json
-bool
)
2824 -> { "execute": "query-mice" }
2828 "name":"QEMU Microsoft Mouse",
2834 "name":"QEMU PS/2 Mouse",
2845 .name
= "query-mice",
2847 .mhandler
.cmd_new
= qmp_marshal_input_query_mice
,
2854 Show VNC server information
.
2856 Return a json
-object with server information
. Connected clients are returned
2857 as a json
-array of json
-objects
.
2859 The main json
-object contains the following
:
2861 - "enabled": true or
false (json
-bool
)
2862 - "host": server
's IP address (json-string)
2863 - "family": address family (json-string)
2864 - Possible values: "ipv4", "ipv6", "unix", "unknown"
2865 - "service": server's port
number (json
-string
)
2866 - "auth": authentication
method (json
-string
)
2867 - Possible values
: "invalid", "none", "ra2", "ra2ne", "sasl", "tight",
2868 "tls", "ultra", "unknown", "vencrypt", "vencrypt",
2869 "vencrypt+plain", "vencrypt+tls+none",
2870 "vencrypt+tls+plain", "vencrypt+tls+sasl",
2871 "vencrypt+tls+vnc", "vencrypt+x509+none",
2872 "vencrypt+x509+plain", "vencrypt+x509+sasl",
2873 "vencrypt+x509+vnc", "vnc"
2874 - "clients": a json
-array of all connected clients
2876 Clients are described by a json
-object
, each one contain the following
:
2878 - "host": client
's IP address (json-string)
2879 - "family": address family (json-string)
2880 - Possible values: "ipv4", "ipv6", "unix", "unknown"
2881 - "service": client's port
number (json
-string
)
2882 - "x509_dname": TLS
dname (json
-string
, optional
)
2883 - "sasl_username": SASL
username (json
-string
, optional
)
2887 -> { "execute": "query-vnc" }
2908 .name
= "query-vnc",
2910 .mhandler
.cmd_new
= qmp_marshal_input_query_vnc
,
2913 .name
= "query-vnc-servers",
2915 .mhandler
.cmd_new
= qmp_marshal_input_query_vnc_servers
,
2922 Show SPICE server information
.
2924 Return a json
-object with server information
. Connected clients are returned
2925 as a json
-array of json
-objects
.
2927 The main json
-object contains the following
:
2929 - "enabled": true or
false (json
-bool
)
2930 - "host": server
's IP address (json-string)
2931 - "port": server's port
number (json
-int
, optional
)
2932 - "tls-port": server
's port number (json-int, optional)
2933 - "auth": authentication method (json-string)
2934 - Possible values: "none", "spice"
2935 - "channels": a json-array of all active channels clients
2937 Channels are described by a json-object, each one contain the following:
2939 - "host": client's IP
address (json
-string
)
2940 - "family": address
family (json
-string
)
2941 - Possible values
: "ipv4", "ipv6", "unix", "unknown"
2942 - "port": client
's port number (json-string)
2943 - "connection-id": spice connection id. All channels with the same id
2944 belong to the same spice session (json-int)
2945 - "channel-type": channel type. "1" is the main control channel, filter for
2946 this one if you want track spice sessions only (json-int)
2947 - "channel-id": channel id. Usually "0", might be different needed when
2948 multiple channels of the same type exist, such as multiple
2949 display channels in a multihead setup (json-int)
2950 - "tls": whether the channel is encrypted (json-bool)
2954 -> { "execute": "query-spice" }
2967 "connection-id": 1804289383,
2968 "host": "127.0.0.1",
2976 "connection-id": 1804289383,
2977 "host": "127.0.0.1",
2981 [ ... more channels follow ... ]
2988 #if defined(CONFIG_SPICE)
2990 .name = "query-spice",
2992 .mhandler.cmd_new = qmp_marshal_input_query_spice,
3002 Return a json-object with the following information:
3004 - "name": VM's
name (json
-string
, optional
)
3008 -> { "execute": "query-name" }
3009 <- { "return": { "name": "qemu-name" } }
3014 .name
= "query-name",
3016 .mhandler
.cmd_new
= qmp_marshal_input_query_name
,
3025 Return a json
-object with the following information
:
3027 - "UUID": Universally Unique
Identifier (json
-string
)
3031 -> { "execute": "query-uuid" }
3032 <- { "return": { "UUID": "550e8400-e29b-41d4-a716-446655440000" } }
3037 .name
= "query-uuid",
3039 .mhandler
.cmd_new
= qmp_marshal_input_query_uuid
,
3043 query
-command
-line
-options
3044 --------------------------
3046 Show command line option schema
.
3048 Return a json
-array of command line option schema
for all
options (or
for
3049 the given option
), returning an error
if the given option doesn
't exist.
3051 Each array entry contains the following:
3053 - "option": option name (json-string)
3054 - "parameters": a json-array describes all parameters of the option:
3055 - "name": parameter name (json-string)
3056 - "type": parameter type (one of 'string
', 'boolean
', 'number
',
3058 - "help": human readable description of the parameter
3059 (json-string, optional)
3060 - "default": default value string for the parameter
3061 (json-string, optional)
3065 -> { "execute": "query-command-line-options", "arguments": { "option": "option-rom" } }
3074 "name": "bootindex",
3078 "option": "option-rom"
3086 .name = "query-command-line-options",
3087 .args_type = "option:s?",
3088 .mhandler.cmd_new = qmp_marshal_input_query_command_line_options,
3097 Return a json-object. If migration is active there will be another json-object
3098 with RAM migration status and if block migration is active another one with
3099 block migration status.
3101 The main json-object contains the following:
3103 - "status": migration status (json-string)
3104 - Possible values: "setup", "active", "completed", "failed", "cancelled"
3105 - "total-time": total amount of ms since migration started. If
3106 migration has ended, it returns the total migration
3108 - "setup-time" amount of setup time in milliseconds _before_ the
3109 iterations begin but _after_ the QMP command is issued.
3110 This is designed to provide an accounting of any activities
3111 (such as RDMA pinning) which may be expensive, but do not
3112 actually occur during the iterative migration rounds
3113 themselves. (json-int)
3114 - "downtime": only present when migration has finished correctly
3115 total amount in ms for downtime that happened (json-int)
3116 - "expected-downtime": only present while migration is active
3117 total amount in ms for downtime that was calculated on
3118 the last bitmap round (json-int)
3119 - "ram": only present if "status" is "active", it is a json-object with the
3120 following RAM information:
3121 - "transferred": amount transferred in bytes (json-int)
3122 - "remaining": amount remaining to transfer in bytes (json-int)
3123 - "total": total amount of memory in bytes (json-int)
3124 - "duplicate": number of pages filled entirely with the same
3126 These are sent over the wire much more efficiently.
3127 - "skipped": number of skipped zero pages (json-int)
3128 - "normal" : number of whole pages transferred. I.e. they
3129 were not sent as duplicate or xbzrle pages (json-int)
3130 - "normal-bytes" : number of bytes transferred in whole
3131 pages. This is just normal pages times size of one page,
3132 but this way upper levels don't need to care about page
3134 - "dirty-sync-count": times that dirty ram was
synchronized (json
-int
)
3135 - "disk": only present
if "status" is
"active" and it is a block migration
,
3136 it is a json
-object with the following disk information
:
3137 - "transferred": amount transferred
in bytes (json
-int
)
3138 - "remaining": amount remaining to transfer
in bytes json
-int
)
3139 - "total": total disk size
in bytes (json
-int
)
3140 - "xbzrle-cache": only present
if XBZRLE is active
.
3141 It is a json
-object with the following XBZRLE information
:
3142 - "cache-size": XBZRLE cache size
in bytes
3143 - "bytes": number of bytes transferred
for XBZRLE compressed pages
3144 - "pages": number of XBZRLE compressed pages
3145 - "cache-miss": number of XBRZRLE page cache misses
3146 - "cache-miss-rate": rate of XBRZRLE page cache misses
3147 - "overflow": number of times XBZRLE overflows
. This means
3148 that the XBZRLE encoding was bigger than just sent the
3149 whole page
, and then we sent the whole page
instead (as as
3154 1. Before the first migration
3156 -> { "execute": "query-migrate" }
3159 2. Migration is done and has succeeded
3161 -> { "execute": "query-migrate" }
3163 "status": "completed",
3173 "normal-bytes":123456,
3174 "dirty-sync-count":15
3179 3. Migration is done and has failed
3181 -> { "execute": "query-migrate" }
3182 <- { "return": { "status": "failed" } }
3184 4. Migration is being performed and is not a block migration
:
3186 -> { "execute": "query-migrate" }
3196 "expected-downtime":12345,
3199 "normal-bytes":123456,
3200 "dirty-sync-count":15
3205 5. Migration is being performed and is a block migration
:
3207 -> { "execute": "query-migrate" }
3213 "remaining":1053304,
3217 "expected-downtime":12345,
3220 "normal-bytes":123456,
3221 "dirty-sync-count":15
3225 "remaining":20880384,
3231 6. Migration is being performed and XBZRLE is active
:
3233 -> { "execute": "query-migrate" }
3237 "capabilities" : [ { "capability": "xbzrle", "state" : true } ],
3240 "remaining":1053304,
3244 "expected-downtime":12345,
3247 "normal-bytes":3412992,
3248 "dirty-sync-count":15
3251 "cache-size":67108864,
3255 "cache-miss-rate":0.123,
3264 .name
= "query-migrate",
3266 .mhandler
.cmd_new
= qmp_marshal_input_query_migrate
,
3270 migrate
-set
-capabilities
3271 ------------------------
3273 Enable
/Disable migration capabilities
3275 - "xbzrle": XBZRLE support
3276 - "rdma-pin-all": pin all pages when
using RDMA during migration
3277 - "auto-converge": throttle down guest to help convergence of migration
3278 - "zero-blocks": compress zero blocks during block migration
3284 -> { "execute": "migrate-set-capabilities" , "arguments":
3285 { "capabilities": [ { "capability": "xbzrle", "state": true } ] } }
3290 .name
= "migrate-set-capabilities",
3291 .args_type
= "capabilities:O",
3292 .params
= "capability:s,state:b",
3293 .mhandler
.cmd_new
= qmp_marshal_input_migrate_set_capabilities
,
3296 query
-migrate
-capabilities
3297 --------------------------
3299 Query current migration capabilities
3301 - "capabilities": migration capabilities state
3302 - "xbzrle" : XBZRLE
state (json
-bool
)
3303 - "rdma-pin-all" : RDMA Pin Page
state (json
-bool
)
3304 - "auto-converge" : Auto Converge
state (json
-bool
)
3305 - "zero-blocks" : Zero Blocks
state (json
-bool
)
3311 -> { "execute": "query-migrate-capabilities" }
3312 <- { "return": [ { "state": false, "capability": "xbzrle" } ] }
3317 .name
= "query-migrate-capabilities",
3319 .mhandler
.cmd_new
= qmp_marshal_input_query_migrate_capabilities
,
3326 Show balloon information
.
3328 Make an asynchronous request
for balloon info
. When the request completes a
3329 json
-object will be returned containing the following data
:
3331 - "actual": current balloon value
in bytes (json
-int
)
3335 -> { "execute": "query-balloon" }
3338 "actual":1073741824,
3345 .name
= "query-balloon",
3347 .mhandler
.cmd_new
= qmp_marshal_input_query_balloon
,
3351 .name
= "query-block-jobs",
3353 .mhandler
.cmd_new
= qmp_marshal_input_query_block_jobs
,
3358 .args_type
= "path:s",
3359 .mhandler
.cmd_new
= qmp_marshal_input_qom_list
,
3364 .args_type
= "path:s,property:s,value:q",
3365 .mhandler
.cmd_new
= qmp_qom_set
,
3370 .args_type
= "path:s,property:s",
3371 .mhandler
.cmd_new
= qmp_qom_get
,
3375 .name
= "nbd-server-start",
3376 .args_type
= "addr:q",
3377 .mhandler
.cmd_new
= qmp_marshal_input_nbd_server_start
,
3380 .name
= "nbd-server-add",
3381 .args_type
= "device:B,writable:b?",
3382 .mhandler
.cmd_new
= qmp_marshal_input_nbd_server_add
,
3385 .name
= "nbd-server-stop",
3387 .mhandler
.cmd_new
= qmp_marshal_input_nbd_server_stop
,
3391 .name
= "change-vnc-password",
3392 .args_type
= "password:s",
3393 .mhandler
.cmd_new
= qmp_marshal_input_change_vnc_password
,
3396 .name
= "qom-list-types",
3397 .args_type
= "implements:s?,abstract:b?",
3398 .mhandler
.cmd_new
= qmp_marshal_input_qom_list_types
,
3402 .name
= "device-list-properties",
3403 .args_type
= "typename:s",
3404 .mhandler
.cmd_new
= qmp_marshal_input_device_list_properties
,
3408 .name
= "query-machines",
3410 .mhandler
.cmd_new
= qmp_marshal_input_query_machines
,
3414 .name
= "query-cpu-definitions",
3416 .mhandler
.cmd_new
= qmp_marshal_input_query_cpu_definitions
,
3420 .name
= "query-target",
3422 .mhandler
.cmd_new
= qmp_marshal_input_query_target
,
3426 .name
= "query-tpm",
3428 .mhandler
.cmd_new
= qmp_marshal_input_query_tpm
,
3435 Return information about the TPM device
.
3441 -> { "execute": "query-tpm" }
3444 { "model": "tpm-tis",
3446 { "type": "passthrough",
3448 { "cancel-path": "/sys/class/misc/tpm0/device/cancel",
3460 .name
= "query-tpm-models",
3462 .mhandler
.cmd_new
= qmp_marshal_input_query_tpm_models
,
3469 Return a list of supported TPM models
.
3475 -> { "execute": "query-tpm-models" }
3476 <- { "return": [ "tpm-tis" ] }
3481 .name
= "query-tpm-types",
3483 .mhandler
.cmd_new
= qmp_marshal_input_query_tpm_types
,
3490 Return a list of supported TPM types
.
3496 -> { "execute": "query-tpm-types" }
3497 <- { "return": [ "passthrough" ] }
3502 .name
= "chardev-add",
3503 .args_type
= "id:s,backend:q",
3504 .mhandler
.cmd_new
= qmp_marshal_input_chardev_add
,
3515 - "id": the chardev
's ID, must be unique (json-string)
3516 - "backend": chardev backend type + parameters
3520 -> { "execute" : "chardev-add",
3521 "arguments" : { "id" : "foo",
3522 "backend" : { "type" : "null", "data" : {} } } }
3525 -> { "execute" : "chardev-add",
3526 "arguments" : { "id" : "bar",
3527 "backend" : { "type" : "file",
3528 "data" : { "out" : "/tmp/bar.log" } } } }
3531 -> { "execute" : "chardev-add",
3532 "arguments" : { "id" : "baz",
3533 "backend" : { "type" : "pty", "data" : {} } } }
3534 <- { "return": { "pty" : "/dev/pty/42" } }
3539 .name = "chardev-remove",
3540 .args_type = "id:s",
3541 .mhandler.cmd_new = qmp_marshal_input_chardev_remove,
3553 - "id": the chardev's ID
, must exist and not be
in use (json
-string
)
3557 -> { "execute": "chardev-remove", "arguments": { "id" : "foo" } }
3562 .name
= "query-rx-filter",
3563 .args_type
= "name:s?",
3564 .mhandler
.cmd_new
= qmp_marshal_input_query_rx_filter
,
3571 Show rx
-filter information
.
3573 Returns a json
-array of rx
-filter information
for all
NICs (or
for the
3574 given NIC
), returning an error
if the given NIC doesn
't exist, or
3575 given NIC doesn't support rx
-filter querying
, or given net client
3578 The query will clear the event notification flag of each NIC, then qemu
3579 will start to emit event to QMP monitor.
3581 Each array entry contains the following:
3583 - "name": net client name (json-string)
3584 - "promiscuous": promiscuous mode is enabled (json-bool)
3585 - "multicast": multicast receive state (one of 'normal
', 'none
', 'all
')
3586 - "unicast": unicast receive state (one of 'normal
', 'none
', 'all
')
3587 - "vlan": vlan receive state (one of 'normal
', 'none
', 'all
') (Since 2.0)
3588 - "broadcast-allowed": allow to receive broadcast (json-bool)
3589 - "multicast-overflow": multicast table is overflowed (json-bool)
3590 - "unicast-overflow": unicast table is overflowed (json-bool)
3591 - "main-mac": main macaddr string (json-string)
3592 - "vlan-table": a json-array of active vlan id
3593 - "unicast-table": a json-array of unicast macaddr string
3594 - "multicast-table": a json-array of multicast macaddr string
3598 -> { "execute": "query-rx-filter", "arguments": { "name": "vnet0" } }
3601 "promiscuous": true,
3603 "main-mac": "52:54:00:12:34:56",
3604 "unicast": "normal",
3612 "multicast": "normal",
3613 "multicast-overflow": false,
3614 "unicast-overflow": false,
3615 "multicast-table": [
3616 "01:00:5e:00:00:01",
3617 "33:33:00:00:00:01",
3620 "broadcast-allowed": false
3628 .name = "blockdev-add",
3629 .args_type = "options:q",
3630 .mhandler.cmd_new = qmp_marshal_input_blockdev_add,
3641 - "options": block driver options
3645 -> { "execute": "blockdev-add",
3646 "arguments": { "options" : { "driver": "qcow2",
3647 "file": { "driver": "file",
3648 "filename": "test.qcow2" } } } }
3653 -> { "execute": "blockdev-add",
3665 "filename": "/tmp/test.qcow2"
3671 "filename": "/dev/fdset/4"
3683 .name = "query-named-block-nodes",
3685 .mhandler.cmd_new = qmp_marshal_input_query_named_block_nodes,
3689 @query-named-block-nodes
3690 ------------------------
3692 Return a list of BlockDeviceInfo for all the named block driver nodes
3696 -> { "execute": "query-named-block-nodes" }
3697 <- { "return": [ { "ro":false,
3700 "file":"disks/test.qcow2",
3701 "node-name": "my-node",
3702 "backing_file_depth":1,
3716 "write_threshold": 0,
3718 "filename":"disks/test.qcow2",
3720 "virtual-size":2048000,
3721 "backing_file":"base.qcow2",
3722 "full-backing-filename":"disks/base.qcow2",
3723 "backing-filename-format:"qcow2",
3727 "name": "snapshot1",
3729 "date-sec": 10000200,
3731 "vm-clock-sec": 206,
3736 "filename":"disks/base.qcow2",
3738 "virtual-size":2048000
3745 .name = "query-memdev",
3747 .mhandler.cmd_new = qmp_marshal_input_query_memdev,
3754 Show memory devices information.
3759 -> { "execute": "query-memdev" }
3766 "host-nodes": [0, 1],
3774 "host-nodes": [2, 3],
3775 "policy": "preferred"
3783 .name = "query-memory-devices",
3785 .mhandler.cmd_new = qmp_marshal_input_query_memory_devices,
3789 @query-memory-devices
3790 --------------------
3792 Return a list of memory devices.
3795 -> { "execute": "query-memory-devices" }
3796 <- { "return": [ { "data":
3797 { "addr": 5368709120,
3798 "hotpluggable": true,
3801 "memdev": "/objects/memX",
3810 .name = "query-acpi-ospm-status",
3812 .mhandler.cmd_new = qmp_marshal_input_query_acpi_ospm_status,
3816 @query-acpi-ospm-status
3817 --------------------
3819 Return list of ACPIOSTInfo for devices that support status reporting
3820 via ACPI _OST method.
3823 -> { "execute": "query-acpi-ospm-status" }
3824 <- { "return": [ { "device": "d1", "slot": "0", "slot-type": "DIMM", "source": 1, "status": 0},
3825 { "slot": "1", "slot-type": "DIMM", "source": 0, "status": 0},
3826 { "slot": "2", "slot-type": "DIMM", "source": 0, "status": 0},
3827 { "slot": "3", "slot-type": "DIMM", "source": 0, "status": 0}
3831 #if defined TARGET_I386
3833 .name = "rtc-reset-reinjection",
3835 .mhandler.cmd_new = qmp_marshal_input_rtc_reset_reinjection,
3840 rtc-reset-reinjection
3841 ---------------------
3843 Reset the RTC interrupt reinjection backlog.
3849 -> { "execute": "rtc-reset-reinjection" }
3854 .name = "trace-event-get-state",
3855 .args_type = "name:s",
3856 .mhandler.cmd_new = qmp_marshal_input_trace_event_get_state,
3860 trace-event-get-state
3861 ---------------------
3863 Query the state of events.
3867 -> { "execute": "trace-event-get-state", "arguments": { "name": "qemu_memalign" } }
3868 <- { "return": [ { "name": "qemu_memalign", "state": "disabled" } ] }
3872 .name = "trace-event-set-state",
3873 .args_type = "name:s,enable:b,ignore-unavailable:b?",
3874 .mhandler.cmd_new = qmp_marshal_input_trace_event_set_state,
3878 trace-event-set-state
3879 ---------------------
3881 Set the state of events.
3885 -> { "execute": "trace-event-set-state", "arguments": { "name": "qemu_memalign", "enable": "true" } }
3890 .name = "x-input-send-event",
3891 .args_type = "console:i?,events:q",
3892 .mhandler.cmd_new = qmp_marshal_input_x_input_send_event,
3899 Send input event to guest.
3903 - "console": console index. (json-int, optional)
3904 - "events": list of input events.
3906 The consoles are visible in the qom tree, under
3907 /backend/console[$index]. They have a device link and head property, so
3908 it is possible to map which console belongs to which device and display.
3910 Note: this command is experimental, and not a stable API.
3914 Press left mouse button.
3916 -> { "execute": "x-input-send-event",
3917 "arguments": { "console": 0,
3918 "events": [ { "type": "btn",
3919 "data" : { "down": true, "button": "Left" } } ] } }
3922 -> { "execute": "x-input-send-event",
3923 "arguments": { "console": 0,
3924 "events": [ { "type": "btn",
3925 "data" : { "down": false, "button": "Left" } } ] } }
3932 -> { "execute": "x-input-send-event",
3933 "arguments": { "console": 0, "events": [
3934 { "type": "key", "data" : { "down": true,
3935 "key": {"type": "qcode", "data": "ctrl" } } },
3936 { "type": "key", "data" : { "down": true,
3937 "key": {"type": "qcode", "data": "alt" } } },
3938 { "type": "key", "data" : { "down": true,
3939 "key": {"type": "qcode", "data": "delete" } } } ] } }
3944 Move mouse pointer to absolute coordinates (20000, 400).
3946 -> { "execute": "x-input-send-event" ,
3947 "arguments": { "console": 0, "events": [
3948 { "type": "abs", "data" : { "axis": "X", "value" : 20000 } },
3949 { "type": "abs", "data" : { "axis": "Y", "value" : 400 } } ] } }
3955 .name = "block-set-write-threshold",
3956 .args_type = "node-name:s,write-threshold:l",
3957 .mhandler.cmd_new = qmp_marshal_input_block_set_write_threshold,
3961 block-set-write-threshold
3964 Change the write threshold for a block drive. The threshold is an offset,
3965 thus must be non-negative. Default is no write threshold.
3966 Setting the threshold to zero disables it.
3970 - "node-name": the node name in the block driver state graph (json-string)
3971 - "write-threshold": the write threshold in bytes (json-int)
3975 -> { "execute": "block-set-write-threshold",
3976 "arguments": { "node-name": "mydev",
3977 "write-threshold": 17179869184 } }