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 } }
560 Set migration information for remote display. This makes the server
561 ask the client to automatically reconnect using the new parameters
562 once migration finished successfully. Only implemented for SPICE.
566 - "protocol": must be "spice" (json-string)
567 - "hostname": migration target hostname (json-string)
568 - "port": spice tcp port for plaintext channels (json-int, optional)
569 - "tls-port": spice tcp port for tls-secured channels (json-int, optional)
570 - "cert-subject": server certificate subject (json-string, optional)
574 -> { "execute": "client_migrate_info",
575 "arguments": { "protocol": "spice",
576 "hostname": "virt42.lab.kraxel.org",
583 Dump guest memory to file. The file can be processed with crash or gdb.
587 - "paging": do paging to get guest's memory mapping (json-bool)
588 - "protocol": destination file(started with "file:") or destination file
589 descriptor (started with "fd:") (json-string)
590 - "detach": if specified, command will return immediately, without waiting
591 for the dump to finish. The user can track progress using
592 "query-dump". (json-bool)
593 - "begin": the starting physical address. It's optional, and should be specified
594 with length together (json-int)
595 - "length": the memory size, in bytes. It's optional, and should be specified
596 with begin together (json-int)
597 - "format": the format of guest memory dump. It's optional, and can be
598 elf|kdump-zlib|kdump-lzo|kdump-snappy, but non-elf formats will
599 conflict with paging and filter, ie. begin and length (json-string)
603 -> { "execute": "dump-guest-memory", "arguments": { "protocol": "fd:dump" } }
608 (1) All boolean arguments default to false
610 query-dump-guest-memory-capability
613 Show available formats for 'dump-guest-memory'
617 -> { "execute": "query-dump-guest-memory-capability" }
618 <- { "return": { "formats":
619 ["elf", "kdump-zlib", "kdump-lzo", "kdump-snappy"] }
624 Query background dump status.
630 -> { "execute": "query-dump" }
631 <- { "return": { "status": "active", "completed": 1024000,
637 Save guest storage keys to file.
641 - "filename": file path (json-string)
645 -> { "execute": "dump-skeys", "arguments": { "filename": "/tmp/skeys" } }
651 Add host network device.
655 - "type": the device type, "tap", "user", ... (json-string)
656 - "id": the device's ID, must be unique (json-string)
661 -> { "execute": "netdev_add",
662 "arguments": { "type": "user", "id": "netdev1",
663 "dnssearch": "example.org" } }
666 Note: The supported device options are the same ones supported by the '-netdev'
667 command-line argument, which are listed in the '-help' output or QEMU's
673 Remove host network device.
677 - "id": the device's ID, must be unique (json-string)
681 -> { "execute": "netdev_del", "arguments": { "id": "netdev1" } }
692 - "qom-type": the object's QOM type, i.e. the class name (json-string)
693 - "id": the object's ID, must be unique (json-string)
694 - "props": a dictionary of object property values (optional, json-dict)
698 -> { "execute": "object-add", "arguments": { "qom-type": "rng-random", "id": "rng1",
699 "props": { "filename": "/dev/hwrng" } } }
709 - "id": the object's ID (json-string)
713 -> { "execute": "object-del", "arguments": { "id": "rng1" } }
720 Resize a block image while a guest is running.
724 - "device": the device's ID, must be unique (json-string)
725 - "node-name": the node name in the block driver state graph (json-string)
730 -> { "execute": "block_resize", "arguments": { "device": "scratch", "size": 1073741824 } }
736 Copy data from a backing file into a block device.
740 - "job-id": Identifier for the newly-created block job. If omitted,
741 the device name will be used. (json-string, optional)
742 - "device": The device name or node-name of a root node (json-string)
743 - "base": The file name of the backing image above which copying starts
744 (json-string, optional)
745 - "backing-file": The backing file string to write into the active layer. This
746 filename is not validated.
748 If a pathname string is such that it cannot be resolved by
749 QEMU, that means that subsequent QMP or HMP commands must use
750 node-names for the image in question, as filename lookup
753 If not specified, QEMU will automatically determine the
754 backing file string to use, or error out if there is no
755 obvious choice. Care should be taken when specifying the
756 string, to specify a valid filename or protocol.
757 (json-string, optional) (Since 2.1)
758 - "speed": the maximum speed, in bytes per second (json-int, optional)
759 - "on-error": the action to take on an error (default 'report'). 'stop' and
760 'enospc' can only be used if the block device supports io-status.
761 (json-string, optional) (Since 2.1)
765 -> { "execute": "block-stream", "arguments": { "device": "virtio0",
766 "base": "/tmp/master.qcow2" } }
772 Live commit of data from overlay image nodes into backing nodes - i.e., writes
773 data between 'top' and 'base' into 'base'.
777 - "job-id": Identifier for the newly-created block job. If omitted,
778 the device name will be used. (json-string, optional)
779 - "device": The device name or node-name of a root node (json-string)
780 - "base": The file name of the backing image to write data into.
781 If not specified, this is the deepest backing image
782 (json-string, optional)
783 - "top": The file name of the backing image within the image chain,
784 which contains the topmost data to be committed down. If
785 not specified, this is the active layer. (json-string, optional)
787 - backing-file: The backing file string to write into the overlay
788 image of 'top'. If 'top' is the active layer,
789 specifying a backing file string is an error. This
790 filename is not validated.
792 If a pathname string is such that it cannot be
793 resolved by QEMU, that means that subsequent QMP or
794 HMP commands must use node-names for the image in
795 question, as filename lookup methods will fail.
797 If not specified, QEMU will automatically determine
798 the backing file string to use, or error out if
799 there is no obvious choice. Care should be taken
800 when specifying the string, to specify a valid
801 filename or protocol.
802 (json-string, optional) (Since 2.1)
804 If top == base, that is an error.
805 If top == active, the job will not be completed by itself,
806 user needs to complete the job with the block-job-complete
807 command after getting the ready event. (Since 2.0)
809 If the base image is smaller than top, then the base image
810 will be resized to be the same size as top. If top is
811 smaller than the base image, the base will not be
812 truncated. If you want the base image size to match the
813 size of the smaller top, you can safely truncate it
814 yourself once the commit operation successfully completes.
816 - "speed": the maximum speed, in bytes per second (json-int, optional)
821 -> { "execute": "block-commit", "arguments": { "device": "virtio0",
822 "top": "/tmp/snap1.qcow2" } }
828 Start a point-in-time copy of a block device to a new destination. The
829 status of ongoing drive-backup operations can be checked with
830 query-block-jobs where the BlockJobInfo.type field has the value 'backup'.
831 The operation can be stopped before it has completed using the
832 block-job-cancel command.
836 - "job-id": Identifier for the newly-created block job. If omitted,
837 the device name will be used. (json-string, optional)
838 - "device": the device name or node-name of a root node which should be copied.
840 - "target": the target of the new image. If the file exists, or if it is a
841 device, the existing file/device will be used as the new
842 destination. If it does not exist, a new file will be created.
844 - "format": the format of the new destination, default is to probe if 'mode' is
845 'existing', else the format of the source
846 (json-string, optional)
847 - "sync": what parts of the disk image should be copied to the destination;
848 possibilities include "full" for all the disk, "top" for only the sectors
849 allocated in the topmost image, "incremental" for only the dirty sectors in
850 the bitmap, or "none" to only replicate new I/O (MirrorSyncMode).
851 - "bitmap": dirty bitmap name for sync==incremental. Must be present if sync
852 is "incremental", must NOT be present otherwise.
853 - "mode": whether and how QEMU should create a new image
854 (NewImageMode, optional, default 'absolute-paths')
855 - "speed": the maximum speed, in bytes per second (json-int, optional)
856 - "compress": true to compress data, if the target format supports it.
857 (json-bool, optional, default false)
858 - "on-source-error": the action to take on an error on the source, default
859 'report'. 'stop' and 'enospc' can only be used
860 if the block device supports io-status.
861 (BlockdevOnError, optional)
862 - "on-target-error": the action to take on an error on the target, default
863 'report' (no limitations, since this applies to
864 a different block device than device).
865 (BlockdevOnError, optional)
868 -> { "execute": "drive-backup", "arguments": { "device": "drive0",
870 "target": "backup.img" } }
876 The device version of drive-backup: this command takes an existing named device
881 - "job-id": Identifier for the newly-created block job. If omitted,
882 the device name will be used. (json-string, optional)
883 - "device": the device name or node-name of a root node which should be copied.
885 - "target": the name of the backup target device. (json-string)
886 - "sync": what parts of the disk image should be copied to the destination;
887 possibilities include "full" for all the disk, "top" for only the
888 sectors allocated in the topmost image, or "none" to only replicate
889 new I/O (MirrorSyncMode).
890 - "speed": the maximum speed, in bytes per second (json-int, optional)
891 - "compress": true to compress data, if the target format supports it.
892 (json-bool, optional, default false)
893 - "on-source-error": the action to take on an error on the source, default
894 'report'. 'stop' and 'enospc' can only be used
895 if the block device supports io-status.
896 (BlockdevOnError, optional)
897 - "on-target-error": the action to take on an error on the target, default
898 'report' (no limitations, since this applies to
899 a different block device than device).
900 (BlockdevOnError, optional)
903 -> { "execute": "blockdev-backup", "arguments": { "device": "src-id",
905 "target": "tgt-id" } }
911 Atomically operate on one or more block devices. Operations that are
916 - blockdev-snapshot-sync
917 - blockdev-snapshot-internal-sync
919 - block-dirty-bitmap-add
920 - block-dirty-bitmap-clear
922 Refer to the qemu/qapi-schema.json file for minimum required QEMU
923 versions for these operations. A list of dictionaries is accepted,
924 that contains the actions to be performed. If there is any failure
925 performing any of the operations, all operations for the group are
928 For external snapshots, the dictionary contains the device, the file to use for
929 the new snapshot, and the format. The default format, if not specified, is
932 Each new snapshot defaults to being created by QEMU (wiping any
933 contents if the file already exists), but it is also possible to reuse
934 an externally-created file. In the latter case, you should ensure that
935 the new image file has the same contents as the current one; QEMU cannot
936 perform any meaningful check. Typically this is achieved by using the
937 current image file as the backing file for the new image.
939 On failure, the original disks pre-snapshot attempt will be used.
941 For internal snapshots, the dictionary contains the device and the snapshot's
942 name. If an internal snapshot matching name already exists, the request will
943 be rejected. Only some image formats support it, for example, qcow2, rbd,
946 On failure, qemu will try delete the newly created internal snapshot in the
947 transaction. When an I/O error occurs during deletion, the user needs to fix
948 it later with qemu-img or other command.
953 - "type": the operation to perform (json-string). Possible
954 values: "drive-backup", "blockdev-backup",
955 "blockdev-snapshot-sync",
956 "blockdev-snapshot-internal-sync",
957 "abort", "block-dirty-bitmap-add",
958 "block-dirty-bitmap-clear"
959 - "data": a dictionary. The contents depend on the value
960 of "type". When "type" is "blockdev-snapshot-sync":
961 - "device": device name to snapshot (json-string)
962 - "node-name": graph node name to snapshot (json-string)
963 - "snapshot-file": name of new image file (json-string)
964 - "snapshot-node-name": graph node name of the new snapshot (json-string)
965 - "format": format of new image (json-string, optional)
966 - "mode": whether and how QEMU should create the snapshot file
967 (NewImageMode, optional, default "absolute-paths")
968 When "type" is "blockdev-snapshot-internal-sync":
969 - "device": the device name or node-name of a root node to snapshot
971 - "name": name of the new snapshot (json-string)
975 -> { "execute": "transaction",
976 "arguments": { "actions": [
977 { "type": "blockdev-snapshot-sync", "data" : { "device": "ide-hd0",
978 "snapshot-file": "/some/place/my-image",
979 "format": "qcow2" } },
980 { "type": "blockdev-snapshot-sync", "data" : { "node-name": "myfile",
981 "snapshot-file": "/some/place/my-image2",
982 "snapshot-node-name": "node3432",
984 "format": "qcow2" } },
985 { "type": "blockdev-snapshot-sync", "data" : { "device": "ide-hd1",
986 "snapshot-file": "/some/place/my-image2",
988 "format": "qcow2" } },
989 { "type": "blockdev-snapshot-internal-sync", "data" : {
991 "name": "snapshot0" } } ] } }
994 block-dirty-bitmap-add
995 ----------------------
998 Create a dirty bitmap with a name on the device, and start tracking the writes.
1002 - "node": device/node on which to create dirty bitmap (json-string)
1003 - "name": name of the new dirty bitmap (json-string)
1004 - "granularity": granularity to track writes with (int, optional)
1008 -> { "execute": "block-dirty-bitmap-add", "arguments": { "node": "drive0",
1009 "name": "bitmap0" } }
1012 block-dirty-bitmap-remove
1013 -------------------------
1016 Stop write tracking and remove the dirty bitmap that was created with
1017 block-dirty-bitmap-add.
1021 - "node": device/node on which to remove dirty bitmap (json-string)
1022 - "name": name of the dirty bitmap to remove (json-string)
1026 -> { "execute": "block-dirty-bitmap-remove", "arguments": { "node": "drive0",
1027 "name": "bitmap0" } }
1030 block-dirty-bitmap-clear
1031 ------------------------
1034 Reset the dirty bitmap associated with a node so that an incremental backup
1035 from this point in time forward will only backup clusters modified after this
1040 - "node": device/node on which to remove dirty bitmap (json-string)
1041 - "name": name of the dirty bitmap to remove (json-string)
1045 -> { "execute": "block-dirty-bitmap-clear", "arguments": { "node": "drive0",
1046 "name": "bitmap0" } }
1049 blockdev-snapshot-sync
1050 ----------------------
1052 Synchronous snapshot of a block device. snapshot-file specifies the
1053 target of the new image. If the file exists, or if it is a device, the
1054 snapshot will be created in the existing file/device. If does not
1055 exist, a new file will be created. format specifies the format of the
1056 snapshot image, default is qcow2.
1060 - "device": device name to snapshot (json-string)
1061 - "node-name": graph node name to snapshot (json-string)
1062 - "snapshot-file": name of new image file (json-string)
1063 - "snapshot-node-name": graph node name of the new snapshot (json-string)
1064 - "mode": whether and how QEMU should create the snapshot file
1065 (NewImageMode, optional, default "absolute-paths")
1066 - "format": format of new image (json-string, optional)
1070 -> { "execute": "blockdev-snapshot-sync", "arguments": { "device": "ide-hd0",
1072 "/some/place/my-image",
1073 "format": "qcow2" } }
1080 Create a snapshot, by installing 'node' as the backing image of
1081 'overlay'. Additionally, if 'node' is associated with a block
1082 device, the block device changes to using 'overlay' as its new active
1087 - "node": device that will have a snapshot created (json-string)
1088 - "overlay": device that will have 'node' as its backing image (json-string)
1092 -> { "execute": "blockdev-add",
1093 "arguments": { "options": { "driver": "qcow2",
1094 "node-name": "node1534",
1095 "file": { "driver": "file",
1096 "filename": "hd1.qcow2" },
1101 -> { "execute": "blockdev-snapshot", "arguments": { "node": "ide-hd0",
1102 "overlay": "node1534" } }
1105 blockdev-snapshot-internal-sync
1106 -------------------------------
1108 Synchronously take an internal snapshot of a block device when the format of
1109 image used supports it. If the name is an empty string, or a snapshot with
1110 name already exists, the operation will fail.
1114 - "device": the device name or node-name of a root node to snapshot
1116 - "name": name of the new snapshot (json-string)
1120 -> { "execute": "blockdev-snapshot-internal-sync",
1121 "arguments": { "device": "ide-hd0",
1122 "name": "snapshot0" }
1126 blockdev-snapshot-delete-internal-sync
1127 --------------------------------------
1129 Synchronously delete an internal snapshot of a block device when the format of
1130 image used supports it. The snapshot is identified by name or id or both. One
1131 of name or id is required. If the snapshot is not found, the operation will
1136 - "device": the device name or node-name of a root node (json-string)
1137 - "id": ID of the snapshot (json-string, optional)
1138 - "name": name of the snapshot (json-string, optional)
1142 -> { "execute": "blockdev-snapshot-delete-internal-sync",
1143 "arguments": { "device": "ide-hd0",
1144 "name": "snapshot0" }
1148 "name": "snapshot0",
1150 "date-sec": 1000012,
1152 "vm-clock-sec": 100,
1160 Start mirroring a block device's writes to a new destination. target
1161 specifies the target of the new image. If the file exists, or if it is
1162 a device, it will be used as the new destination for writes. If it does not
1163 exist, a new file will be created. format specifies the format of the
1164 mirror image, default is to probe if mode='existing', else the format
1169 - "job-id": Identifier for the newly-created block job. If omitted,
1170 the device name will be used. (json-string, optional)
1171 - "device": the device name or node-name of a root node whose writes should be
1172 mirrored. (json-string)
1173 - "target": name of new image file (json-string)
1174 - "format": format of new image (json-string, optional)
1175 - "node-name": the name of the new block driver state in the node graph
1176 (json-string, optional)
1177 - "replaces": the block driver node name to replace when finished
1178 (json-string, optional)
1179 - "mode": how an image file should be created into the target
1180 file/device (NewImageMode, optional, default 'absolute-paths')
1181 - "speed": maximum speed of the streaming job, in bytes per second
1183 - "granularity": granularity of the dirty bitmap, in bytes (json-int, optional)
1184 - "buf-size": maximum amount of data in flight from source to target, in bytes
1185 (json-int, default 10M)
1186 - "sync": what parts of the disk image should be copied to the destination;
1187 possibilities include "full" for all the disk, "top" for only the sectors
1188 allocated in the topmost image, or "none" to only replicate new I/O
1190 - "on-source-error": the action to take on an error on the source
1191 (BlockdevOnError, default 'report')
1192 - "on-target-error": the action to take on an error on the target
1193 (BlockdevOnError, default 'report')
1194 - "unmap": whether the target sectors should be discarded where source has only
1195 zeroes. (json-bool, optional, default true)
1197 The default value of the granularity is the image cluster size clamped
1198 between 4096 and 65536, if the image format defines one. If the format
1199 does not define a cluster size, the default value of the granularity
1205 -> { "execute": "drive-mirror", "arguments": { "device": "ide-hd0",
1206 "target": "/some/place/my-image",
1208 "format": "qcow2" } }
1214 Start mirroring a block device's writes to another block device. target
1215 specifies the target of mirror operation.
1219 - "job-id": Identifier for the newly-created block job. If omitted,
1220 the device name will be used. (json-string, optional)
1221 - "device": The device name or node-name of a root node whose writes should be
1222 mirrored (json-string)
1223 - "target": device name to mirror to (json-string)
1224 - "replaces": the block driver node name to replace when finished
1225 (json-string, optional)
1226 - "speed": maximum speed of the streaming job, in bytes per second
1228 - "granularity": granularity of the dirty bitmap, in bytes (json-int, optional)
1229 - "buf_size": maximum amount of data in flight from source to target, in bytes
1230 (json-int, default 10M)
1231 - "sync": what parts of the disk image should be copied to the destination;
1232 possibilities include "full" for all the disk, "top" for only the sectors
1233 allocated in the topmost image, or "none" to only replicate new I/O
1235 - "on-source-error": the action to take on an error on the source
1236 (BlockdevOnError, default 'report')
1237 - "on-target-error": the action to take on an error on the target
1238 (BlockdevOnError, default 'report')
1240 The default value of the granularity is the image cluster size clamped
1241 between 4096 and 65536, if the image format defines one. If the format
1242 does not define a cluster size, the default value of the granularity
1247 -> { "execute": "blockdev-mirror", "arguments": { "device": "ide-hd0",
1248 "target": "target0",
1256 Change the backing file in the image file metadata. This does not cause
1257 QEMU to reopen the image file to reparse the backing filename (it may,
1258 however, perform a reopen to change permissions from r/o -> r/w -> r/o,
1259 if needed). The new backing file string is written into the image file
1260 metadata, and the QEMU internal strings are updated.
1264 - "image-node-name": The name of the block driver state node of the
1265 image to modify. The "device" is argument is used to
1266 verify "image-node-name" is in the chain described by
1268 (json-string, optional)
1270 - "device": The device name or node-name of the root node that owns
1274 - "backing-file": The string to write as the backing file. This string is
1275 not validated, so care should be taken when specifying
1276 the string or the image chain may not be able to be
1280 Returns: Nothing on success
1281 If "device" does not exist or cannot be determined, DeviceNotFound
1286 Request VM to change its memory allocation (in bytes).
1290 - "value": New memory allocation (json-int)
1294 -> { "execute": "balloon", "arguments": { "value": 536870912 } }
1300 Change the link status of a network adapter.
1304 - "name": network device name (json-string)
1305 - "up": status is up (json-bool)
1309 -> { "execute": "set_link", "arguments": { "name": "e1000.0", "up": false } }
1315 Receive a file descriptor via SCM rights and assign it a name.
1319 - "fdname": file descriptor name (json-string)
1323 -> { "execute": "getfd", "arguments": { "fdname": "fd1" } }
1328 (1) If the name specified by the "fdname" argument already exists,
1329 the file descriptor assigned to it will be closed and replaced
1330 by the received file descriptor.
1331 (2) The 'closefd' command can be used to explicitly close the file
1332 descriptor when it is no longer needed.
1337 Close a file descriptor previously passed via SCM rights.
1341 - "fdname": file descriptor name (json-string)
1345 -> { "execute": "closefd", "arguments": { "fdname": "fd1" } }
1351 Add a file descriptor, that was passed via SCM rights, to an fd set.
1355 - "fdset-id": The ID of the fd set to add the file descriptor to.
1356 (json-int, optional)
1357 - "opaque": A free-form string that can be used to describe the fd.
1358 (json-string, optional)
1360 Return a json-object with the following information:
1362 - "fdset-id": The ID of the fd set that the fd was added to. (json-int)
1363 - "fd": The file descriptor that was received via SCM rights and added to the
1368 -> { "execute": "add-fd", "arguments": { "fdset-id": 1 } }
1369 <- { "return": { "fdset-id": 1, "fd": 3 } }
1373 (1) The list of fd sets is shared by all monitor connections.
1374 (2) If "fdset-id" is not specified, a new fd set will be created.
1379 Remove a file descriptor from an fd set.
1383 - "fdset-id": The ID of the fd set that the file descriptor belongs to.
1385 - "fd": The file descriptor that is to be removed. (json-int, optional)
1389 -> { "execute": "remove-fd", "arguments": { "fdset-id": 1, "fd": 3 } }
1394 (1) The list of fd sets is shared by all monitor connections.
1395 (2) If "fd" is not specified, all file descriptors in "fdset-id" will be
1401 Return information describing all fd sets.
1407 -> { "execute": "query-fdsets" }
1413 "opaque": "rdonly:/path/to/file"
1417 "opaque": "rdwr:/path/to/file"
1436 Note: The list of fd sets is shared by all monitor connections.
1441 Set the password of encrypted block devices.
1445 - "device": device name (json-string)
1446 - "node-name": name in the block driver state graph (json-string)
1447 - "password": password (json-string)
1451 -> { "execute": "block_passwd", "arguments": { "device": "ide0-hd0",
1452 "password": "12345" } }
1455 block_set_io_throttle
1458 Change I/O throttle limits for a block drive.
1462 - "device": block device name (deprecated, use @id instead)
1463 (json-string, optional)
1464 - "id": the name or QOM path of the guest device (json-string, optional)
1465 - "bps": total throughput limit in bytes per second (json-int)
1466 - "bps_rd": read throughput limit in bytes per second (json-int)
1467 - "bps_wr": write throughput limit in bytes per second (json-int)
1468 - "iops": total I/O operations per second (json-int)
1469 - "iops_rd": read I/O operations per second (json-int)
1470 - "iops_wr": write I/O operations per second (json-int)
1471 - "bps_max": total throughput limit during bursts, in bytes (json-int, optional)
1472 - "bps_rd_max": read throughput limit during bursts, in bytes (json-int, optional)
1473 - "bps_wr_max": write throughput limit during bursts, in bytes (json-int, optional)
1474 - "iops_max": total I/O operations per second during bursts (json-int, optional)
1475 - "iops_rd_max": read I/O operations per second during bursts (json-int, optional)
1476 - "iops_wr_max": write I/O operations per second during bursts (json-int, optional)
1477 - "bps_max_length": maximum length of the @bps_max burst period, in seconds (json-int, optional)
1478 - "bps_rd_max_length": maximum length of the @bps_rd_max burst period, in seconds (json-int, optional)
1479 - "bps_wr_max_length": maximum length of the @bps_wr_max burst period, in seconds (json-int, optional)
1480 - "iops_max_length": maximum length of the @iops_max burst period, in seconds (json-int, optional)
1481 - "iops_rd_max_length": maximum length of the @iops_rd_max burst period, in seconds (json-int, optional)
1482 - "iops_wr_max_length": maximum length of the @iops_wr_max burst period, in seconds (json-int, optional)
1483 - "iops_size": I/O size in bytes when limiting (json-int, optional)
1484 - "group": throttle group name (json-string, optional)
1488 -> { "execute": "block_set_io_throttle", "arguments": { "id": "ide0-1-0",
1501 "bps_max_length": 60,
1508 Set the password for vnc/spice protocols.
1512 - "protocol": protocol name (json-string)
1513 - "password": password (json-string)
1514 - "connected": [ keep | disconnect | fail ] (json-string, optional)
1518 -> { "execute": "set_password", "arguments": { "protocol": "vnc",
1519 "password": "secret" } }
1525 Set the password expire time for vnc/spice protocols.
1529 - "protocol": protocol name (json-string)
1530 - "time": [ now | never | +secs | secs ] (json-string)
1534 -> { "execute": "expire_password", "arguments": { "protocol": "vnc",
1541 Add a graphics client
1545 - "protocol": protocol name (json-string)
1546 - "fdname": file descriptor name (json-string)
1547 - "skipauth": whether to skip authentication (json-bool, optional)
1548 - "tls": whether to perform TLS (json-bool, optional)
1552 -> { "execute": "add_client", "arguments": { "protocol": "vnc",
1553 "fdname": "myclient" } }
1559 Enable QMP capabilities.
1565 -> { "execute": "qmp_capabilities" }
1568 Note: This command must be issued before issuing any other command.
1570 human-monitor-command
1571 ---------------------
1573 Execute a Human Monitor command.
1577 - command-line: the command name and its arguments, just like the
1578 Human Monitor's shell (json-string)
1579 - cpu-index: select the CPU number to be used by commands which access CPU
1580 data, like 'info registers'. The Monitor selects CPU 0 if this
1581 argument is not provided (json-int, optional)
1585 -> { "execute": "human-monitor-command", "arguments": { "command-line": "info kvm" } }
1586 <- { "return": "kvm support: enabled\r\n" }
1590 (1) The Human Monitor is NOT an stable interface, this means that command
1591 names, arguments and responses can change or be removed at ANY time.
1592 Applications that rely on long term stability guarantees should NOT
1597 o This command is stateless, this means that commands that depend
1598 on state information (such as getfd) might not work
1600 o Commands that prompt the user for data (eg. 'cont' when the block
1601 device is encrypted) don't currently work
1612 Return a json-object with the following information:
1614 - "qemu": A json-object containing three integer values:
1615 - "major": QEMU's major version (json-int)
1616 - "minor": QEMU's minor version (json-int)
1617 - "micro": QEMU's micro version (json-int)
1618 - "package": package's version (json-string)
1622 -> { "execute": "query-version" }
1637 List QMP available commands.
1639 Each command is represented by a json-object, the returned value is a json-array
1642 Each json-object contain:
1644 - "name": command's name (json-string)
1648 -> { "execute": "query-commands" }
1652 "name":"query-balloon"
1655 "name":"system_powerdown"
1660 Note: This example has been shortened as the real response is too long.
1665 List QMP available events.
1667 Each event is represented by a json-object, the returned value is a json-array
1670 Each json-object contains:
1672 - "name": event's name (json-string)
1676 -> { "execute": "query-events" }
1688 Note: This example has been shortened as the real response is too long.
1693 Return the QMP wire schema. The returned value is a json-array of
1694 named schema entities. Entities are commands, events and various
1695 types. See docs/qapi-code-gen.txt for information on their structure
1701 Each device is represented by a json-object. The returned value is a json-array
1704 Each json-object contain the following:
1706 - "label": device's label (json-string)
1707 - "filename": device's file (json-string)
1708 - "frontend-open": open/closed state of the frontend device attached to this
1713 -> { "execute": "query-chardev" }
1717 "label": "charchannel0",
1718 "filename": "unix:/var/lib/libvirt/qemu/seabios.rhel6.agent,server",
1719 "frontend-open": false
1722 "label": "charmonitor",
1723 "filename": "unix:/var/lib/libvirt/qemu/seabios.rhel6.monitor,server",
1724 "frontend-open": true
1727 "label": "charserial0",
1728 "filename": "pty:/dev/pts/2",
1729 "frontend-open": true
1734 query-chardev-backends
1737 List available character device backends.
1739 Each backend is represented by a json-object, the returned value is a json-array
1742 Each json-object contains:
1744 - "name": backend name (json-string)
1748 -> { "execute": "query-chardev-backends" }
1769 Show the block devices.
1771 Each block device information is stored in a json-object and the returned value
1772 is a json-array of all devices.
1774 Each json-object contain the following:
1776 - "device": device name (json-string)
1777 - "type": device type (json-string)
1778 - deprecated, retained for backward compatibility
1779 - Possible values: "unknown"
1780 - "removable": true if the device is removable, false otherwise (json-bool)
1781 - "locked": true if the device is locked, false otherwise (json-bool)
1782 - "tray_open": only present if removable, true if the device has a tray,
1783 and it is open (json-bool)
1784 - "inserted": only present if the device is inserted, it is a json-object
1785 containing the following:
1786 - "file": device file name (json-string)
1787 - "ro": true if read-only, false otherwise (json-bool)
1788 - "drv": driver format name (json-string)
1789 - Possible values: "blkdebug", "bochs", "cloop", "dmg",
1790 "file", "file", "ftp", "ftps", "host_cdrom",
1791 "host_device", "http", "https",
1792 "nbd", "parallels", "qcow", "qcow2", "raw",
1793 "tftp", "vdi", "vmdk", "vpc", "vvfat"
1794 - "backing_file": backing file name (json-string, optional)
1795 - "backing_file_depth": number of files in the backing file chain (json-int)
1796 - "encrypted": true if encrypted, false otherwise (json-bool)
1797 - "bps": limit total bytes per second (json-int)
1798 - "bps_rd": limit read bytes per second (json-int)
1799 - "bps_wr": limit write bytes per second (json-int)
1800 - "iops": limit total I/O operations per second (json-int)
1801 - "iops_rd": limit read operations per second (json-int)
1802 - "iops_wr": limit write operations per second (json-int)
1803 - "bps_max": total max in bytes (json-int)
1804 - "bps_rd_max": read max in bytes (json-int)
1805 - "bps_wr_max": write max in bytes (json-int)
1806 - "iops_max": total I/O operations max (json-int)
1807 - "iops_rd_max": read I/O operations max (json-int)
1808 - "iops_wr_max": write I/O operations max (json-int)
1809 - "iops_size": I/O size when limiting by iops (json-int)
1810 - "detect_zeroes": detect and optimize zero writing (json-string)
1811 - Possible values: "off", "on", "unmap"
1812 - "write_threshold": write offset threshold in bytes, a event will be
1813 emitted if crossed. Zero if disabled (json-int)
1814 - "image": the detail of the image, it is a json-object containing
1816 - "filename": image file name (json-string)
1817 - "format": image format (json-string)
1818 - "virtual-size": image capacity in bytes (json-int)
1819 - "dirty-flag": true if image is not cleanly closed, not present
1820 means clean (json-bool, optional)
1821 - "actual-size": actual size on disk in bytes of the image, not
1822 present when image does not support thin
1823 provision (json-int, optional)
1824 - "cluster-size": size of a cluster in bytes, not present if image
1825 format does not support it (json-int, optional)
1826 - "encrypted": true if the image is encrypted, not present means
1827 false or the image format does not support
1828 encryption (json-bool, optional)
1829 - "backing_file": backing file name, not present means no backing
1830 file is used or the image format does not
1831 support backing file chain
1832 (json-string, optional)
1833 - "full-backing-filename": full path of the backing file, not
1834 present if it equals backing_file or no
1835 backing file is used
1836 (json-string, optional)
1837 - "backing-filename-format": the format of the backing file, not
1838 present means unknown or no backing
1839 file (json-string, optional)
1840 - "snapshots": the internal snapshot info, it is an optional list
1841 of json-object containing the following:
1842 - "id": unique snapshot id (json-string)
1843 - "name": snapshot name (json-string)
1844 - "vm-state-size": size of the VM state in bytes (json-int)
1845 - "date-sec": UTC date of the snapshot in seconds (json-int)
1846 - "date-nsec": fractional part in nanoseconds to be used with
1848 - "vm-clock-sec": VM clock relative to boot in seconds
1850 - "vm-clock-nsec": fractional part in nanoseconds to be used
1851 with vm-clock-sec (json-int)
1852 - "backing-image": the detail of the backing image, it is an
1853 optional json-object only present when a
1854 backing image present for this image
1856 - "io-status": I/O operation status, only present if the device supports it
1857 and the VM is configured to stop on errors. It's always reset
1858 to "ok" when the "cont" command is issued (json_string, optional)
1859 - Possible values: "ok", "failed", "nospace"
1863 -> { "execute": "query-block" }
1868 "device":"ide0-hd0",
1875 "file":"disks/test.qcow2",
1876 "backing_file_depth":1,
1890 "detect_zeroes": "on",
1891 "write_threshold": 0,
1893 "filename":"disks/test.qcow2",
1895 "virtual-size":2048000,
1896 "backing_file":"base.qcow2",
1897 "full-backing-filename":"disks/base.qcow2",
1898 "backing-filename-format":"qcow2",
1902 "name": "snapshot1",
1904 "date-sec": 10000200,
1906 "vm-clock-sec": 206,
1911 "filename":"disks/base.qcow2",
1913 "virtual-size":2048000
1921 "device":"ide1-cd0",
1944 Show block device statistics.
1946 Each device statistic information is stored in a json-object and the returned
1947 value is a json-array of all devices.
1949 Each json-object contain the following:
1951 - "device": device name (json-string)
1952 - "stats": A json-object with the statistics information, it contains:
1953 - "rd_bytes": bytes read (json-int)
1954 - "wr_bytes": bytes written (json-int)
1955 - "rd_operations": read operations (json-int)
1956 - "wr_operations": write operations (json-int)
1957 - "flush_operations": cache flush operations (json-int)
1958 - "wr_total_time_ns": total time spend on writes in nano-seconds (json-int)
1959 - "rd_total_time_ns": total time spend on reads in nano-seconds (json-int)
1960 - "flush_total_time_ns": total time spend on cache flushes in nano-seconds (json-int)
1961 - "wr_highest_offset": The offset after the greatest byte written to the
1962 BlockDriverState since it has been opened (json-int)
1963 - "rd_merged": number of read requests that have been merged into
1964 another request (json-int)
1965 - "wr_merged": number of write requests that have been merged into
1966 another request (json-int)
1967 - "idle_time_ns": time since the last I/O operation, in
1968 nanoseconds. If the field is absent it means
1969 that there haven't been any operations yet
1970 (json-int, optional)
1971 - "failed_rd_operations": number of failed read operations
1973 - "failed_wr_operations": number of failed write operations
1975 - "failed_flush_operations": number of failed flush operations
1977 - "invalid_rd_operations": number of invalid read operations
1979 - "invalid_wr_operations": number of invalid write operations
1981 - "invalid_flush_operations": number of invalid flush operations
1983 - "account_invalid": whether invalid operations are included in
1984 the last access statistics (json-bool)
1985 - "account_failed": whether failed operations are included in the
1986 latency and last access statistics
1988 - "timed_stats": A json-array containing statistics collected in
1989 specific intervals, with the following members:
1990 - "interval_length": interval used for calculating the
1991 statistics, in seconds (json-int)
1992 - "min_rd_latency_ns": minimum latency of read operations in
1993 the defined interval, in nanoseconds
1995 - "min_wr_latency_ns": minimum latency of write operations in
1996 the defined interval, in nanoseconds
1998 - "min_flush_latency_ns": minimum latency of flush operations
1999 in the defined interval, in
2000 nanoseconds (json-int)
2001 - "max_rd_latency_ns": maximum latency of read operations in
2002 the defined interval, in nanoseconds
2004 - "max_wr_latency_ns": maximum latency of write operations in
2005 the defined interval, in nanoseconds
2007 - "max_flush_latency_ns": maximum latency of flush operations
2008 in the defined interval, in
2009 nanoseconds (json-int)
2010 - "avg_rd_latency_ns": average latency of read operations in
2011 the defined interval, in nanoseconds
2013 - "avg_wr_latency_ns": average latency of write operations in
2014 the defined interval, in nanoseconds
2016 - "avg_flush_latency_ns": average latency of flush operations
2017 in the defined interval, in
2018 nanoseconds (json-int)
2019 - "avg_rd_queue_depth": average number of pending read
2020 operations in the defined interval
2022 - "avg_wr_queue_depth": average number of pending write
2023 operations in the defined interval
2025 - "parent": Contains recursively the statistics of the underlying
2026 protocol (e.g. the host file for a qcow2 image). If there is
2027 no underlying protocol, this field is omitted
2028 (json-object, optional)
2032 -> { "execute": "query-blockstats" }
2036 "device":"ide0-hd0",
2039 "wr_highest_offset":3686448128,
2041 "wr_operations":751,
2042 "rd_bytes":122567168,
2043 "rd_operations":36772
2044 "wr_total_times_ns":313253456
2045 "rd_total_times_ns":3465673657
2046 "flush_total_times_ns":49653
2047 "flush_operations":61,
2050 "idle_time_ns":2953431879,
2051 "account_invalid":true,
2052 "account_failed":false
2056 "wr_highest_offset":2821110784,
2058 "wr_operations":692,
2059 "rd_bytes":122739200,
2060 "rd_operations":36604
2061 "flush_operations":51,
2062 "wr_total_times_ns":313253456
2063 "rd_total_times_ns":3465673657
2064 "flush_total_times_ns":49653,
2067 "idle_time_ns":2953431879,
2068 "account_invalid":true,
2069 "account_failed":false
2073 "device":"ide1-cd0",
2075 "wr_highest_offset":0,
2080 "flush_operations":0,
2081 "wr_total_times_ns":0
2082 "rd_total_times_ns":0
2083 "flush_total_times_ns":0,
2086 "account_invalid":false,
2087 "account_failed":false
2093 "wr_highest_offset":0,
2098 "flush_operations":0,
2099 "wr_total_times_ns":0
2100 "rd_total_times_ns":0
2101 "flush_total_times_ns":0,
2104 "account_invalid":false,
2105 "account_failed":false
2111 "wr_highest_offset":0,
2116 "flush_operations":0,
2117 "wr_total_times_ns":0
2118 "rd_total_times_ns":0
2119 "flush_total_times_ns":0,
2122 "account_invalid":false,
2123 "account_failed":false
2132 Show CPU information.
2134 Return a json-array. Each CPU is represented by a json-object, which contains:
2136 - "CPU": CPU index (json-int)
2137 - "current": true if this is the current CPU, false otherwise (json-bool)
2138 - "halted": true if the cpu is halted, false otherwise (json-bool)
2139 - "qom_path": path to the CPU object in the QOM tree (json-str)
2140 - "arch": architecture of the cpu, which determines what additional
2141 keys will be present (json-str)
2142 - Current program counter. The key's name depends on the architecture:
2143 "pc": i386/x86_64 (json-int)
2144 "nip": PPC (json-int)
2145 "pc" and "npc": sparc (json-int)
2146 "PC": mips (json-int)
2147 - "thread_id": ID of the underlying host thread (json-int)
2151 -> { "execute": "query-cpus" }
2158 "qom_path":"/machine/unattached/device[0]",
2167 "qom_path":"/machine/unattached/device[2]",
2178 Returns a list of information about each iothread.
2180 Note this list excludes the QEMU main loop thread, which is not declared
2181 using the -object iothread command-line option. It is always the main thread
2184 Return a json-array. Each iothread is represented by a json-object, which contains:
2186 - "id": name of iothread (json-str)
2187 - "thread-id": ID of the underlying host thread (json-int)
2191 -> { "execute": "query-iothreads" }
2208 PCI buses and devices information.
2210 The returned value is a json-array of all buses. Each bus is represented by
2211 a json-object, which has a key with a json-array of all PCI devices attached
2212 to it. Each device is represented by a json-object.
2214 The bus json-object contains the following:
2216 - "bus": bus number (json-int)
2217 - "devices": a json-array of json-objects, each json-object represents a
2220 The PCI device json-object contains the following:
2222 - "bus": identical to the parent's bus number (json-int)
2223 - "slot": slot number (json-int)
2224 - "function": function number (json-int)
2225 - "class_info": a json-object containing:
2226 - "desc": device class description (json-string, optional)
2227 - "class": device class number (json-int)
2228 - "id": a json-object containing:
2229 - "device": device ID (json-int)
2230 - "vendor": vendor ID (json-int)
2231 - "irq": device's IRQ if assigned (json-int, optional)
2232 - "qdev_id": qdev id string (json-string)
2233 - "pci_bridge": It's a json-object, only present if this device is a
2234 PCI bridge, contains:
2235 - "bus": bus number (json-int)
2236 - "secondary": secondary bus number (json-int)
2237 - "subordinate": subordinate bus number (json-int)
2238 - "io_range": I/O memory range information, a json-object with the
2240 - "base": base address, in bytes (json-int)
2241 - "limit": limit address, in bytes (json-int)
2242 - "memory_range": memory range information, a json-object with the
2244 - "base": base address, in bytes (json-int)
2245 - "limit": limit address, in bytes (json-int)
2246 - "prefetchable_range": Prefetchable memory range information, a
2247 json-object with the following members:
2248 - "base": base address, in bytes (json-int)
2249 - "limit": limit address, in bytes (json-int)
2250 - "devices": a json-array of PCI devices if there's any attached, each
2251 each element is represented by a json-object, which contains
2252 the same members of the 'PCI device json-object' described
2254 - "regions": a json-array of json-objects, each json-object represents a
2255 memory region of this device
2257 The memory range json-object contains the following:
2259 - "base": base memory address (json-int)
2260 - "limit": limit value (json-int)
2262 The region json-object can be an I/O region or a memory region, an I/O region
2263 json-object contains the following:
2265 - "type": "io" (json-string, fixed)
2266 - "bar": BAR number (json-int)
2267 - "address": memory address (json-int)
2268 - "size": memory size (json-int)
2270 A memory region json-object contains the following:
2272 - "type": "memory" (json-string, fixed)
2273 - "bar": BAR number (json-int)
2274 - "address": memory address (json-int)
2275 - "size": memory size (json-int)
2276 - "mem_type_64": true or false (json-bool)
2277 - "prefetch": true or false (json-bool)
2281 -> { "execute": "query-pci" }
2293 "desc":"Host bridge"
2327 "desc":"IDE controller"
2349 "desc":"VGA controller"
2359 "mem_type_64":false,
2362 "address":4026531840,
2367 "mem_type_64":false,
2370 "address":4060086272,
2375 "mem_type_64":false,
2390 "desc":"RAM controller"
2411 Note: This example has been shortened as the real response is too long.
2416 Show KVM information.
2418 Return a json-object with the following information:
2420 - "enabled": true if KVM support is enabled, false otherwise (json-bool)
2421 - "present": true if QEMU has KVM support, false otherwise (json-bool)
2425 -> { "execute": "query-kvm" }
2426 <- { "return": { "enabled": true, "present": true } }
2431 Return a json-object with the following information:
2433 - "running": true if the VM is running, or false if it is paused (json-bool)
2434 - "singlestep": true if the VM is in single step mode,
2435 false otherwise (json-bool)
2436 - "status": one of the following values (json-string)
2437 "debug" - QEMU is running on a debugger
2438 "inmigrate" - guest is paused waiting for an incoming migration
2439 "internal-error" - An internal error that prevents further guest
2440 execution has occurred
2441 "io-error" - the last IOP has failed and the device is configured
2442 to pause on I/O errors
2443 "paused" - guest has been paused via the 'stop' command
2444 "postmigrate" - guest is paused following a successful 'migrate'
2445 "prelaunch" - QEMU was started with -S and guest has not started
2446 "finish-migrate" - guest is paused to finish the migration process
2447 "restore-vm" - guest is paused to restore VM state
2448 "running" - guest is actively running
2449 "save-vm" - guest is paused to save the VM state
2450 "shutdown" - guest is shut down (and -no-shutdown is in use)
2451 "watchdog" - the watchdog action is configured to pause and
2456 -> { "execute": "query-status" }
2457 <- { "return": { "running": true, "singlestep": false, "status": "running" } }
2462 Show VM mice information.
2464 Each mouse is represented by a json-object, the returned value is a json-array
2467 The mouse json-object contains the following:
2469 - "name": mouse's name (json-string)
2470 - "index": mouse's index (json-int)
2471 - "current": true if this mouse is receiving events, false otherwise (json-bool)
2472 - "absolute": true if the mouse generates absolute input events (json-bool)
2476 -> { "execute": "query-mice" }
2480 "name":"QEMU Microsoft Mouse",
2486 "name":"QEMU PS/2 Mouse",
2497 Show VNC server information.
2499 Return a json-object with server information. Connected clients are returned
2500 as a json-array of json-objects.
2502 The main json-object contains the following:
2504 - "enabled": true or false (json-bool)
2505 - "host": server's IP address (json-string)
2506 - "family": address family (json-string)
2507 - Possible values: "ipv4", "ipv6", "unix", "unknown"
2508 - "service": server's port number (json-string)
2509 - "auth": authentication method (json-string)
2510 - Possible values: "invalid", "none", "ra2", "ra2ne", "sasl", "tight",
2511 "tls", "ultra", "unknown", "vencrypt", "vencrypt",
2512 "vencrypt+plain", "vencrypt+tls+none",
2513 "vencrypt+tls+plain", "vencrypt+tls+sasl",
2514 "vencrypt+tls+vnc", "vencrypt+x509+none",
2515 "vencrypt+x509+plain", "vencrypt+x509+sasl",
2516 "vencrypt+x509+vnc", "vnc"
2517 - "clients": a json-array of all connected clients
2519 Clients are described by a json-object, each one contain the following:
2521 - "host": client's IP address (json-string)
2522 - "family": address family (json-string)
2523 - Possible values: "ipv4", "ipv6", "unix", "unknown"
2524 - "service": client's port number (json-string)
2525 - "x509_dname": TLS dname (json-string, optional)
2526 - "sasl_username": SASL username (json-string, optional)
2530 -> { "execute": "query-vnc" }
2551 Show SPICE server information.
2553 Return a json-object with server information. Connected clients are returned
2554 as a json-array of json-objects.
2556 The main json-object contains the following:
2558 - "enabled": true or false (json-bool)
2559 - "host": server's IP address (json-string)
2560 - "port": server's port number (json-int, optional)
2561 - "tls-port": server's port number (json-int, optional)
2562 - "auth": authentication method (json-string)
2563 - Possible values: "none", "spice"
2564 - "channels": a json-array of all active channels clients
2566 Channels are described by a json-object, each one contain the following:
2568 - "host": client's IP address (json-string)
2569 - "family": address family (json-string)
2570 - Possible values: "ipv4", "ipv6", "unix", "unknown"
2571 - "port": client's port number (json-string)
2572 - "connection-id": spice connection id. All channels with the same id
2573 belong to the same spice session (json-int)
2574 - "channel-type": channel type. "1" is the main control channel, filter for
2575 this one if you want track spice sessions only (json-int)
2576 - "channel-id": channel id. Usually "0", might be different needed when
2577 multiple channels of the same type exist, such as multiple
2578 display channels in a multihead setup (json-int)
2579 - "tls": whether the channel is encrypted (json-bool)
2583 -> { "execute": "query-spice" }
2596 "connection-id": 1804289383,
2597 "host": "127.0.0.1",
2605 "connection-id": 1804289383,
2606 "host": "127.0.0.1",
2610 [ ... more channels follow ... ]
2620 Return a json-object with the following information:
2622 - "name": VM's name (json-string, optional)
2626 -> { "execute": "query-name" }
2627 <- { "return": { "name": "qemu-name" } }
2634 Return a json-object with the following information:
2636 - "UUID": Universally Unique Identifier (json-string)
2640 -> { "execute": "query-uuid" }
2641 <- { "return": { "UUID": "550e8400-e29b-41d4-a716-446655440000" } }
2643 query-command-line-options
2644 --------------------------
2646 Show command line option schema.
2648 Return a json-array of command line option schema for all options (or for
2649 the given option), returning an error if the given option doesn't exist.
2651 Each array entry contains the following:
2653 - "option": option name (json-string)
2654 - "parameters": a json-array describes all parameters of the option:
2655 - "name": parameter name (json-string)
2656 - "type": parameter type (one of 'string', 'boolean', 'number',
2658 - "help": human readable description of the parameter
2659 (json-string, optional)
2660 - "default": default value string for the parameter
2661 (json-string, optional)
2665 -> { "execute": "query-command-line-options", "arguments": { "option": "option-rom" } }
2674 "name": "bootindex",
2678 "option": "option-rom"
2688 Return a json-object. If migration is active there will be another json-object
2689 with RAM migration status and if block migration is active another one with
2690 block migration status.
2692 The main json-object contains the following:
2694 - "status": migration status (json-string)
2695 - Possible values: "setup", "active", "completed", "failed", "cancelled"
2696 - "total-time": total amount of ms since migration started. If
2697 migration has ended, it returns the total migration
2699 - "setup-time" amount of setup time in milliseconds _before_ the
2700 iterations begin but _after_ the QMP command is issued.
2701 This is designed to provide an accounting of any activities
2702 (such as RDMA pinning) which may be expensive, but do not
2703 actually occur during the iterative migration rounds
2704 themselves. (json-int)
2705 - "downtime": only present when migration has finished correctly
2706 total amount in ms for downtime that happened (json-int)
2707 - "expected-downtime": only present while migration is active
2708 total amount in ms for downtime that was calculated on
2709 the last bitmap round (json-int)
2710 - "ram": only present if "status" is "active", it is a json-object with the
2711 following RAM information:
2712 - "transferred": amount transferred in bytes (json-int)
2713 - "remaining": amount remaining to transfer in bytes (json-int)
2714 - "total": total amount of memory in bytes (json-int)
2715 - "duplicate": number of pages filled entirely with the same
2717 These are sent over the wire much more efficiently.
2718 - "skipped": number of skipped zero pages (json-int)
2719 - "normal" : number of whole pages transferred. I.e. they
2720 were not sent as duplicate or xbzrle pages (json-int)
2721 - "normal-bytes" : number of bytes transferred in whole
2722 pages. This is just normal pages times size of one page,
2723 but this way upper levels don't need to care about page
2725 - "dirty-sync-count": times that dirty ram was synchronized (json-int)
2726 - "disk": only present if "status" is "active" and it is a block migration,
2727 it is a json-object with the following disk information:
2728 - "transferred": amount transferred in bytes (json-int)
2729 - "remaining": amount remaining to transfer in bytes json-int)
2730 - "total": total disk size in bytes (json-int)
2731 - "xbzrle-cache": only present if XBZRLE is active.
2732 It is a json-object with the following XBZRLE information:
2733 - "cache-size": XBZRLE cache size in bytes
2734 - "bytes": number of bytes transferred for XBZRLE compressed pages
2735 - "pages": number of XBZRLE compressed pages
2736 - "cache-miss": number of XBRZRLE page cache misses
2737 - "cache-miss-rate": rate of XBRZRLE page cache misses
2738 - "overflow": number of times XBZRLE overflows. This means
2739 that the XBZRLE encoding was bigger than just sent the
2740 whole page, and then we sent the whole page instead (as as
2745 1. Before the first migration
2747 -> { "execute": "query-migrate" }
2750 2. Migration is done and has succeeded
2752 -> { "execute": "query-migrate" }
2754 "status": "completed",
2764 "normal-bytes":123456,
2765 "dirty-sync-count":15
2770 3. Migration is done and has failed
2772 -> { "execute": "query-migrate" }
2773 <- { "return": { "status": "failed" } }
2775 4. Migration is being performed and is not a block migration:
2777 -> { "execute": "query-migrate" }
2787 "expected-downtime":12345,
2790 "normal-bytes":123456,
2791 "dirty-sync-count":15
2796 5. Migration is being performed and is a block migration:
2798 -> { "execute": "query-migrate" }
2804 "remaining":1053304,
2808 "expected-downtime":12345,
2811 "normal-bytes":123456,
2812 "dirty-sync-count":15
2816 "remaining":20880384,
2822 6. Migration is being performed and XBZRLE is active:
2824 -> { "execute": "query-migrate" }
2828 "capabilities" : [ { "capability": "xbzrle", "state" : true } ],
2831 "remaining":1053304,
2835 "expected-downtime":12345,
2838 "normal-bytes":3412992,
2839 "dirty-sync-count":15
2842 "cache-size":67108864,
2846 "cache-miss-rate":0.123,
2852 migrate-set-capabilities
2853 ------------------------
2855 Enable/Disable migration capabilities
2857 - "xbzrle": XBZRLE support
2858 - "rdma-pin-all": pin all pages when using RDMA during migration
2859 - "auto-converge": throttle down guest to help convergence of migration
2860 - "zero-blocks": compress zero blocks during block migration
2861 - "compress": use multiple compression threads to accelerate live migration
2862 - "events": generate events for each migration state change
2863 - "postcopy-ram": postcopy mode for live migration
2869 -> { "execute": "migrate-set-capabilities" , "arguments":
2870 { "capabilities": [ { "capability": "xbzrle", "state": true } ] } }
2872 query-migrate-capabilities
2873 --------------------------
2875 Query current migration capabilities
2877 - "capabilities": migration capabilities state
2878 - "xbzrle" : XBZRLE state (json-bool)
2879 - "rdma-pin-all" : RDMA Pin Page state (json-bool)
2880 - "auto-converge" : Auto Converge state (json-bool)
2881 - "zero-blocks" : Zero Blocks state (json-bool)
2882 - "compress": Multiple compression threads state (json-bool)
2883 - "events": Migration state change event state (json-bool)
2884 - "postcopy-ram": postcopy ram state (json-bool)
2890 -> { "execute": "query-migrate-capabilities" }
2892 {"state": false, "capability": "xbzrle"},
2893 {"state": false, "capability": "rdma-pin-all"},
2894 {"state": false, "capability": "auto-converge"},
2895 {"state": false, "capability": "zero-blocks"},
2896 {"state": false, "capability": "compress"},
2897 {"state": true, "capability": "events"},
2898 {"state": false, "capability": "postcopy-ram"}
2901 migrate-set-parameters
2902 ----------------------
2904 Set migration parameters
2906 - "compress-level": set compression level during migration (json-int)
2907 - "compress-threads": set compression thread count for migration (json-int)
2908 - "decompress-threads": set decompression thread count for migration (json-int)
2909 - "cpu-throttle-initial": set initial percentage of time guest cpus are
2910 throttled for auto-converge (json-int)
2911 - "cpu-throttle-increment": set throttle increasing percentage for
2912 auto-converge (json-int)
2913 - "max-bandwidth": set maximum speed for migrations (in bytes/sec) (json-int)
2914 - "downtime-limit": set maximum tolerated downtime (in milliseconds) for
2915 migrations (json-int)
2920 -> { "execute": "migrate-set-parameters" , "arguments":
2921 { "compress-level": 1 } }
2923 query-migrate-parameters
2924 ------------------------
2926 Query current migration parameters
2928 - "parameters": migration parameters value
2929 - "compress-level" : compression level value (json-int)
2930 - "compress-threads" : compression thread count value (json-int)
2931 - "decompress-threads" : decompression thread count value (json-int)
2932 - "cpu-throttle-initial" : initial percentage of time guest cpus are
2933 throttled (json-int)
2934 - "cpu-throttle-increment" : throttle increasing percentage for
2935 auto-converge (json-int)
2936 - "max-bandwidth" : maximium migration speed in bytes per second
2938 - "downtime-limit" : maximum tolerated downtime of migration in
2939 milliseconds (json-int)
2944 -> { "execute": "query-migrate-parameters" }
2947 "decompress-threads": 2,
2948 "cpu-throttle-increment": 10,
2949 "compress-threads": 8,
2950 "compress-level": 1,
2951 "cpu-throttle-initial": 20,
2952 "max-bandwidth": 33554432,
2953 "downtime-limit": 300
2960 Show balloon information.
2962 Make an asynchronous request for balloon info. When the request completes a
2963 json-object will be returned containing the following data:
2965 - "actual": current balloon value in bytes (json-int)
2969 -> { "execute": "query-balloon" }
2972 "actual":1073741824,
2979 Return information about the TPM device.
2985 -> { "execute": "query-tpm" }
2988 { "model": "tpm-tis",
2990 { "type": "passthrough",
2992 { "cancel-path": "/sys/class/misc/tpm0/device/cancel",
3004 Return a list of supported TPM models.
3010 -> { "execute": "query-tpm-models" }
3011 <- { "return": [ "tpm-tis" ] }
3016 Return a list of supported TPM types.
3022 -> { "execute": "query-tpm-types" }
3023 <- { "return": [ "passthrough" ] }
3032 - "id": the chardev's ID, must be unique (json-string)
3033 - "backend": chardev backend type + parameters
3037 -> { "execute" : "chardev-add",
3038 "arguments" : { "id" : "foo",
3039 "backend" : { "type" : "null", "data" : {} } } }
3042 -> { "execute" : "chardev-add",
3043 "arguments" : { "id" : "bar",
3044 "backend" : { "type" : "file",
3045 "data" : { "out" : "/tmp/bar.log" } } } }
3048 -> { "execute" : "chardev-add",
3049 "arguments" : { "id" : "baz",
3050 "backend" : { "type" : "pty", "data" : {} } } }
3051 <- { "return": { "pty" : "/dev/pty/42" } }
3060 - "id": the chardev's ID, must exist and not be in use (json-string)
3064 -> { "execute": "chardev-remove", "arguments": { "id" : "foo" } }
3070 Show rx-filter information.
3072 Returns a json-array of rx-filter information for all NICs (or for the
3073 given NIC), returning an error if the given NIC doesn't exist, or
3074 given NIC doesn't support rx-filter querying, or given net client
3077 The query will clear the event notification flag of each NIC, then qemu
3078 will start to emit event to QMP monitor.
3080 Each array entry contains the following:
3082 - "name": net client name (json-string)
3083 - "promiscuous": promiscuous mode is enabled (json-bool)
3084 - "multicast": multicast receive state (one of 'normal', 'none', 'all')
3085 - "unicast": unicast receive state (one of 'normal', 'none', 'all')
3086 - "vlan": vlan receive state (one of 'normal', 'none', 'all') (Since 2.0)
3087 - "broadcast-allowed": allow to receive broadcast (json-bool)
3088 - "multicast-overflow": multicast table is overflowed (json-bool)
3089 - "unicast-overflow": unicast table is overflowed (json-bool)
3090 - "main-mac": main macaddr string (json-string)
3091 - "vlan-table": a json-array of active vlan id
3092 - "unicast-table": a json-array of unicast macaddr string
3093 - "multicast-table": a json-array of multicast macaddr string
3097 -> { "execute": "query-rx-filter", "arguments": { "name": "vnet0" } }
3100 "promiscuous": true,
3102 "main-mac": "52:54:00:12:34:56",
3103 "unicast": "normal",
3111 "multicast": "normal",
3112 "multicast-overflow": false,
3113 "unicast-overflow": false,
3114 "multicast-table": [
3115 "01:00:5e:00:00:01",
3116 "33:33:00:00:00:01",
3119 "broadcast-allowed": false
3129 This command is still a work in progress. It doesn't support all
3130 block drivers among other things. Stay away from it unless you want
3131 to help with its development.
3135 - "options": block driver options
3139 -> { "execute": "blockdev-add",
3140 "arguments": { "options" : { "driver": "qcow2",
3141 "file": { "driver": "file",
3142 "filename": "test.qcow2" } } } }
3147 -> { "execute": "blockdev-add",
3151 "node-name": "my_disk",
3159 "filename": "/tmp/test.qcow2"
3165 "filename": "/dev/fdset/4"
3178 Deletes a block device that has been added using blockdev-add.
3179 The command will fail if the node is attached to a device or is
3180 otherwise being used.
3182 This command is still a work in progress and is considered
3183 experimental. Stay away from it unless you want to help with its
3188 - "node-name": Name of the graph node to delete (json-string)
3192 -> { "execute": "blockdev-add",
3196 "node-name": "node0",
3199 "filename": "test.qcow2"
3207 -> { "execute": "x-blockdev-del",
3208 "arguments": { "node-name": "node0" }
3215 Opens a block device's tray. If there is a block driver state tree inserted as a
3216 medium, it will become inaccessible to the guest (but it will remain associated
3217 to the block device, so closing the tray will make it accessible again).
3219 If the tray was already open before, this will be a no-op.
3221 Once the tray opens, a DEVICE_TRAY_MOVED event is emitted. There are cases in
3222 which no such event will be generated, these include:
3223 - if the guest has locked the tray, @force is false and the guest does not
3224 respond to the eject request
3225 - if the BlockBackend denoted by @device does not have a guest device attached
3227 - if the guest device does not have an actual tray and is empty, for instance
3228 for floppy disk drives
3232 - "device": block device name (deprecated, use @id instead)
3233 (json-string, optional)
3234 - "id": the name or QOM path of the guest device (json-string, optional)
3235 - "force": if false (the default), an eject request will be sent to the guest if
3236 it has locked the tray (and the tray will not be opened immediately);
3237 if true, the tray will be opened regardless of whether it is locked
3238 (json-bool, optional)
3242 -> { "execute": "blockdev-open-tray",
3243 "arguments": { "id": "ide0-1-0" } }
3245 <- { "timestamp": { "seconds": 1418751016,
3246 "microseconds": 716996 },
3247 "event": "DEVICE_TRAY_MOVED",
3248 "data": { "device": "ide1-cd0",
3250 "tray-open": true } }
3257 Closes a block device's tray. If there is a block driver state tree associated
3258 with the block device (which is currently ejected), that tree will be loaded as
3261 If the tray was already closed before, this will be a no-op.
3265 - "device": block device name (deprecated, use @id instead)
3266 (json-string, optional)
3267 - "id": the name or QOM path of the guest device (json-string, optional)
3271 -> { "execute": "blockdev-close-tray",
3272 "arguments": { "id": "ide0-1-0" } }
3274 <- { "timestamp": { "seconds": 1418751345,
3275 "microseconds": 272147 },
3276 "event": "DEVICE_TRAY_MOVED",
3277 "data": { "device": "ide1-cd0",
3279 "tray-open": false } }
3283 x-blockdev-remove-medium
3284 ------------------------
3286 Removes a medium (a block driver state tree) from a block device. That block
3287 device's tray must currently be open (unless there is no attached guest device).
3289 If the tray is open and there is no medium inserted, this will be a no-op.
3291 This command is still a work in progress and is considered experimental.
3292 Stay away from it unless you want to help with its development.
3296 - "device": block device name (deprecated, use @id instead)
3297 (json-string, optional)
3298 - "id": the name or QOM path of the guest device (json-string, optional)
3302 -> { "execute": "x-blockdev-remove-medium",
3303 "arguments": { "id": "ide0-1-0" } }
3305 <- { "error": { "class": "GenericError",
3306 "desc": "Tray of device 'ide0-1-0' is not open" } }
3308 -> { "execute": "blockdev-open-tray",
3309 "arguments": { "id": "ide0-1-0" } }
3311 <- { "timestamp": { "seconds": 1418751627,
3312 "microseconds": 549958 },
3313 "event": "DEVICE_TRAY_MOVED",
3314 "data": { "device": "ide1-cd0",
3316 "tray-open": true } }
3320 -> { "execute": "x-blockdev-remove-medium",
3321 "arguments": { "device": "ide0-1-0" } }
3325 x-blockdev-insert-medium
3326 ------------------------
3328 Inserts a medium (a block driver state tree) into a block device. That block
3329 device's tray must currently be open (unless there is no attached guest device)
3330 and there must be no medium inserted already.
3332 This command is still a work in progress and is considered experimental.
3333 Stay away from it unless you want to help with its development.
3337 - "device": block device name (deprecated, use @id instead)
3338 (json-string, optional)
3339 - "id": the name or QOM path of the guest device (json-string, optional)
3340 - "node-name": root node of the BDS tree to insert into the block device
3344 -> { "execute": "blockdev-add",
3345 "arguments": { "options": { "node-name": "node0",
3347 "file": { "driver": "file",
3348 "filename": "fedora.iso" } } } }
3352 -> { "execute": "x-blockdev-insert-medium",
3353 "arguments": { "id": "ide0-1-0",
3354 "node-name": "node0" } }
3361 Dynamically reconfigure the block driver state graph. It can be used
3362 to add, remove, insert or replace a graph node. Currently only the
3363 Quorum driver implements this feature to add or remove its child. This
3364 is useful to fix a broken quorum child.
3366 If @node is specified, it will be inserted under @parent. @child
3367 may not be specified in this case. If both @parent and @child are
3368 specified but @node is not, @child will be detached from @parent.
3371 - "parent": the id or name of the parent node (json-string)
3372 - "child": the name of a child under the given parent node (json-string, optional)
3373 - "node": the name of the node that will be added (json-string, optional)
3375 Note: this command is experimental, and not a stable API. It doesn't
3376 support all kinds of operations, all kinds of children, nor all block
3379 Warning: The data in a new quorum child MUST be consistent with that of
3380 the rest of the array.
3384 Add a new node to a quorum
3385 -> { "execute": "blockdev-add",
3386 "arguments": { "options": { "driver": "raw",
3387 "node-name": "new_node",
3388 "file": { "driver": "file",
3389 "filename": "test.raw" } } } }
3391 -> { "execute": "x-blockdev-change",
3392 "arguments": { "parent": "disk1",
3393 "node": "new_node" } }
3396 Delete a quorum's node
3397 -> { "execute": "x-blockdev-change",
3398 "arguments": { "parent": "disk1",
3399 "child": "children.1" } }
3402 query-named-block-nodes
3403 -----------------------
3405 Return a list of BlockDeviceInfo for all the named block driver nodes
3409 -> { "execute": "query-named-block-nodes" }
3410 <- { "return": [ { "ro":false,
3413 "file":"disks/test.qcow2",
3414 "node-name": "my-node",
3415 "backing_file_depth":1,
3429 "write_threshold": 0,
3431 "filename":"disks/test.qcow2",
3433 "virtual-size":2048000,
3434 "backing_file":"base.qcow2",
3435 "full-backing-filename":"disks/base.qcow2",
3436 "backing-filename-format":"qcow2",
3440 "name": "snapshot1",
3442 "date-sec": 10000200,
3444 "vm-clock-sec": 206,
3449 "filename":"disks/base.qcow2",
3451 "virtual-size":2048000
3455 blockdev-change-medium
3456 ----------------------
3458 Changes the medium inserted into a block device by ejecting the current medium
3459 and loading a new image file which is inserted as the new medium.
3463 - "device": block device name (deprecated, use @id instead)
3464 (json-string, optional)
3465 - "id": the name or QOM path of the guest device (json-string, optional)
3466 - "filename": filename of the new image (json-string)
3467 - "format": format of the new image (json-string, optional)
3468 - "read-only-mode": new read-only mode (json-string, optional)
3469 - Possible values: "retain" (default), "read-only", "read-write"
3473 1. Change a removable medium
3475 -> { "execute": "blockdev-change-medium",
3476 "arguments": { "id": "ide0-1-0",
3477 "filename": "/srv/images/Fedora-12-x86_64-DVD.iso",
3481 2. Load a read-only medium into a writable drive
3483 -> { "execute": "blockdev-change-medium",
3484 "arguments": { "id": "floppyA",
3485 "filename": "/srv/images/ro.img",
3487 "read-only-mode": "retain" } }
3490 { "class": "GenericError",
3491 "desc": "Could not open '/srv/images/ro.img': Permission denied" } }
3493 -> { "execute": "blockdev-change-medium",
3494 "arguments": { "id": "floppyA",
3495 "filename": "/srv/images/ro.img",
3497 "read-only-mode": "read-only" } }
3504 Show memory devices information.
3509 -> { "execute": "query-memdev" }
3516 "host-nodes": [0, 1],
3524 "host-nodes": [2, 3],
3525 "policy": "preferred"
3530 query-memory-devices
3531 --------------------
3533 Return a list of memory devices.
3536 -> { "execute": "query-memory-devices" }
3537 <- { "return": [ { "data":
3538 { "addr": 5368709120,
3539 "hotpluggable": true,
3542 "memdev": "/objects/memX",
3549 query-acpi-ospm-status
3550 ----------------------
3552 Return list of ACPIOSTInfo for devices that support status reporting
3553 via ACPI _OST method.
3556 -> { "execute": "query-acpi-ospm-status" }
3557 <- { "return": [ { "device": "d1", "slot": "0", "slot-type": "DIMM", "source": 1, "status": 0},
3558 { "slot": "1", "slot-type": "DIMM", "source": 0, "status": 0},
3559 { "slot": "2", "slot-type": "DIMM", "source": 0, "status": 0},
3560 { "slot": "3", "slot-type": "DIMM", "source": 0, "status": 0}
3563 rtc-reset-reinjection
3564 ---------------------
3566 Reset the RTC interrupt reinjection backlog.
3572 -> { "execute": "rtc-reset-reinjection" }
3575 trace-event-get-state
3576 ---------------------
3578 Query the state of events.
3582 - "name": Event name pattern (json-string).
3583 - "vcpu": The vCPU to query, any vCPU by default (json-int, optional).
3585 An event is returned if:
3586 - its name matches the "name" pattern, and
3587 - if "vcpu" is given, the event has the "vcpu" property.
3589 Therefore, if "vcpu" is given, the operation will only match per-vCPU events,
3590 returning their state on the specified vCPU. Special case: if "name" is an exact
3591 match, "vcpu" is given and the event does not have the "vcpu" property, an error
3596 -> { "execute": "trace-event-get-state", "arguments": { "name": "qemu_memalign" } }
3597 <- { "return": [ { "name": "qemu_memalign", "state": "disabled" } ] }
3599 trace-event-set-state
3600 ---------------------
3602 Set the state of events.
3606 - "name": Event name pattern (json-string).
3607 - "enable": Whether to enable or disable the event (json-bool).
3608 - "ignore-unavailable": Whether to ignore errors for events that cannot be
3609 changed (json-bool, optional).
3610 - "vcpu": The vCPU to act upon, all vCPUs by default (json-int, optional).
3612 An event's state is modified if:
3613 - its name matches the "name" pattern, and
3614 - if "vcpu" is given, the event has the "vcpu" property.
3616 Therefore, if "vcpu" is given, the operation will only match per-vCPU events,
3617 setting their state on the specified vCPU. Special case: if "name" is an exact
3618 match, "vcpu" is given and the event does not have the "vcpu" property, an error
3623 -> { "execute": "trace-event-set-state", "arguments": { "name": "qemu_memalign", "enable": "true" } }
3629 Send input event to guest.
3633 - "device": display device (json-string, optional)
3634 - "head": display head (json-int, optional)
3635 - "events": list of input events
3637 The consoles are visible in the qom tree, under
3638 /backend/console[$index]. They have a device link and head property, so
3639 it is possible to map which console belongs to which device and display.
3643 Press left mouse button.
3645 -> { "execute": "input-send-event",
3646 "arguments": { "device": "video0",
3647 "events": [ { "type": "btn",
3648 "data" : { "down": true, "button": "left" } } ] } }
3651 -> { "execute": "input-send-event",
3652 "arguments": { "device": "video0",
3653 "events": [ { "type": "btn",
3654 "data" : { "down": false, "button": "left" } } ] } }
3661 -> { "execute": "input-send-event",
3662 "arguments": { "events": [
3663 { "type": "key", "data" : { "down": true,
3664 "key": {"type": "qcode", "data": "ctrl" } } },
3665 { "type": "key", "data" : { "down": true,
3666 "key": {"type": "qcode", "data": "alt" } } },
3667 { "type": "key", "data" : { "down": true,
3668 "key": {"type": "qcode", "data": "delete" } } } ] } }
3673 Move mouse pointer to absolute coordinates (20000, 400).
3675 -> { "execute": "input-send-event" ,
3676 "arguments": { "events": [
3677 { "type": "abs", "data" : { "axis": "x", "value" : 20000 } },
3678 { "type": "abs", "data" : { "axis": "y", "value" : 400 } } ] } }
3681 block-set-write-threshold
3684 Change the write threshold for a block drive. The threshold is an offset,
3685 thus must be non-negative. Default is no write threshold.
3686 Setting the threshold to zero disables it.
3690 - "node-name": the node name in the block driver state graph (json-string)
3691 - "write-threshold": the write threshold in bytes (json-int)
3695 -> { "execute": "block-set-write-threshold",
3696 "arguments": { "node-name": "mydev",
3697 "write-threshold": 17179869184 } }
3705 - "name": switch name
3709 -> { "execute": "query-rocker", "arguments": { "name": "sw1" } }
3710 <- { "return": {"name": "sw1", "ports": 2, "id": 1327446905938}}
3712 Show rocker switch ports
3713 ------------------------
3717 - "name": switch name
3721 -> { "execute": "query-rocker-ports", "arguments": { "name": "sw1" } }
3722 <- { "return": [ {"duplex": "full", "enabled": true, "name": "sw1.1",
3723 "autoneg": "off", "link-up": true, "speed": 10000},
3724 {"duplex": "full", "enabled": true, "name": "sw1.2",
3725 "autoneg": "off", "link-up": true, "speed": 10000}
3728 Show rocker switch OF-DPA flow tables
3729 -------------------------------------
3733 - "name": switch name
3734 - "tbl-id": (optional) flow table ID
3738 -> { "execute": "query-rocker-of-dpa-flows", "arguments": { "name": "sw1" } }
3739 <- { "return": [ {"key": {"in-pport": 0, "priority": 1, "tbl-id": 0},
3742 "action": {"goto-tbl": 10},
3743 "mask": {"in-pport": 4294901760}
3748 Show rocker OF-DPA group tables
3749 -------------------------------
3753 - "name": switch name
3754 - "type": (optional) group type
3758 -> { "execute": "query-rocker-of-dpa-groups", "arguments": { "name": "sw1" } }
3759 <- { "return": [ {"type": 0, "out-pport": 2, "pport": 2, "vlan-id": 3841,
3760 "pop-vlan": 1, "id": 251723778},
3761 {"type": 0, "out-pport": 0, "pport": 0, "vlan-id": 3841,
3762 "pop-vlan": 1, "id": 251723776},
3763 {"type": 0, "out-pport": 1, "pport": 1, "vlan-id": 3840,
3764 "pop-vlan": 1, "id": 251658241},
3765 {"type": 0, "out-pport": 0, "pport": 0, "vlan-id": 3840,
3766 "pop-vlan": 1, "id": 251658240}
3769 query-gic-capabilities
3772 Return a list of GICCapability objects, describing supported GIC
3773 (Generic Interrupt Controller) versions.
3779 -> { "execute": "query-gic-capabilities" }
3780 <- { "return": [{ "version": 2, "emulated": true, "kernel": false },
3781 { "version": 3, "emulated": false, "kernel": true } ] }
3783 Show existing/possible CPUs
3784 ---------------------------
3788 Example for pseries machine type started with
3789 -smp 2,cores=2,maxcpus=4 -cpu POWER8:
3791 -> { "execute": "query-hotpluggable-cpus" }
3793 { "props": { "core-id": 8 }, "type": "POWER8-spapr-cpu-core",
3795 { "props": { "core-id": 0 }, "type": "POWER8-spapr-cpu-core",
3796 "vcpus-count": 1, "qom-path": "/machine/unattached/device[0]"}
3799 Example for pc machine type started with
3801 -> { "execute": "query-hotpluggable-cpus" }
3804 "type": "qemu64-x86_64-cpu", "vcpus-count": 1,
3805 "props": {"core-id": 0, "socket-id": 1, "thread-id": 0}
3808 "qom-path": "/machine/unattached/device[0]",
3809 "type": "qemu64-x86_64-cpu", "vcpus-count": 1,
3810 "props": {"core-id": 0, "socket-id": 0, "thread-id": 0}