1 HXCOMM QMP dispatch table and documentation
2 HXCOMM Text between SQMP and EQMP is copied to the QMP documention 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
enum values
)
351 - hold
-time
: time to delay key up events
, milliseconds
. Defaults to
100
356 -> { "execute": "send-key",
357 "arguments": { 'keys': [ 'ctrl', 'alt', 'delete' ] } }
364 .args_type
= "index:i",
365 .mhandler
.cmd_new
= qmp_marshal_input_cpu
,
376 - "index": the CPU
's index (json-int)
380 -> { "execute": "cpu", "arguments": { "index": 0 } }
383 Note: CPUs' indexes are obtained with the
'query-cpus' command
.
390 .mhandler
.cmd_new
= qmp_marshal_input_cpu_add
,
401 - "id": cpu
id (json
-int
)
405 -> { "execute": "cpu-add", "arguments": { "id": 2 } }
412 .args_type
= "val:l,size:i,filename:s,cpu:i?",
413 .mhandler
.cmd_new
= qmp_marshal_input_memsave
,
420 Save to disk virtual memory dump starting at
'val' of size
'size'.
424 - "val": the starting
address (json
-int
)
425 - "size": the memory size
, in bytes (json
-int
)
426 - "filename": file
path (json
-string
)
427 - "cpu": virtual CPU
index (json
-int
, optional
)
431 -> { "execute": "memsave",
432 "arguments": { "val": 10,
434 "filename": "/tmp/virtual-mem-dump" } }
441 .args_type
= "val:l,size:i,filename:s",
442 .mhandler
.cmd_new
= qmp_marshal_input_pmemsave
,
449 Save to disk physical memory dump starting at
'val' of size
'size'.
453 - "val": the starting
address (json
-int
)
454 - "size": the memory size
, in bytes (json
-int
)
455 - "filename": file
path (json
-string
)
459 -> { "execute": "pmemsave",
460 "arguments": { "val": 10,
462 "filename": "/tmp/physical-mem-dump" } }
468 .name
= "inject-nmi",
470 .mhandler
.cmd_new
= qmp_marshal_input_inject_nmi
,
477 Inject an NMI on guest
's CPUs.
483 -> { "execute": "inject-nmi" }
486 Note: inject-nmi fails when the guest doesn't support injecting
.
487 Currently
, only x86 guests
do.
492 .name
= "ringbuf-write",
493 .args_type
= "device:s,data:s,format:s?",
494 .mhandler
.cmd_new
= qmp_marshal_input_ringbuf_write
,
501 Write to a ring buffer character device
.
505 - "device": ring buffer character device
name (json
-string
)
506 - "data": data to
write (json
-string
)
507 - "format": data
format (json
-string
, optional
)
508 - Possible values
: "utf8" (default), "base64"
509 Bug
: invalid base64 is currently not rejected
.
510 Whitespace
*is
* invalid
.
514 -> { "execute": "ringbuf-write",
515 "arguments": { "device": "foo",
523 .name
= "ringbuf-read",
524 .args_type
= "device:s,size:i,format:s?",
525 .mhandler
.cmd_new
= qmp_marshal_input_ringbuf_read
,
532 Read from a ring buffer character device
.
536 - "device": ring buffer character device
name (json
-string
)
537 - "size": how many bytes to read at
most (json
-int
)
538 - Number of data bytes
, not number of characters
in encoded data
539 - "format": data
format (json
-string
, optional
)
540 - Possible values
: "utf8" (default), "base64"
541 - Naturally
, format
"utf8" works only when the ring buffer
542 contains valid UTF
-8 text
. Invalid UTF
-8 sequences get
543 replaced
. Bug
: replacement doesn
't work. Bug: can screw
544 up on encountering NUL characters, after the ring buffer
545 lost data, and when reading stops because the size limit
550 -> { "execute": "ringbuf-read",
551 "arguments": { "device": "foo",
554 <- {"return": "abcdefgh"}
559 .name = "xen-save-devices-state",
560 .args_type = "filename:F",
561 .mhandler.cmd_new = qmp_marshal_input_xen_save_devices_state,
565 xen-save-devices-state
568 Save the state of all devices to file. The RAM and the block devices
569 of the VM are not saved by this command.
573 - "filename": the file to save the state of the devices to as binary
574 data. See xen-save-devices-state.txt for a description of the binary
579 -> { "execute": "xen-save-devices-state",
580 "arguments": { "filename": "/tmp/save" } }
586 .name = "xen-set-global-dirty-log",
587 .args_type = "enable:b",
588 .mhandler.cmd_new = qmp_marshal_input_xen_set_global_dirty_log,
592 xen-set-global-dirty-log
595 Enable or disable the global dirty log mode.
599 - "enable": Enable it or disable it.
603 -> { "execute": "xen-set-global-dirty-log",
604 "arguments": { "enable": true } }
611 .args_type = "detach:-d,blk:-b,inc:-i,uri:s",
612 .mhandler.cmd_new = qmp_marshal_input_migrate,
623 - "blk": block migration, full disk copy (json-bool, optional)
624 - "inc": incremental disk copy (json-bool, optional)
625 - "uri": Destination URI (json-string)
629 -> { "execute": "migrate", "arguments": { "uri": "tcp:0:4446" } }
634 (1) The 'query
-migrate
' command should be used to check migration's progress
635 and final
result (this information is provided by the
'status' member
)
636 (2) All boolean arguments
default to
false
637 (3) The user Monitor
's "detach" argument is invalid in QMP and should not
643 .name = "migrate_cancel",
645 .mhandler.cmd_new = qmp_marshal_input_migrate_cancel,
652 Cancel the current migration.
658 -> { "execute": "migrate_cancel" }
663 .name = "migrate-set-cache-size",
664 .args_type = "value:o",
665 .mhandler.cmd_new = qmp_marshal_input_migrate_set_cache_size,
669 migrate-set-cache-size
670 ----------------------
672 Set cache size to be used by XBZRLE migration, the cache size will be rounded
673 down to the nearest power of 2
677 - "value": cache size in bytes (json-int)
681 -> { "execute": "migrate-set-cache-size", "arguments": { "value": 536870912 } }
686 .name = "query-migrate-cache-size",
688 .mhandler.cmd_new = qmp_marshal_input_query_migrate_cache_size,
692 query-migrate-cache-size
693 ------------------------
695 Show cache size to be used by XBZRLE migration
697 returns a json-object with the following information:
702 -> { "execute": "query-migrate-cache-size" }
703 <- { "return": 67108864 }
708 .name = "migrate_set_speed",
709 .args_type = "value:o",
710 .mhandler.cmd_new = qmp_marshal_input_migrate_set_speed,
717 Set maximum speed for migrations.
721 - "value": maximum speed, in bytes per second (json-int)
725 -> { "execute": "migrate_set_speed", "arguments": { "value": 1024 } }
731 .name = "migrate_set_downtime",
732 .args_type = "value:T",
733 .mhandler.cmd_new = qmp_marshal_input_migrate_set_downtime,
740 Set maximum tolerated downtime (in seconds) for migrations.
744 - "value": maximum downtime (json-number)
748 -> { "execute": "migrate_set_downtime", "arguments": { "value": 0.1 } }
754 .name = "client_migrate_info",
755 .args_type = "protocol:s,hostname:s,port:i?,tls-port:i?,cert-subject:s?",
756 .params = "protocol hostname port tls-port cert-subject",
757 .help = "send migration info to spice/vnc client",
758 .user_print = monitor_user_noop,
759 .mhandler.cmd_async = client_migrate_info,
760 .flags = MONITOR_CMD_ASYNC,
767 Set the spice/vnc connection info for the migration target. The spice/vnc
768 server will ask the spice/vnc client to automatically reconnect using the
769 new parameters (if specified) once the vm migration finished successfully.
773 - "protocol": protocol: "spice" or "vnc" (json-string)
774 - "hostname": migration target hostname (json-string)
775 - "port": spice/vnc tcp port for plaintext channels (json-int, optional)
776 - "tls-port": spice tcp port for tls-secured channels (json-int, optional)
777 - "cert-subject": server certificate subject (json-string, optional)
781 -> { "execute": "client_migrate_info",
782 "arguments": { "protocol": "spice",
783 "hostname": "virt42.lab.kraxel.org",
790 .name = "dump-guest-memory",
791 .args_type = "paging:b,protocol:s,begin:i?,end:i?",
792 .params = "-p protocol [begin] [length]",
793 .help = "dump guest memory to file",
794 .user_print = monitor_user_noop,
795 .mhandler.cmd_new = qmp_marshal_input_dump_guest_memory,
802 Dump guest memory to file. The file can be processed with crash or gdb.
806 - "paging": do paging to get guest's memory
mapping (json
-bool
)
807 - "protocol": destination
file(started with
"file:") or destination file
808 descriptor (started with
"fd:") (json
-string
)
809 - "begin": the starting physical address
. It
's optional, and should be specified
810 with length together (json-int)
811 - "length": the memory size, in bytes. It's optional
, and should be specified
812 with begin
together (json
-int
)
816 -> { "execute": "dump-guest-memory", "arguments": { "protocol": "fd:dump" } }
821 (1) All boolean arguments
default to
false
826 .name
= "netdev_add",
827 .args_type
= "netdev:O",
828 .mhandler
.cmd_new
= qmp_netdev_add
,
835 Add host network device
.
839 - "type": the device type
, "tap", "user", ... (json
-string
)
840 - "id": the device
's ID, must be unique (json-string)
845 -> { "execute": "netdev_add", "arguments": { "type": "user", "id": "netdev1" } }
848 Note: The supported device options are the same ones supported by the '-netdev
'
849 command-line argument, which are listed in the '-help
' output or QEMU's
855 .name
= "netdev_del",
857 .mhandler
.cmd_new
= qmp_marshal_input_netdev_del
,
864 Remove host network device
.
868 - "id": the device
's ID, must be unique (json-string)
872 -> { "execute": "netdev_del", "arguments": { "id": "netdev1" } }
879 .name = "block_resize",
880 .args_type = "device:B,size:o",
881 .mhandler.cmd_new = qmp_marshal_input_block_resize,
888 Resize a block image while a guest is running.
892 - "device": the device's ID
, must be
unique (json
-string
)
897 -> { "execute": "block_resize", "arguments": { "device": "scratch", "size": 1073741824 } }
903 .name
= "block-stream",
904 .args_type
= "device:B,base:s?,speed:o?,on-error:s?",
905 .mhandler
.cmd_new
= qmp_marshal_input_block_stream
,
909 .name
= "block-commit",
910 .args_type
= "device:B,base:s?,top:s,speed:o?",
911 .mhandler
.cmd_new
= qmp_marshal_input_block_commit
,
915 .name
= "drive-backup",
916 .args_type
= "device:B,target:s,speed:i?,mode:s?,format:s?,"
917 "on-source-error:s?,on-target-error:s?",
918 .mhandler
.cmd_new
= qmp_marshal_input_drive_backup
,
925 Start a point
-in-time copy of a block device to a
new destination
. The
926 status of ongoing drive
-backup operations can be checked with
927 query
-block
-jobs where the BlockJobInfo
.type field has the value
'backup'.
928 The operation can be stopped before it has completed
using the
929 block
-job
-cancel command
.
933 - "device": the name of the device which should be copied
.
935 - "target": the target of the
new image
. If the file exists
, or
if it is a
936 device
, the existing file
/device will be used as the
new
937 destination
. If it does not exist
, a
new file will be created
.
939 - "format": the format of the
new destination
, default is to probe
if 'mode' is
940 'existing', else the format of the source
941 (json
-string
, optional
)
942 - "mode": whether and how QEMU should create a
new image
943 (NewImageMode
, optional
, default 'absolute-paths')
944 - "speed": the maximum speed
, in bytes per
second (json
-int
, optional
)
945 - "on-source-error": the action to take on an error on the source
, default
946 'report'. 'stop' and
'enospc' can only be used
947 if the block device supports io
-status
.
948 (BlockdevOnError
, optional
)
949 - "on-target-error": the action to take on an error on the target
, default
950 'report' (no limitations
, since
this applies to
951 a different block device than device
).
952 (BlockdevOnError
, optional
)
955 -> { "execute": "drive-backup", "arguments": { "device": "drive0",
956 "target": "backup.img" } }
961 .name
= "block-job-set-speed",
962 .args_type
= "device:B,speed:o",
963 .mhandler
.cmd_new
= qmp_marshal_input_block_job_set_speed
,
967 .name
= "block-job-cancel",
968 .args_type
= "device:B,force:b?",
969 .mhandler
.cmd_new
= qmp_marshal_input_block_job_cancel
,
972 .name
= "block-job-pause",
973 .args_type
= "device:B",
974 .mhandler
.cmd_new
= qmp_marshal_input_block_job_pause
,
977 .name
= "block-job-resume",
978 .args_type
= "device:B",
979 .mhandler
.cmd_new
= qmp_marshal_input_block_job_resume
,
982 .name
= "block-job-complete",
983 .args_type
= "device:B",
984 .mhandler
.cmd_new
= qmp_marshal_input_block_job_complete
,
987 .name
= "transaction",
988 .args_type
= "actions:q",
989 .mhandler
.cmd_new
= qmp_marshal_input_transaction
,
996 Atomically operate on one or more block devices
. The only supported
997 operation
for now is snapshotting
. If there is any failure performing
998 any of the operations
, all snapshots
for the group are abandoned
, and
999 the original disks pre
-snapshot attempt are used
.
1001 A list of dictionaries is accepted
, that contains the actions to be performed
.
1002 For snapshots
this is the device
, the file to use
for the
new snapshot
,
1003 and the format
. The
default format
, if not specified
, is qcow2
.
1005 Each
new snapshot defaults to being created by
QEMU (wiping any
1006 contents
if the file already exists
), but it is also possible to reuse
1007 an externally
-created file
. In the latter
case, you should ensure that
1008 the
new image file has the same contents as the current one
; QEMU cannot
1009 perform any meaningful check
. Typically
this is achieved by
using the
1010 current image file as the backing file
for the
new image
.
1015 - "type": the operation to perform
. The only supported
1016 value is
"blockdev-snapshot-sync". (json
-string
)
1017 - "data": a dictionary
. The contents depend on the value
1018 of
"type". When
"type" is
"blockdev-snapshot-sync":
1019 - "device": device name to
snapshot (json
-string
)
1020 - "snapshot-file": name of
new image
file (json
-string
)
1021 - "format": format of
new image (json
-string
, optional
)
1022 - "mode": whether and how QEMU should create the snapshot file
1023 (NewImageMode
, optional
, default "absolute-paths")
1027 -> { "execute": "transaction",
1028 "arguments": { "actions": [
1029 { 'type': 'blockdev-snapshot-sync', 'data' : { "device": "ide-hd0",
1030 "snapshot-file": "/some/place/my-image",
1031 "format": "qcow2" } },
1032 { 'type': 'blockdev-snapshot-sync', 'data' : { "device": "ide-hd1",
1033 "snapshot-file": "/some/place/my-image2",
1035 "format": "qcow2" } } ] } }
1041 .name
= "blockdev-snapshot-sync",
1042 .args_type
= "device:B,snapshot-file:s,format:s?,mode:s?",
1043 .mhandler
.cmd_new
= qmp_marshal_input_blockdev_snapshot_sync
,
1047 blockdev
-snapshot
-sync
1048 ----------------------
1050 Synchronous snapshot of a block device
. snapshot
-file specifies the
1051 target of the
new image
. If the file exists
, or
if it is a device
, the
1052 snapshot will be created
in the existing file
/device
. If does not
1053 exist
, a
new file will be created
. format specifies the format of the
1054 snapshot image
, default is qcow2
.
1058 - "device": device name to
snapshot (json
-string
)
1059 - "snapshot-file": name of
new image
file (json
-string
)
1060 - "mode": whether and how QEMU should create the snapshot file
1061 (NewImageMode
, optional
, default "absolute-paths")
1062 - "format": format of
new image (json
-string
, optional
)
1066 -> { "execute": "blockdev-snapshot-sync", "arguments": { "device": "ide-hd0",
1068 "/some/place/my-image",
1069 "format": "qcow2" } }
1075 .name
= "drive-mirror",
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 "granularity:i?,buf-size:i?",
1079 .mhandler
.cmd_new
= qmp_marshal_input_drive_mirror
,
1086 Start mirroring a block device
's writes to a new destination. target
1087 specifies the target of the new image. If the file exists, or if it is
1088 a device, it will be used as the new destination for writes. If it does not
1089 exist, a new file will be created. format specifies the format of the
1090 mirror image, default is to probe if mode='existing
', else the format
1095 - "device": device name to operate on (json-string)
1096 - "target": name of new image file (json-string)
1097 - "format": format of new image (json-string, optional)
1098 - "mode": how an image file should be created into the target
1099 file/device (NewImageMode, optional, default 'absolute
-paths
')
1100 - "speed": maximum speed of the streaming job, in bytes per second
1102 - "granularity": granularity of the dirty bitmap, in bytes (json-int, optional)
1103 - "buf_size": maximum amount of data in flight from source to target, in bytes
1104 (json-int, default 10M)
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 - "on-source-error": the action to take on an error on the source
1110 (BlockdevOnError, default 'report
')
1111 - "on-target-error": the action to take on an error on the target
1112 (BlockdevOnError, default 'report
')
1114 The default value of the granularity is the image cluster size clamped
1115 between 4096 and 65536, if the image format defines one. If the format
1116 does not define a cluster size, the default value of the granularity
1122 -> { "execute": "drive-mirror", "arguments": { "device": "ide-hd0",
1123 "target": "/some/place/my-image",
1125 "format": "qcow2" } }
1132 .args_type = "value:M",
1133 .mhandler.cmd_new = qmp_marshal_input_balloon,
1140 Request VM to change its memory allocation (in bytes).
1144 - "value": New memory allocation (json-int)
1148 -> { "execute": "balloon", "arguments": { "value": 536870912 } }
1155 .args_type = "name:s,up:b",
1156 .mhandler.cmd_new = qmp_marshal_input_set_link,
1163 Change the link status of a network adapter.
1167 - "name": network device name (json-string)
1168 - "up": status is up (json-bool)
1172 -> { "execute": "set_link", "arguments": { "name": "e1000.0", "up": false } }
1179 .args_type = "fdname:s",
1180 .params = "getfd name",
1181 .help = "receive a file descriptor via SCM rights and assign it a name",
1182 .mhandler.cmd_new = qmp_marshal_input_getfd,
1189 Receive a file descriptor via SCM rights and assign it a name.
1193 - "fdname": file descriptor name (json-string)
1197 -> { "execute": "getfd", "arguments": { "fdname": "fd1" } }
1202 (1) If the name specified by the "fdname" argument already exists,
1203 the file descriptor assigned to it will be closed and replaced
1204 by the received file descriptor.
1205 (2) The 'closefd
' command can be used to explicitly close the file
1206 descriptor when it is no longer needed.
1212 .args_type = "fdname:s",
1213 .params = "closefd name",
1214 .help = "close a file descriptor previously passed via SCM rights",
1215 .mhandler.cmd_new = qmp_marshal_input_closefd,
1222 Close a file descriptor previously passed via SCM rights.
1226 - "fdname": file descriptor name (json-string)
1230 -> { "execute": "closefd", "arguments": { "fdname": "fd1" } }
1237 .args_type = "fdset-id:i?,opaque:s?",
1238 .params = "add-fd fdset-id opaque",
1239 .help = "Add a file descriptor, that was passed via SCM rights, to an fd set",
1240 .mhandler.cmd_new = qmp_marshal_input_add_fd,
1247 Add a file descriptor, that was passed via SCM rights, to an fd set.
1251 - "fdset-id": The ID of the fd set to add the file descriptor to.
1252 (json-int, optional)
1253 - "opaque": A free-form string that can be used to describe the fd.
1254 (json-string, optional)
1256 Return a json-object with the following information:
1258 - "fdset-id": The ID of the fd set that the fd was added to. (json-int)
1259 - "fd": The file descriptor that was received via SCM rights and added to the
1264 -> { "execute": "add-fd", "arguments": { "fdset-id": 1 } }
1265 <- { "return": { "fdset-id": 1, "fd": 3 } }
1269 (1) The list of fd sets is shared by all monitor connections.
1270 (2) If "fdset-id" is not specified, a new fd set will be created.
1275 .name = "remove-fd",
1276 .args_type = "fdset-id:i,fd:i?",
1277 .params = "remove-fd fdset-id fd",
1278 .help = "Remove a file descriptor from an fd set",
1279 .mhandler.cmd_new = qmp_marshal_input_remove_fd,
1286 Remove a file descriptor from an fd set.
1290 - "fdset-id": The ID of the fd set that the file descriptor belongs to.
1292 - "fd": The file descriptor that is to be removed. (json-int, optional)
1296 -> { "execute": "remove-fd", "arguments": { "fdset-id": 1, "fd": 3 } }
1301 (1) The list of fd sets is shared by all monitor connections.
1302 (2) If "fd" is not specified, all file descriptors in "fdset-id" will be
1308 .name = "query-fdsets",
1310 .help = "Return information describing all fd sets",
1311 .mhandler.cmd_new = qmp_marshal_input_query_fdsets,
1318 Return information describing all fd sets.
1324 -> { "execute": "query-fdsets" }
1330 "opaque": "rdonly:/path/to/file"
1334 "opaque": "rdwr:/path/to/file"
1353 Note: The list of fd sets is shared by all monitor connections.
1358 .name = "block_passwd",
1359 .args_type = "device:B,password:s",
1360 .mhandler.cmd_new = qmp_marshal_input_block_passwd,
1367 Set the password of encrypted block devices.
1371 - "device": device name (json-string)
1372 - "password": password (json-string)
1376 -> { "execute": "block_passwd", "arguments": { "device": "ide0-hd0",
1377 "password": "12345" } }
1383 .name = "block_set_io_throttle",
1384 .args_type = "device:B,bps:l,bps_rd:l,bps_wr:l,iops:l,iops_rd:l,iops_wr:l",
1385 .mhandler.cmd_new = qmp_marshal_input_block_set_io_throttle,
1389 block_set_io_throttle
1392 Change I/O throttle limits for a block drive.
1396 - "device": device name (json-string)
1397 - "bps": total throughput limit in bytes per second(json-int)
1398 - "bps_rd": read throughput limit in bytes per second(json-int)
1399 - "bps_wr": read throughput limit in bytes per second(json-int)
1400 - "iops": total I/O operations per second(json-int)
1401 - "iops_rd": read I/O operations per second(json-int)
1402 - "iops_wr": write I/O operations per second(json-int)
1406 -> { "execute": "block_set_io_throttle", "arguments": { "device": "virtio0",
1418 .name = "set_password",
1419 .args_type = "protocol:s,password:s,connected:s?",
1420 .mhandler.cmd_new = qmp_marshal_input_set_password,
1427 Set the password for vnc/spice protocols.
1431 - "protocol": protocol name (json-string)
1432 - "password": password (json-string)
1433 - "connected": [ keep | disconnect | fail ] (josn-string, optional)
1437 -> { "execute": "set_password", "arguments": { "protocol": "vnc",
1438 "password": "secret" } }
1444 .name = "expire_password",
1445 .args_type = "protocol:s,time:s",
1446 .mhandler.cmd_new = qmp_marshal_input_expire_password,
1453 Set the password expire time for vnc/spice protocols.
1457 - "protocol": protocol name (json-string)
1458 - "time": [ now | never | +secs | secs ] (json-string)
1462 -> { "execute": "expire_password", "arguments": { "protocol": "vnc",
1469 .name = "add_client",
1470 .args_type = "protocol:s,fdname:s,skipauth:b?,tls:b?",
1471 .mhandler.cmd_new = qmp_marshal_input_add_client,
1478 Add a graphics client
1482 - "protocol": protocol name (json-string)
1483 - "fdname": file descriptor name (json-string)
1484 - "skipauth": whether to skip authentication (json-bool, optional)
1485 - "tls": whether to perform TLS (json-bool, optional)
1489 -> { "execute": "add_client", "arguments": { "protocol": "vnc",
1490 "fdname": "myclient" } }
1495 .name = "qmp_capabilities",
1498 .help = "enable QMP capabilities",
1499 .user_print = monitor_user_noop,
1500 .mhandler.cmd_new = do_qmp_capabilities,
1507 Enable QMP capabilities.
1513 -> { "execute": "qmp_capabilities" }
1516 Note: This command must be issued before issuing any other command.
1521 .name = "human-monitor-command",
1522 .args_type = "command-line:s,cpu-index:i?",
1523 .mhandler.cmd_new = qmp_marshal_input_human_monitor_command,
1527 human-monitor-command
1528 ---------------------
1530 Execute a Human Monitor command.
1534 - command-line: the command name and its arguments, just like the
1535 Human Monitor's
shell (json
-string
)
1536 - cpu
-index
: select the CPU number to be used by commands which access CPU
1537 data
, like
'info registers'. The Monitor selects CPU
0 if this
1538 argument is not
provided (json
-int
, optional
)
1542 -> { "execute": "human-monitor-command", "arguments": { "command-line": "info kvm" } }
1543 <- { "return": "kvm support: enabled\r\n" }
1547 (1) The Human Monitor is NOT an stable
interface, this means that command
1548 names
, arguments and responses can change or be removed at ANY time
.
1549 Applications that rely on long term stability guarantees should NOT
1554 o This command is stateless
, this means that commands that depend
1555 on state
information (such as getfd
) might not work
1557 o Commands that prompt the user
for data (eg
. 'cont' when the block
1558 device is encrypted
) don
't currently work
1563 HXCOMM Each query command below is inside a SQMP/EQMP section, do NOT change
1564 HXCOMM this! We will possibly move query commands definitions inside those
1565 HXCOMM sections, just like regular commands.
1575 Return a json-object with the following information:
1577 - "qemu": A json-object containing three integer values:
1578 - "major": QEMU's major
version (json
-int
)
1579 - "minor": QEMU
's minor version (json-int)
1580 - "micro": QEMU's micro
version (json
-int
)
1581 - "package": package's version (json-string)
1585 -> { "execute": "query-version" }
1600 .name = "query-version",
1602 .mhandler.cmd_new = qmp_marshal_input_query_version,
1609 List QMP available commands.
1611 Each command is represented by a json-object, the returned value is a json-array
1614 Each json-object contain:
1616 - "name": command's
name (json
-string
)
1620 -> { "execute": "query-commands" }
1624 "name":"query-balloon"
1627 "name":"system_powerdown"
1632 Note
: This example has been shortened as the real response is too long
.
1637 .name
= "query-commands",
1639 .mhandler
.cmd_new
= qmp_marshal_input_query_commands
,
1646 List QMP available events
.
1648 Each event is represented by a json
-object
, the returned value is a json
-array
1651 Each json
-object contains
:
1653 - "name": event
's name (json-string)
1657 -> { "execute": "query-events" }
1669 Note: This example has been shortened as the real response is too long.
1674 .name = "query-events",
1676 .mhandler.cmd_new = qmp_marshal_input_query_events,
1683 Each device is represented by a json-object. The returned value is a json-array
1686 Each json-object contain the following:
1688 - "label": device's
label (json
-string
)
1689 - "filename": device
's file (json-string)
1693 -> { "execute": "query-chardev" }
1710 .name = "query-chardev",
1712 .mhandler.cmd_new = qmp_marshal_input_query_chardev,
1719 Show the block devices.
1721 Each block device information is stored in a json-object and the returned value
1722 is a json-array of all devices.
1724 Each json-object contain the following:
1726 - "device": device name (json-string)
1727 - "type": device type (json-string)
1728 - deprecated, retained for backward compatibility
1729 - Possible values: "unknown"
1730 - "removable": true if the device is removable, false otherwise (json-bool)
1731 - "locked": true if the device is locked, false otherwise (json-bool)
1732 - "tray_open": only present if removable, true if the device has a tray,
1733 and it is open (json-bool)
1734 - "inserted": only present if the device is inserted, it is a json-object
1735 containing the following:
1736 - "file": device file name (json-string)
1737 - "ro": true if read-only, false otherwise (json-bool)
1738 - "drv": driver format name (json-string)
1739 - Possible values: "blkdebug", "bochs", "cloop", "cow", "dmg",
1740 "file", "file", "ftp", "ftps", "host_cdrom",
1741 "host_device", "host_floppy", "http", "https",
1742 "nbd", "parallels", "qcow", "qcow2", "raw",
1743 "tftp", "vdi", "vmdk", "vpc", "vvfat"
1744 - "backing_file": backing file name (json-string, optional)
1745 - "backing_file_depth": number of files in the backing file chain (json-int)
1746 - "encrypted": true if encrypted, false otherwise (json-bool)
1747 - "bps": limit total bytes per second (json-int)
1748 - "bps_rd": limit read bytes per second (json-int)
1749 - "bps_wr": limit write bytes per second (json-int)
1750 - "iops": limit total I/O operations per second (json-int)
1751 - "iops_rd": limit read operations per second (json-int)
1752 - "iops_wr": limit write operations per second (json-int)
1753 - "image": the detail of the image, it is a json-object containing
1755 - "filename": image file name (json-string)
1756 - "format": image format (json-string)
1757 - "virtual-size": image capacity in bytes (json-int)
1758 - "dirty-flag": true if image is not cleanly closed, not present
1759 means clean (json-bool, optional)
1760 - "actual-size": actual size on disk in bytes of the image, not
1761 present when image does not support thin
1762 provision (json-int, optional)
1763 - "cluster-size": size of a cluster in bytes, not present if image
1764 format does not support it (json-int, optional)
1765 - "encrypted": true if the image is encrypted, not present means
1766 false or the image format does not support
1767 encryption (json-bool, optional)
1768 - "backing_file": backing file name, not present means no backing
1769 file is used or the image format does not
1770 support backing file chain
1771 (json-string, optional)
1772 - "full-backing-filename": full path of the backing file, not
1773 present if it equals backing_file or no
1774 backing file is used
1775 (json-string, optional)
1776 - "backing-filename-format": the format of the backing file, not
1777 present means unknown or no backing
1778 file (json-string, optional)
1779 - "snapshots": the internal snapshot info, it is an optional list
1780 of json-object containing the following:
1781 - "id": unique snapshot id (json-string)
1782 - "name": snapshot name (json-string)
1783 - "vm-state-size": size of the VM state in bytes (json-int)
1784 - "date-sec": UTC date of the snapshot in seconds (json-int)
1785 - "date-nsec": fractional part in nanoseconds to be used with
1787 - "vm-clock-sec": VM clock relative to boot in seconds
1789 - "vm-clock-nsec": fractional part in nanoseconds to be used
1790 with vm-clock-sec (json-int)
1791 - "backing-image": the detail of the backing image, it is an
1792 optional json-object only present when a
1793 backing image present for this image
1795 - "io-status": I/O operation status, only present if the device supports it
1796 and the VM is configured to stop on errors. It's always reset
1797 to
"ok" when the
"cont" command is
issued (json_string
, optional
)
1798 - Possible values
: "ok", "failed", "nospace"
1802 -> { "execute": "query-block" }
1807 "device":"ide0-hd0",
1814 "file":"disks/test.qcow2",
1815 "backing_file_depth":1,
1823 "filename":"disks/test.qcow2",
1825 "virtual-size":2048000,
1826 "backing_file":"base.qcow2",
1827 "full-backing-filename":"disks/base.qcow2",
1828 "backing-filename-format:"qcow2
",
1832 "name
": "snapshot1
",
1834 "date
-sec
": 10000200,
1836 "vm
-clock
-sec
": 206,
1841 "filename
":"disks
/base
.qcow2
",
1843 "virtual
-size
":2048000
1851 "device
":"ide1
-cd0
",
1874 .name = "query
-block
",
1876 .mhandler.cmd_new = qmp_marshal_input_query_block,
1883 Show block device statistics.
1885 Each device statistic information is stored in a json-object and the returned
1886 value is a json-array of all devices.
1888 Each json-object contain the following:
1890 - "device
": device name (json-string)
1891 - "stats
": A json-object with the statistics information, it contains:
1892 - "rd_bytes
": bytes read (json-int)
1893 - "wr_bytes
": bytes written (json-int)
1894 - "rd_operations
": read operations (json-int)
1895 - "wr_operations
": write operations (json-int)
1896 - "flush_operations
": cache flush operations (json-int)
1897 - "wr_total_time_ns
": total time spend on writes in nano-seconds (json-int)
1898 - "rd_total_time_ns
": total time spend on reads in nano-seconds (json-int)
1899 - "flush_total_time_ns
": total time spend on cache flushes in nano-seconds (json-int)
1900 - "wr_highest_offset
": Highest offset of a sector written since the
1901 BlockDriverState has been opened (json-int)
1902 - "parent
": Contains recursively the statistics of the underlying
1903 protocol (e.g. the host file for a qcow2 image). If there is
1904 no underlying protocol, this field is omitted
1905 (json-object, optional)
1909 -> { "execute
": "query
-blockstats
" }
1913 "device
":"ide0
-hd0
",
1916 "wr_highest_offset
":3686448128,
1918 "wr_operations
":751,
1919 "rd_bytes
":122567168,
1920 "rd_operations
":36772
1921 "wr_total_times_ns
":313253456
1922 "rd_total_times_ns
":3465673657
1923 "flush_total_times_ns
":49653
1924 "flush_operations
":61,
1928 "wr_highest_offset
":2821110784,
1930 "wr_operations
":692,
1931 "rd_bytes
":122739200,
1932 "rd_operations
":36604
1933 "flush_operations
":51,
1934 "wr_total_times_ns
":313253456
1935 "rd_total_times_ns
":3465673657
1936 "flush_total_times_ns
":49653
1940 "device
":"ide1
-cd0
",
1942 "wr_highest_offset
":0,
1947 "flush_operations
":0,
1948 "wr_total_times_ns
":0
1949 "rd_total_times_ns
":0
1950 "flush_total_times_ns
":0
1956 "wr_highest_offset
":0,
1961 "flush_operations
":0,
1962 "wr_total_times_ns
":0
1963 "rd_total_times_ns
":0
1964 "flush_total_times_ns
":0
1970 "wr_highest_offset
":0,
1975 "flush_operations
":0,
1976 "wr_total_times_ns
":0
1977 "rd_total_times_ns
":0
1978 "flush_total_times_ns
":0
1987 .name = "query
-blockstats
",
1989 .mhandler.cmd_new = qmp_marshal_input_query_blockstats,
1996 Show CPU information.
1998 Return a json-array. Each CPU is represented by a json-object, which contains:
2000 - "CPU
": CPU index (json-int)
2001 - "current
": true if this is the current CPU, false otherwise (json-bool)
2002 - "halted
": true if the cpu is halted, false otherwise (json-bool)
2003 - Current program counter. The key's name depends on the architecture:
2004 "pc
": i386/x86_64 (json-int)
2005 "nip
": PPC (json-int)
2006 "pc
" and "npc
": sparc (json-int)
2007 "PC
": mips (json-int)
2008 - "thread_id
": ID of the underlying host thread (json-int)
2012 -> { "execute
": "query
-cpus
" }
2035 .name = "query
-cpus
",
2037 .mhandler.cmd_new = qmp_marshal_input_query_cpus,
2044 PCI buses and devices information.
2046 The returned value is a json-array of all buses. Each bus is represented by
2047 a json-object, which has a key with a json-array of all PCI devices attached
2048 to it. Each device is represented by a json-object.
2050 The bus json-object contains the following:
2052 - "bus
": bus number (json-int)
2053 - "devices
": a json-array of json-objects, each json-object represents a
2056 The PCI device json-object contains the following:
2058 - "bus
": identical to the parent's bus number (json-int)
2059 - "slot
": slot number (json-int)
2060 - "function": function number (json-int)
2061 - "class_info
": a json-object containing:
2062 - "desc
": device class description (json-string, optional)
2063 - "class": device class number (json-int)
2064 - "id
": a json-object containing:
2065 - "device
": device ID (json-int)
2066 - "vendor
": vendor ID (json-int)
2067 - "irq
": device's IRQ if assigned (json-int, optional)
2068 - "qdev_id
": qdev id string (json-string)
2069 - "pci_bridge
": It's a json-object, only present if this device is a
2070 PCI bridge, contains:
2071 - "bus
": bus number (json-int)
2072 - "secondary
": secondary bus number (json-int)
2073 - "subordinate
": subordinate bus number (json-int)
2074 - "io_range
": I/O memory range information, a json-object with the
2076 - "base
": base address, in bytes (json-int)
2077 - "limit
": limit address, in bytes (json-int)
2078 - "memory_range
": memory range information, a json-object with the
2080 - "base
": base address, in bytes (json-int)
2081 - "limit
": limit address, in bytes (json-int)
2082 - "prefetchable_range
": Prefetchable memory range information, a
2083 json-object with the following members:
2084 - "base
": base address, in bytes (json-int)
2085 - "limit
": limit address, in bytes (json-int)
2086 - "devices
": a json-array of PCI devices if there's any attached, each
2087 each element is represented by a json-object, which contains
2088 the same members of the 'PCI device json-object' described
2090 - "regions
": a json-array of json-objects, each json-object represents a
2091 memory region of this device
2093 The memory range json-object contains the following:
2095 - "base
": base memory address (json-int)
2096 - "limit
": limit value (json-int)
2098 The region json-object can be an I/O region or a memory region, an I/O region
2099 json-object contains the following:
2101 - "type
": "io
" (json-string, fixed)
2102 - "bar
": BAR number (json-int)
2103 - "address
": memory address (json-int)
2104 - "size
": memory size (json-int)
2106 A memory region json-object contains the following:
2108 - "type
": "memory
" (json-string, fixed)
2109 - "bar
": BAR number (json-int)
2110 - "address
": memory address (json-int)
2111 - "size
": memory size (json-int)
2112 - "mem_type_64
": true or false (json-bool)
2113 - "prefetch
": true or false (json-bool)
2117 -> { "execute
": "query
-pci
" }
2129 "desc
":"Host bridge
"
2163 "desc
":"IDE controller
"
2185 "desc
":"VGA controller
"
2195 "mem_type_64
":false,
2198 "address
":4026531840,
2203 "mem_type_64
":false,
2206 "address
":4060086272,
2211 "mem_type_64
":false,
2226 "desc
":"RAM controller
"
2247 Note: This example has been shortened as the real response is too long.
2252 .name = "query
-pci
",
2254 .mhandler.cmd_new = qmp_marshal_input_query_pci,
2261 Show KVM information.
2263 Return a json-object with the following information:
2265 - "enabled
": true if KVM support is enabled, false otherwise (json-bool)
2266 - "present
": true if QEMU has KVM support, false otherwise (json-bool)
2270 -> { "execute
": "query
-kvm
" }
2271 <- { "return": { "enabled
": true, "present
": true } }
2276 .name = "query
-kvm
",
2278 .mhandler.cmd_new = qmp_marshal_input_query_kvm,
2285 Return a json-object with the following information:
2287 - "running
": true if the VM is running, or false if it is paused (json-bool)
2288 - "singlestep
": true if the VM is in single step mode,
2289 false otherwise (json-bool)
2290 - "status
": one of the following values (json-string)
2291 "debug
" - QEMU is running on a debugger
2292 "inmigrate
" - guest is paused waiting for an incoming migration
2293 "internal
-error
" - An internal error that prevents further guest
2294 execution has occurred
2295 "io
-error
" - the last IOP has failed and the device is configured
2296 to pause on I/O errors
2297 "paused
" - guest has been paused via the 'stop' command
2298 "postmigrate
" - guest is paused following a successful 'migrate'
2299 "prelaunch
" - QEMU was started with -S and guest has not started
2300 "finish
-migrate
" - guest is paused to finish the migration process
2301 "restore
-vm
" - guest is paused to restore VM state
2302 "running
" - guest is actively running
2303 "save
-vm
" - guest is paused to save the VM state
2304 "shutdown
" - guest is shut down (and -no-shutdown is in use)
2305 "watchdog
" - the watchdog action is configured to pause and
2310 -> { "execute
": "query
-status
" }
2311 <- { "return": { "running
": true, "singlestep
": false, "status
": "running
" } }
2316 .name = "query
-status
",
2318 .mhandler.cmd_new = qmp_marshal_input_query_status,
2325 Show VM mice information.
2327 Each mouse is represented by a json-object, the returned value is a json-array
2330 The mouse json-object contains the following:
2332 - "name
": mouse's name (json-string)
2333 - "index
": mouse's index (json-int)
2334 - "current
": true if this mouse is receiving events, false otherwise (json-bool)
2335 - "absolute
": true if the mouse generates absolute input events (json-bool)
2339 -> { "execute
": "query
-mice
" }
2343 "name
":"QEMU Microsoft Mouse
",
2349 "name
":"QEMU PS
/2 Mouse
",
2360 .name = "query
-mice
",
2362 .mhandler.cmd_new = qmp_marshal_input_query_mice,
2369 Show VNC server information.
2371 Return a json-object with server information. Connected clients are returned
2372 as a json-array of json-objects.
2374 The main json-object contains the following:
2376 - "enabled
": true or false (json-bool)
2377 - "host
": server's IP address (json-string)
2378 - "family
": address family (json-string)
2379 - Possible values: "ipv4
", "ipv6
", "unix
", "unknown
"
2380 - "service
": server's port number (json-string)
2381 - "auth
": authentication method (json-string)
2382 - Possible values: "invalid
", "none
", "ra2
", "ra2ne
", "sasl
", "tight
",
2383 "tls
", "ultra
", "unknown
", "vencrypt
", "vencrypt
",
2384 "vencrypt
+plain
", "vencrypt
+tls
+none
",
2385 "vencrypt
+tls
+plain
", "vencrypt
+tls
+sasl
",
2386 "vencrypt
+tls
+vnc
", "vencrypt
+x509
+none
",
2387 "vencrypt
+x509
+plain
", "vencrypt
+x509
+sasl
",
2388 "vencrypt
+x509
+vnc
", "vnc
"
2389 - "clients
": a json-array of all connected clients
2391 Clients are described by a json-object, each one contain the following:
2393 - "host
": client's IP address (json-string)
2394 - "family
": address family (json-string)
2395 - Possible values: "ipv4
", "ipv6
", "unix
", "unknown
"
2396 - "service
": client's port number (json-string)
2397 - "x509_dname
": TLS dname (json-string, optional)
2398 - "sasl_username
": SASL username (json-string, optional)
2402 -> { "execute
": "query
-vnc
" }
2423 .name = "query
-vnc
",
2425 .mhandler.cmd_new = qmp_marshal_input_query_vnc,
2432 Show SPICE server information.
2434 Return a json-object with server information. Connected clients are returned
2435 as a json-array of json-objects.
2437 The main json-object contains the following:
2439 - "enabled
": true or false (json-bool)
2440 - "host
": server's IP address (json-string)
2441 - "port
": server's port number (json-int, optional)
2442 - "tls
-port
": server's port number (json-int, optional)
2443 - "auth
": authentication method (json-string)
2444 - Possible values: "none
", "spice
"
2445 - "channels
": a json-array of all active channels clients
2447 Channels are described by a json-object, each one contain the following:
2449 - "host
": client's IP address (json-string)
2450 - "family
": address family (json-string)
2451 - Possible values: "ipv4
", "ipv6
", "unix
", "unknown
"
2452 - "port
": client's port number (json-string)
2453 - "connection
-id
": spice connection id. All channels with the same id
2454 belong to the same spice session (json-int)
2455 - "channel
-type
": channel type. "1" is the main control channel, filter for
2456 this one if you want track spice sessions only (json-int)
2457 - "channel
-id
": channel id. Usually "0", might be different needed when
2458 multiple channels of the same type exist, such as multiple
2459 display channels in a multihead setup (json-int)
2460 - "tls
": whevener the channel is encrypted (json-bool)
2464 -> { "execute
": "query
-spice
" }
2477 "connection
-id
": 1804289383,
2478 "host
": "127.0.0.1",
2486 "connection
-id
": 1804289383,
2487 "host
": "127.0.0.1",
2491 [ ... more channels follow ... ]
2498 #if defined(CONFIG_SPICE)
2500 .name = "query
-spice
",
2502 .mhandler.cmd_new = qmp_marshal_input_query_spice,
2512 Return a json-object with the following information:
2514 - "name
": VM's name (json-string, optional)
2518 -> { "execute
": "query
-name
" }
2519 <- { "return": { "name
": "qemu
-name
" } }
2524 .name = "query
-name
",
2526 .mhandler.cmd_new = qmp_marshal_input_query_name,
2535 Return a json-object with the following information:
2537 - "UUID
": Universally Unique Identifier (json-string)
2541 -> { "execute
": "query
-uuid
" }
2542 <- { "return": { "UUID
": "550e8400-e29b
-41d4-a716
-446655440000" } }
2547 .name = "query
-uuid
",
2549 .mhandler.cmd_new = qmp_marshal_input_query_uuid,
2553 query-command-line-options
2554 --------------------------
2556 Show command line option schema.
2558 Return a json-array of command line option schema for all options (or for
2559 the given option), returning an error if the given option doesn't exist.
2561 Each array entry contains the following:
2563 - "option
": option name (json-string)
2564 - "parameters
": a json-array describes all parameters of the option:
2565 - "name
": parameter name (json-string)
2566 - "type
": parameter type (one of 'string', 'boolean', 'number',
2568 - "help
": human readable description of the parameter
2569 (json-string, optional)
2573 -> { "execute
": "query
-command
-line
-options
", "arguments
": { "option
": "option
-rom
" } }
2582 "name
": "bootindex
",
2586 "option
": "option
-rom
"
2594 .name = "query
-command
-line
-options
",
2595 .args_type = "option
:s?
",
2596 .mhandler.cmd_new = qmp_marshal_input_query_command_line_options,
2605 Return a json-object. If migration is active there will be another json-object
2606 with RAM migration status and if block migration is active another one with
2607 block migration status.
2609 The main json-object contains the following:
2611 - "status
": migration status (json-string)
2612 - Possible values: "active
", "completed
", "failed
", "cancelled
"
2613 - "total
-time
": total amount of ms since migration started. If
2614 migration has ended, it returns the total migration
2616 - "downtime
": only present when migration has finished correctly
2617 total amount in ms for downtime that happened (json-int)
2618 - "expected
-downtime
": only present while migration is active
2619 total amount in ms for downtime that was calculated on
2620 the last bitmap round (json-int)
2621 - "ram
": only present if "status
" is "active
", it is a json-object with the
2622 following RAM information:
2623 - "transferred
": amount transferred in bytes (json-int)
2624 - "remaining
": amount remaining to transfer in bytes (json-int)
2625 - "total
": total amount of memory in bytes (json-int)
2626 - "duplicate
": number of pages filled entirely with the same
2628 These are sent over the wire much more efficiently.
2629 - "skipped
": number of skipped zero pages (json-int)
2630 - "normal
" : number of whole pages transferred. I.e. they
2631 were not sent as duplicate or xbzrle pages (json-int)
2632 - "normal
-bytes
" : number of bytes transferred in whole
2633 pages. This is just normal pages times size of one page,
2634 but this way upper levels don't need to care about page
2636 - "disk
": only present if "status
" is "active
" and it is a block migration,
2637 it is a json-object with the following disk information:
2638 - "transferred
": amount transferred in bytes (json-int)
2639 - "remaining
": amount remaining to transfer in bytes json-int)
2640 - "total
": total disk size in bytes (json-int)
2641 - "xbzrle
-cache
": only present if XBZRLE is active.
2642 It is a json-object with the following XBZRLE information:
2643 - "cache
-size
": XBZRLE cache size in bytes
2644 - "bytes
": number of bytes transferred for XBZRLE compressed pages
2645 - "pages
": number of XBZRLE compressed pages
2646 - "cache
-miss
": number of XBRZRLE page cache misses
2647 - "overflow
": number of times XBZRLE overflows. This means
2648 that the XBZRLE encoding was bigger than just sent the
2649 whole page, and then we sent the whole page instead (as as
2654 1. Before the first migration
2656 -> { "execute
": "query
-migrate
" }
2659 2. Migration is done and has succeeded
2661 -> { "execute
": "query
-migrate
" }
2663 "status
": "completed
",
2672 "normal
-bytes
":123456
2677 3. Migration is done and has failed
2679 -> { "execute
": "query
-migrate
" }
2680 <- { "return": { "status
": "failed
" } }
2682 4. Migration is being performed and is not a block migration:
2684 -> { "execute
": "query
-migrate
" }
2693 "expected
-downtime
":12345,
2696 "normal
-bytes
":123456
2701 5. Migration is being performed and is a block migration:
2703 -> { "execute
": "query
-migrate
" }
2709 "remaining
":1053304,
2712 "expected
-downtime
":12345,
2715 "normal
-bytes
":123456
2719 "remaining
":20880384,
2725 6. Migration is being performed and XBZRLE is active:
2727 -> { "execute
": "query
-migrate
" }
2731 "capabilities
" : [ { "capability
": "xbzrle
", "state
" : true } ],
2734 "remaining
":1053304,
2737 "expected
-downtime
":12345,
2740 "normal
-bytes
":3412992
2743 "cache
-size
":67108864,
2755 .name = "query
-migrate
",
2757 .mhandler.cmd_new = qmp_marshal_input_query_migrate,
2761 migrate-set-capabilities
2762 ------------------------
2764 Enable/Disable migration capabilities
2766 - "xbzrle
": XBZRLE support
2772 -> { "execute
": "migrate
-set
-capabilities
" , "arguments
":
2773 { "capabilities
": [ { "capability
": "xbzrle
", "state
": true } ] } }
2778 .name = "migrate
-set
-capabilities
",
2779 .args_type = "capabilities
:O
",
2780 .params = "capability
:s
,state
:b
",
2781 .mhandler.cmd_new = qmp_marshal_input_migrate_set_capabilities,
2784 query-migrate-capabilities
2785 --------------------------
2787 Query current migration capabilities
2789 - "capabilities
": migration capabilities state
2790 - "xbzrle
" : XBZRLE state (json-bool)
2796 -> { "execute
": "query
-migrate
-capabilities
" }
2797 <- { "return": [ { "state
": false, "capability
": "xbzrle
" } ] }
2802 .name = "query
-migrate
-capabilities
",
2804 .mhandler.cmd_new = qmp_marshal_input_query_migrate_capabilities,
2811 Show balloon information.
2813 Make an asynchronous request for balloon info. When the request completes a
2814 json-object will be returned containing the following data:
2816 - "actual
": current balloon value in bytes (json-int)
2820 -> { "execute
": "query
-balloon
" }
2823 "actual
":1073741824,
2830 .name = "query
-balloon
",
2832 .mhandler.cmd_new = qmp_marshal_input_query_balloon,
2836 .name = "query
-block
-jobs
",
2838 .mhandler.cmd_new = qmp_marshal_input_query_block_jobs,
2843 .args_type = "path
:s
",
2844 .mhandler.cmd_new = qmp_marshal_input_qom_list,
2849 .args_type = "path
:s
,property
:s
,value
:q
",
2850 .mhandler.cmd_new = qmp_qom_set,
2855 .args_type = "path
:s
,property
:s
",
2856 .mhandler.cmd_new = qmp_qom_get,
2860 .name = "nbd
-server
-start
",
2861 .args_type = "addr
:q
",
2862 .mhandler.cmd_new = qmp_marshal_input_nbd_server_start,
2865 .name = "nbd
-server
-add
",
2866 .args_type = "device
:B
,writable
:b?
",
2867 .mhandler.cmd_new = qmp_marshal_input_nbd_server_add,
2870 .name = "nbd
-server
-stop
",
2872 .mhandler.cmd_new = qmp_marshal_input_nbd_server_stop,
2876 .name = "change
-vnc
-password
",
2877 .args_type = "password
:s
",
2878 .mhandler.cmd_new = qmp_marshal_input_change_vnc_password,
2881 .name = "qom
-list
-types
",
2882 .args_type = "implements:s?
,abstract
:b?
",
2883 .mhandler.cmd_new = qmp_marshal_input_qom_list_types,
2887 .name = "device
-list
-properties
",
2888 .args_type = "typename
:s
",
2889 .mhandler.cmd_new = qmp_marshal_input_device_list_properties,
2893 .name = "query
-machines
",
2895 .mhandler.cmd_new = qmp_marshal_input_query_machines,
2899 .name = "query
-cpu
-definitions
",
2901 .mhandler.cmd_new = qmp_marshal_input_query_cpu_definitions,
2905 .name = "query
-target
",
2907 .mhandler.cmd_new = qmp_marshal_input_query_target,
2911 .name = "query
-tpm
",
2913 .mhandler.cmd_new = qmp_marshal_input_query_tpm,
2920 Return information about the TPM device.
2926 -> { "execute
": "query
-tpm
" }
2929 { "model
": "tpm
-tis
",
2931 { "type
": "passthrough
",
2933 { "cancel
-path
": "/sys
/class/misc
/tpm0
/device
/cancel
",
2945 .name = "query
-tpm
-models
",
2947 .mhandler.cmd_new = qmp_marshal_input_query_tpm_models,
2954 Return a list of supported TPM models.
2960 -> { "execute
": "query
-tpm
-models
" }
2961 <- { "return": [ "tpm
-tis
" ] }
2966 .name = "query
-tpm
-types
",
2968 .mhandler.cmd_new = qmp_marshal_input_query_tpm_types,
2975 Return a list of supported TPM types.
2981 -> { "execute
": "query
-tpm
-types
" }
2982 <- { "return": [ "passthrough
" ] }
2987 .name = "chardev
-add
",
2988 .args_type = "id
:s
,backend
:q
",
2989 .mhandler.cmd_new = qmp_marshal_input_chardev_add,
3000 - "id
": the chardev's ID, must be unique (json-string)
3001 - "backend
": chardev backend type + parameters
3005 -> { "execute
" : "chardev
-add
",
3006 "arguments
" : { "id
" : "foo
",
3007 "backend
" : { "type
" : "null", "data
" : {} } } }
3010 -> { "execute
" : "chardev
-add
",
3011 "arguments
" : { "id
" : "bar
",
3012 "backend
" : { "type
" : "file
",
3013 "data
" : { "out
" : "/tmp
/bar
.log
" } } } }
3016 -> { "execute
" : "chardev
-add
",
3017 "arguments
" : { "id
" : "baz
",
3018 "backend
" : { "type
" : "pty
", "data
" : {} } } }
3019 <- { "return": { "pty
" : "/dev
/pty
/42" } }
3024 .name = "chardev
-remove
",
3025 .args_type = "id
:s
",
3026 .mhandler.cmd_new = qmp_marshal_input_chardev_remove,
3038 - "id
": the chardev's ID, must exist and not be in use (json-string)
3042 -> { "execute
": "chardev
-remove
", "arguments
": { "id
" : "foo
" } }