1 HXCOMM QMP dispatch table and documentation
2 HXCOMM Text between SQMP and EQMP is copied to the QMP documentation file and
3 HXCOMM does not show up in the other formats.
9 This document describes all commands currently supported by QMP.
11 Most of the time their usage is exactly the same as in the user Monitor, this
12 means that any other document which also describe commands (the manpage,
13 QEMU's manual, etc) can and should be consulted.
15 QMP has two types of commands: regular and query commands. Regular commands
16 usually change the Virtual Machine's state someway, while query commands just
17 return information. The sections below are divided accordingly.
19 It's important to observe that all communication examples are formatted in
20 a reader-friendly way, so that they're easier to understand. However, in real
21 protocol usage, they're emitted as a single line.
23 Also, the following notation is used to denote data flow:
25 -> data issued by the Client
26 <- Server data response
28 Please, refer to the QMP specification (QMP/qmp-spec.txt) for detailed
29 information on the Server command and response formats.
31 NOTE: This document is temporary and will be replaced soon.
33 1. Stability Considerations
34 ===========================
36 The current QMP command set (described in this file) may be useful for a
37 number of use cases, however it's limited and several commands have bad
38 defined semantics, specially with regard to command completion.
40 These problems are going to be solved incrementally in the next QEMU releases
41 and we're going to establish a deprecation policy for badly defined commands.
43 If you're planning to adopt QMP, please observe the following:
45 1. The deprecation policy will take effect and be documented soon, please
46 check the documentation of each used command as soon as a new release of
49 2. DO NOT rely on anything which is not explicit documented
51 3. Errors, in special, are not documented. Applications should NOT check
52 for specific errors classes or data (it's strongly recommended to only
53 check for the "error" key)
58 Server's responses in the examples below are always a success response, please
59 refer to the QMP specification for more details on error responses.
66 .mhandler.cmd_new = qmp_marshal_input_quit,
79 -> { "execute": "quit" }
86 .args_type = "force:-f,device:B",
87 .mhandler.cmd_new = qmp_marshal_input_eject,
94 Eject a removable medium.
98 - force: force ejection (json-bool, optional)
99 - device: device name (json-string)
103 -> { "execute": "eject", "arguments": { "device": "ide1-cd0" } }
106 Note: The "force" argument defaults to false.
112 .args_type = "device:B,target:F,arg:s?",
113 .mhandler.cmd_new = qmp_marshal_input_change,
120 Change a removable medium or VNC configuration.
124 - "device": device name (json-string)
125 - "target": filename or item (json-string)
126 - "arg": additional argument (json-string, optional)
130 1. Change a removable medium
132 -> { "execute": "change",
133 "arguments": { "device": "ide1-cd0",
134 "target": "/srv/images/Fedora-12-x86_64-DVD.iso" } }
137 2. Change VNC password
139 -> { "execute": "change",
140 "arguments": { "device": "vnc", "target": "password",
147 .name = "screendump",
148 .args_type = "filename:F",
149 .mhandler.cmd_new = qmp_marshal_input_screendump,
156 Save screen into PPM image.
160 - "filename": file path (json-string)
164 -> { "execute": "screendump", "arguments": { "filename": "/tmp/image" } }
172 .mhandler.cmd_new = qmp_marshal_input_stop,
185 -> { "execute": "stop" }
193 .mhandler.cmd_new = qmp_marshal_input_cont,
206 -> { "execute": "cont" }
212 .name = "system_wakeup",
214 .mhandler.cmd_new = qmp_marshal_input_system_wakeup,
221 Wakeup guest from suspend.
227 -> { "execute": "system_wakeup" }
233 .name = "system_reset",
235 .mhandler.cmd_new = qmp_marshal_input_system_reset,
248 -> { "execute": "system_reset" }
254 .name = "system_powerdown",
256 .mhandler.cmd_new = qmp_marshal_input_system_powerdown,
263 Send system power down event.
269 -> { "execute": "system_powerdown" }
275 .name = "device_add",
276 .args_type = "device:O",
277 .params = "driver[,prop=value][,...]",
278 .help = "add device, like -device on the command line",
279 .mhandler.cmd_new = qmp_device_add,
290 - "driver": the name of the new device's driver (json-string)
291 - "bus": the device's parent bus (device tree path, json-string, optional)
292 - "id": the device's ID, must be unique (json-string)
297 -> { "execute": "device_add", "arguments": { "driver": "e1000", "id": "net1" } }
302 (1) For detailed information about this command, please refer to the
303 'docs/qdev-device-use.txt' file.
305 (2) It's possible to list device properties by running QEMU with the
306 "-device DEVICE,\?" command-line argument, where DEVICE is the device's name
311 .name = "device_del",
313 .mhandler.cmd_new = qmp_marshal_input_device_del,
324 - "id": the device's ID (json-string)
328 -> { "execute": "device_del", "arguments": { "id": "net1" } }
335 .args_type = "keys:q,hold-time:i?",
336 .mhandler.cmd_new = qmp_marshal_input_send_key,
348 - "key": key sequence (a json-array of key union values,
349 union can be number or qcode enum)
351 - hold-time: time to delay key up events, milliseconds. Defaults to 100
356 -> { "execute": "send-key",
357 "arguments": { "keys": [ { "type": "qcode", "data": "ctrl" },
358 { "type": "qcode", "data": "alt" },
359 { "type": "qcode", "data": "delete" } ] } }
366 .args_type = "index:i",
367 .mhandler.cmd_new = qmp_marshal_input_cpu,
378 - "index": the CPU's index (json-int)
382 -> { "execute": "cpu", "arguments": { "index": 0 } }
385 Note: CPUs' indexes are obtained with the 'query-cpus' command.
392 .mhandler.cmd_new = qmp_marshal_input_cpu_add,
403 - "id": cpu id (json-int)
407 -> { "execute": "cpu-add", "arguments": { "id": 2 } }
414 .args_type = "val:l,size:i,filename:s,cpu:i?",
415 .mhandler.cmd_new = qmp_marshal_input_memsave,
422 Save to disk virtual memory dump starting at 'val' of size 'size'.
426 - "val": the starting address (json-int)
427 - "size": the memory size, in bytes (json-int)
428 - "filename": file path (json-string)
429 - "cpu": virtual CPU index (json-int, optional)
433 -> { "execute": "memsave",
434 "arguments": { "val": 10,
436 "filename": "/tmp/virtual-mem-dump" } }
443 .args_type = "val:l,size:i,filename:s",
444 .mhandler.cmd_new = qmp_marshal_input_pmemsave,
451 Save to disk physical memory dump starting at 'val' of size 'size'.
455 - "val": the starting address (json-int)
456 - "size": the memory size, in bytes (json-int)
457 - "filename": file path (json-string)
461 -> { "execute": "pmemsave",
462 "arguments": { "val": 10,
464 "filename": "/tmp/physical-mem-dump" } }
470 .name = "inject-nmi",
472 .mhandler.cmd_new = qmp_marshal_input_inject_nmi,
479 Inject an NMI on the default CPU (x86/s390) or all CPUs (ppc64).
485 -> { "execute": "inject-nmi" }
488 Note: inject-nmi fails when the guest doesn't support injecting.
493 .name = "ringbuf-write",
494 .args_type = "device:s,data:s,format:s?",
495 .mhandler.cmd_new = qmp_marshal_input_ringbuf_write,
502 Write to a ring buffer character device.
506 - "device": ring buffer character device name (json-string)
507 - "data": data to write (json-string)
508 - "format": data format (json-string, optional)
509 - Possible values: "utf8" (default), "base64"
510 Bug: invalid base64 is currently not rejected.
511 Whitespace *is* invalid.
515 -> { "execute": "ringbuf-write",
516 "arguments": { "device": "foo",
524 .name = "ringbuf-read",
525 .args_type = "device:s,size:i,format:s?",
526 .mhandler.cmd_new = qmp_marshal_input_ringbuf_read,
533 Read from a ring buffer character device.
537 - "device": ring buffer character device name (json-string)
538 - "size": how many bytes to read at most (json-int)
539 - Number of data bytes, not number of characters in encoded data
540 - "format": data format (json-string, optional)
541 - Possible values: "utf8" (default), "base64"
542 - Naturally, format "utf8" works only when the ring buffer
543 contains valid UTF-8 text. Invalid UTF-8 sequences get
544 replaced. Bug: replacement doesn't work. Bug: can screw
545 up on encountering NUL characters, after the ring buffer
546 lost data, and when reading stops because the size limit
551 -> { "execute": "ringbuf-read",
552 "arguments": { "device": "foo",
555 <- {"return": "abcdefgh"}
560 .name = "xen-save-devices-state",
561 .args_type = "filename:F",
562 .mhandler.cmd_new = qmp_marshal_input_xen_save_devices_state,
566 xen-save-devices-state
569 Save the state of all devices to file. The RAM and the block devices
570 of the VM are not saved by this command.
574 - "filename": the file to save the state of the devices to as binary
575 data. See xen-save-devices-state.txt for a description of the binary
580 -> { "execute": "xen-save-devices-state",
581 "arguments": { "filename": "/tmp/save" } }
587 .name = "xen-set-global-dirty-log",
588 .args_type = "enable:b",
589 .mhandler.cmd_new = qmp_marshal_input_xen_set_global_dirty_log,
593 xen-set-global-dirty-log
596 Enable or disable the global dirty log mode.
600 - "enable": Enable it or disable it.
604 -> { "execute": "xen-set-global-dirty-log",
605 "arguments": { "enable": true } }
612 .args_type = "detach:-d,blk:-b,inc:-i,uri:s",
613 .mhandler.cmd_new = qmp_marshal_input_migrate,
624 - "blk": block migration, full disk copy (json-bool, optional)
625 - "inc": incremental disk copy (json-bool, optional)
626 - "uri": Destination URI (json-string)
630 -> { "execute": "migrate", "arguments": { "uri": "tcp:0:4446" } }
635 (1) The 'query-migrate' command should be used to check migration's progress
636 and final result (this information is provided by the 'status' member)
637 (2) All boolean arguments default to false
638 (3) The user Monitor's "detach" argument is invalid in QMP and should not
644 .name = "migrate_cancel",
646 .mhandler.cmd_new = qmp_marshal_input_migrate_cancel,
653 Cancel the current migration.
659 -> { "execute": "migrate_cancel" }
665 .name = "migrate-incoming",
666 .args_type = "uri:s",
667 .mhandler.cmd_new = qmp_marshal_input_migrate_incoming,
674 Continue an incoming migration
678 - "uri": Source/listening URI (json-string)
682 -> { "execute": "migrate-incoming", "arguments": { "uri": "tcp::4446" } }
687 (1) QEMU must be started with -incoming defer to allow migrate-incoming to
689 (2) The uri format is the same as for -incoming
693 .name = "migrate-set-cache-size",
694 .args_type = "value:o",
695 .mhandler.cmd_new = qmp_marshal_input_migrate_set_cache_size,
699 migrate-set-cache-size
700 ----------------------
702 Set cache size to be used by XBZRLE migration, the cache size will be rounded
703 down to the nearest power of 2
707 - "value": cache size in bytes (json-int)
711 -> { "execute": "migrate-set-cache-size", "arguments": { "value": 536870912 } }
716 .name = "query-migrate-cache-size",
718 .mhandler.cmd_new = qmp_marshal_input_query_migrate_cache_size,
722 query-migrate-cache-size
723 ------------------------
725 Show cache size to be used by XBZRLE migration
727 returns a json-object with the following information:
732 -> { "execute": "query-migrate-cache-size" }
733 <- { "return": 67108864 }
738 .name = "migrate_set_speed",
739 .args_type = "value:o",
740 .mhandler.cmd_new = qmp_marshal_input_migrate_set_speed,
747 Set maximum speed for migrations.
751 - "value": maximum speed, in bytes per second (json-int)
755 -> { "execute": "migrate_set_speed", "arguments": { "value": 1024 } }
761 .name = "migrate_set_downtime",
762 .args_type = "value:T",
763 .mhandler.cmd_new = qmp_marshal_input_migrate_set_downtime,
770 Set maximum tolerated downtime (in seconds) for migrations.
774 - "value": maximum downtime (json-number)
778 -> { "execute": "migrate_set_downtime", "arguments": { "value": 0.1 } }
784 .name = "client_migrate_info",
785 .args_type = "protocol:s,hostname:s,port:i?,tls-port:i?,cert-subject:s?",
786 .params = "protocol hostname port tls-port cert-subject",
787 .help = "set migration information for remote display",
788 .mhandler.cmd_new = qmp_marshal_input_client_migrate_info,
795 Set migration information for remote display. This makes the server
796 ask the client to automatically reconnect using the new parameters
797 once migration finished successfully. Only implemented for SPICE.
801 - "protocol": must be "spice" (json-string)
802 - "hostname": migration target hostname (json-string)
803 - "port": spice tcp port for plaintext channels (json-int, optional)
804 - "tls-port": spice tcp port for tls-secured channels (json-int, optional)
805 - "cert-subject": server certificate subject (json-string, optional)
809 -> { "execute": "client_migrate_info",
810 "arguments": { "protocol": "spice",
811 "hostname": "virt42.lab.kraxel.org",
818 .name = "dump-guest-memory",
819 .args_type = "paging:b,protocol:s,begin:i?,end:i?,format:s?",
820 .params = "-p protocol [begin] [length] [format]",
821 .help = "dump guest memory to file",
822 .mhandler.cmd_new = qmp_marshal_input_dump_guest_memory,
829 Dump guest memory to file. The file can be processed with crash or gdb.
833 - "paging": do paging to get guest's memory mapping (json-bool)
834 - "protocol": destination file(started with "file:") or destination file
835 descriptor (started with "fd:") (json-string)
836 - "begin": the starting physical address. It's optional, and should be specified
837 with length together (json-int)
838 - "length": the memory size, in bytes. It's optional, and should be specified
839 with begin together (json-int)
840 - "format": the format of guest memory dump. It's optional, and can be
841 elf|kdump-zlib|kdump-lzo|kdump-snappy, but non-elf formats will
842 conflict with paging and filter, ie. begin and length (json-string)
846 -> { "execute": "dump-guest-memory", "arguments": { "protocol": "fd:dump" } }
851 (1) All boolean arguments default to false
856 .name = "query-dump-guest-memory-capability",
858 .mhandler.cmd_new = qmp_marshal_input_query_dump_guest_memory_capability,
862 query-dump-guest-memory-capability
865 Show available formats for 'dump-guest-memory'
869 -> { "execute": "query-dump-guest-memory-capability" }
870 <- { "return": { "formats":
871 ["elf", "kdump-zlib", "kdump-lzo", "kdump-snappy"] }
876 .name = "netdev_add",
877 .args_type = "netdev:O",
878 .mhandler.cmd_new = qmp_netdev_add,
885 Add host network device.
889 - "type": the device type, "tap", "user", ... (json-string)
890 - "id": the device's ID, must be unique (json-string)
895 -> { "execute": "netdev_add", "arguments": { "type": "user", "id": "netdev1" } }
898 Note: The supported device options are the same ones supported by the '-netdev'
899 command-line argument, which are listed in the '-help' output or QEMU's
905 .name = "netdev_del",
907 .mhandler.cmd_new = qmp_marshal_input_netdev_del,
914 Remove host network device.
918 - "id": the device's ID, must be unique (json-string)
922 -> { "execute": "netdev_del", "arguments": { "id": "netdev1" } }
929 .name = "object-add",
930 .args_type = "qom-type:s,id:s,props:q?",
931 .mhandler.cmd_new = qmp_object_add,
942 - "qom-type": the object's QOM type, i.e. the class name (json-string)
943 - "id": the object's ID, must be unique (json-string)
944 - "props": a dictionary of object property values (optional, json-dict)
948 -> { "execute": "object-add", "arguments": { "qom-type": "rng-random", "id": "rng1",
949 "props": { "filename": "/dev/hwrng" } } }
955 .name = "object-del",
957 .mhandler.cmd_new = qmp_marshal_input_object_del,
968 - "id": the object's ID (json-string)
972 -> { "execute": "object-del", "arguments": { "id": "rng1" } }
980 .name = "block_resize",
981 .args_type = "device:s?,node-name:s?,size:o",
982 .mhandler.cmd_new = qmp_marshal_input_block_resize,
989 Resize a block image while a guest is running.
993 - "device": the device's ID, must be unique (json-string)
994 - "node-name": the node name in the block driver state graph (json-string)
999 -> { "execute": "block_resize", "arguments": { "device": "scratch", "size": 1073741824 } }
1005 .name = "block-stream",
1006 .args_type = "device:B,base:s?,speed:o?,backing-file:s?,on-error:s?",
1007 .mhandler.cmd_new = qmp_marshal_input_block_stream,
1014 Copy data from a backing file into a block device.
1018 - "device": The device's ID, must be unique (json-string)
1019 - "base": The file name of the backing image above which copying starts
1020 (json-string, optional)
1021 - "backing-file": The backing file string to write into the active layer. This
1022 filename is not validated.
1024 If a pathname string is such that it cannot be resolved by
1025 QEMU, that means that subsequent QMP or HMP commands must use
1026 node-names for the image in question, as filename lookup
1029 If not specified, QEMU will automatically determine the
1030 backing file string to use, or error out if there is no
1031 obvious choice. Care should be taken when specifying the
1032 string, to specify a valid filename or protocol.
1033 (json-string, optional) (Since 2.1)
1034 - "speed": the maximum speed, in bytes per second (json-int, optional)
1035 - "on-error": the action to take on an error (default 'report'). 'stop' and
1036 'enospc' can only be used if the block device supports io-status.
1037 (json-string, optional) (Since 2.1)
1041 -> { "execute": "block-stream", "arguments": { "device": "virtio0",
1042 "base": "/tmp/master.qcow2" } }
1048 .name = "block-commit",
1049 .args_type = "device:B,base:s?,top:s?,backing-file:s?,speed:o?",
1050 .mhandler.cmd_new = qmp_marshal_input_block_commit,
1057 Live commit of data from overlay image nodes into backing nodes - i.e., writes
1058 data between 'top' and 'base' into 'base'.
1062 - "device": The device's ID, must be unique (json-string)
1063 - "base": The file name of the backing image to write data into.
1064 If not specified, this is the deepest backing image
1065 (json-string, optional)
1066 - "top": The file name of the backing image within the image chain,
1067 which contains the topmost data to be committed down. If
1068 not specified, this is the active layer. (json-string, optional)
1070 - backing-file: The backing file string to write into the overlay
1071 image of 'top'. If 'top' is the active layer,
1072 specifying a backing file string is an error. This
1073 filename is not validated.
1075 If a pathname string is such that it cannot be
1076 resolved by QEMU, that means that subsequent QMP or
1077 HMP commands must use node-names for the image in
1078 question, as filename lookup methods will fail.
1080 If not specified, QEMU will automatically determine
1081 the backing file string to use, or error out if
1082 there is no obvious choice. Care should be taken
1083 when specifying the string, to specify a valid
1084 filename or protocol.
1085 (json-string, optional) (Since 2.1)
1087 If top == base, that is an error.
1088 If top == active, the job will not be completed by itself,
1089 user needs to complete the job with the block-job-complete
1090 command after getting the ready event. (Since 2.0)
1092 If the base image is smaller than top, then the base image
1093 will be resized to be the same size as top. If top is
1094 smaller than the base image, the base will not be
1095 truncated. If you want the base image size to match the
1096 size of the smaller top, you can safely truncate it
1097 yourself once the commit operation successfully completes.
1099 - "speed": the maximum speed, in bytes per second (json-int, optional)
1104 -> { "execute": "block-commit", "arguments": { "device": "virtio0",
1105 "top": "/tmp/snap1.qcow2" } }
1111 .name = "drive-backup",
1112 .args_type = "sync:s,device:B,target:s,speed:i?,mode:s?,format:s?,"
1113 "bitmap:s?,on-source-error:s?,on-target-error:s?",
1114 .mhandler.cmd_new = qmp_marshal_input_drive_backup,
1121 Start a point-in-time copy of a block device to a new destination. The
1122 status of ongoing drive-backup operations can be checked with
1123 query-block-jobs where the BlockJobInfo.type field has the value 'backup'.
1124 The operation can be stopped before it has completed using the
1125 block-job-cancel command.
1129 - "device": the name of the device which should be copied.
1131 - "target": the target of the new image. If the file exists, or if it is a
1132 device, the existing file/device will be used as the new
1133 destination. If it does not exist, a new file will be created.
1135 - "format": the format of the new destination, default is to probe if 'mode' is
1136 'existing', else the format of the source
1137 (json-string, optional)
1138 - "sync": what parts of the disk image should be copied to the destination;
1139 possibilities include "full" for all the disk, "top" for only the sectors
1140 allocated in the topmost image, "incremental" for only the dirty sectors in
1141 the bitmap, or "none" to only replicate new I/O (MirrorSyncMode).
1142 - "bitmap": dirty bitmap name for sync==incremental. Must be present if sync
1143 is "incremental", must NOT be present otherwise.
1144 - "mode": whether and how QEMU should create a new image
1145 (NewImageMode, optional, default 'absolute-paths')
1146 - "speed": the maximum speed, in bytes per second (json-int, optional)
1147 - "on-source-error": the action to take on an error on the source, default
1148 'report'. 'stop' and 'enospc' can only be used
1149 if the block device supports io-status.
1150 (BlockdevOnError, optional)
1151 - "on-target-error": the action to take on an error on the target, default
1152 'report' (no limitations, since this applies to
1153 a different block device than device).
1154 (BlockdevOnError, optional)
1157 -> { "execute": "drive-backup", "arguments": { "device": "drive0",
1159 "target": "backup.img" } }
1165 .name = "blockdev-backup",
1166 .args_type = "sync:s,device:B,target:B,speed:i?,"
1167 "on-source-error:s?,on-target-error:s?",
1168 .mhandler.cmd_new = qmp_marshal_input_blockdev_backup,
1175 The device version of drive-backup: this command takes an existing named device
1180 - "device": the name of the device which should be copied.
1182 - "target": the name of the backup target device. (json-string)
1183 - "sync": what parts of the disk image should be copied to the destination;
1184 possibilities include "full" for all the disk, "top" for only the
1185 sectors allocated in the topmost image, or "none" to only replicate
1186 new I/O (MirrorSyncMode).
1187 - "speed": the maximum speed, in bytes per second (json-int, optional)
1188 - "on-source-error": the action to take on an error on the source, default
1189 'report'. 'stop' and 'enospc' can only be used
1190 if the block device supports io-status.
1191 (BlockdevOnError, optional)
1192 - "on-target-error": the action to take on an error on the target, default
1193 'report' (no limitations, since this applies to
1194 a different block device than device).
1195 (BlockdevOnError, optional)
1198 -> { "execute": "blockdev-backup", "arguments": { "device": "src-id",
1200 "target": "tgt-id" } }
1206 .name = "block-job-set-speed",
1207 .args_type = "device:B,speed:o",
1208 .mhandler.cmd_new = qmp_marshal_input_block_job_set_speed,
1212 .name = "block-job-cancel",
1213 .args_type = "device:B,force:b?",
1214 .mhandler.cmd_new = qmp_marshal_input_block_job_cancel,
1217 .name = "block-job-pause",
1218 .args_type = "device:B",
1219 .mhandler.cmd_new = qmp_marshal_input_block_job_pause,
1222 .name = "block-job-resume",
1223 .args_type = "device:B",
1224 .mhandler.cmd_new = qmp_marshal_input_block_job_resume,
1227 .name = "block-job-complete",
1228 .args_type = "device:B",
1229 .mhandler.cmd_new = qmp_marshal_input_block_job_complete,
1232 .name = "transaction",
1233 .args_type = "actions:q",
1234 .mhandler.cmd_new = qmp_marshal_input_transaction,
1241 Atomically operate on one or more block devices. The only supported operations
1242 for now are drive-backup, internal and external snapshotting. A list of
1243 dictionaries is accepted, that contains the actions to be performed.
1244 If there is any failure performing any of the operations, all operations
1245 for the group are abandoned.
1247 For external snapshots, the dictionary contains the device, the file to use for
1248 the new snapshot, and the format. The default format, if not specified, is
1251 Each new snapshot defaults to being created by QEMU (wiping any
1252 contents if the file already exists), but it is also possible to reuse
1253 an externally-created file. In the latter case, you should ensure that
1254 the new image file has the same contents as the current one; QEMU cannot
1255 perform any meaningful check. Typically this is achieved by using the
1256 current image file as the backing file for the new image.
1258 On failure, the original disks pre-snapshot attempt will be used.
1260 For internal snapshots, the dictionary contains the device and the snapshot's
1261 name. If an internal snapshot matching name already exists, the request will
1262 be rejected. Only some image formats support it, for example, qcow2, rbd,
1265 On failure, qemu will try delete the newly created internal snapshot in the
1266 transaction. When an I/O error occurs during deletion, the user needs to fix
1267 it later with qemu-img or other command.
1272 - "type": the operation to perform. The only supported
1273 value is "blockdev-snapshot-sync". (json-string)
1274 - "data": a dictionary. The contents depend on the value
1275 of "type". When "type" is "blockdev-snapshot-sync":
1276 - "device": device name to snapshot (json-string)
1277 - "node-name": graph node name to snapshot (json-string)
1278 - "snapshot-file": name of new image file (json-string)
1279 - "snapshot-node-name": graph node name of the new snapshot (json-string)
1280 - "format": format of new image (json-string, optional)
1281 - "mode": whether and how QEMU should create the snapshot file
1282 (NewImageMode, optional, default "absolute-paths")
1283 When "type" is "blockdev-snapshot-internal-sync":
1284 - "device": device name to snapshot (json-string)
1285 - "name": name of the new snapshot (json-string)
1289 -> { "execute": "transaction",
1290 "arguments": { "actions": [
1291 { "type": "blockdev-snapshot-sync", "data" : { "device": "ide-hd0",
1292 "snapshot-file": "/some/place/my-image",
1293 "format": "qcow2" } },
1294 { "type": "blockdev-snapshot-sync", "data" : { "node-name": "myfile",
1295 "snapshot-file": "/some/place/my-image2",
1296 "snapshot-node-name": "node3432",
1298 "format": "qcow2" } },
1299 { "type": "blockdev-snapshot-sync", "data" : { "device": "ide-hd1",
1300 "snapshot-file": "/some/place/my-image2",
1302 "format": "qcow2" } },
1303 { "type": "blockdev-snapshot-internal-sync", "data" : {
1304 "device": "ide-hd2",
1305 "name": "snapshot0" } } ] } }
1311 .name = "block-dirty-bitmap-add",
1312 .args_type = "node:B,name:s,granularity:i?",
1313 .mhandler.cmd_new = qmp_marshal_input_block_dirty_bitmap_add,
1318 block-dirty-bitmap-add
1319 ----------------------
1322 Create a dirty bitmap with a name on the device, and start tracking the writes.
1326 - "node": device/node on which to create dirty bitmap (json-string)
1327 - "name": name of the new dirty bitmap (json-string)
1328 - "granularity": granularity to track writes with (int, optional)
1332 -> { "execute": "block-dirty-bitmap-add", "arguments": { "node": "drive0",
1333 "name": "bitmap0" } }
1339 .name = "block-dirty-bitmap-remove",
1340 .args_type = "node:B,name:s",
1341 .mhandler.cmd_new = qmp_marshal_input_block_dirty_bitmap_remove,
1346 block-dirty-bitmap-remove
1347 -------------------------
1350 Stop write tracking and remove the dirty bitmap that was created with
1351 block-dirty-bitmap-add.
1355 - "node": device/node on which to remove dirty bitmap (json-string)
1356 - "name": name of the dirty bitmap to remove (json-string)
1360 -> { "execute": "block-dirty-bitmap-remove", "arguments": { "node": "drive0",
1361 "name": "bitmap0" } }
1367 .name = "block-dirty-bitmap-clear",
1368 .args_type = "node:B,name:s",
1369 .mhandler.cmd_new = qmp_marshal_input_block_dirty_bitmap_clear,
1374 block-dirty-bitmap-clear
1375 ------------------------
1378 Reset the dirty bitmap associated with a node so that an incremental backup
1379 from this point in time forward will only backup clusters modified after this
1384 - "node": device/node on which to remove dirty bitmap (json-string)
1385 - "name": name of the dirty bitmap to remove (json-string)
1389 -> { "execute": "block-dirty-bitmap-clear", "arguments": { "node": "drive0",
1390 "name": "bitmap0" } }
1396 .name = "blockdev-snapshot-sync",
1397 .args_type = "device:s?,node-name:s?,snapshot-file:s,snapshot-node-name:s?,format:s?,mode:s?",
1398 .mhandler.cmd_new = qmp_marshal_input_blockdev_snapshot_sync,
1402 blockdev-snapshot-sync
1403 ----------------------
1405 Synchronous snapshot of a block device. snapshot-file specifies the
1406 target of the new image. If the file exists, or if it is a device, the
1407 snapshot will be created in the existing file/device. If does not
1408 exist, a new file will be created. format specifies the format of the
1409 snapshot image, default is qcow2.
1413 - "device": device name to snapshot (json-string)
1414 - "node-name": graph node name to snapshot (json-string)
1415 - "snapshot-file": name of new image file (json-string)
1416 - "snapshot-node-name": graph node name of the new snapshot (json-string)
1417 - "mode": whether and how QEMU should create the snapshot file
1418 (NewImageMode, optional, default "absolute-paths")
1419 - "format": format of new image (json-string, optional)
1423 -> { "execute": "blockdev-snapshot-sync", "arguments": { "device": "ide-hd0",
1425 "/some/place/my-image",
1426 "format": "qcow2" } }
1432 .name = "blockdev-snapshot-internal-sync",
1433 .args_type = "device:B,name:s",
1434 .mhandler.cmd_new = qmp_marshal_input_blockdev_snapshot_internal_sync,
1438 blockdev-snapshot-internal-sync
1439 -------------------------------
1441 Synchronously take an internal snapshot of a block device when the format of
1442 image used supports it. If the name is an empty string, or a snapshot with
1443 name already exists, the operation will fail.
1447 - "device": device name to snapshot (json-string)
1448 - "name": name of the new snapshot (json-string)
1452 -> { "execute": "blockdev-snapshot-internal-sync",
1453 "arguments": { "device": "ide-hd0",
1454 "name": "snapshot0" }
1461 .name = "blockdev-snapshot-delete-internal-sync",
1462 .args_type = "device:B,id:s?,name:s?",
1464 qmp_marshal_input_blockdev_snapshot_delete_internal_sync,
1468 blockdev-snapshot-delete-internal-sync
1469 --------------------------------------
1471 Synchronously delete an internal snapshot of a block device when the format of
1472 image used supports it. The snapshot is identified by name or id or both. One
1473 of name or id is required. If the snapshot is not found, the operation will
1478 - "device": device name (json-string)
1479 - "id": ID of the snapshot (json-string, optional)
1480 - "name": name of the snapshot (json-string, optional)
1484 -> { "execute": "blockdev-snapshot-delete-internal-sync",
1485 "arguments": { "device": "ide-hd0",
1486 "name": "snapshot0" }
1490 "name": "snapshot0",
1492 "date-sec": 1000012,
1494 "vm-clock-sec": 100,
1502 .name = "drive-mirror",
1503 .args_type = "sync:s,device:B,target:s,speed:i?,mode:s?,format:s?,"
1504 "node-name:s?,replaces:s?,"
1505 "on-source-error:s?,on-target-error:s?,"
1506 "granularity:i?,buf-size:i?",
1507 .mhandler.cmd_new = qmp_marshal_input_drive_mirror,
1514 Start mirroring a block device's writes to a new destination. target
1515 specifies the target of the new image. If the file exists, or if it is
1516 a device, it will be used as the new destination for writes. If it does not
1517 exist, a new file will be created. format specifies the format of the
1518 mirror image, default is to probe if mode='existing', else the format
1523 - "device": device name to operate on (json-string)
1524 - "target": name of new image file (json-string)
1525 - "format": format of new image (json-string, optional)
1526 - "node-name": the name of the new block driver state in the node graph
1527 (json-string, optional)
1528 - "replaces": the block driver node name to replace when finished
1529 (json-string, optional)
1530 - "mode": how an image file should be created into the target
1531 file/device (NewImageMode, optional, default 'absolute-paths')
1532 - "speed": maximum speed of the streaming job, in bytes per second
1534 - "granularity": granularity of the dirty bitmap, in bytes (json-int, optional)
1535 - "buf_size": maximum amount of data in flight from source to target, in bytes
1536 (json-int, default 10M)
1537 - "sync": what parts of the disk image should be copied to the destination;
1538 possibilities include "full" for all the disk, "top" for only the sectors
1539 allocated in the topmost image, or "none" to only replicate new I/O
1541 - "on-source-error": the action to take on an error on the source
1542 (BlockdevOnError, default 'report')
1543 - "on-target-error": the action to take on an error on the target
1544 (BlockdevOnError, default 'report')
1546 The default value of the granularity is the image cluster size clamped
1547 between 4096 and 65536, if the image format defines one. If the format
1548 does not define a cluster size, the default value of the granularity
1554 -> { "execute": "drive-mirror", "arguments": { "device": "ide-hd0",
1555 "target": "/some/place/my-image",
1557 "format": "qcow2" } }
1563 .name = "change-backing-file",
1564 .args_type = "device:s,image-node-name:s,backing-file:s",
1565 .mhandler.cmd_new = qmp_marshal_input_change_backing_file,
1573 Change the backing file in the image file metadata. This does not cause
1574 QEMU to reopen the image file to reparse the backing filename (it may,
1575 however, perform a reopen to change permissions from r/o -> r/w -> r/o,
1576 if needed). The new backing file string is written into the image file
1577 metadata, and the QEMU internal strings are updated.
1581 - "image-node-name": The name of the block driver state node of the
1582 image to modify. The "device" is argument is used to
1583 verify "image-node-name" is in the chain described by
1585 (json-string, optional)
1587 - "device": The name of the device.
1590 - "backing-file": The string to write as the backing file. This string is
1591 not validated, so care should be taken when specifying
1592 the string or the image chain may not be able to be
1596 Returns: Nothing on success
1597 If "device" does not exist or cannot be determined, DeviceNotFound
1603 .args_type = "value:M",
1604 .mhandler.cmd_new = qmp_marshal_input_balloon,
1611 Request VM to change its memory allocation (in bytes).
1615 - "value": New memory allocation (json-int)
1619 -> { "execute": "balloon", "arguments": { "value": 536870912 } }
1626 .args_type = "name:s,up:b",
1627 .mhandler.cmd_new = qmp_marshal_input_set_link,
1634 Change the link status of a network adapter.
1638 - "name": network device name (json-string)
1639 - "up": status is up (json-bool)
1643 -> { "execute": "set_link", "arguments": { "name": "e1000.0", "up": false } }
1650 .args_type = "fdname:s",
1651 .params = "getfd name",
1652 .help = "receive a file descriptor via SCM rights and assign it a name",
1653 .mhandler.cmd_new = qmp_marshal_input_getfd,
1660 Receive a file descriptor via SCM rights and assign it a name.
1664 - "fdname": file descriptor name (json-string)
1668 -> { "execute": "getfd", "arguments": { "fdname": "fd1" } }
1673 (1) If the name specified by the "fdname" argument already exists,
1674 the file descriptor assigned to it will be closed and replaced
1675 by the received file descriptor.
1676 (2) The 'closefd' command can be used to explicitly close the file
1677 descriptor when it is no longer needed.
1683 .args_type = "fdname:s",
1684 .params = "closefd name",
1685 .help = "close a file descriptor previously passed via SCM rights",
1686 .mhandler.cmd_new = qmp_marshal_input_closefd,
1693 Close a file descriptor previously passed via SCM rights.
1697 - "fdname": file descriptor name (json-string)
1701 -> { "execute": "closefd", "arguments": { "fdname": "fd1" } }
1708 .args_type = "fdset-id:i?,opaque:s?",
1709 .params = "add-fd fdset-id opaque",
1710 .help = "Add a file descriptor, that was passed via SCM rights, to an fd set",
1711 .mhandler.cmd_new = qmp_marshal_input_add_fd,
1718 Add a file descriptor, that was passed via SCM rights, to an fd set.
1722 - "fdset-id": The ID of the fd set to add the file descriptor to.
1723 (json-int, optional)
1724 - "opaque": A free-form string that can be used to describe the fd.
1725 (json-string, optional)
1727 Return a json-object with the following information:
1729 - "fdset-id": The ID of the fd set that the fd was added to. (json-int)
1730 - "fd": The file descriptor that was received via SCM rights and added to the
1735 -> { "execute": "add-fd", "arguments": { "fdset-id": 1 } }
1736 <- { "return": { "fdset-id": 1, "fd": 3 } }
1740 (1) The list of fd sets is shared by all monitor connections.
1741 (2) If "fdset-id" is not specified, a new fd set will be created.
1746 .name = "remove-fd",
1747 .args_type = "fdset-id:i,fd:i?",
1748 .params = "remove-fd fdset-id fd",
1749 .help = "Remove a file descriptor from an fd set",
1750 .mhandler.cmd_new = qmp_marshal_input_remove_fd,
1757 Remove a file descriptor from an fd set.
1761 - "fdset-id": The ID of the fd set that the file descriptor belongs to.
1763 - "fd": The file descriptor that is to be removed. (json-int, optional)
1767 -> { "execute": "remove-fd", "arguments": { "fdset-id": 1, "fd": 3 } }
1772 (1) The list of fd sets is shared by all monitor connections.
1773 (2) If "fd" is not specified, all file descriptors in "fdset-id" will be
1779 .name = "query-fdsets",
1781 .help = "Return information describing all fd sets",
1782 .mhandler.cmd_new = qmp_marshal_input_query_fdsets,
1789 Return information describing all fd sets.
1795 -> { "execute": "query-fdsets" }
1801 "opaque": "rdonly:/path/to/file"
1805 "opaque": "rdwr:/path/to/file"
1824 Note: The list of fd sets is shared by all monitor connections.
1829 .name = "block_passwd",
1830 .args_type = "device:s?,node-name:s?,password:s",
1831 .mhandler.cmd_new = qmp_marshal_input_block_passwd,
1838 Set the password of encrypted block devices.
1842 - "device": device name (json-string)
1843 - "node-name": name in the block driver state graph (json-string)
1844 - "password": password (json-string)
1848 -> { "execute": "block_passwd", "arguments": { "device": "ide0-hd0",
1849 "password": "12345" } }
1855 .name = "block_set_io_throttle",
1856 .args_type = "device:B,bps:l,bps_rd:l,bps_wr:l,iops:l,iops_rd:l,iops_wr:l,bps_max:l?,bps_rd_max:l?,bps_wr_max:l?,iops_max:l?,iops_rd_max:l?,iops_wr_max:l?,iops_size:l?,group:s?",
1857 .mhandler.cmd_new = qmp_marshal_input_block_set_io_throttle,
1861 block_set_io_throttle
1864 Change I/O throttle limits for a block drive.
1868 - "device": device name (json-string)
1869 - "bps": total throughput limit in bytes per second (json-int)
1870 - "bps_rd": read throughput limit in bytes per second (json-int)
1871 - "bps_wr": write throughput limit in bytes per second (json-int)
1872 - "iops": total I/O operations per second (json-int)
1873 - "iops_rd": read I/O operations per second (json-int)
1874 - "iops_wr": write I/O operations per second (json-int)
1875 - "bps_max": total max in bytes (json-int)
1876 - "bps_rd_max": read max in bytes (json-int)
1877 - "bps_wr_max": write max in bytes (json-int)
1878 - "iops_max": total I/O operations max (json-int)
1879 - "iops_rd_max": read I/O operations max (json-int)
1880 - "iops_wr_max": write I/O operations max (json-int)
1881 - "iops_size": I/O size in bytes when limiting (json-int)
1882 - "group": throttle group name (json-string)
1886 -> { "execute": "block_set_io_throttle", "arguments": { "device": "virtio0",
1905 .name = "set_password",
1906 .args_type = "protocol:s,password:s,connected:s?",
1907 .mhandler.cmd_new = qmp_marshal_input_set_password,
1914 Set the password for vnc/spice protocols.
1918 - "protocol": protocol name (json-string)
1919 - "password": password (json-string)
1920 - "connected": [ keep | disconnect | fail ] (json-string, optional)
1924 -> { "execute": "set_password", "arguments": { "protocol": "vnc",
1925 "password": "secret" } }
1931 .name = "expire_password",
1932 .args_type = "protocol:s,time:s",
1933 .mhandler.cmd_new = qmp_marshal_input_expire_password,
1940 Set the password expire time for vnc/spice protocols.
1944 - "protocol": protocol name (json-string)
1945 - "time": [ now | never | +secs | secs ] (json-string)
1949 -> { "execute": "expire_password", "arguments": { "protocol": "vnc",
1956 .name = "add_client",
1957 .args_type = "protocol:s,fdname:s,skipauth:b?,tls:b?",
1958 .mhandler.cmd_new = qmp_marshal_input_add_client,
1965 Add a graphics client
1969 - "protocol": protocol name (json-string)
1970 - "fdname": file descriptor name (json-string)
1971 - "skipauth": whether to skip authentication (json-bool, optional)
1972 - "tls": whether to perform TLS (json-bool, optional)
1976 -> { "execute": "add_client", "arguments": { "protocol": "vnc",
1977 "fdname": "myclient" } }
1982 .name = "qmp_capabilities",
1985 .help = "enable QMP capabilities",
1986 .mhandler.cmd_new = qmp_capabilities,
1993 Enable QMP capabilities.
1999 -> { "execute": "qmp_capabilities" }
2002 Note: This command must be issued before issuing any other command.
2007 .name = "human-monitor-command",
2008 .args_type = "command-line:s,cpu-index:i?",
2009 .mhandler.cmd_new = qmp_marshal_input_human_monitor_command,
2013 human-monitor-command
2014 ---------------------
2016 Execute a Human Monitor command.
2020 - command-line: the command name and its arguments, just like the
2021 Human Monitor's shell (json-string)
2022 - cpu-index: select the CPU number to be used by commands which access CPU
2023 data, like 'info registers'. The Monitor selects CPU 0 if this
2024 argument is not provided (json-int, optional)
2028 -> { "execute": "human-monitor-command", "arguments": { "command-line": "info kvm" } }
2029 <- { "return": "kvm support: enabled\r\n" }
2033 (1) The Human Monitor is NOT an stable interface, this means that command
2034 names, arguments and responses can change or be removed at ANY time.
2035 Applications that rely on long term stability guarantees should NOT
2040 o This command is stateless, this means that commands that depend
2041 on state information (such as getfd) might not work
2043 o Commands that prompt the user for data (eg. 'cont' when the block
2044 device is encrypted) don't currently work
2049 HXCOMM Each query command below is inside a SQMP/EQMP section, do NOT change
2050 HXCOMM this! We will possibly move query commands definitions inside those
2051 HXCOMM sections, just like regular commands.
2061 Return a json-object with the following information:
2063 - "qemu": A json-object containing three integer values:
2064 - "major": QEMU's major version (json-int)
2065 - "minor": QEMU's minor version (json-int)
2066 - "micro": QEMU's micro version (json-int)
2067 - "package": package's version (json-string)
2071 -> { "execute": "query-version" }
2086 .name = "query-version",
2088 .mhandler.cmd_new = qmp_marshal_input_query_version,
2095 List QMP available commands.
2097 Each command is represented by a json-object, the returned value is a json-array
2100 Each json-object contain:
2102 - "name": command's name (json-string)
2106 -> { "execute": "query-commands" }
2110 "name":"query-balloon"
2113 "name":"system_powerdown"
2118 Note: This example has been shortened as the real response is too long.
2123 .name = "query-commands",
2125 .mhandler.cmd_new = qmp_marshal_input_query_commands,
2132 List QMP available events.
2134 Each event is represented by a json-object, the returned value is a json-array
2137 Each json-object contains:
2139 - "name": event's name (json-string)
2143 -> { "execute": "query-events" }
2155 Note: This example has been shortened as the real response is too long.
2160 .name = "query-events",
2162 .mhandler.cmd_new = qmp_marshal_input_query_events,
2169 Each device is represented by a json-object. The returned value is a json-array
2172 Each json-object contain the following:
2174 - "label": device's label (json-string)
2175 - "filename": device's file (json-string)
2176 - "frontend-open": open/closed state of the frontend device attached to this
2181 -> { "execute": "query-chardev" }
2185 "label": "charchannel0",
2186 "filename": "unix:/var/lib/libvirt/qemu/seabios.rhel6.agent,server",
2187 "frontend-open": false
2190 "label": "charmonitor",
2191 "filename": "unix:/var/lib/libvirt/qemu/seabios.rhel6.monitor,server",
2192 "frontend-open": true
2195 "label": "charserial0",
2196 "filename": "pty:/dev/pts/2",
2197 "frontend-open": true
2205 .name = "query-chardev",
2207 .mhandler.cmd_new = qmp_marshal_input_query_chardev,
2211 query-chardev-backends
2214 List available character device backends.
2216 Each backend is represented by a json-object, the returned value is a json-array
2219 Each json-object contains:
2221 - "name": backend name (json-string)
2225 -> { "execute": "query-chardev-backends" }
2246 .name = "query-chardev-backends",
2248 .mhandler.cmd_new = qmp_marshal_input_query_chardev_backends,
2255 Show the block devices.
2257 Each block device information is stored in a json-object and the returned value
2258 is a json-array of all devices.
2260 Each json-object contain the following:
2262 - "device": device name (json-string)
2263 - "type": device type (json-string)
2264 - deprecated, retained for backward compatibility
2265 - Possible values: "unknown"
2266 - "removable": true if the device is removable, false otherwise (json-bool)
2267 - "locked": true if the device is locked, false otherwise (json-bool)
2268 - "tray_open": only present if removable, true if the device has a tray,
2269 and it is open (json-bool)
2270 - "inserted": only present if the device is inserted, it is a json-object
2271 containing the following:
2272 - "file": device file name (json-string)
2273 - "ro": true if read-only, false otherwise (json-bool)
2274 - "drv": driver format name (json-string)
2275 - Possible values: "blkdebug", "bochs", "cloop", "dmg",
2276 "file", "file", "ftp", "ftps", "host_cdrom",
2277 "host_device", "http", "https",
2278 "nbd", "parallels", "qcow", "qcow2", "raw",
2279 "tftp", "vdi", "vmdk", "vpc", "vvfat"
2280 - "backing_file": backing file name (json-string, optional)
2281 - "backing_file_depth": number of files in the backing file chain (json-int)
2282 - "encrypted": true if encrypted, false otherwise (json-bool)
2283 - "bps": limit total bytes per second (json-int)
2284 - "bps_rd": limit read bytes per second (json-int)
2285 - "bps_wr": limit write bytes per second (json-int)
2286 - "iops": limit total I/O operations per second (json-int)
2287 - "iops_rd": limit read operations per second (json-int)
2288 - "iops_wr": limit write operations per second (json-int)
2289 - "bps_max": total max in bytes (json-int)
2290 - "bps_rd_max": read max in bytes (json-int)
2291 - "bps_wr_max": write max in bytes (json-int)
2292 - "iops_max": total I/O operations max (json-int)
2293 - "iops_rd_max": read I/O operations max (json-int)
2294 - "iops_wr_max": write I/O operations max (json-int)
2295 - "iops_size": I/O size when limiting by iops (json-int)
2296 - "detect_zeroes": detect and optimize zero writing (json-string)
2297 - Possible values: "off", "on", "unmap"
2298 - "write_threshold": write offset threshold in bytes, a event will be
2299 emitted if crossed. Zero if disabled (json-int)
2300 - "image": the detail of the image, it is a json-object containing
2302 - "filename": image file name (json-string)
2303 - "format": image format (json-string)
2304 - "virtual-size": image capacity in bytes (json-int)
2305 - "dirty-flag": true if image is not cleanly closed, not present
2306 means clean (json-bool, optional)
2307 - "actual-size": actual size on disk in bytes of the image, not
2308 present when image does not support thin
2309 provision (json-int, optional)
2310 - "cluster-size": size of a cluster in bytes, not present if image
2311 format does not support it (json-int, optional)
2312 - "encrypted": true if the image is encrypted, not present means
2313 false or the image format does not support
2314 encryption (json-bool, optional)
2315 - "backing_file": backing file name, not present means no backing
2316 file is used or the image format does not
2317 support backing file chain
2318 (json-string, optional)
2319 - "full-backing-filename": full path of the backing file, not
2320 present if it equals backing_file or no
2321 backing file is used
2322 (json-string, optional)
2323 - "backing-filename-format": the format of the backing file, not
2324 present means unknown or no backing
2325 file (json-string, optional)
2326 - "snapshots": the internal snapshot info, it is an optional list
2327 of json-object containing the following:
2328 - "id": unique snapshot id (json-string)
2329 - "name": snapshot name (json-string)
2330 - "vm-state-size": size of the VM state in bytes (json-int)
2331 - "date-sec": UTC date of the snapshot in seconds (json-int)
2332 - "date-nsec": fractional part in nanoseconds to be used with
2334 - "vm-clock-sec": VM clock relative to boot in seconds
2336 - "vm-clock-nsec": fractional part in nanoseconds to be used
2337 with vm-clock-sec (json-int)
2338 - "backing-image": the detail of the backing image, it is an
2339 optional json-object only present when a
2340 backing image present for this image
2342 - "io-status": I/O operation status, only present if the device supports it
2343 and the VM is configured to stop on errors. It's always reset
2344 to "ok" when the "cont" command is issued (json_string, optional)
2345 - Possible values: "ok", "failed", "nospace"
2349 -> { "execute": "query-block" }
2354 "device":"ide0-hd0",
2361 "file":"disks/test.qcow2",
2362 "backing_file_depth":1,
2376 "detect_zeroes": "on",
2377 "write_threshold": 0,
2379 "filename":"disks/test.qcow2",
2381 "virtual-size":2048000,
2382 "backing_file":"base.qcow2",
2383 "full-backing-filename":"disks/base.qcow2",
2384 "backing-filename-format":"qcow2",
2388 "name": "snapshot1",
2390 "date-sec": 10000200,
2392 "vm-clock-sec": 206,
2397 "filename":"disks/base.qcow2",
2399 "virtual-size":2048000
2407 "device":"ide1-cd0",
2430 .name = "query-block",
2432 .mhandler.cmd_new = qmp_marshal_input_query_block,
2439 Show block device statistics.
2441 Each device statistic information is stored in a json-object and the returned
2442 value is a json-array of all devices.
2444 Each json-object contain the following:
2446 - "device": device name (json-string)
2447 - "stats": A json-object with the statistics information, it contains:
2448 - "rd_bytes": bytes read (json-int)
2449 - "wr_bytes": bytes written (json-int)
2450 - "rd_operations": read operations (json-int)
2451 - "wr_operations": write operations (json-int)
2452 - "flush_operations": cache flush operations (json-int)
2453 - "wr_total_time_ns": total time spend on writes in nano-seconds (json-int)
2454 - "rd_total_time_ns": total time spend on reads in nano-seconds (json-int)
2455 - "flush_total_time_ns": total time spend on cache flushes in nano-seconds (json-int)
2456 - "wr_highest_offset": Highest offset of a sector written since the
2457 BlockDriverState has been opened (json-int)
2458 - "rd_merged": number of read requests that have been merged into
2459 another request (json-int)
2460 - "wr_merged": number of write requests that have been merged into
2461 another request (json-int)
2462 - "parent": Contains recursively the statistics of the underlying
2463 protocol (e.g. the host file for a qcow2 image). If there is
2464 no underlying protocol, this field is omitted
2465 (json-object, optional)
2469 -> { "execute": "query-blockstats" }
2473 "device":"ide0-hd0",
2476 "wr_highest_offset":3686448128,
2478 "wr_operations":751,
2479 "rd_bytes":122567168,
2480 "rd_operations":36772
2481 "wr_total_times_ns":313253456
2482 "rd_total_times_ns":3465673657
2483 "flush_total_times_ns":49653
2484 "flush_operations":61,
2490 "wr_highest_offset":2821110784,
2492 "wr_operations":692,
2493 "rd_bytes":122739200,
2494 "rd_operations":36604
2495 "flush_operations":51,
2496 "wr_total_times_ns":313253456
2497 "rd_total_times_ns":3465673657
2498 "flush_total_times_ns":49653,
2504 "device":"ide1-cd0",
2506 "wr_highest_offset":0,
2511 "flush_operations":0,
2512 "wr_total_times_ns":0
2513 "rd_total_times_ns":0
2514 "flush_total_times_ns":0,
2522 "wr_highest_offset":0,
2527 "flush_operations":0,
2528 "wr_total_times_ns":0
2529 "rd_total_times_ns":0
2530 "flush_total_times_ns":0,
2538 "wr_highest_offset":0,
2543 "flush_operations":0,
2544 "wr_total_times_ns":0
2545 "rd_total_times_ns":0
2546 "flush_total_times_ns":0,
2557 .name = "query-blockstats",
2558 .args_type = "query-nodes:b?",
2559 .mhandler.cmd_new = qmp_marshal_input_query_blockstats,
2566 Show CPU information.
2568 Return a json-array. Each CPU is represented by a json-object, which contains:
2570 - "CPU": CPU index (json-int)
2571 - "current": true if this is the current CPU, false otherwise (json-bool)
2572 - "halted": true if the cpu is halted, false otherwise (json-bool)
2573 - "qom_path": path to the CPU object in the QOM tree (json-str)
2574 - Current program counter. The key's name depends on the architecture:
2575 "pc": i386/x86_64 (json-int)
2576 "nip": PPC (json-int)
2577 "pc" and "npc": sparc (json-int)
2578 "PC": mips (json-int)
2579 - "thread_id": ID of the underlying host thread (json-int)
2583 -> { "execute": "query-cpus" }
2590 "qom_path":"/machine/unattached/device[0]",
2598 "qom_path":"/machine/unattached/device[2]",
2608 .name = "query-cpus",
2610 .mhandler.cmd_new = qmp_marshal_input_query_cpus,
2617 Returns a list of information about each iothread.
2619 Note this list excludes the QEMU main loop thread, which is not declared
2620 using the -object iothread command-line option. It is always the main thread
2623 Return a json-array. Each iothread is represented by a json-object, which contains:
2625 - "id": name of iothread (json-str)
2626 - "thread-id": ID of the underlying host thread (json-int)
2630 -> { "execute": "query-iothreads" }
2647 .name = "query-iothreads",
2649 .mhandler.cmd_new = qmp_marshal_input_query_iothreads,
2656 PCI buses and devices information.
2658 The returned value is a json-array of all buses. Each bus is represented by
2659 a json-object, which has a key with a json-array of all PCI devices attached
2660 to it. Each device is represented by a json-object.
2662 The bus json-object contains the following:
2664 - "bus": bus number (json-int)
2665 - "devices": a json-array of json-objects, each json-object represents a
2668 The PCI device json-object contains the following:
2670 - "bus": identical to the parent's bus number (json-int)
2671 - "slot": slot number (json-int)
2672 - "function": function number (json-int)
2673 - "class_info": a json-object containing:
2674 - "desc": device class description (json-string, optional)
2675 - "class": device class number (json-int)
2676 - "id": a json-object containing:
2677 - "device": device ID (json-int)
2678 - "vendor": vendor ID (json-int)
2679 - "irq": device's IRQ if assigned (json-int, optional)
2680 - "qdev_id": qdev id string (json-string)
2681 - "pci_bridge": It's a json-object, only present if this device is a
2682 PCI bridge, contains:
2683 - "bus": bus number (json-int)
2684 - "secondary": secondary bus number (json-int)
2685 - "subordinate": subordinate bus number (json-int)
2686 - "io_range": I/O memory range information, a json-object with the
2688 - "base": base address, in bytes (json-int)
2689 - "limit": limit address, in bytes (json-int)
2690 - "memory_range": memory range information, a json-object with the
2692 - "base": base address, in bytes (json-int)
2693 - "limit": limit address, in bytes (json-int)
2694 - "prefetchable_range": Prefetchable memory range information, a
2695 json-object with the following members:
2696 - "base": base address, in bytes (json-int)
2697 - "limit": limit address, in bytes (json-int)
2698 - "devices": a json-array of PCI devices if there's any attached, each
2699 each element is represented by a json-object, which contains
2700 the same members of the 'PCI device json-object' described
2702 - "regions": a json-array of json-objects, each json-object represents a
2703 memory region of this device
2705 The memory range json-object contains the following:
2707 - "base": base memory address (json-int)
2708 - "limit": limit value (json-int)
2710 The region json-object can be an I/O region or a memory region, an I/O region
2711 json-object contains the following:
2713 - "type": "io" (json-string, fixed)
2714 - "bar": BAR number (json-int)
2715 - "address": memory address (json-int)
2716 - "size": memory size (json-int)
2718 A memory region json-object contains the following:
2720 - "type": "memory" (json-string, fixed)
2721 - "bar": BAR number (json-int)
2722 - "address": memory address (json-int)
2723 - "size": memory size (json-int)
2724 - "mem_type_64": true or false (json-bool)
2725 - "prefetch": true or false (json-bool)
2729 -> { "execute": "query-pci" }
2741 "desc":"Host bridge"
2775 "desc":"IDE controller"
2797 "desc":"VGA controller"
2807 "mem_type_64":false,
2810 "address":4026531840,
2815 "mem_type_64":false,
2818 "address":4060086272,
2823 "mem_type_64":false,
2838 "desc":"RAM controller"
2859 Note: This example has been shortened as the real response is too long.
2864 .name = "query-pci",
2866 .mhandler.cmd_new = qmp_marshal_input_query_pci,
2873 Show KVM information.
2875 Return a json-object with the following information:
2877 - "enabled": true if KVM support is enabled, false otherwise (json-bool)
2878 - "present": true if QEMU has KVM support, false otherwise (json-bool)
2882 -> { "execute": "query-kvm" }
2883 <- { "return": { "enabled": true, "present": true } }
2888 .name = "query-kvm",
2890 .mhandler.cmd_new = qmp_marshal_input_query_kvm,
2897 Return a json-object with the following information:
2899 - "running": true if the VM is running, or false if it is paused (json-bool)
2900 - "singlestep": true if the VM is in single step mode,
2901 false otherwise (json-bool)
2902 - "status": one of the following values (json-string)
2903 "debug" - QEMU is running on a debugger
2904 "inmigrate" - guest is paused waiting for an incoming migration
2905 "internal-error" - An internal error that prevents further guest
2906 execution has occurred
2907 "io-error" - the last IOP has failed and the device is configured
2908 to pause on I/O errors
2909 "paused" - guest has been paused via the 'stop' command
2910 "postmigrate" - guest is paused following a successful 'migrate'
2911 "prelaunch" - QEMU was started with -S and guest has not started
2912 "finish-migrate" - guest is paused to finish the migration process
2913 "restore-vm" - guest is paused to restore VM state
2914 "running" - guest is actively running
2915 "save-vm" - guest is paused to save the VM state
2916 "shutdown" - guest is shut down (and -no-shutdown is in use)
2917 "watchdog" - the watchdog action is configured to pause and
2922 -> { "execute": "query-status" }
2923 <- { "return": { "running": true, "singlestep": false, "status": "running" } }
2928 .name = "query-status",
2930 .mhandler.cmd_new = qmp_marshal_input_query_status,
2937 Show VM mice information.
2939 Each mouse is represented by a json-object, the returned value is a json-array
2942 The mouse json-object contains the following:
2944 - "name": mouse's name (json-string)
2945 - "index": mouse's index (json-int)
2946 - "current": true if this mouse is receiving events, false otherwise (json-bool)
2947 - "absolute": true if the mouse generates absolute input events (json-bool)
2951 -> { "execute": "query-mice" }
2955 "name":"QEMU Microsoft Mouse",
2961 "name":"QEMU PS/2 Mouse",
2972 .name = "query-mice",
2974 .mhandler.cmd_new = qmp_marshal_input_query_mice,
2981 Show VNC server information.
2983 Return a json-object with server information. Connected clients are returned
2984 as a json-array of json-objects.
2986 The main json-object contains the following:
2988 - "enabled": true or false (json-bool)
2989 - "host": server's IP address (json-string)
2990 - "family": address family (json-string)
2991 - Possible values: "ipv4", "ipv6", "unix", "unknown"
2992 - "service": server's port number (json-string)
2993 - "auth": authentication method (json-string)
2994 - Possible values: "invalid", "none", "ra2", "ra2ne", "sasl", "tight",
2995 "tls", "ultra", "unknown", "vencrypt", "vencrypt",
2996 "vencrypt+plain", "vencrypt+tls+none",
2997 "vencrypt+tls+plain", "vencrypt+tls+sasl",
2998 "vencrypt+tls+vnc", "vencrypt+x509+none",
2999 "vencrypt+x509+plain", "vencrypt+x509+sasl",
3000 "vencrypt+x509+vnc", "vnc"
3001 - "clients": a json-array of all connected clients
3003 Clients are described by a json-object, each one contain the following:
3005 - "host": client's IP address (json-string)
3006 - "family": address family (json-string)
3007 - Possible values: "ipv4", "ipv6", "unix", "unknown"
3008 - "service": client's port number (json-string)
3009 - "x509_dname": TLS dname (json-string, optional)
3010 - "sasl_username": SASL username (json-string, optional)
3014 -> { "execute": "query-vnc" }
3035 .name = "query-vnc",
3037 .mhandler.cmd_new = qmp_marshal_input_query_vnc,
3040 .name = "query-vnc-servers",
3042 .mhandler.cmd_new = qmp_marshal_input_query_vnc_servers,
3049 Show SPICE server information.
3051 Return a json-object with server information. Connected clients are returned
3052 as a json-array of json-objects.
3054 The main json-object contains the following:
3056 - "enabled": true or false (json-bool)
3057 - "host": server's IP address (json-string)
3058 - "port": server's port number (json-int, optional)
3059 - "tls-port": server's port number (json-int, optional)
3060 - "auth": authentication method (json-string)
3061 - Possible values: "none", "spice"
3062 - "channels": a json-array of all active channels clients
3064 Channels are described by a json-object, each one contain the following:
3066 - "host": client's IP address (json-string)
3067 - "family": address family (json-string)
3068 - Possible values: "ipv4", "ipv6", "unix", "unknown"
3069 - "port": client's port number (json-string)
3070 - "connection-id": spice connection id. All channels with the same id
3071 belong to the same spice session (json-int)
3072 - "channel-type": channel type. "1" is the main control channel, filter for
3073 this one if you want track spice sessions only (json-int)
3074 - "channel-id": channel id. Usually "0", might be different needed when
3075 multiple channels of the same type exist, such as multiple
3076 display channels in a multihead setup (json-int)
3077 - "tls": whether the channel is encrypted (json-bool)
3081 -> { "execute": "query-spice" }
3094 "connection-id": 1804289383,
3095 "host": "127.0.0.1",
3103 "connection-id": 1804289383,
3104 "host": "127.0.0.1",
3108 [ ... more channels follow ... ]
3115 #if defined(CONFIG_SPICE)
3117 .name = "query-spice",
3119 .mhandler.cmd_new = qmp_marshal_input_query_spice,
3129 Return a json-object with the following information:
3131 - "name": VM's name (json-string, optional)
3135 -> { "execute": "query-name" }
3136 <- { "return": { "name": "qemu-name" } }
3141 .name = "query-name",
3143 .mhandler.cmd_new = qmp_marshal_input_query_name,
3152 Return a json-object with the following information:
3154 - "UUID": Universally Unique Identifier (json-string)
3158 -> { "execute": "query-uuid" }
3159 <- { "return": { "UUID": "550e8400-e29b-41d4-a716-446655440000" } }
3164 .name = "query-uuid",
3166 .mhandler.cmd_new = qmp_marshal_input_query_uuid,
3170 query-command-line-options
3171 --------------------------
3173 Show command line option schema.
3175 Return a json-array of command line option schema for all options (or for
3176 the given option), returning an error if the given option doesn't exist.
3178 Each array entry contains the following:
3180 - "option": option name (json-string)
3181 - "parameters": a json-array describes all parameters of the option:
3182 - "name": parameter name (json-string)
3183 - "type": parameter type (one of 'string', 'boolean', 'number',
3185 - "help": human readable description of the parameter
3186 (json-string, optional)
3187 - "default": default value string for the parameter
3188 (json-string, optional)
3192 -> { "execute": "query-command-line-options", "arguments": { "option": "option-rom" } }
3201 "name": "bootindex",
3205 "option": "option-rom"
3213 .name = "query-command-line-options",
3214 .args_type = "option:s?",
3215 .mhandler.cmd_new = qmp_marshal_input_query_command_line_options,
3224 Return a json-object. If migration is active there will be another json-object
3225 with RAM migration status and if block migration is active another one with
3226 block migration status.
3228 The main json-object contains the following:
3230 - "status": migration status (json-string)
3231 - Possible values: "setup", "active", "completed", "failed", "cancelled"
3232 - "total-time": total amount of ms since migration started. If
3233 migration has ended, it returns the total migration
3235 - "setup-time" amount of setup time in milliseconds _before_ the
3236 iterations begin but _after_ the QMP command is issued.
3237 This is designed to provide an accounting of any activities
3238 (such as RDMA pinning) which may be expensive, but do not
3239 actually occur during the iterative migration rounds
3240 themselves. (json-int)
3241 - "downtime": only present when migration has finished correctly
3242 total amount in ms for downtime that happened (json-int)
3243 - "expected-downtime": only present while migration is active
3244 total amount in ms for downtime that was calculated on
3245 the last bitmap round (json-int)
3246 - "ram": only present if "status" is "active", it is a json-object with the
3247 following RAM information:
3248 - "transferred": amount transferred in bytes (json-int)
3249 - "remaining": amount remaining to transfer in bytes (json-int)
3250 - "total": total amount of memory in bytes (json-int)
3251 - "duplicate": number of pages filled entirely with the same
3253 These are sent over the wire much more efficiently.
3254 - "skipped": number of skipped zero pages (json-int)
3255 - "normal" : number of whole pages transferred. I.e. they
3256 were not sent as duplicate or xbzrle pages (json-int)
3257 - "normal-bytes" : number of bytes transferred in whole
3258 pages. This is just normal pages times size of one page,
3259 but this way upper levels don't need to care about page
3261 - "dirty-sync-count": times that dirty ram was synchronized (json-int)
3262 - "disk": only present if "status" is "active" and it is a block migration,
3263 it is a json-object with the following disk information:
3264 - "transferred": amount transferred in bytes (json-int)
3265 - "remaining": amount remaining to transfer in bytes json-int)
3266 - "total": total disk size in bytes (json-int)
3267 - "xbzrle-cache": only present if XBZRLE is active.
3268 It is a json-object with the following XBZRLE information:
3269 - "cache-size": XBZRLE cache size in bytes
3270 - "bytes": number of bytes transferred for XBZRLE compressed pages
3271 - "pages": number of XBZRLE compressed pages
3272 - "cache-miss": number of XBRZRLE page cache misses
3273 - "cache-miss-rate": rate of XBRZRLE page cache misses
3274 - "overflow": number of times XBZRLE overflows. This means
3275 that the XBZRLE encoding was bigger than just sent the
3276 whole page, and then we sent the whole page instead (as as
3281 1. Before the first migration
3283 -> { "execute": "query-migrate" }
3286 2. Migration is done and has succeeded
3288 -> { "execute": "query-migrate" }
3290 "status": "completed",
3300 "normal-bytes":123456,
3301 "dirty-sync-count":15
3306 3. Migration is done and has failed
3308 -> { "execute": "query-migrate" }
3309 <- { "return": { "status": "failed" } }
3311 4. Migration is being performed and is not a block migration:
3313 -> { "execute": "query-migrate" }
3323 "expected-downtime":12345,
3326 "normal-bytes":123456,
3327 "dirty-sync-count":15
3332 5. Migration is being performed and is a block migration:
3334 -> { "execute": "query-migrate" }
3340 "remaining":1053304,
3344 "expected-downtime":12345,
3347 "normal-bytes":123456,
3348 "dirty-sync-count":15
3352 "remaining":20880384,
3358 6. Migration is being performed and XBZRLE is active:
3360 -> { "execute": "query-migrate" }
3364 "capabilities" : [ { "capability": "xbzrle", "state" : true } ],
3367 "remaining":1053304,
3371 "expected-downtime":12345,
3374 "normal-bytes":3412992,
3375 "dirty-sync-count":15
3378 "cache-size":67108864,
3382 "cache-miss-rate":0.123,
3391 .name = "query-migrate",
3393 .mhandler.cmd_new = qmp_marshal_input_query_migrate,
3397 migrate-set-capabilities
3398 ------------------------
3400 Enable/Disable migration capabilities
3402 - "xbzrle": XBZRLE support
3403 - "rdma-pin-all": pin all pages when using RDMA during migration
3404 - "auto-converge": throttle down guest to help convergence of migration
3405 - "zero-blocks": compress zero blocks during block migration
3411 -> { "execute": "migrate-set-capabilities" , "arguments":
3412 { "capabilities": [ { "capability": "xbzrle", "state": true } ] } }
3417 .name = "migrate-set-capabilities",
3418 .args_type = "capabilities:q",
3419 .params = "capability:s,state:b",
3420 .mhandler.cmd_new = qmp_marshal_input_migrate_set_capabilities,
3423 query-migrate-capabilities
3424 --------------------------
3426 Query current migration capabilities
3428 - "capabilities": migration capabilities state
3429 - "xbzrle" : XBZRLE state (json-bool)
3430 - "rdma-pin-all" : RDMA Pin Page state (json-bool)
3431 - "auto-converge" : Auto Converge state (json-bool)
3432 - "zero-blocks" : Zero Blocks state (json-bool)
3438 -> { "execute": "query-migrate-capabilities" }
3439 <- { "return": [ { "state": false, "capability": "xbzrle" } ] }
3444 .name = "query-migrate-capabilities",
3446 .mhandler.cmd_new = qmp_marshal_input_query_migrate_capabilities,
3450 migrate-set-parameters
3451 ----------------------
3453 Set migration parameters
3455 - "compress-level": set compression level during migration (json-int)
3456 - "compress-threads": set compression thread count for migration (json-int)
3457 - "decompress-threads": set decompression thread count for migration (json-int)
3463 -> { "execute": "migrate-set-parameters" , "arguments":
3464 { "compress-level": 1 } }
3469 .name = "migrate-set-parameters",
3471 "compress-level:i?,compress-threads:i?,decompress-threads:i?",
3472 .mhandler.cmd_new = qmp_marshal_input_migrate_set_parameters,
3475 query-migrate-parameters
3476 ------------------------
3478 Query current migration parameters
3480 - "parameters": migration parameters value
3481 - "compress-level" : compression level value (json-int)
3482 - "compress-threads" : compression thread count value (json-int)
3483 - "decompress-threads" : decompression thread count value (json-int)
3489 -> { "execute": "query-migrate-parameters" }
3492 "decompress-threads", 2,
3493 "compress-threads", 8,
3501 .name = "query-migrate-parameters",
3503 .mhandler.cmd_new = qmp_marshal_input_query_migrate_parameters,
3510 Show balloon information.
3512 Make an asynchronous request for balloon info. When the request completes a
3513 json-object will be returned containing the following data:
3515 - "actual": current balloon value in bytes (json-int)
3519 -> { "execute": "query-balloon" }
3522 "actual":1073741824,
3529 .name = "query-balloon",
3531 .mhandler.cmd_new = qmp_marshal_input_query_balloon,
3535 .name = "query-block-jobs",
3537 .mhandler.cmd_new = qmp_marshal_input_query_block_jobs,
3542 .args_type = "path:s",
3543 .mhandler.cmd_new = qmp_marshal_input_qom_list,
3548 .args_type = "path:s,property:s,value:q",
3549 .mhandler.cmd_new = qmp_qom_set,
3554 .args_type = "path:s,property:s",
3555 .mhandler.cmd_new = qmp_qom_get,
3559 .name = "nbd-server-start",
3560 .args_type = "addr:q",
3561 .mhandler.cmd_new = qmp_marshal_input_nbd_server_start,
3564 .name = "nbd-server-add",
3565 .args_type = "device:B,writable:b?",
3566 .mhandler.cmd_new = qmp_marshal_input_nbd_server_add,
3569 .name = "nbd-server-stop",
3571 .mhandler.cmd_new = qmp_marshal_input_nbd_server_stop,
3575 .name = "change-vnc-password",
3576 .args_type = "password:s",
3577 .mhandler.cmd_new = qmp_marshal_input_change_vnc_password,
3580 .name = "qom-list-types",
3581 .args_type = "implements:s?,abstract:b?",
3582 .mhandler.cmd_new = qmp_marshal_input_qom_list_types,
3586 .name = "device-list-properties",
3587 .args_type = "typename:s",
3588 .mhandler.cmd_new = qmp_marshal_input_device_list_properties,
3592 .name = "query-machines",
3594 .mhandler.cmd_new = qmp_marshal_input_query_machines,
3598 .name = "query-cpu-definitions",
3600 .mhandler.cmd_new = qmp_marshal_input_query_cpu_definitions,
3604 .name = "query-target",
3606 .mhandler.cmd_new = qmp_marshal_input_query_target,
3610 .name = "query-tpm",
3612 .mhandler.cmd_new = qmp_marshal_input_query_tpm,
3619 Return information about the TPM device.
3625 -> { "execute": "query-tpm" }
3628 { "model": "tpm-tis",
3630 { "type": "passthrough",
3632 { "cancel-path": "/sys/class/misc/tpm0/device/cancel",
3644 .name = "query-tpm-models",
3646 .mhandler.cmd_new = qmp_marshal_input_query_tpm_models,
3653 Return a list of supported TPM models.
3659 -> { "execute": "query-tpm-models" }
3660 <- { "return": [ "tpm-tis" ] }
3665 .name = "query-tpm-types",
3667 .mhandler.cmd_new = qmp_marshal_input_query_tpm_types,
3674 Return a list of supported TPM types.
3680 -> { "execute": "query-tpm-types" }
3681 <- { "return": [ "passthrough" ] }
3686 .name = "chardev-add",
3687 .args_type = "id:s,backend:q",
3688 .mhandler.cmd_new = qmp_marshal_input_chardev_add,
3699 - "id": the chardev's ID, must be unique (json-string)
3700 - "backend": chardev backend type + parameters
3704 -> { "execute" : "chardev-add",
3705 "arguments" : { "id" : "foo",
3706 "backend" : { "type" : "null", "data" : {} } } }
3709 -> { "execute" : "chardev-add",
3710 "arguments" : { "id" : "bar",
3711 "backend" : { "type" : "file",
3712 "data" : { "out" : "/tmp/bar.log" } } } }
3715 -> { "execute" : "chardev-add",
3716 "arguments" : { "id" : "baz",
3717 "backend" : { "type" : "pty", "data" : {} } } }
3718 <- { "return": { "pty" : "/dev/pty/42" } }
3723 .name = "chardev-remove",
3724 .args_type = "id:s",
3725 .mhandler.cmd_new = qmp_marshal_input_chardev_remove,
3737 - "id": the chardev's ID, must exist and not be in use (json-string)
3741 -> { "execute": "chardev-remove", "arguments": { "id" : "foo" } }
3746 .name = "query-rx-filter",
3747 .args_type = "name:s?",
3748 .mhandler.cmd_new = qmp_marshal_input_query_rx_filter,
3755 Show rx-filter information.
3757 Returns a json-array of rx-filter information for all NICs (or for the
3758 given NIC), returning an error if the given NIC doesn't exist, or
3759 given NIC doesn't support rx-filter querying, or given net client
3762 The query will clear the event notification flag of each NIC, then qemu
3763 will start to emit event to QMP monitor.
3765 Each array entry contains the following:
3767 - "name": net client name (json-string)
3768 - "promiscuous": promiscuous mode is enabled (json-bool)
3769 - "multicast": multicast receive state (one of 'normal', 'none', 'all')
3770 - "unicast": unicast receive state (one of 'normal', 'none', 'all')
3771 - "vlan": vlan receive state (one of 'normal', 'none', 'all') (Since 2.0)
3772 - "broadcast-allowed": allow to receive broadcast (json-bool)
3773 - "multicast-overflow": multicast table is overflowed (json-bool)
3774 - "unicast-overflow": unicast table is overflowed (json-bool)
3775 - "main-mac": main macaddr string (json-string)
3776 - "vlan-table": a json-array of active vlan id
3777 - "unicast-table": a json-array of unicast macaddr string
3778 - "multicast-table": a json-array of multicast macaddr string
3782 -> { "execute": "query-rx-filter", "arguments": { "name": "vnet0" } }
3785 "promiscuous": true,
3787 "main-mac": "52:54:00:12:34:56",
3788 "unicast": "normal",
3796 "multicast": "normal",
3797 "multicast-overflow": false,
3798 "unicast-overflow": false,
3799 "multicast-table": [
3800 "01:00:5e:00:00:01",
3801 "33:33:00:00:00:01",
3804 "broadcast-allowed": false
3812 .name = "blockdev-add",
3813 .args_type = "options:q",
3814 .mhandler.cmd_new = qmp_marshal_input_blockdev_add,
3823 This command is still a work in progress. It doesn't support all
3824 block drivers, it lacks a matching blockdev-del, and more. Stay away
3825 from it unless you want to help with its development.
3829 - "options": block driver options
3833 -> { "execute": "blockdev-add",
3834 "arguments": { "options" : { "driver": "qcow2",
3835 "file": { "driver": "file",
3836 "filename": "test.qcow2" } } } }
3841 -> { "execute": "blockdev-add",
3853 "filename": "/tmp/test.qcow2"
3859 "filename": "/dev/fdset/4"
3871 .name = "query-named-block-nodes",
3873 .mhandler.cmd_new = qmp_marshal_input_query_named_block_nodes,
3877 @query-named-block-nodes
3878 ------------------------
3880 Return a list of BlockDeviceInfo for all the named block driver nodes
3884 -> { "execute": "query-named-block-nodes" }
3885 <- { "return": [ { "ro":false,
3888 "file":"disks/test.qcow2",
3889 "node-name": "my-node",
3890 "backing_file_depth":1,
3904 "write_threshold": 0,
3906 "filename":"disks/test.qcow2",
3908 "virtual-size":2048000,
3909 "backing_file":"base.qcow2",
3910 "full-backing-filename":"disks/base.qcow2",
3911 "backing-filename-format":"qcow2",
3915 "name": "snapshot1",
3917 "date-sec": 10000200,
3919 "vm-clock-sec": 206,
3924 "filename":"disks/base.qcow2",
3926 "virtual-size":2048000
3933 .name = "query-memdev",
3935 .mhandler.cmd_new = qmp_marshal_input_query_memdev,
3942 Show memory devices information.
3947 -> { "execute": "query-memdev" }
3954 "host-nodes": [0, 1],
3962 "host-nodes": [2, 3],
3963 "policy": "preferred"
3971 .name = "query-memory-devices",
3973 .mhandler.cmd_new = qmp_marshal_input_query_memory_devices,
3977 @query-memory-devices
3978 --------------------
3980 Return a list of memory devices.
3983 -> { "execute": "query-memory-devices" }
3984 <- { "return": [ { "data":
3985 { "addr": 5368709120,
3986 "hotpluggable": true,
3989 "memdev": "/objects/memX",
3998 .name = "query-acpi-ospm-status",
4000 .mhandler.cmd_new = qmp_marshal_input_query_acpi_ospm_status,
4004 @query-acpi-ospm-status
4005 --------------------
4007 Return list of ACPIOSTInfo for devices that support status reporting
4008 via ACPI _OST method.
4011 -> { "execute": "query-acpi-ospm-status" }
4012 <- { "return": [ { "device": "d1", "slot": "0", "slot-type": "DIMM", "source": 1, "status": 0},
4013 { "slot": "1", "slot-type": "DIMM", "source": 0, "status": 0},
4014 { "slot": "2", "slot-type": "DIMM", "source": 0, "status": 0},
4015 { "slot": "3", "slot-type": "DIMM", "source": 0, "status": 0}
4019 #if defined TARGET_I386
4021 .name = "rtc-reset-reinjection",
4023 .mhandler.cmd_new = qmp_marshal_input_rtc_reset_reinjection,
4028 rtc-reset-reinjection
4029 ---------------------
4031 Reset the RTC interrupt reinjection backlog.
4037 -> { "execute": "rtc-reset-reinjection" }
4042 .name = "trace-event-get-state",
4043 .args_type = "name:s",
4044 .mhandler.cmd_new = qmp_marshal_input_trace_event_get_state,
4048 trace-event-get-state
4049 ---------------------
4051 Query the state of events.
4055 -> { "execute": "trace-event-get-state", "arguments": { "name": "qemu_memalign" } }
4056 <- { "return": [ { "name": "qemu_memalign", "state": "disabled" } ] }
4060 .name = "trace-event-set-state",
4061 .args_type = "name:s,enable:b,ignore-unavailable:b?",
4062 .mhandler.cmd_new = qmp_marshal_input_trace_event_set_state,
4066 trace-event-set-state
4067 ---------------------
4069 Set the state of events.
4073 -> { "execute": "trace-event-set-state", "arguments": { "name": "qemu_memalign", "enable": "true" } }
4078 .name = "x-input-send-event",
4079 .args_type = "console:i?,events:q",
4080 .mhandler.cmd_new = qmp_marshal_input_x_input_send_event,
4087 Send input event to guest.
4091 - "console": console index. (json-int, optional)
4092 - "events": list of input events.
4094 The consoles are visible in the qom tree, under
4095 /backend/console[$index]. They have a device link and head property, so
4096 it is possible to map which console belongs to which device and display.
4098 Note: this command is experimental, and not a stable API.
4102 Press left mouse button.
4104 -> { "execute": "x-input-send-event",
4105 "arguments": { "console": 0,
4106 "events": [ { "type": "btn",
4107 "data" : { "down": true, "button": "Left" } } ] } }
4110 -> { "execute": "x-input-send-event",
4111 "arguments": { "console": 0,
4112 "events": [ { "type": "btn",
4113 "data" : { "down": false, "button": "Left" } } ] } }
4120 -> { "execute": "x-input-send-event",
4121 "arguments": { "console": 0, "events": [
4122 { "type": "key", "data" : { "down": true,
4123 "key": {"type": "qcode", "data": "ctrl" } } },
4124 { "type": "key", "data" : { "down": true,
4125 "key": {"type": "qcode", "data": "alt" } } },
4126 { "type": "key", "data" : { "down": true,
4127 "key": {"type": "qcode", "data": "delete" } } } ] } }
4132 Move mouse pointer to absolute coordinates (20000, 400).
4134 -> { "execute": "x-input-send-event" ,
4135 "arguments": { "console": 0, "events": [
4136 { "type": "abs", "data" : { "axis": "X", "value" : 20000 } },
4137 { "type": "abs", "data" : { "axis": "Y", "value" : 400 } } ] } }
4143 .name = "block-set-write-threshold",
4144 .args_type = "node-name:s,write-threshold:l",
4145 .mhandler.cmd_new = qmp_marshal_input_block_set_write_threshold,
4149 block-set-write-threshold
4152 Change the write threshold for a block drive. The threshold is an offset,
4153 thus must be non-negative. Default is no write threshold.
4154 Setting the threshold to zero disables it.
4158 - "node-name": the node name in the block driver state graph (json-string)
4159 - "write-threshold": the write threshold in bytes (json-int)
4163 -> { "execute": "block-set-write-threshold",
4164 "arguments": { "node-name": "mydev",
4165 "write-threshold": 17179869184 } }
4171 .name = "query-rocker",
4172 .args_type = "name:s",
4173 .mhandler.cmd_new = qmp_marshal_input_query_rocker,
4182 - "name": switch name
4186 -> { "execute": "query-rocker", "arguments": { "name": "sw1" } }
4187 <- { "return": {"name": "sw1", "ports": 2, "id": 1327446905938}}
4192 .name = "query-rocker-ports",
4193 .args_type = "name:s",
4194 .mhandler.cmd_new = qmp_marshal_input_query_rocker_ports,
4198 Show rocker switch ports
4199 ------------------------
4203 - "name": switch name
4207 -> { "execute": "query-rocker-ports", "arguments": { "name": "sw1" } }
4208 <- { "return": [ {"duplex": "full", "enabled": true, "name": "sw1.1",
4209 "autoneg": "off", "link-up": true, "speed": 10000},
4210 {"duplex": "full", "enabled": true, "name": "sw1.2",
4211 "autoneg": "off", "link-up": true, "speed": 10000}
4217 .name = "query-rocker-of-dpa-flows",
4218 .args_type = "name:s,tbl-id:i?",
4219 .mhandler.cmd_new = qmp_marshal_input_query_rocker_of_dpa_flows,
4223 Show rocker switch OF-DPA flow tables
4224 -------------------------------------
4228 - "name": switch name
4229 - "tbl-id": (optional) flow table ID
4233 -> { "execute": "query-rocker-of-dpa-flows", "arguments": { "name": "sw1" } }
4234 <- { "return": [ {"key": {"in-pport": 0, "priority": 1, "tbl-id": 0},
4237 "action": {"goto-tbl": 10},
4238 "mask": {"in-pport": 4294901760}
4246 .name = "query-rocker-of-dpa-groups",
4247 .args_type = "name:s,type:i?",
4248 .mhandler.cmd_new = qmp_marshal_input_query_rocker_of_dpa_groups,
4252 Show rocker OF-DPA group tables
4253 -------------------------------
4257 - "name": switch name
4258 - "type": (optional) group type
4262 -> { "execute": "query-rocker-of-dpa-groups", "arguments": { "name": "sw1" } }
4263 <- { "return": [ {"type": 0, "out-pport": 2, "pport": 2, "vlan-id": 3841,
4264 "pop-vlan": 1, "id": 251723778},
4265 {"type": 0, "out-pport": 0, "pport": 0, "vlan-id": 3841,
4266 "pop-vlan": 1, "id": 251723776},
4267 {"type": 0, "out-pport": 1, "pport": 1, "vlan-id": 3840,
4268 "pop-vlan": 1, "id": 251658241},
4269 {"type": 0, "out-pport": 0, "pport": 0, "vlan-id": 3840,
4270 "pop-vlan": 1, "id": 251658240}