4 This document describes all commands currently supported by QMP.
6 Most of the time their usage is exactly the same as in the user Monitor, this
7 means that any other document which also describe commands (the manpage,
8 QEMU's manual, etc) can and should be consulted.
10 QMP has two types of commands: regular and query commands. Regular commands
11 usually change the Virtual Machine's state someway, while query commands just
12 return information. The sections below are divided accordingly.
14 It's important to observe that all communication examples are formatted in
15 a reader-friendly way, so that they're easier to understand. However, in real
16 protocol usage, they're emitted as a single line.
18 Also, the following notation is used to denote data flow:
20 -> data issued by the Client
21 <- Server data response
23 Please, refer to the QMP specification (docs/qmp-spec.txt) for detailed
24 information on the Server command and response formats.
26 NOTE: This document is temporary and will be replaced soon.
28 1. Stability Considerations
29 ===========================
31 The current QMP command set (described in this file) may be useful for a
32 number of use cases, however it's limited and several commands have bad
33 defined semantics, specially with regard to command completion.
35 These problems are going to be solved incrementally in the next QEMU releases
36 and we're going to establish a deprecation policy for badly defined commands.
38 If you're planning to adopt QMP, please observe the following:
40 1. The deprecation policy will take effect and be documented soon, please
41 check the documentation of each used command as soon as a new release of
44 2. DO NOT rely on anything which is not explicit documented
46 3. Errors, in special, are not documented. Applications should NOT check
47 for specific errors classes or data (it's strongly recommended to only
48 check for the "error" key)
53 Server's responses in the examples below are always a success response, please
54 refer to the QMP specification for more details on error responses.
65 -> { "execute": "quit" }
71 Eject a removable medium.
75 - "force": force ejection (json-bool, optional)
76 - "device": block device name (deprecated, use @id instead)
77 (json-string, optional)
78 - "id": the name or QOM path of the guest device (json-string, optional)
82 -> { "execute": "eject", "arguments": { "id": "ide0-1-0" } }
85 Note: The "force" argument defaults to false.
90 Change a removable medium or VNC configuration.
94 - "device": device name (json-string)
95 - "target": filename or item (json-string)
96 - "arg": additional argument (json-string, optional)
100 1. Change a removable medium
102 -> { "execute": "change",
103 "arguments": { "device": "ide1-cd0",
104 "target": "/srv/images/Fedora-12-x86_64-DVD.iso" } }
107 2. Change VNC password
109 -> { "execute": "change",
110 "arguments": { "device": "vnc", "target": "password",
117 Save screen into PPM image.
121 - "filename": file path (json-string)
125 -> { "execute": "screendump", "arguments": { "filename": "/tmp/image" } }
137 -> { "execute": "stop" }
149 -> { "execute": "cont" }
155 Wakeup guest from suspend.
161 -> { "execute": "system_wakeup" }
173 -> { "execute": "system_reset" }
179 Send system power down event.
185 -> { "execute": "system_powerdown" }
195 - "driver": the name of the new device's driver (json-string)
196 - "bus": the device's parent bus (device tree path, json-string, optional)
197 - "id": the device's ID, must be unique (json-string)
202 -> { "execute": "device_add", "arguments": { "driver": "e1000", "id": "net1" } }
207 (1) For detailed information about this command, please refer to the
208 'docs/qdev-device-use.txt' file.
210 (2) It's possible to list device properties by running QEMU with the
211 "-device DEVICE,\?" command-line argument, where DEVICE is the device's name
220 - "id": the device's ID or QOM path (json-string)
224 -> { "execute": "device_del", "arguments": { "id": "net1" } }
229 -> { "execute": "device_del", "arguments": { "id": "/machine/peripheral-anon/device[0]" } }
240 - "key": key sequence (a json-array of key union values,
241 union can be number or qcode enum)
243 - hold-time: time to delay key up events, milliseconds. Defaults to 100
248 -> { "execute": "send-key",
249 "arguments": { "keys": [ { "type": "qcode", "data": "ctrl" },
250 { "type": "qcode", "data": "alt" },
251 { "type": "qcode", "data": "delete" } ] } }
261 - "index": the CPU's index (json-int)
265 -> { "execute": "cpu", "arguments": { "index": 0 } }
268 Note: CPUs' indexes are obtained with the 'query-cpus' command.
277 - "id": cpu id (json-int)
281 -> { "execute": "cpu-add", "arguments": { "id": 2 } }
287 Save to disk virtual memory dump starting at 'val' of size 'size'.
291 - "val": the starting address (json-int)
292 - "size": the memory size, in bytes (json-int)
293 - "filename": file path (json-string)
294 - "cpu": virtual CPU index (json-int, optional)
298 -> { "execute": "memsave",
299 "arguments": { "val": 10,
301 "filename": "/tmp/virtual-mem-dump" } }
307 Save to disk physical memory dump starting at 'val' of size 'size'.
311 - "val": the starting address (json-int)
312 - "size": the memory size, in bytes (json-int)
313 - "filename": file path (json-string)
317 -> { "execute": "pmemsave",
318 "arguments": { "val": 10,
320 "filename": "/tmp/physical-mem-dump" } }
326 Inject an NMI on the default CPU (x86/s390) or all CPUs (ppc64).
332 -> { "execute": "inject-nmi" }
335 Note: inject-nmi fails when the guest doesn't support injecting.
340 Write to a ring buffer character device.
344 - "device": ring buffer character device name (json-string)
345 - "data": data to write (json-string)
346 - "format": data format (json-string, optional)
347 - Possible values: "utf8" (default), "base64"
351 -> { "execute": "ringbuf-write",
352 "arguments": { "device": "foo",
360 Read from a ring buffer character device.
364 - "device": ring buffer character device name (json-string)
365 - "size": how many bytes to read at most (json-int)
366 - Number of data bytes, not number of characters in encoded data
367 - "format": data format (json-string, optional)
368 - Possible values: "utf8" (default), "base64"
369 - Naturally, format "utf8" works only when the ring buffer
370 contains valid UTF-8 text. Invalid UTF-8 sequences get
371 replaced. Bug: replacement doesn't work. Bug: can screw
372 up on encountering NUL characters, after the ring buffer
373 lost data, and when reading stops because the size limit
378 -> { "execute": "ringbuf-read",
379 "arguments": { "device": "foo",
382 <- {"return": "abcdefgh"}
384 xen-save-devices-state
387 Save the state of all devices to file. The RAM and the block devices
388 of the VM are not saved by this command.
392 - "filename": the file to save the state of the devices to as binary
393 data. See xen-save-devices-state.txt for a description of the binary
398 -> { "execute": "xen-save-devices-state",
399 "arguments": { "filename": "/tmp/save" } }
402 xen-load-devices-state
403 ----------------------
405 Load the state of all devices from file. The RAM and the block devices
406 of the VM are not loaded by this command.
410 - "filename": the file to load the state of the devices from as binary
411 data. See xen-save-devices-state.txt for a description of the binary
416 -> { "execute": "xen-load-devices-state",
417 "arguments": { "filename": "/tmp/resume" } }
420 xen-set-global-dirty-log
423 Enable or disable the global dirty log mode.
427 - "enable": Enable it or disable it.
431 -> { "execute": "xen-set-global-dirty-log",
432 "arguments": { "enable": true } }
442 - "blk": block migration, full disk copy (json-bool, optional)
443 - "inc": incremental disk copy (json-bool, optional)
444 - "uri": Destination URI (json-string)
448 -> { "execute": "migrate", "arguments": { "uri": "tcp:0:4446" } }
453 (1) The 'query-migrate' command should be used to check migration's progress
454 and final result (this information is provided by the 'status' member)
455 (2) All boolean arguments default to false
456 (3) The user Monitor's "detach" argument is invalid in QMP and should not
462 Cancel the current migration.
468 -> { "execute": "migrate_cancel" }
474 Continue an incoming migration
478 - "uri": Source/listening URI (json-string)
482 -> { "execute": "migrate-incoming", "arguments": { "uri": "tcp::4446" } }
487 (1) QEMU must be started with -incoming defer to allow migrate-incoming to
489 (2) The uri format is the same as for -incoming
491 migrate-set-cache-size
492 ----------------------
494 Set cache size to be used by XBZRLE migration, the cache size will be rounded
495 down to the nearest power of 2
499 - "value": cache size in bytes (json-int)
503 -> { "execute": "migrate-set-cache-size", "arguments": { "value": 536870912 } }
506 migrate-start-postcopy
507 ----------------------
509 Switch an in-progress migration to postcopy mode. Ignored after the end of
510 migration (or once already in postcopy).
513 -> { "execute": "migrate-start-postcopy" }
516 query-migrate-cache-size
517 ------------------------
519 Show cache size to be used by XBZRLE migration
521 returns a json-object with the following information:
526 -> { "execute": "query-migrate-cache-size" }
527 <- { "return": 67108864 }
532 Set maximum speed for migrations.
536 - "value": maximum speed, in bytes per second (json-int)
540 -> { "execute": "migrate_set_speed", "arguments": { "value": 1024 } }
546 Set maximum tolerated downtime (in seconds) for migrations.
550 - "value": maximum downtime (json-number)
554 -> { "execute": "migrate_set_downtime", "arguments": { "value": 0.1 } }
557 x-colo-lost-heartbeat
560 Tell COLO that heartbeat is lost, a failover or takeover is needed.
564 -> { "execute": "x-colo-lost-heartbeat" }
570 Set migration information for remote display. This makes the server
571 ask the client to automatically reconnect using the new parameters
572 once migration finished successfully. Only implemented for SPICE.
576 - "protocol": must be "spice" (json-string)
577 - "hostname": migration target hostname (json-string)
578 - "port": spice tcp port for plaintext channels (json-int, optional)
579 - "tls-port": spice tcp port for tls-secured channels (json-int, optional)
580 - "cert-subject": server certificate subject (json-string, optional)
584 -> { "execute": "client_migrate_info",
585 "arguments": { "protocol": "spice",
586 "hostname": "virt42.lab.kraxel.org",
593 Dump guest memory to file. The file can be processed with crash or gdb.
597 - "paging": do paging to get guest's memory mapping (json-bool)
598 - "protocol": destination file(started with "file:") or destination file
599 descriptor (started with "fd:") (json-string)
600 - "detach": if specified, command will return immediately, without waiting
601 for the dump to finish. The user can track progress using
602 "query-dump". (json-bool)
603 - "begin": the starting physical address. It's optional, and should be specified
604 with length together (json-int)
605 - "length": the memory size, in bytes. It's optional, and should be specified
606 with begin together (json-int)
607 - "format": the format of guest memory dump. It's optional, and can be
608 elf|kdump-zlib|kdump-lzo|kdump-snappy, but non-elf formats will
609 conflict with paging and filter, ie. begin and length (json-string)
613 -> { "execute": "dump-guest-memory", "arguments": { "protocol": "fd:dump" } }
618 (1) All boolean arguments default to false
620 query-dump-guest-memory-capability
623 Show available formats for 'dump-guest-memory'
627 -> { "execute": "query-dump-guest-memory-capability" }
628 <- { "return": { "formats":
629 ["elf", "kdump-zlib", "kdump-lzo", "kdump-snappy"] }
634 Query background dump status.
640 -> { "execute": "query-dump" }
641 <- { "return": { "status": "active", "completed": 1024000,
647 Save guest storage keys to file.
651 - "filename": file path (json-string)
655 -> { "execute": "dump-skeys", "arguments": { "filename": "/tmp/skeys" } }
661 Add host network device.
665 - "type": the device type, "tap", "user", ... (json-string)
666 - "id": the device's ID, must be unique (json-string)
671 -> { "execute": "netdev_add",
672 "arguments": { "type": "user", "id": "netdev1",
673 "dnssearch": "example.org" } }
676 Note: The supported device options are the same ones supported by the '-netdev'
677 command-line argument, which are listed in the '-help' output or QEMU's
683 Remove host network device.
687 - "id": the device's ID, must be unique (json-string)
691 -> { "execute": "netdev_del", "arguments": { "id": "netdev1" } }
702 - "qom-type": the object's QOM type, i.e. the class name (json-string)
703 - "id": the object's ID, must be unique (json-string)
704 - "props": a dictionary of object property values (optional, json-dict)
708 -> { "execute": "object-add", "arguments": { "qom-type": "rng-random", "id": "rng1",
709 "props": { "filename": "/dev/hwrng" } } }
719 - "id": the object's ID (json-string)
723 -> { "execute": "object-del", "arguments": { "id": "rng1" } }
730 Resize a block image while a guest is running.
734 - "device": the device's ID, must be unique (json-string)
735 - "node-name": the node name in the block driver state graph (json-string)
740 -> { "execute": "block_resize", "arguments": { "device": "scratch", "size": 1073741824 } }
746 Copy data from a backing file into a block device.
750 - "job-id": Identifier for the newly-created block job. If omitted,
751 the device name will be used. (json-string, optional)
752 - "device": The device name or node-name of a root node (json-string)
753 - "base": The file name of the backing image above which copying starts.
754 It cannot be set if 'base-node' is also set (json-string, optional)
755 - "base-node": the node name of the backing image above which copying starts.
756 It cannot be set if 'base' is also set.
757 (json-string, optional) (Since 2.8)
758 - "backing-file": The backing file string to write into the active layer. This
759 filename is not validated.
761 If a pathname string is such that it cannot be resolved by
762 QEMU, that means that subsequent QMP or HMP commands must use
763 node-names for the image in question, as filename lookup
766 If not specified, QEMU will automatically determine the
767 backing file string to use, or error out if there is no
768 obvious choice. Care should be taken when specifying the
769 string, to specify a valid filename or protocol.
770 (json-string, optional) (Since 2.1)
771 - "speed": the maximum speed, in bytes per second (json-int, optional)
772 - "on-error": the action to take on an error (default 'report'). 'stop' and
773 'enospc' can only be used if the block device supports io-status.
774 (json-string, optional) (Since 2.1)
778 -> { "execute": "block-stream", "arguments": { "device": "virtio0",
779 "base": "/tmp/master.qcow2" } }
785 Live commit of data from overlay image nodes into backing nodes - i.e., writes
786 data between 'top' and 'base' into 'base'.
790 - "job-id": Identifier for the newly-created block job. If omitted,
791 the device name will be used. (json-string, optional)
792 - "device": The device name or node-name of a root node (json-string)
793 - "base": The file name of the backing image to write data into.
794 If not specified, this is the deepest backing image
795 (json-string, optional)
796 - "top": The file name of the backing image within the image chain,
797 which contains the topmost data to be committed down. If
798 not specified, this is the active layer. (json-string, optional)
800 - backing-file: The backing file string to write into the overlay
801 image of 'top'. If 'top' is the active layer,
802 specifying a backing file string is an error. This
803 filename is not validated.
805 If a pathname string is such that it cannot be
806 resolved by QEMU, that means that subsequent QMP or
807 HMP commands must use node-names for the image in
808 question, as filename lookup methods will fail.
810 If not specified, QEMU will automatically determine
811 the backing file string to use, or error out if
812 there is no obvious choice. Care should be taken
813 when specifying the string, to specify a valid
814 filename or protocol.
815 (json-string, optional) (Since 2.1)
817 If top == base, that is an error.
818 If top == active, the job will not be completed by itself,
819 user needs to complete the job with the block-job-complete
820 command after getting the ready event. (Since 2.0)
822 If the base image is smaller than top, then the base image
823 will be resized to be the same size as top. If top is
824 smaller than the base image, the base will not be
825 truncated. If you want the base image size to match the
826 size of the smaller top, you can safely truncate it
827 yourself once the commit operation successfully completes.
829 - "speed": the maximum speed, in bytes per second (json-int, optional)
834 -> { "execute": "block-commit", "arguments": { "device": "virtio0",
835 "top": "/tmp/snap1.qcow2" } }
841 Start a point-in-time copy of a block device to a new destination. The
842 status of ongoing drive-backup operations can be checked with
843 query-block-jobs where the BlockJobInfo.type field has the value 'backup'.
844 The operation can be stopped before it has completed using the
845 block-job-cancel command.
849 - "job-id": Identifier for the newly-created block job. If omitted,
850 the device name will be used. (json-string, optional)
851 - "device": the device name or node-name of a root node which should be copied.
853 - "target": the target of the new image. If the file exists, or if it is a
854 device, the existing file/device will be used as the new
855 destination. If it does not exist, a new file will be created.
857 - "format": the format of the new destination, default is to probe if 'mode' is
858 'existing', else the format of the source
859 (json-string, optional)
860 - "sync": what parts of the disk image should be copied to the destination;
861 possibilities include "full" for all the disk, "top" for only the sectors
862 allocated in the topmost image, "incremental" for only the dirty sectors in
863 the bitmap, or "none" to only replicate new I/O (MirrorSyncMode).
864 - "bitmap": dirty bitmap name for sync==incremental. Must be present if sync
865 is "incremental", must NOT be present otherwise.
866 - "mode": whether and how QEMU should create a new image
867 (NewImageMode, optional, default 'absolute-paths')
868 - "speed": the maximum speed, in bytes per second (json-int, optional)
869 - "compress": true to compress data, if the target format supports it.
870 (json-bool, optional, default false)
871 - "on-source-error": the action to take on an error on the source, default
872 'report'. 'stop' and 'enospc' can only be used
873 if the block device supports io-status.
874 (BlockdevOnError, optional)
875 - "on-target-error": the action to take on an error on the target, default
876 'report' (no limitations, since this applies to
877 a different block device than device).
878 (BlockdevOnError, optional)
881 -> { "execute": "drive-backup", "arguments": { "device": "drive0",
883 "target": "backup.img" } }
889 The device version of drive-backup: this command takes an existing named device
894 - "job-id": Identifier for the newly-created block job. If omitted,
895 the device name will be used. (json-string, optional)
896 - "device": the device name or node-name of a root node which should be copied.
898 - "target": the name of the backup target device. (json-string)
899 - "sync": what parts of the disk image should be copied to the destination;
900 possibilities include "full" for all the disk, "top" for only the
901 sectors allocated in the topmost image, or "none" to only replicate
902 new I/O (MirrorSyncMode).
903 - "speed": the maximum speed, in bytes per second (json-int, optional)
904 - "compress": true to compress data, if the target format supports it.
905 (json-bool, optional, default false)
906 - "on-source-error": the action to take on an error on the source, default
907 'report'. 'stop' and 'enospc' can only be used
908 if the block device supports io-status.
909 (BlockdevOnError, optional)
910 - "on-target-error": the action to take on an error on the target, default
911 'report' (no limitations, since this applies to
912 a different block device than device).
913 (BlockdevOnError, optional)
916 -> { "execute": "blockdev-backup", "arguments": { "device": "src-id",
918 "target": "tgt-id" } }
924 Atomically operate on one or more block devices. Operations that are
929 - blockdev-snapshot-sync
930 - blockdev-snapshot-internal-sync
932 - block-dirty-bitmap-add
933 - block-dirty-bitmap-clear
935 Refer to the qemu/qapi-schema.json file for minimum required QEMU
936 versions for these operations. A list of dictionaries is accepted,
937 that contains the actions to be performed. If there is any failure
938 performing any of the operations, all operations for the group are
941 For external snapshots, the dictionary contains the device, the file to use for
942 the new snapshot, and the format. The default format, if not specified, is
945 Each new snapshot defaults to being created by QEMU (wiping any
946 contents if the file already exists), but it is also possible to reuse
947 an externally-created file. In the latter case, you should ensure that
948 the new image file has the same contents as the current one; QEMU cannot
949 perform any meaningful check. Typically this is achieved by using the
950 current image file as the backing file for the new image.
952 On failure, the original disks pre-snapshot attempt will be used.
954 For internal snapshots, the dictionary contains the device and the snapshot's
955 name. If an internal snapshot matching name already exists, the request will
956 be rejected. Only some image formats support it, for example, qcow2, rbd,
959 On failure, qemu will try delete the newly created internal snapshot in the
960 transaction. When an I/O error occurs during deletion, the user needs to fix
961 it later with qemu-img or other command.
966 - "type": the operation to perform (json-string). Possible
967 values: "drive-backup", "blockdev-backup",
968 "blockdev-snapshot-sync",
969 "blockdev-snapshot-internal-sync",
970 "abort", "block-dirty-bitmap-add",
971 "block-dirty-bitmap-clear"
972 - "data": a dictionary. The contents depend on the value
973 of "type". When "type" is "blockdev-snapshot-sync":
974 - "device": device name to snapshot (json-string)
975 - "node-name": graph node name to snapshot (json-string)
976 - "snapshot-file": name of new image file (json-string)
977 - "snapshot-node-name": graph node name of the new snapshot (json-string)
978 - "format": format of new image (json-string, optional)
979 - "mode": whether and how QEMU should create the snapshot file
980 (NewImageMode, optional, default "absolute-paths")
981 When "type" is "blockdev-snapshot-internal-sync":
982 - "device": the device name or node-name of a root node to snapshot
984 - "name": name of the new snapshot (json-string)
988 -> { "execute": "transaction",
989 "arguments": { "actions": [
990 { "type": "blockdev-snapshot-sync", "data" : { "device": "ide-hd0",
991 "snapshot-file": "/some/place/my-image",
992 "format": "qcow2" } },
993 { "type": "blockdev-snapshot-sync", "data" : { "node-name": "myfile",
994 "snapshot-file": "/some/place/my-image2",
995 "snapshot-node-name": "node3432",
997 "format": "qcow2" } },
998 { "type": "blockdev-snapshot-sync", "data" : { "device": "ide-hd1",
999 "snapshot-file": "/some/place/my-image2",
1001 "format": "qcow2" } },
1002 { "type": "blockdev-snapshot-internal-sync", "data" : {
1003 "device": "ide-hd2",
1004 "name": "snapshot0" } } ] } }
1007 block-dirty-bitmap-add
1008 ----------------------
1011 Create a dirty bitmap with a name on the device, and start tracking the writes.
1015 - "node": device/node on which to create dirty bitmap (json-string)
1016 - "name": name of the new dirty bitmap (json-string)
1017 - "granularity": granularity to track writes with (int, optional)
1021 -> { "execute": "block-dirty-bitmap-add", "arguments": { "node": "drive0",
1022 "name": "bitmap0" } }
1025 block-dirty-bitmap-remove
1026 -------------------------
1029 Stop write tracking and remove the dirty bitmap that was created with
1030 block-dirty-bitmap-add.
1034 - "node": device/node on which to remove dirty bitmap (json-string)
1035 - "name": name of the dirty bitmap to remove (json-string)
1039 -> { "execute": "block-dirty-bitmap-remove", "arguments": { "node": "drive0",
1040 "name": "bitmap0" } }
1043 block-dirty-bitmap-clear
1044 ------------------------
1047 Reset the dirty bitmap associated with a node so that an incremental backup
1048 from this point in time forward will only backup clusters modified after this
1053 - "node": device/node on which to remove dirty bitmap (json-string)
1054 - "name": name of the dirty bitmap to remove (json-string)
1058 -> { "execute": "block-dirty-bitmap-clear", "arguments": { "node": "drive0",
1059 "name": "bitmap0" } }
1062 blockdev-snapshot-sync
1063 ----------------------
1065 Synchronous snapshot of a block device. snapshot-file specifies the
1066 target of the new image. If the file exists, or if it is a device, the
1067 snapshot will be created in the existing file/device. If does not
1068 exist, a new file will be created. format specifies the format of the
1069 snapshot image, default is qcow2.
1073 - "device": device name to snapshot (json-string)
1074 - "node-name": graph node name to snapshot (json-string)
1075 - "snapshot-file": name of new image file (json-string)
1076 - "snapshot-node-name": graph node name of the new snapshot (json-string)
1077 - "mode": whether and how QEMU should create the snapshot file
1078 (NewImageMode, optional, default "absolute-paths")
1079 - "format": format of new image (json-string, optional)
1083 -> { "execute": "blockdev-snapshot-sync", "arguments": { "device": "ide-hd0",
1085 "/some/place/my-image",
1086 "format": "qcow2" } }
1093 Create a snapshot, by installing 'node' as the backing image of
1094 'overlay'. Additionally, if 'node' is associated with a block
1095 device, the block device changes to using 'overlay' as its new active
1100 - "node": device that will have a snapshot created (json-string)
1101 - "overlay": device that will have 'node' as its backing image (json-string)
1105 -> { "execute": "blockdev-add",
1106 "arguments": { "driver": "qcow2",
1107 "node-name": "node1534",
1108 "file": { "driver": "file",
1109 "filename": "hd1.qcow2" },
1114 -> { "execute": "blockdev-snapshot", "arguments": { "node": "ide-hd0",
1115 "overlay": "node1534" } }
1118 blockdev-snapshot-internal-sync
1119 -------------------------------
1121 Synchronously take an internal snapshot of a block device when the format of
1122 image used supports it. If the name is an empty string, or a snapshot with
1123 name already exists, the operation will fail.
1127 - "device": the device name or node-name of a root node to snapshot
1129 - "name": name of the new snapshot (json-string)
1133 -> { "execute": "blockdev-snapshot-internal-sync",
1134 "arguments": { "device": "ide-hd0",
1135 "name": "snapshot0" }
1139 blockdev-snapshot-delete-internal-sync
1140 --------------------------------------
1142 Synchronously delete an internal snapshot of a block device when the format of
1143 image used supports it. The snapshot is identified by name or id or both. One
1144 of name or id is required. If the snapshot is not found, the operation will
1149 - "device": the device name or node-name of a root node (json-string)
1150 - "id": ID of the snapshot (json-string, optional)
1151 - "name": name of the snapshot (json-string, optional)
1155 -> { "execute": "blockdev-snapshot-delete-internal-sync",
1156 "arguments": { "device": "ide-hd0",
1157 "name": "snapshot0" }
1161 "name": "snapshot0",
1163 "date-sec": 1000012,
1165 "vm-clock-sec": 100,
1173 Start mirroring a block device's writes to a new destination. target
1174 specifies the target of the new image. If the file exists, or if it is
1175 a device, it will be used as the new destination for writes. If it does not
1176 exist, a new file will be created. format specifies the format of the
1177 mirror image, default is to probe if mode='existing', else the format
1182 - "job-id": Identifier for the newly-created block job. If omitted,
1183 the device name will be used. (json-string, optional)
1184 - "device": the device name or node-name of a root node whose writes should be
1185 mirrored. (json-string)
1186 - "target": name of new image file (json-string)
1187 - "format": format of new image (json-string, optional)
1188 - "node-name": the name of the new block driver state in the node graph
1189 (json-string, optional)
1190 - "replaces": the block driver node name to replace when finished
1191 (json-string, optional)
1192 - "mode": how an image file should be created into the target
1193 file/device (NewImageMode, optional, default 'absolute-paths')
1194 - "speed": maximum speed of the streaming job, in bytes per second
1196 - "granularity": granularity of the dirty bitmap, in bytes (json-int, optional)
1197 - "buf-size": maximum amount of data in flight from source to target, in bytes
1198 (json-int, default 10M)
1199 - "sync": what parts of the disk image should be copied to the destination;
1200 possibilities include "full" for all the disk, "top" for only the sectors
1201 allocated in the topmost image, or "none" to only replicate new I/O
1203 - "on-source-error": the action to take on an error on the source
1204 (BlockdevOnError, default 'report')
1205 - "on-target-error": the action to take on an error on the target
1206 (BlockdevOnError, default 'report')
1207 - "unmap": whether the target sectors should be discarded where source has only
1208 zeroes. (json-bool, optional, default true)
1210 The default value of the granularity is the image cluster size clamped
1211 between 4096 and 65536, if the image format defines one. If the format
1212 does not define a cluster size, the default value of the granularity
1218 -> { "execute": "drive-mirror", "arguments": { "device": "ide-hd0",
1219 "target": "/some/place/my-image",
1221 "format": "qcow2" } }
1227 Start mirroring a block device's writes to another block device. target
1228 specifies the target of mirror operation.
1232 - "job-id": Identifier for the newly-created block job. If omitted,
1233 the device name will be used. (json-string, optional)
1234 - "device": The device name or node-name of a root node whose writes should be
1235 mirrored (json-string)
1236 - "target": device name to mirror to (json-string)
1237 - "replaces": the block driver node name to replace when finished
1238 (json-string, optional)
1239 - "speed": maximum speed of the streaming job, in bytes per second
1241 - "granularity": granularity of the dirty bitmap, in bytes (json-int, optional)
1242 - "buf_size": maximum amount of data in flight from source to target, in bytes
1243 (json-int, default 10M)
1244 - "sync": what parts of the disk image should be copied to the destination;
1245 possibilities include "full" for all the disk, "top" for only the sectors
1246 allocated in the topmost image, or "none" to only replicate new I/O
1248 - "on-source-error": the action to take on an error on the source
1249 (BlockdevOnError, default 'report')
1250 - "on-target-error": the action to take on an error on the target
1251 (BlockdevOnError, default 'report')
1253 The default value of the granularity is the image cluster size clamped
1254 between 4096 and 65536, if the image format defines one. If the format
1255 does not define a cluster size, the default value of the granularity
1260 -> { "execute": "blockdev-mirror", "arguments": { "device": "ide-hd0",
1261 "target": "target0",
1269 Change the backing file in the image file metadata. This does not cause
1270 QEMU to reopen the image file to reparse the backing filename (it may,
1271 however, perform a reopen to change permissions from r/o -> r/w -> r/o,
1272 if needed). The new backing file string is written into the image file
1273 metadata, and the QEMU internal strings are updated.
1277 - "image-node-name": The name of the block driver state node of the
1278 image to modify. The "device" is argument is used to
1279 verify "image-node-name" is in the chain described by
1281 (json-string, optional)
1283 - "device": The device name or node-name of the root node that owns
1287 - "backing-file": The string to write as the backing file. This string is
1288 not validated, so care should be taken when specifying
1289 the string or the image chain may not be able to be
1293 Returns: Nothing on success
1294 If "device" does not exist or cannot be determined, DeviceNotFound
1299 Request VM to change its memory allocation (in bytes).
1303 - "value": New memory allocation (json-int)
1307 -> { "execute": "balloon", "arguments": { "value": 536870912 } }
1313 Change the link status of a network adapter.
1317 - "name": network device name (json-string)
1318 - "up": status is up (json-bool)
1322 -> { "execute": "set_link", "arguments": { "name": "e1000.0", "up": false } }
1328 Receive a file descriptor via SCM rights and assign it a name.
1332 - "fdname": file descriptor name (json-string)
1336 -> { "execute": "getfd", "arguments": { "fdname": "fd1" } }
1341 (1) If the name specified by the "fdname" argument already exists,
1342 the file descriptor assigned to it will be closed and replaced
1343 by the received file descriptor.
1344 (2) The 'closefd' command can be used to explicitly close the file
1345 descriptor when it is no longer needed.
1350 Close a file descriptor previously passed via SCM rights.
1354 - "fdname": file descriptor name (json-string)
1358 -> { "execute": "closefd", "arguments": { "fdname": "fd1" } }
1364 Add a file descriptor, that was passed via SCM rights, to an fd set.
1368 - "fdset-id": The ID of the fd set to add the file descriptor to.
1369 (json-int, optional)
1370 - "opaque": A free-form string that can be used to describe the fd.
1371 (json-string, optional)
1373 Return a json-object with the following information:
1375 - "fdset-id": The ID of the fd set that the fd was added to. (json-int)
1376 - "fd": The file descriptor that was received via SCM rights and added to the
1381 -> { "execute": "add-fd", "arguments": { "fdset-id": 1 } }
1382 <- { "return": { "fdset-id": 1, "fd": 3 } }
1386 (1) The list of fd sets is shared by all monitor connections.
1387 (2) If "fdset-id" is not specified, a new fd set will be created.
1392 Remove a file descriptor from an fd set.
1396 - "fdset-id": The ID of the fd set that the file descriptor belongs to.
1398 - "fd": The file descriptor that is to be removed. (json-int, optional)
1402 -> { "execute": "remove-fd", "arguments": { "fdset-id": 1, "fd": 3 } }
1407 (1) The list of fd sets is shared by all monitor connections.
1408 (2) If "fd" is not specified, all file descriptors in "fdset-id" will be
1414 Return information describing all fd sets.
1420 -> { "execute": "query-fdsets" }
1426 "opaque": "rdonly:/path/to/file"
1430 "opaque": "rdwr:/path/to/file"
1449 Note: The list of fd sets is shared by all monitor connections.
1454 Set the password of encrypted block devices.
1458 - "device": device name (json-string)
1459 - "node-name": name in the block driver state graph (json-string)
1460 - "password": password (json-string)
1464 -> { "execute": "block_passwd", "arguments": { "device": "ide0-hd0",
1465 "password": "12345" } }
1468 block_set_io_throttle
1471 Change I/O throttle limits for a block drive.
1475 - "device": block device name (deprecated, use @id instead)
1476 (json-string, optional)
1477 - "id": the name or QOM path of the guest device (json-string, optional)
1478 - "bps": total throughput limit in bytes per second (json-int)
1479 - "bps_rd": read throughput limit in bytes per second (json-int)
1480 - "bps_wr": write throughput limit in bytes per second (json-int)
1481 - "iops": total I/O operations per second (json-int)
1482 - "iops_rd": read I/O operations per second (json-int)
1483 - "iops_wr": write I/O operations per second (json-int)
1484 - "bps_max": total throughput limit during bursts, in bytes (json-int, optional)
1485 - "bps_rd_max": read throughput limit during bursts, in bytes (json-int, optional)
1486 - "bps_wr_max": write throughput limit during bursts, in bytes (json-int, optional)
1487 - "iops_max": total I/O operations per second during bursts (json-int, optional)
1488 - "iops_rd_max": read I/O operations per second during bursts (json-int, optional)
1489 - "iops_wr_max": write I/O operations per second during bursts (json-int, optional)
1490 - "bps_max_length": maximum length of the @bps_max burst period, in seconds (json-int, optional)
1491 - "bps_rd_max_length": maximum length of the @bps_rd_max burst period, in seconds (json-int, optional)
1492 - "bps_wr_max_length": maximum length of the @bps_wr_max burst period, in seconds (json-int, optional)
1493 - "iops_max_length": maximum length of the @iops_max burst period, in seconds (json-int, optional)
1494 - "iops_rd_max_length": maximum length of the @iops_rd_max burst period, in seconds (json-int, optional)
1495 - "iops_wr_max_length": maximum length of the @iops_wr_max burst period, in seconds (json-int, optional)
1496 - "iops_size": I/O size in bytes when limiting (json-int, optional)
1497 - "group": throttle group name (json-string, optional)
1501 -> { "execute": "block_set_io_throttle", "arguments": { "id": "ide0-1-0",
1514 "bps_max_length": 60,
1521 Set the password for vnc/spice protocols.
1525 - "protocol": protocol name (json-string)
1526 - "password": password (json-string)
1527 - "connected": [ keep | disconnect | fail ] (json-string, optional)
1531 -> { "execute": "set_password", "arguments": { "protocol": "vnc",
1532 "password": "secret" } }
1538 Set the password expire time for vnc/spice protocols.
1542 - "protocol": protocol name (json-string)
1543 - "time": [ now | never | +secs | secs ] (json-string)
1547 -> { "execute": "expire_password", "arguments": { "protocol": "vnc",
1554 Add a graphics client
1558 - "protocol": protocol name (json-string)
1559 - "fdname": file descriptor name (json-string)
1560 - "skipauth": whether to skip authentication (json-bool, optional)
1561 - "tls": whether to perform TLS (json-bool, optional)
1565 -> { "execute": "add_client", "arguments": { "protocol": "vnc",
1566 "fdname": "myclient" } }
1572 Enable QMP capabilities.
1578 -> { "execute": "qmp_capabilities" }
1581 Note: This command must be issued before issuing any other command.
1583 human-monitor-command
1584 ---------------------
1586 Execute a Human Monitor command.
1590 - command-line: the command name and its arguments, just like the
1591 Human Monitor's shell (json-string)
1592 - cpu-index: select the CPU number to be used by commands which access CPU
1593 data, like 'info registers'. The Monitor selects CPU 0 if this
1594 argument is not provided (json-int, optional)
1598 -> { "execute": "human-monitor-command", "arguments": { "command-line": "info kvm" } }
1599 <- { "return": "kvm support: enabled\r\n" }
1603 (1) The Human Monitor is NOT an stable interface, this means that command
1604 names, arguments and responses can change or be removed at ANY time.
1605 Applications that rely on long term stability guarantees should NOT
1610 o This command is stateless, this means that commands that depend
1611 on state information (such as getfd) might not work
1613 o Commands that prompt the user for data (eg. 'cont' when the block
1614 device is encrypted) don't currently work
1625 Return a json-object with the following information:
1627 - "qemu": A json-object containing three integer values:
1628 - "major": QEMU's major version (json-int)
1629 - "minor": QEMU's minor version (json-int)
1630 - "micro": QEMU's micro version (json-int)
1631 - "package": package's version (json-string)
1635 -> { "execute": "query-version" }
1650 List QMP available commands.
1652 Each command is represented by a json-object, the returned value is a json-array
1655 Each json-object contain:
1657 - "name": command's name (json-string)
1661 -> { "execute": "query-commands" }
1665 "name":"query-balloon"
1668 "name":"system_powerdown"
1673 Note: This example has been shortened as the real response is too long.
1678 List QMP available events.
1680 Each event is represented by a json-object, the returned value is a json-array
1683 Each json-object contains:
1685 - "name": event's name (json-string)
1689 -> { "execute": "query-events" }
1701 Note: This example has been shortened as the real response is too long.
1706 Return the QMP wire schema. The returned value is a json-array of
1707 named schema entities. Entities are commands, events and various
1708 types. See docs/qapi-code-gen.txt for information on their structure
1714 Each device is represented by a json-object. The returned value is a json-array
1717 Each json-object contain the following:
1719 - "label": device's label (json-string)
1720 - "filename": device's file (json-string)
1721 - "frontend-open": open/closed state of the frontend device attached to this
1726 -> { "execute": "query-chardev" }
1730 "label": "charchannel0",
1731 "filename": "unix:/var/lib/libvirt/qemu/seabios.rhel6.agent,server",
1732 "frontend-open": false
1735 "label": "charmonitor",
1736 "filename": "unix:/var/lib/libvirt/qemu/seabios.rhel6.monitor,server",
1737 "frontend-open": true
1740 "label": "charserial0",
1741 "filename": "pty:/dev/pts/2",
1742 "frontend-open": true
1747 query-chardev-backends
1750 List available character device backends.
1752 Each backend is represented by a json-object, the returned value is a json-array
1755 Each json-object contains:
1757 - "name": backend name (json-string)
1761 -> { "execute": "query-chardev-backends" }
1782 Show the block devices.
1784 Each block device information is stored in a json-object and the returned value
1785 is a json-array of all devices.
1787 Each json-object contain the following:
1789 - "device": device name (json-string)
1790 - "type": device type (json-string)
1791 - deprecated, retained for backward compatibility
1792 - Possible values: "unknown"
1793 - "removable": true if the device is removable, false otherwise (json-bool)
1794 - "locked": true if the device is locked, false otherwise (json-bool)
1795 - "tray_open": only present if removable, true if the device has a tray,
1796 and it is open (json-bool)
1797 - "inserted": only present if the device is inserted, it is a json-object
1798 containing the following:
1799 - "file": device file name (json-string)
1800 - "ro": true if read-only, false otherwise (json-bool)
1801 - "drv": driver format name (json-string)
1802 - Possible values: "blkdebug", "bochs", "cloop", "dmg",
1803 "file", "file", "ftp", "ftps", "host_cdrom",
1804 "host_device", "http", "https",
1805 "nbd", "parallels", "qcow", "qcow2", "raw",
1806 "vdi", "vmdk", "vpc", "vvfat"
1807 - "backing_file": backing file name (json-string, optional)
1808 - "backing_file_depth": number of files in the backing file chain (json-int)
1809 - "encrypted": true if encrypted, false otherwise (json-bool)
1810 - "bps": limit total bytes per second (json-int)
1811 - "bps_rd": limit read bytes per second (json-int)
1812 - "bps_wr": limit write bytes per second (json-int)
1813 - "iops": limit total I/O operations per second (json-int)
1814 - "iops_rd": limit read operations per second (json-int)
1815 - "iops_wr": limit write operations per second (json-int)
1816 - "bps_max": total max in bytes (json-int)
1817 - "bps_rd_max": read max in bytes (json-int)
1818 - "bps_wr_max": write max in bytes (json-int)
1819 - "iops_max": total I/O operations max (json-int)
1820 - "iops_rd_max": read I/O operations max (json-int)
1821 - "iops_wr_max": write I/O operations max (json-int)
1822 - "iops_size": I/O size when limiting by iops (json-int)
1823 - "detect_zeroes": detect and optimize zero writing (json-string)
1824 - Possible values: "off", "on", "unmap"
1825 - "write_threshold": write offset threshold in bytes, a event will be
1826 emitted if crossed. Zero if disabled (json-int)
1827 - "image": the detail of the image, it is a json-object containing
1829 - "filename": image file name (json-string)
1830 - "format": image format (json-string)
1831 - "virtual-size": image capacity in bytes (json-int)
1832 - "dirty-flag": true if image is not cleanly closed, not present
1833 means clean (json-bool, optional)
1834 - "actual-size": actual size on disk in bytes of the image, not
1835 present when image does not support thin
1836 provision (json-int, optional)
1837 - "cluster-size": size of a cluster in bytes, not present if image
1838 format does not support it (json-int, optional)
1839 - "encrypted": true if the image is encrypted, not present means
1840 false or the image format does not support
1841 encryption (json-bool, optional)
1842 - "backing_file": backing file name, not present means no backing
1843 file is used or the image format does not
1844 support backing file chain
1845 (json-string, optional)
1846 - "full-backing-filename": full path of the backing file, not
1847 present if it equals backing_file or no
1848 backing file is used
1849 (json-string, optional)
1850 - "backing-filename-format": the format of the backing file, not
1851 present means unknown or no backing
1852 file (json-string, optional)
1853 - "snapshots": the internal snapshot info, it is an optional list
1854 of json-object containing the following:
1855 - "id": unique snapshot id (json-string)
1856 - "name": snapshot name (json-string)
1857 - "vm-state-size": size of the VM state in bytes (json-int)
1858 - "date-sec": UTC date of the snapshot in seconds (json-int)
1859 - "date-nsec": fractional part in nanoseconds to be used with
1861 - "vm-clock-sec": VM clock relative to boot in seconds
1863 - "vm-clock-nsec": fractional part in nanoseconds to be used
1864 with vm-clock-sec (json-int)
1865 - "backing-image": the detail of the backing image, it is an
1866 optional json-object only present when a
1867 backing image present for this image
1869 - "io-status": I/O operation status, only present if the device supports it
1870 and the VM is configured to stop on errors. It's always reset
1871 to "ok" when the "cont" command is issued (json_string, optional)
1872 - Possible values: "ok", "failed", "nospace"
1876 -> { "execute": "query-block" }
1881 "device":"ide0-hd0",
1888 "file":"disks/test.qcow2",
1889 "backing_file_depth":1,
1903 "detect_zeroes": "on",
1904 "write_threshold": 0,
1906 "filename":"disks/test.qcow2",
1908 "virtual-size":2048000,
1909 "backing_file":"base.qcow2",
1910 "full-backing-filename":"disks/base.qcow2",
1911 "backing-filename-format":"qcow2",
1915 "name": "snapshot1",
1917 "date-sec": 10000200,
1919 "vm-clock-sec": 206,
1924 "filename":"disks/base.qcow2",
1926 "virtual-size":2048000
1934 "device":"ide1-cd0",
1957 Show block device statistics.
1959 Each device statistic information is stored in a json-object and the returned
1960 value is a json-array of all devices.
1962 Each json-object contain the following:
1964 - "device": device name (json-string)
1965 - "stats": A json-object with the statistics information, it contains:
1966 - "rd_bytes": bytes read (json-int)
1967 - "wr_bytes": bytes written (json-int)
1968 - "rd_operations": read operations (json-int)
1969 - "wr_operations": write operations (json-int)
1970 - "flush_operations": cache flush operations (json-int)
1971 - "wr_total_time_ns": total time spend on writes in nano-seconds (json-int)
1972 - "rd_total_time_ns": total time spend on reads in nano-seconds (json-int)
1973 - "flush_total_time_ns": total time spend on cache flushes in nano-seconds (json-int)
1974 - "wr_highest_offset": The offset after the greatest byte written to the
1975 BlockDriverState since it has been opened (json-int)
1976 - "rd_merged": number of read requests that have been merged into
1977 another request (json-int)
1978 - "wr_merged": number of write requests that have been merged into
1979 another request (json-int)
1980 - "idle_time_ns": time since the last I/O operation, in
1981 nanoseconds. If the field is absent it means
1982 that there haven't been any operations yet
1983 (json-int, optional)
1984 - "failed_rd_operations": number of failed read operations
1986 - "failed_wr_operations": number of failed write operations
1988 - "failed_flush_operations": number of failed flush operations
1990 - "invalid_rd_operations": number of invalid read operations
1992 - "invalid_wr_operations": number of invalid write operations
1994 - "invalid_flush_operations": number of invalid flush operations
1996 - "account_invalid": whether invalid operations are included in
1997 the last access statistics (json-bool)
1998 - "account_failed": whether failed operations are included in the
1999 latency and last access statistics
2001 - "timed_stats": A json-array containing statistics collected in
2002 specific intervals, with the following members:
2003 - "interval_length": interval used for calculating the
2004 statistics, in seconds (json-int)
2005 - "min_rd_latency_ns": minimum latency of read operations in
2006 the defined interval, in nanoseconds
2008 - "min_wr_latency_ns": minimum latency of write operations in
2009 the defined interval, in nanoseconds
2011 - "min_flush_latency_ns": minimum latency of flush operations
2012 in the defined interval, in
2013 nanoseconds (json-int)
2014 - "max_rd_latency_ns": maximum latency of read operations in
2015 the defined interval, in nanoseconds
2017 - "max_wr_latency_ns": maximum latency of write operations in
2018 the defined interval, in nanoseconds
2020 - "max_flush_latency_ns": maximum latency of flush operations
2021 in the defined interval, in
2022 nanoseconds (json-int)
2023 - "avg_rd_latency_ns": average latency of read operations in
2024 the defined interval, in nanoseconds
2026 - "avg_wr_latency_ns": average latency of write operations in
2027 the defined interval, in nanoseconds
2029 - "avg_flush_latency_ns": average latency of flush operations
2030 in the defined interval, in
2031 nanoseconds (json-int)
2032 - "avg_rd_queue_depth": average number of pending read
2033 operations in the defined interval
2035 - "avg_wr_queue_depth": average number of pending write
2036 operations in the defined interval
2038 - "parent": Contains recursively the statistics of the underlying
2039 protocol (e.g. the host file for a qcow2 image). If there is
2040 no underlying protocol, this field is omitted
2041 (json-object, optional)
2045 -> { "execute": "query-blockstats" }
2049 "device":"ide0-hd0",
2052 "wr_highest_offset":3686448128,
2054 "wr_operations":751,
2055 "rd_bytes":122567168,
2056 "rd_operations":36772
2057 "wr_total_times_ns":313253456
2058 "rd_total_times_ns":3465673657
2059 "flush_total_times_ns":49653
2060 "flush_operations":61,
2063 "idle_time_ns":2953431879,
2064 "account_invalid":true,
2065 "account_failed":false
2069 "wr_highest_offset":2821110784,
2071 "wr_operations":692,
2072 "rd_bytes":122739200,
2073 "rd_operations":36604
2074 "flush_operations":51,
2075 "wr_total_times_ns":313253456
2076 "rd_total_times_ns":3465673657
2077 "flush_total_times_ns":49653,
2080 "idle_time_ns":2953431879,
2081 "account_invalid":true,
2082 "account_failed":false
2086 "device":"ide1-cd0",
2088 "wr_highest_offset":0,
2093 "flush_operations":0,
2094 "wr_total_times_ns":0
2095 "rd_total_times_ns":0
2096 "flush_total_times_ns":0,
2099 "account_invalid":false,
2100 "account_failed":false
2106 "wr_highest_offset":0,
2111 "flush_operations":0,
2112 "wr_total_times_ns":0
2113 "rd_total_times_ns":0
2114 "flush_total_times_ns":0,
2117 "account_invalid":false,
2118 "account_failed":false
2124 "wr_highest_offset":0,
2129 "flush_operations":0,
2130 "wr_total_times_ns":0
2131 "rd_total_times_ns":0
2132 "flush_total_times_ns":0,
2135 "account_invalid":false,
2136 "account_failed":false
2145 Show CPU information.
2147 Return a json-array. Each CPU is represented by a json-object, which contains:
2149 - "CPU": CPU index (json-int)
2150 - "current": true if this is the current CPU, false otherwise (json-bool)
2151 - "halted": true if the cpu is halted, false otherwise (json-bool)
2152 - "qom_path": path to the CPU object in the QOM tree (json-str)
2153 - "arch": architecture of the cpu, which determines what additional
2154 keys will be present (json-str)
2155 - Current program counter. The key's name depends on the architecture:
2156 "pc": i386/x86_64 (json-int)
2157 "nip": PPC (json-int)
2158 "pc" and "npc": sparc (json-int)
2159 "PC": mips (json-int)
2160 - "thread_id": ID of the underlying host thread (json-int)
2164 -> { "execute": "query-cpus" }
2171 "qom_path":"/machine/unattached/device[0]",
2180 "qom_path":"/machine/unattached/device[2]",
2191 Returns a list of information about each iothread.
2193 Note this list excludes the QEMU main loop thread, which is not declared
2194 using the -object iothread command-line option. It is always the main thread
2197 Return a json-array. Each iothread is represented by a json-object, which contains:
2199 - "id": name of iothread (json-str)
2200 - "thread-id": ID of the underlying host thread (json-int)
2204 -> { "execute": "query-iothreads" }
2221 PCI buses and devices information.
2223 The returned value is a json-array of all buses. Each bus is represented by
2224 a json-object, which has a key with a json-array of all PCI devices attached
2225 to it. Each device is represented by a json-object.
2227 The bus json-object contains the following:
2229 - "bus": bus number (json-int)
2230 - "devices": a json-array of json-objects, each json-object represents a
2233 The PCI device json-object contains the following:
2235 - "bus": identical to the parent's bus number (json-int)
2236 - "slot": slot number (json-int)
2237 - "function": function number (json-int)
2238 - "class_info": a json-object containing:
2239 - "desc": device class description (json-string, optional)
2240 - "class": device class number (json-int)
2241 - "id": a json-object containing:
2242 - "device": device ID (json-int)
2243 - "vendor": vendor ID (json-int)
2244 - "irq": device's IRQ if assigned (json-int, optional)
2245 - "qdev_id": qdev id string (json-string)
2246 - "pci_bridge": It's a json-object, only present if this device is a
2247 PCI bridge, contains:
2248 - "bus": bus number (json-int)
2249 - "secondary": secondary bus number (json-int)
2250 - "subordinate": subordinate bus number (json-int)
2251 - "io_range": I/O memory range information, a json-object with the
2253 - "base": base address, in bytes (json-int)
2254 - "limit": limit address, in bytes (json-int)
2255 - "memory_range": memory range information, a json-object with the
2257 - "base": base address, in bytes (json-int)
2258 - "limit": limit address, in bytes (json-int)
2259 - "prefetchable_range": Prefetchable memory range information, a
2260 json-object with the following members:
2261 - "base": base address, in bytes (json-int)
2262 - "limit": limit address, in bytes (json-int)
2263 - "devices": a json-array of PCI devices if there's any attached, each
2264 each element is represented by a json-object, which contains
2265 the same members of the 'PCI device json-object' described
2267 - "regions": a json-array of json-objects, each json-object represents a
2268 memory region of this device
2270 The memory range json-object contains the following:
2272 - "base": base memory address (json-int)
2273 - "limit": limit value (json-int)
2275 The region json-object can be an I/O region or a memory region, an I/O region
2276 json-object contains the following:
2278 - "type": "io" (json-string, fixed)
2279 - "bar": BAR number (json-int)
2280 - "address": memory address (json-int)
2281 - "size": memory size (json-int)
2283 A memory region json-object contains the following:
2285 - "type": "memory" (json-string, fixed)
2286 - "bar": BAR number (json-int)
2287 - "address": memory address (json-int)
2288 - "size": memory size (json-int)
2289 - "mem_type_64": true or false (json-bool)
2290 - "prefetch": true or false (json-bool)
2294 -> { "execute": "query-pci" }
2306 "desc":"Host bridge"
2340 "desc":"IDE controller"
2362 "desc":"VGA controller"
2372 "mem_type_64":false,
2375 "address":4026531840,
2380 "mem_type_64":false,
2383 "address":4060086272,
2388 "mem_type_64":false,
2403 "desc":"RAM controller"
2424 Note: This example has been shortened as the real response is too long.
2429 Show KVM information.
2431 Return a json-object with the following information:
2433 - "enabled": true if KVM support is enabled, false otherwise (json-bool)
2434 - "present": true if QEMU has KVM support, false otherwise (json-bool)
2438 -> { "execute": "query-kvm" }
2439 <- { "return": { "enabled": true, "present": true } }
2444 Return a json-object with the following information:
2446 - "running": true if the VM is running, or false if it is paused (json-bool)
2447 - "singlestep": true if the VM is in single step mode,
2448 false otherwise (json-bool)
2449 - "status": one of the following values (json-string)
2450 "debug" - QEMU is running on a debugger
2451 "inmigrate" - guest is paused waiting for an incoming migration
2452 "internal-error" - An internal error that prevents further guest
2453 execution has occurred
2454 "io-error" - the last IOP has failed and the device is configured
2455 to pause on I/O errors
2456 "paused" - guest has been paused via the 'stop' command
2457 "postmigrate" - guest is paused following a successful 'migrate'
2458 "prelaunch" - QEMU was started with -S and guest has not started
2459 "finish-migrate" - guest is paused to finish the migration process
2460 "restore-vm" - guest is paused to restore VM state
2461 "running" - guest is actively running
2462 "save-vm" - guest is paused to save the VM state
2463 "shutdown" - guest is shut down (and -no-shutdown is in use)
2464 "watchdog" - the watchdog action is configured to pause and
2469 -> { "execute": "query-status" }
2470 <- { "return": { "running": true, "singlestep": false, "status": "running" } }
2475 Show VM mice information.
2477 Each mouse is represented by a json-object, the returned value is a json-array
2480 The mouse json-object contains the following:
2482 - "name": mouse's name (json-string)
2483 - "index": mouse's index (json-int)
2484 - "current": true if this mouse is receiving events, false otherwise (json-bool)
2485 - "absolute": true if the mouse generates absolute input events (json-bool)
2489 -> { "execute": "query-mice" }
2493 "name":"QEMU Microsoft Mouse",
2499 "name":"QEMU PS/2 Mouse",
2510 Show VNC server information.
2512 Return a json-object with server information. Connected clients are returned
2513 as a json-array of json-objects.
2515 The main json-object contains the following:
2517 - "enabled": true or false (json-bool)
2518 - "host": server's IP address (json-string)
2519 - "family": address family (json-string)
2520 - Possible values: "ipv4", "ipv6", "unix", "unknown"
2521 - "service": server's port number (json-string)
2522 - "auth": authentication method (json-string)
2523 - Possible values: "invalid", "none", "ra2", "ra2ne", "sasl", "tight",
2524 "tls", "ultra", "unknown", "vencrypt", "vencrypt",
2525 "vencrypt+plain", "vencrypt+tls+none",
2526 "vencrypt+tls+plain", "vencrypt+tls+sasl",
2527 "vencrypt+tls+vnc", "vencrypt+x509+none",
2528 "vencrypt+x509+plain", "vencrypt+x509+sasl",
2529 "vencrypt+x509+vnc", "vnc"
2530 - "clients": a json-array of all connected clients
2532 Clients are described by a json-object, each one contain the following:
2534 - "host": client's IP address (json-string)
2535 - "family": address family (json-string)
2536 - Possible values: "ipv4", "ipv6", "unix", "unknown"
2537 - "service": client's port number (json-string)
2538 - "x509_dname": TLS dname (json-string, optional)
2539 - "sasl_username": SASL username (json-string, optional)
2543 -> { "execute": "query-vnc" }
2564 Show SPICE server information.
2566 Return a json-object with server information. Connected clients are returned
2567 as a json-array of json-objects.
2569 The main json-object contains the following:
2571 - "enabled": true or false (json-bool)
2572 - "host": server's IP address (json-string)
2573 - "port": server's port number (json-int, optional)
2574 - "tls-port": server's port number (json-int, optional)
2575 - "auth": authentication method (json-string)
2576 - Possible values: "none", "spice"
2577 - "channels": a json-array of all active channels clients
2579 Channels are described by a json-object, each one contain the following:
2581 - "host": client's IP address (json-string)
2582 - "family": address family (json-string)
2583 - Possible values: "ipv4", "ipv6", "unix", "unknown"
2584 - "port": client's port number (json-string)
2585 - "connection-id": spice connection id. All channels with the same id
2586 belong to the same spice session (json-int)
2587 - "channel-type": channel type. "1" is the main control channel, filter for
2588 this one if you want track spice sessions only (json-int)
2589 - "channel-id": channel id. Usually "0", might be different needed when
2590 multiple channels of the same type exist, such as multiple
2591 display channels in a multihead setup (json-int)
2592 - "tls": whether the channel is encrypted (json-bool)
2596 -> { "execute": "query-spice" }
2609 "connection-id": 1804289383,
2610 "host": "127.0.0.1",
2618 "connection-id": 1804289383,
2619 "host": "127.0.0.1",
2623 [ ... more channels follow ... ]
2633 Return a json-object with the following information:
2635 - "name": VM's name (json-string, optional)
2639 -> { "execute": "query-name" }
2640 <- { "return": { "name": "qemu-name" } }
2647 Return a json-object with the following information:
2649 - "UUID": Universally Unique Identifier (json-string)
2653 -> { "execute": "query-uuid" }
2654 <- { "return": { "UUID": "550e8400-e29b-41d4-a716-446655440000" } }
2656 query-command-line-options
2657 --------------------------
2659 Show command line option schema.
2661 Return a json-array of command line option schema for all options (or for
2662 the given option), returning an error if the given option doesn't exist.
2664 Each array entry contains the following:
2666 - "option": option name (json-string)
2667 - "parameters": a json-array describes all parameters of the option:
2668 - "name": parameter name (json-string)
2669 - "type": parameter type (one of 'string', 'boolean', 'number',
2671 - "help": human readable description of the parameter
2672 (json-string, optional)
2673 - "default": default value string for the parameter
2674 (json-string, optional)
2678 -> { "execute": "query-command-line-options", "arguments": { "option": "option-rom" } }
2687 "name": "bootindex",
2691 "option": "option-rom"
2701 Return a json-object. If migration is active there will be another json-object
2702 with RAM migration status and if block migration is active another one with
2703 block migration status.
2705 The main json-object contains the following:
2707 - "status": migration status (json-string)
2708 - Possible values: "setup", "active", "completed", "failed", "cancelled"
2709 - "total-time": total amount of ms since migration started. If
2710 migration has ended, it returns the total migration
2712 - "setup-time" amount of setup time in milliseconds _before_ the
2713 iterations begin but _after_ the QMP command is issued.
2714 This is designed to provide an accounting of any activities
2715 (such as RDMA pinning) which may be expensive, but do not
2716 actually occur during the iterative migration rounds
2717 themselves. (json-int)
2718 - "downtime": only present when migration has finished correctly
2719 total amount in ms for downtime that happened (json-int)
2720 - "expected-downtime": only present while migration is active
2721 total amount in ms for downtime that was calculated on
2722 the last bitmap round (json-int)
2723 - "ram": only present if "status" is "active", it is a json-object with the
2724 following RAM information:
2725 - "transferred": amount transferred in bytes (json-int)
2726 - "remaining": amount remaining to transfer in bytes (json-int)
2727 - "total": total amount of memory in bytes (json-int)
2728 - "duplicate": number of pages filled entirely with the same
2730 These are sent over the wire much more efficiently.
2731 - "skipped": number of skipped zero pages (json-int)
2732 - "normal" : number of whole pages transferred. I.e. they
2733 were not sent as duplicate or xbzrle pages (json-int)
2734 - "normal-bytes" : number of bytes transferred in whole
2735 pages. This is just normal pages times size of one page,
2736 but this way upper levels don't need to care about page
2738 - "dirty-sync-count": times that dirty ram was synchronized (json-int)
2739 - "disk": only present if "status" is "active" and it is a block migration,
2740 it is a json-object with the following disk information:
2741 - "transferred": amount transferred in bytes (json-int)
2742 - "remaining": amount remaining to transfer in bytes json-int)
2743 - "total": total disk size in bytes (json-int)
2744 - "xbzrle-cache": only present if XBZRLE is active.
2745 It is a json-object with the following XBZRLE information:
2746 - "cache-size": XBZRLE cache size in bytes
2747 - "bytes": number of bytes transferred for XBZRLE compressed pages
2748 - "pages": number of XBZRLE compressed pages
2749 - "cache-miss": number of XBRZRLE page cache misses
2750 - "cache-miss-rate": rate of XBRZRLE page cache misses
2751 - "overflow": number of times XBZRLE overflows. This means
2752 that the XBZRLE encoding was bigger than just sent the
2753 whole page, and then we sent the whole page instead (as as
2758 1. Before the first migration
2760 -> { "execute": "query-migrate" }
2763 2. Migration is done and has succeeded
2765 -> { "execute": "query-migrate" }
2767 "status": "completed",
2777 "normal-bytes":123456,
2778 "dirty-sync-count":15
2783 3. Migration is done and has failed
2785 -> { "execute": "query-migrate" }
2786 <- { "return": { "status": "failed" } }
2788 4. Migration is being performed and is not a block migration:
2790 -> { "execute": "query-migrate" }
2800 "expected-downtime":12345,
2803 "normal-bytes":123456,
2804 "dirty-sync-count":15
2809 5. Migration is being performed and is a block migration:
2811 -> { "execute": "query-migrate" }
2817 "remaining":1053304,
2821 "expected-downtime":12345,
2824 "normal-bytes":123456,
2825 "dirty-sync-count":15
2829 "remaining":20880384,
2835 6. Migration is being performed and XBZRLE is active:
2837 -> { "execute": "query-migrate" }
2841 "capabilities" : [ { "capability": "xbzrle", "state" : true } ],
2844 "remaining":1053304,
2848 "expected-downtime":12345,
2851 "normal-bytes":3412992,
2852 "dirty-sync-count":15
2855 "cache-size":67108864,
2859 "cache-miss-rate":0.123,
2865 migrate-set-capabilities
2866 ------------------------
2868 Enable/Disable migration capabilities
2870 - "xbzrle": XBZRLE support
2871 - "rdma-pin-all": pin all pages when using RDMA during migration
2872 - "auto-converge": throttle down guest to help convergence of migration
2873 - "zero-blocks": compress zero blocks during block migration
2874 - "compress": use multiple compression threads to accelerate live migration
2875 - "events": generate events for each migration state change
2876 - "postcopy-ram": postcopy mode for live migration
2877 - "x-colo": COarse-Grain LOck Stepping (COLO) for Non-stop Service
2883 -> { "execute": "migrate-set-capabilities" , "arguments":
2884 { "capabilities": [ { "capability": "xbzrle", "state": true } ] } }
2886 query-migrate-capabilities
2887 --------------------------
2889 Query current migration capabilities
2891 - "capabilities": migration capabilities state
2892 - "xbzrle" : XBZRLE state (json-bool)
2893 - "rdma-pin-all" : RDMA Pin Page state (json-bool)
2894 - "auto-converge" : Auto Converge state (json-bool)
2895 - "zero-blocks" : Zero Blocks state (json-bool)
2896 - "compress": Multiple compression threads state (json-bool)
2897 - "events": Migration state change event state (json-bool)
2898 - "postcopy-ram": postcopy ram state (json-bool)
2899 - "x-colo": COarse-Grain LOck Stepping for Non-stop Service (json-bool)
2905 -> { "execute": "query-migrate-capabilities" }
2907 {"state": false, "capability": "xbzrle"},
2908 {"state": false, "capability": "rdma-pin-all"},
2909 {"state": false, "capability": "auto-converge"},
2910 {"state": false, "capability": "zero-blocks"},
2911 {"state": false, "capability": "compress"},
2912 {"state": true, "capability": "events"},
2913 {"state": false, "capability": "postcopy-ram"},
2914 {"state": false, "capability": "x-colo"}
2917 migrate-set-parameters
2918 ----------------------
2920 Set migration parameters
2922 - "compress-level": set compression level during migration (json-int)
2923 - "compress-threads": set compression thread count for migration (json-int)
2924 - "decompress-threads": set decompression thread count for migration (json-int)
2925 - "cpu-throttle-initial": set initial percentage of time guest cpus are
2926 throttled for auto-converge (json-int)
2927 - "cpu-throttle-increment": set throttle increasing percentage for
2928 auto-converge (json-int)
2929 - "max-bandwidth": set maximum speed for migrations (in bytes/sec) (json-int)
2930 - "downtime-limit": set maximum tolerated downtime (in milliseconds) for
2931 migrations (json-int)
2932 - "x-checkpoint-delay": set the delay time for periodic checkpoint (json-int)
2938 -> { "execute": "migrate-set-parameters" , "arguments":
2939 { "compress-level": 1 } }
2941 query-migrate-parameters
2942 ------------------------
2944 Query current migration parameters
2946 - "parameters": migration parameters value
2947 - "compress-level" : compression level value (json-int)
2948 - "compress-threads" : compression thread count value (json-int)
2949 - "decompress-threads" : decompression thread count value (json-int)
2950 - "cpu-throttle-initial" : initial percentage of time guest cpus are
2951 throttled (json-int)
2952 - "cpu-throttle-increment" : throttle increasing percentage for
2953 auto-converge (json-int)
2954 - "max-bandwidth" : maximium migration speed in bytes per second
2956 - "downtime-limit" : maximum tolerated downtime of migration in
2957 milliseconds (json-int)
2962 -> { "execute": "query-migrate-parameters" }
2965 "decompress-threads": 2,
2966 "cpu-throttle-increment": 10,
2967 "compress-threads": 8,
2968 "compress-level": 1,
2969 "cpu-throttle-initial": 20,
2970 "max-bandwidth": 33554432,
2971 "downtime-limit": 300
2978 Show balloon information.
2980 Make an asynchronous request for balloon info. When the request completes a
2981 json-object will be returned containing the following data:
2983 - "actual": current balloon value in bytes (json-int)
2987 -> { "execute": "query-balloon" }
2990 "actual":1073741824,
2997 Return information about the TPM device.
3003 -> { "execute": "query-tpm" }
3006 { "model": "tpm-tis",
3008 { "type": "passthrough",
3010 { "cancel-path": "/sys/class/misc/tpm0/device/cancel",
3022 Return a list of supported TPM models.
3028 -> { "execute": "query-tpm-models" }
3029 <- { "return": [ "tpm-tis" ] }
3034 Return a list of supported TPM types.
3040 -> { "execute": "query-tpm-types" }
3041 <- { "return": [ "passthrough" ] }
3050 - "id": the chardev's ID, must be unique (json-string)
3051 - "backend": chardev backend type + parameters
3055 -> { "execute" : "chardev-add",
3056 "arguments" : { "id" : "foo",
3057 "backend" : { "type" : "null", "data" : {} } } }
3060 -> { "execute" : "chardev-add",
3061 "arguments" : { "id" : "bar",
3062 "backend" : { "type" : "file",
3063 "data" : { "out" : "/tmp/bar.log" } } } }
3066 -> { "execute" : "chardev-add",
3067 "arguments" : { "id" : "baz",
3068 "backend" : { "type" : "pty", "data" : {} } } }
3069 <- { "return": { "pty" : "/dev/pty/42" } }
3078 - "id": the chardev's ID, must exist and not be in use (json-string)
3082 -> { "execute": "chardev-remove", "arguments": { "id" : "foo" } }
3088 Show rx-filter information.
3090 Returns a json-array of rx-filter information for all NICs (or for the
3091 given NIC), returning an error if the given NIC doesn't exist, or
3092 given NIC doesn't support rx-filter querying, or given net client
3095 The query will clear the event notification flag of each NIC, then qemu
3096 will start to emit event to QMP monitor.
3098 Each array entry contains the following:
3100 - "name": net client name (json-string)
3101 - "promiscuous": promiscuous mode is enabled (json-bool)
3102 - "multicast": multicast receive state (one of 'normal', 'none', 'all')
3103 - "unicast": unicast receive state (one of 'normal', 'none', 'all')
3104 - "vlan": vlan receive state (one of 'normal', 'none', 'all') (Since 2.0)
3105 - "broadcast-allowed": allow to receive broadcast (json-bool)
3106 - "multicast-overflow": multicast table is overflowed (json-bool)
3107 - "unicast-overflow": unicast table is overflowed (json-bool)
3108 - "main-mac": main macaddr string (json-string)
3109 - "vlan-table": a json-array of active vlan id
3110 - "unicast-table": a json-array of unicast macaddr string
3111 - "multicast-table": a json-array of multicast macaddr string
3115 -> { "execute": "query-rx-filter", "arguments": { "name": "vnet0" } }
3118 "promiscuous": true,
3120 "main-mac": "52:54:00:12:34:56",
3121 "unicast": "normal",
3129 "multicast": "normal",
3130 "multicast-overflow": false,
3131 "unicast-overflow": false,
3132 "multicast-table": [
3133 "01:00:5e:00:00:01",
3134 "33:33:00:00:00:01",
3137 "broadcast-allowed": false
3147 This command is still a work in progress. It doesn't support all
3148 block drivers among other things. Stay away from it unless you want
3149 to help with its development.
3151 For the arguments, see the QAPI schema documentation of BlockdevOptions.
3155 -> { "execute": "blockdev-add",
3156 "arguments": { "driver": "qcow2",
3157 "file": { "driver": "file",
3158 "filename": "test.qcow2" } } }
3163 -> { "execute": "blockdev-add",
3166 "node-name": "my_disk",
3174 "filename": "/tmp/test.qcow2"
3180 "filename": "/dev/fdset/4"
3192 Deletes a block device that has been added using blockdev-add.
3193 The command will fail if the node is attached to a device or is
3194 otherwise being used.
3196 This command is still a work in progress and is considered
3197 experimental. Stay away from it unless you want to help with its
3202 - "node-name": Name of the graph node to delete (json-string)
3206 -> { "execute": "blockdev-add",
3209 "node-name": "node0",
3212 "filename": "test.qcow2"
3219 -> { "execute": "x-blockdev-del",
3220 "arguments": { "node-name": "node0" }
3227 Opens a block device's tray. If there is a block driver state tree inserted as a
3228 medium, it will become inaccessible to the guest (but it will remain associated
3229 to the block device, so closing the tray will make it accessible again).
3231 If the tray was already open before, this will be a no-op.
3233 Once the tray opens, a DEVICE_TRAY_MOVED event is emitted. There are cases in
3234 which no such event will be generated, these include:
3235 - if the guest has locked the tray, @force is false and the guest does not
3236 respond to the eject request
3237 - if the BlockBackend denoted by @device does not have a guest device attached
3239 - if the guest device does not have an actual tray and is empty, for instance
3240 for floppy disk drives
3244 - "device": block device name (deprecated, use @id instead)
3245 (json-string, optional)
3246 - "id": the name or QOM path of the guest device (json-string, optional)
3247 - "force": if false (the default), an eject request will be sent to the guest if
3248 it has locked the tray (and the tray will not be opened immediately);
3249 if true, the tray will be opened regardless of whether it is locked
3250 (json-bool, optional)
3254 -> { "execute": "blockdev-open-tray",
3255 "arguments": { "id": "ide0-1-0" } }
3257 <- { "timestamp": { "seconds": 1418751016,
3258 "microseconds": 716996 },
3259 "event": "DEVICE_TRAY_MOVED",
3260 "data": { "device": "ide1-cd0",
3262 "tray-open": true } }
3269 Closes a block device's tray. If there is a block driver state tree associated
3270 with the block device (which is currently ejected), that tree will be loaded as
3273 If the tray was already closed before, this will be a no-op.
3277 - "device": block device name (deprecated, use @id instead)
3278 (json-string, optional)
3279 - "id": the name or QOM path of the guest device (json-string, optional)
3283 -> { "execute": "blockdev-close-tray",
3284 "arguments": { "id": "ide0-1-0" } }
3286 <- { "timestamp": { "seconds": 1418751345,
3287 "microseconds": 272147 },
3288 "event": "DEVICE_TRAY_MOVED",
3289 "data": { "device": "ide1-cd0",
3291 "tray-open": false } }
3295 x-blockdev-remove-medium
3296 ------------------------
3298 Removes a medium (a block driver state tree) from a block device. That block
3299 device's tray must currently be open (unless there is no attached guest device).
3301 If the tray is open and there is no medium inserted, this will be a no-op.
3303 This command is still a work in progress and is considered experimental.
3304 Stay away from it unless you want to help with its development.
3308 - "device": block device name (deprecated, use @id instead)
3309 (json-string, optional)
3310 - "id": the name or QOM path of the guest device (json-string, optional)
3314 -> { "execute": "x-blockdev-remove-medium",
3315 "arguments": { "id": "ide0-1-0" } }
3317 <- { "error": { "class": "GenericError",
3318 "desc": "Tray of device 'ide0-1-0' is not open" } }
3320 -> { "execute": "blockdev-open-tray",
3321 "arguments": { "id": "ide0-1-0" } }
3323 <- { "timestamp": { "seconds": 1418751627,
3324 "microseconds": 549958 },
3325 "event": "DEVICE_TRAY_MOVED",
3326 "data": { "device": "ide1-cd0",
3328 "tray-open": true } }
3332 -> { "execute": "x-blockdev-remove-medium",
3333 "arguments": { "device": "ide0-1-0" } }
3337 x-blockdev-insert-medium
3338 ------------------------
3340 Inserts a medium (a block driver state tree) into a block device. That block
3341 device's tray must currently be open (unless there is no attached guest device)
3342 and there must be no medium inserted already.
3344 This command is still a work in progress and is considered experimental.
3345 Stay away from it unless you want to help with its development.
3349 - "device": block device name (deprecated, use @id instead)
3350 (json-string, optional)
3351 - "id": the name or QOM path of the guest device (json-string, optional)
3352 - "node-name": root node of the BDS tree to insert into the block device
3356 -> { "execute": "blockdev-add",
3357 "arguments": { { "node-name": "node0",
3359 "file": { "driver": "file",
3360 "filename": "fedora.iso" } } }
3364 -> { "execute": "x-blockdev-insert-medium",
3365 "arguments": { "id": "ide0-1-0",
3366 "node-name": "node0" } }
3373 Dynamically reconfigure the block driver state graph. It can be used
3374 to add, remove, insert or replace a graph node. Currently only the
3375 Quorum driver implements this feature to add or remove its child. This
3376 is useful to fix a broken quorum child.
3378 If @node is specified, it will be inserted under @parent. @child
3379 may not be specified in this case. If both @parent and @child are
3380 specified but @node is not, @child will be detached from @parent.
3383 - "parent": the id or name of the parent node (json-string)
3384 - "child": the name of a child under the given parent node (json-string, optional)
3385 - "node": the name of the node that will be added (json-string, optional)
3387 Note: this command is experimental, and not a stable API. It doesn't
3388 support all kinds of operations, all kinds of children, nor all block
3391 Warning: The data in a new quorum child MUST be consistent with that of
3392 the rest of the array.
3396 Add a new node to a quorum
3397 -> { "execute": "blockdev-add",
3398 "arguments": { "driver": "raw",
3399 "node-name": "new_node",
3400 "file": { "driver": "file",
3401 "filename": "test.raw" } } }
3403 -> { "execute": "x-blockdev-change",
3404 "arguments": { "parent": "disk1",
3405 "node": "new_node" } }
3408 Delete a quorum's node
3409 -> { "execute": "x-blockdev-change",
3410 "arguments": { "parent": "disk1",
3411 "child": "children.1" } }
3414 query-named-block-nodes
3415 -----------------------
3417 Return a list of BlockDeviceInfo for all the named block driver nodes
3421 -> { "execute": "query-named-block-nodes" }
3422 <- { "return": [ { "ro":false,
3425 "file":"disks/test.qcow2",
3426 "node-name": "my-node",
3427 "backing_file_depth":1,
3441 "write_threshold": 0,
3443 "filename":"disks/test.qcow2",
3445 "virtual-size":2048000,
3446 "backing_file":"base.qcow2",
3447 "full-backing-filename":"disks/base.qcow2",
3448 "backing-filename-format":"qcow2",
3452 "name": "snapshot1",
3454 "date-sec": 10000200,
3456 "vm-clock-sec": 206,
3461 "filename":"disks/base.qcow2",
3463 "virtual-size":2048000
3467 blockdev-change-medium
3468 ----------------------
3470 Changes the medium inserted into a block device by ejecting the current medium
3471 and loading a new image file which is inserted as the new medium.
3475 - "device": block device name (deprecated, use @id instead)
3476 (json-string, optional)
3477 - "id": the name or QOM path of the guest device (json-string, optional)
3478 - "filename": filename of the new image (json-string)
3479 - "format": format of the new image (json-string, optional)
3480 - "read-only-mode": new read-only mode (json-string, optional)
3481 - Possible values: "retain" (default), "read-only", "read-write"
3485 1. Change a removable medium
3487 -> { "execute": "blockdev-change-medium",
3488 "arguments": { "id": "ide0-1-0",
3489 "filename": "/srv/images/Fedora-12-x86_64-DVD.iso",
3493 2. Load a read-only medium into a writable drive
3495 -> { "execute": "blockdev-change-medium",
3496 "arguments": { "id": "floppyA",
3497 "filename": "/srv/images/ro.img",
3499 "read-only-mode": "retain" } }
3502 { "class": "GenericError",
3503 "desc": "Could not open '/srv/images/ro.img': Permission denied" } }
3505 -> { "execute": "blockdev-change-medium",
3506 "arguments": { "id": "floppyA",
3507 "filename": "/srv/images/ro.img",
3509 "read-only-mode": "read-only" } }
3516 Show memory devices information.
3521 -> { "execute": "query-memdev" }
3528 "host-nodes": [0, 1],
3536 "host-nodes": [2, 3],
3537 "policy": "preferred"
3542 query-memory-devices
3543 --------------------
3545 Return a list of memory devices.
3548 -> { "execute": "query-memory-devices" }
3549 <- { "return": [ { "data":
3550 { "addr": 5368709120,
3551 "hotpluggable": true,
3554 "memdev": "/objects/memX",
3561 query-acpi-ospm-status
3562 ----------------------
3564 Return list of ACPIOSTInfo for devices that support status reporting
3565 via ACPI _OST method.
3568 -> { "execute": "query-acpi-ospm-status" }
3569 <- { "return": [ { "device": "d1", "slot": "0", "slot-type": "DIMM", "source": 1, "status": 0},
3570 { "slot": "1", "slot-type": "DIMM", "source": 0, "status": 0},
3571 { "slot": "2", "slot-type": "DIMM", "source": 0, "status": 0},
3572 { "slot": "3", "slot-type": "DIMM", "source": 0, "status": 0}
3575 rtc-reset-reinjection
3576 ---------------------
3578 Reset the RTC interrupt reinjection backlog.
3584 -> { "execute": "rtc-reset-reinjection" }
3587 trace-event-get-state
3588 ---------------------
3590 Query the state of events.
3594 - "name": Event name pattern (json-string).
3595 - "vcpu": The vCPU to query, any vCPU by default (json-int, optional).
3597 An event is returned if:
3598 - its name matches the "name" pattern, and
3599 - if "vcpu" is given, the event has the "vcpu" property.
3601 Therefore, if "vcpu" is given, the operation will only match per-vCPU events,
3602 returning their state on the specified vCPU. Special case: if "name" is an exact
3603 match, "vcpu" is given and the event does not have the "vcpu" property, an error
3608 -> { "execute": "trace-event-get-state", "arguments": { "name": "qemu_memalign" } }
3609 <- { "return": [ { "name": "qemu_memalign", "state": "disabled" } ] }
3611 trace-event-set-state
3612 ---------------------
3614 Set the state of events.
3618 - "name": Event name pattern (json-string).
3619 - "enable": Whether to enable or disable the event (json-bool).
3620 - "ignore-unavailable": Whether to ignore errors for events that cannot be
3621 changed (json-bool, optional).
3622 - "vcpu": The vCPU to act upon, all vCPUs by default (json-int, optional).
3624 An event's state is modified if:
3625 - its name matches the "name" pattern, and
3626 - if "vcpu" is given, the event has the "vcpu" property.
3628 Therefore, if "vcpu" is given, the operation will only match per-vCPU events,
3629 setting their state on the specified vCPU. Special case: if "name" is an exact
3630 match, "vcpu" is given and the event does not have the "vcpu" property, an error
3635 -> { "execute": "trace-event-set-state", "arguments": { "name": "qemu_memalign", "enable": "true" } }
3641 Send input event to guest.
3645 - "device": display device (json-string, optional)
3646 - "head": display head (json-int, optional)
3647 - "events": list of input events
3649 The consoles are visible in the qom tree, under
3650 /backend/console[$index]. They have a device link and head property, so
3651 it is possible to map which console belongs to which device and display.
3655 Press left mouse button.
3657 -> { "execute": "input-send-event",
3658 "arguments": { "device": "video0",
3659 "events": [ { "type": "btn",
3660 "data" : { "down": true, "button": "left" } } ] } }
3663 -> { "execute": "input-send-event",
3664 "arguments": { "device": "video0",
3665 "events": [ { "type": "btn",
3666 "data" : { "down": false, "button": "left" } } ] } }
3673 -> { "execute": "input-send-event",
3674 "arguments": { "events": [
3675 { "type": "key", "data" : { "down": true,
3676 "key": {"type": "qcode", "data": "ctrl" } } },
3677 { "type": "key", "data" : { "down": true,
3678 "key": {"type": "qcode", "data": "alt" } } },
3679 { "type": "key", "data" : { "down": true,
3680 "key": {"type": "qcode", "data": "delete" } } } ] } }
3685 Move mouse pointer to absolute coordinates (20000, 400).
3687 -> { "execute": "input-send-event" ,
3688 "arguments": { "events": [
3689 { "type": "abs", "data" : { "axis": "x", "value" : 20000 } },
3690 { "type": "abs", "data" : { "axis": "y", "value" : 400 } } ] } }
3693 block-set-write-threshold
3696 Change the write threshold for a block drive. The threshold is an offset,
3697 thus must be non-negative. Default is no write threshold.
3698 Setting the threshold to zero disables it.
3702 - "node-name": the node name in the block driver state graph (json-string)
3703 - "write-threshold": the write threshold in bytes (json-int)
3707 -> { "execute": "block-set-write-threshold",
3708 "arguments": { "node-name": "mydev",
3709 "write-threshold": 17179869184 } }
3717 - "name": switch name
3721 -> { "execute": "query-rocker", "arguments": { "name": "sw1" } }
3722 <- { "return": {"name": "sw1", "ports": 2, "id": 1327446905938}}
3724 Show rocker switch ports
3725 ------------------------
3729 - "name": switch name
3733 -> { "execute": "query-rocker-ports", "arguments": { "name": "sw1" } }
3734 <- { "return": [ {"duplex": "full", "enabled": true, "name": "sw1.1",
3735 "autoneg": "off", "link-up": true, "speed": 10000},
3736 {"duplex": "full", "enabled": true, "name": "sw1.2",
3737 "autoneg": "off", "link-up": true, "speed": 10000}
3740 Show rocker switch OF-DPA flow tables
3741 -------------------------------------
3745 - "name": switch name
3746 - "tbl-id": (optional) flow table ID
3750 -> { "execute": "query-rocker-of-dpa-flows", "arguments": { "name": "sw1" } }
3751 <- { "return": [ {"key": {"in-pport": 0, "priority": 1, "tbl-id": 0},
3754 "action": {"goto-tbl": 10},
3755 "mask": {"in-pport": 4294901760}
3760 Show rocker OF-DPA group tables
3761 -------------------------------
3765 - "name": switch name
3766 - "type": (optional) group type
3770 -> { "execute": "query-rocker-of-dpa-groups", "arguments": { "name": "sw1" } }
3771 <- { "return": [ {"type": 0, "out-pport": 2, "pport": 2, "vlan-id": 3841,
3772 "pop-vlan": 1, "id": 251723778},
3773 {"type": 0, "out-pport": 0, "pport": 0, "vlan-id": 3841,
3774 "pop-vlan": 1, "id": 251723776},
3775 {"type": 0, "out-pport": 1, "pport": 1, "vlan-id": 3840,
3776 "pop-vlan": 1, "id": 251658241},
3777 {"type": 0, "out-pport": 0, "pport": 0, "vlan-id": 3840,
3778 "pop-vlan": 1, "id": 251658240}
3781 query-gic-capabilities
3784 Return a list of GICCapability objects, describing supported GIC
3785 (Generic Interrupt Controller) versions.
3791 -> { "execute": "query-gic-capabilities" }
3792 <- { "return": [{ "version": 2, "emulated": true, "kernel": false },
3793 { "version": 3, "emulated": false, "kernel": true } ] }
3795 Show existing/possible CPUs
3796 ---------------------------
3800 Example for pseries machine type started with
3801 -smp 2,cores=2,maxcpus=4 -cpu POWER8:
3803 -> { "execute": "query-hotpluggable-cpus" }
3805 { "props": { "core-id": 8 }, "type": "POWER8-spapr-cpu-core",
3807 { "props": { "core-id": 0 }, "type": "POWER8-spapr-cpu-core",
3808 "vcpus-count": 1, "qom-path": "/machine/unattached/device[0]"}
3811 Example for pc machine type started with
3813 -> { "execute": "query-hotpluggable-cpus" }
3816 "type": "qemu64-x86_64-cpu", "vcpus-count": 1,
3817 "props": {"core-id": 0, "socket-id": 1, "thread-id": 0}
3820 "qom-path": "/machine/unattached/device[0]",
3821 "type": "qemu64-x86_64-cpu", "vcpus-count": 1,
3822 "props": {"core-id": 0, "socket-id": 0, "thread-id": 0}