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.
59 Eject a removable medium.
63 - "force": force ejection (json-bool, optional)
64 - "device": block device name (deprecated, use @id instead)
65 (json-string, optional)
66 - "id": the name or QOM path of the guest device (json-string, optional)
70 -> { "execute": "eject", "arguments": { "id": "ide0-1-0" } }
73 Note: The "force" argument defaults to false.
78 Change a removable medium or VNC configuration.
82 - "device": device name (json-string)
83 - "target": filename or item (json-string)
84 - "arg": additional argument (json-string, optional)
88 1. Change a removable medium
90 -> { "execute": "change",
91 "arguments": { "device": "ide1-cd0",
92 "target": "/srv/images/Fedora-12-x86_64-DVD.iso" } }
95 2. Change VNC password
97 -> { "execute": "change",
98 "arguments": { "device": "vnc", "target": "password",
105 Save screen into PPM image.
109 - "filename": file path (json-string)
113 -> { "execute": "screendump", "arguments": { "filename": "/tmp/image" } }
123 - "driver": the name of the new device's driver (json-string)
124 - "bus": the device's parent bus (device tree path, json-string, optional)
125 - "id": the device's ID, must be unique (json-string)
130 -> { "execute": "device_add", "arguments": { "driver": "e1000", "id": "net1" } }
135 (1) For detailed information about this command, please refer to the
136 'docs/qdev-device-use.txt' file.
138 (2) It's possible to list device properties by running QEMU with the
139 "-device DEVICE,\?" command-line argument, where DEVICE is the device's name
148 - "id": the device's ID or QOM path (json-string)
152 -> { "execute": "device_del", "arguments": { "id": "net1" } }
157 -> { "execute": "device_del", "arguments": { "id": "/machine/peripheral-anon/device[0]" } }
168 - "key": key sequence (a json-array of key union values,
169 union can be number or qcode enum)
171 - hold-time: time to delay key up events, milliseconds. Defaults to 100
176 -> { "execute": "send-key",
177 "arguments": { "keys": [ { "type": "qcode", "data": "ctrl" },
178 { "type": "qcode", "data": "alt" },
179 { "type": "qcode", "data": "delete" } ] } }
189 - "index": the CPU's index (json-int)
193 -> { "execute": "cpu", "arguments": { "index": 0 } }
196 Note: CPUs' indexes are obtained with the 'query-cpus' command.
198 xen-save-devices-state
201 Save the state of all devices to file. The RAM and the block devices
202 of the VM are not saved by this command.
206 - "filename": the file to save the state of the devices to as binary
207 data. See xen-save-devices-state.txt for a description of the binary
212 -> { "execute": "xen-save-devices-state",
213 "arguments": { "filename": "/tmp/save" } }
216 xen-load-devices-state
217 ----------------------
219 Load the state of all devices from file. The RAM and the block devices
220 of the VM are not loaded by this command.
224 - "filename": the file to load the state of the devices from as binary
225 data. See xen-save-devices-state.txt for a description of the binary
230 -> { "execute": "xen-load-devices-state",
231 "arguments": { "filename": "/tmp/resume" } }
234 xen-set-global-dirty-log
237 Enable or disable the global dirty log mode.
241 - "enable": Enable it or disable it.
245 -> { "execute": "xen-set-global-dirty-log",
246 "arguments": { "enable": true } }
256 - "blk": block migration, full disk copy (json-bool, optional)
257 - "inc": incremental disk copy (json-bool, optional)
258 - "uri": Destination URI (json-string)
262 -> { "execute": "migrate", "arguments": { "uri": "tcp:0:4446" } }
267 (1) The 'query-migrate' command should be used to check migration's progress
268 and final result (this information is provided by the 'status' member)
269 (2) All boolean arguments default to false
270 (3) The user Monitor's "detach" argument is invalid in QMP and should not
276 Continue an incoming migration
280 - "uri": Source/listening URI (json-string)
284 -> { "execute": "migrate-incoming", "arguments": { "uri": "tcp::4446" } }
289 (1) QEMU must be started with -incoming defer to allow migrate-incoming to
291 (2) The uri format is the same as for -incoming
293 migrate-set-cache-size
294 ----------------------
296 Set cache size to be used by XBZRLE migration, the cache size will be rounded
297 down to the nearest power of 2
301 - "value": cache size in bytes (json-int)
305 -> { "execute": "migrate-set-cache-size", "arguments": { "value": 536870912 } }
308 x-colo-lost-heartbeat
311 Tell COLO that heartbeat is lost, a failover or takeover is needed.
315 -> { "execute": "x-colo-lost-heartbeat" }
321 Dump guest memory to file. The file can be processed with crash or gdb.
325 - "paging": do paging to get guest's memory mapping (json-bool)
326 - "protocol": destination file(started with "file:") or destination file
327 descriptor (started with "fd:") (json-string)
328 - "detach": if specified, command will return immediately, without waiting
329 for the dump to finish. The user can track progress using
330 "query-dump". (json-bool)
331 - "begin": the starting physical address. It's optional, and should be specified
332 with length together (json-int)
333 - "length": the memory size, in bytes. It's optional, and should be specified
334 with begin together (json-int)
335 - "format": the format of guest memory dump. It's optional, and can be
336 elf|kdump-zlib|kdump-lzo|kdump-snappy, but non-elf formats will
337 conflict with paging and filter, ie. begin and length (json-string)
341 -> { "execute": "dump-guest-memory", "arguments": { "protocol": "fd:dump" } }
346 (1) All boolean arguments default to false
348 query-dump-guest-memory-capability
351 Show available formats for 'dump-guest-memory'
355 -> { "execute": "query-dump-guest-memory-capability" }
356 <- { "return": { "formats":
357 ["elf", "kdump-zlib", "kdump-lzo", "kdump-snappy"] }
362 Query background dump status.
368 -> { "execute": "query-dump" }
369 <- { "return": { "status": "active", "completed": 1024000,
375 Save guest storage keys to file.
379 - "filename": file path (json-string)
383 -> { "execute": "dump-skeys", "arguments": { "filename": "/tmp/skeys" } }
389 Add host network device.
393 - "type": the device type, "tap", "user", ... (json-string)
394 - "id": the device's ID, must be unique (json-string)
399 -> { "execute": "netdev_add",
400 "arguments": { "type": "user", "id": "netdev1",
401 "dnssearch": "example.org" } }
404 Note: The supported device options are the same ones supported by the '-netdev'
405 command-line argument, which are listed in the '-help' output or QEMU's
411 Remove host network device.
415 - "id": the device's ID, must be unique (json-string)
419 -> { "execute": "netdev_del", "arguments": { "id": "netdev1" } }
430 - "qom-type": the object's QOM type, i.e. the class name (json-string)
431 - "id": the object's ID, must be unique (json-string)
432 - "props": a dictionary of object property values (optional, json-dict)
436 -> { "execute": "object-add", "arguments": { "qom-type": "rng-random", "id": "rng1",
437 "props": { "filename": "/dev/hwrng" } } }
447 - "id": the object's ID (json-string)
451 -> { "execute": "object-del", "arguments": { "id": "rng1" } }
458 Resize a block image while a guest is running.
462 - "device": the device's ID, must be unique (json-string)
463 - "node-name": the node name in the block driver state graph (json-string)
468 -> { "execute": "block_resize", "arguments": { "device": "scratch", "size": 1073741824 } }
474 Copy data from a backing file into a block device.
478 - "job-id": Identifier for the newly-created block job. If omitted,
479 the device name will be used. (json-string, optional)
480 - "device": The device name or node-name of a root node (json-string)
481 - "base": The file name of the backing image above which copying starts.
482 It cannot be set if 'base-node' is also set (json-string, optional)
483 - "base-node": the node name of the backing image above which copying starts.
484 It cannot be set if 'base' is also set.
485 (json-string, optional) (Since 2.8)
486 - "backing-file": The backing file string to write into the active layer. This
487 filename is not validated.
489 If a pathname string is such that it cannot be resolved by
490 QEMU, that means that subsequent QMP or HMP commands must use
491 node-names for the image in question, as filename lookup
494 If not specified, QEMU will automatically determine the
495 backing file string to use, or error out if there is no
496 obvious choice. Care should be taken when specifying the
497 string, to specify a valid filename or protocol.
498 (json-string, optional) (Since 2.1)
499 - "speed": the maximum speed, in bytes per second (json-int, optional)
500 - "on-error": the action to take on an error (default 'report'). 'stop' and
501 'enospc' can only be used if the block device supports io-status.
502 (json-string, optional) (Since 2.1)
506 -> { "execute": "block-stream", "arguments": { "device": "virtio0",
507 "base": "/tmp/master.qcow2" } }
513 Live commit of data from overlay image nodes into backing nodes - i.e., writes
514 data between 'top' and 'base' into 'base'.
518 - "job-id": Identifier for the newly-created block job. If omitted,
519 the device name will be used. (json-string, optional)
520 - "device": The device name or node-name of a root node (json-string)
521 - "base": The file name of the backing image to write data into.
522 If not specified, this is the deepest backing image
523 (json-string, optional)
524 - "top": The file name of the backing image within the image chain,
525 which contains the topmost data to be committed down. If
526 not specified, this is the active layer. (json-string, optional)
528 - backing-file: The backing file string to write into the overlay
529 image of 'top'. If 'top' is the active layer,
530 specifying a backing file string is an error. This
531 filename is not validated.
533 If a pathname string is such that it cannot be
534 resolved by QEMU, that means that subsequent QMP or
535 HMP commands must use node-names for the image in
536 question, as filename lookup methods will fail.
538 If not specified, QEMU will automatically determine
539 the backing file string to use, or error out if
540 there is no obvious choice. Care should be taken
541 when specifying the string, to specify a valid
542 filename or protocol.
543 (json-string, optional) (Since 2.1)
545 If top == base, that is an error.
546 If top == active, the job will not be completed by itself,
547 user needs to complete the job with the block-job-complete
548 command after getting the ready event. (Since 2.0)
550 If the base image is smaller than top, then the base image
551 will be resized to be the same size as top. If top is
552 smaller than the base image, the base will not be
553 truncated. If you want the base image size to match the
554 size of the smaller top, you can safely truncate it
555 yourself once the commit operation successfully completes.
557 - "speed": the maximum speed, in bytes per second (json-int, optional)
562 -> { "execute": "block-commit", "arguments": { "device": "virtio0",
563 "top": "/tmp/snap1.qcow2" } }
569 Start a point-in-time copy of a block device to a new destination. The
570 status of ongoing drive-backup operations can be checked with
571 query-block-jobs where the BlockJobInfo.type field has the value 'backup'.
572 The operation can be stopped before it has completed using the
573 block-job-cancel command.
577 - "job-id": Identifier for the newly-created block job. If omitted,
578 the device name will be used. (json-string, optional)
579 - "device": the device name or node-name of a root node which should be copied.
581 - "target": the target of the new image. If the file exists, or if it is a
582 device, the existing file/device will be used as the new
583 destination. If it does not exist, a new file will be created.
585 - "format": the format of the new destination, default is to probe if 'mode' is
586 'existing', else the format of the source
587 (json-string, optional)
588 - "sync": what parts of the disk image should be copied to the destination;
589 possibilities include "full" for all the disk, "top" for only the sectors
590 allocated in the topmost image, "incremental" for only the dirty sectors in
591 the bitmap, or "none" to only replicate new I/O (MirrorSyncMode).
592 - "bitmap": dirty bitmap name for sync==incremental. Must be present if sync
593 is "incremental", must NOT be present otherwise.
594 - "mode": whether and how QEMU should create a new image
595 (NewImageMode, optional, default 'absolute-paths')
596 - "speed": the maximum speed, in bytes per second (json-int, optional)
597 - "compress": true to compress data, if the target format supports it.
598 (json-bool, optional, default false)
599 - "on-source-error": the action to take on an error on the source, default
600 'report'. 'stop' and 'enospc' can only be used
601 if the block device supports io-status.
602 (BlockdevOnError, optional)
603 - "on-target-error": the action to take on an error on the target, default
604 'report' (no limitations, since this applies to
605 a different block device than device).
606 (BlockdevOnError, optional)
609 -> { "execute": "drive-backup", "arguments": { "device": "drive0",
611 "target": "backup.img" } }
617 The device version of drive-backup: this command takes an existing named device
622 - "job-id": Identifier for the newly-created block job. If omitted,
623 the device name will be used. (json-string, optional)
624 - "device": the device name or node-name of a root node which should be copied.
626 - "target": the name of the backup target device. (json-string)
627 - "sync": what parts of the disk image should be copied to the destination;
628 possibilities include "full" for all the disk, "top" for only the
629 sectors allocated in the topmost image, or "none" to only replicate
630 new I/O (MirrorSyncMode).
631 - "speed": the maximum speed, in bytes per second (json-int, optional)
632 - "compress": true to compress data, if the target format supports it.
633 (json-bool, optional, default false)
634 - "on-source-error": the action to take on an error on the source, default
635 'report'. 'stop' and 'enospc' can only be used
636 if the block device supports io-status.
637 (BlockdevOnError, optional)
638 - "on-target-error": the action to take on an error on the target, default
639 'report' (no limitations, since this applies to
640 a different block device than device).
641 (BlockdevOnError, optional)
644 -> { "execute": "blockdev-backup", "arguments": { "device": "src-id",
646 "target": "tgt-id" } }
649 block-dirty-bitmap-add
650 ----------------------
653 Create a dirty bitmap with a name on the device, and start tracking the writes.
657 - "node": device/node on which to create dirty bitmap (json-string)
658 - "name": name of the new dirty bitmap (json-string)
659 - "granularity": granularity to track writes with (int, optional)
663 -> { "execute": "block-dirty-bitmap-add", "arguments": { "node": "drive0",
664 "name": "bitmap0" } }
667 block-dirty-bitmap-remove
668 -------------------------
671 Stop write tracking and remove the dirty bitmap that was created with
672 block-dirty-bitmap-add.
676 - "node": device/node on which to remove dirty bitmap (json-string)
677 - "name": name of the dirty bitmap to remove (json-string)
681 -> { "execute": "block-dirty-bitmap-remove", "arguments": { "node": "drive0",
682 "name": "bitmap0" } }
685 block-dirty-bitmap-clear
686 ------------------------
689 Reset the dirty bitmap associated with a node so that an incremental backup
690 from this point in time forward will only backup clusters modified after this
695 - "node": device/node on which to remove dirty bitmap (json-string)
696 - "name": name of the dirty bitmap to remove (json-string)
700 -> { "execute": "block-dirty-bitmap-clear", "arguments": { "node": "drive0",
701 "name": "bitmap0" } }
704 blockdev-snapshot-sync
705 ----------------------
707 Synchronous snapshot of a block device. snapshot-file specifies the
708 target of the new image. If the file exists, or if it is a device, the
709 snapshot will be created in the existing file/device. If does not
710 exist, a new file will be created. format specifies the format of the
711 snapshot image, default is qcow2.
715 - "device": device name to snapshot (json-string)
716 - "node-name": graph node name to snapshot (json-string)
717 - "snapshot-file": name of new image file (json-string)
718 - "snapshot-node-name": graph node name of the new snapshot (json-string)
719 - "mode": whether and how QEMU should create the snapshot file
720 (NewImageMode, optional, default "absolute-paths")
721 - "format": format of new image (json-string, optional)
725 -> { "execute": "blockdev-snapshot-sync", "arguments": { "device": "ide-hd0",
727 "/some/place/my-image",
728 "format": "qcow2" } }
735 Create a snapshot, by installing 'node' as the backing image of
736 'overlay'. Additionally, if 'node' is associated with a block
737 device, the block device changes to using 'overlay' as its new active
742 - "node": device that will have a snapshot created (json-string)
743 - "overlay": device that will have 'node' as its backing image (json-string)
747 -> { "execute": "blockdev-add",
748 "arguments": { "driver": "qcow2",
749 "node-name": "node1534",
750 "file": { "driver": "file",
751 "filename": "hd1.qcow2" },
756 -> { "execute": "blockdev-snapshot", "arguments": { "node": "ide-hd0",
757 "overlay": "node1534" } }
760 blockdev-snapshot-internal-sync
761 -------------------------------
763 Synchronously take an internal snapshot of a block device when the format of
764 image used supports it. If the name is an empty string, or a snapshot with
765 name already exists, the operation will fail.
769 - "device": the device name or node-name of a root node to snapshot
771 - "name": name of the new snapshot (json-string)
775 -> { "execute": "blockdev-snapshot-internal-sync",
776 "arguments": { "device": "ide-hd0",
777 "name": "snapshot0" }
781 blockdev-snapshot-delete-internal-sync
782 --------------------------------------
784 Synchronously delete an internal snapshot of a block device when the format of
785 image used supports it. The snapshot is identified by name or id or both. One
786 of name or id is required. If the snapshot is not found, the operation will
791 - "device": the device name or node-name of a root node (json-string)
792 - "id": ID of the snapshot (json-string, optional)
793 - "name": name of the snapshot (json-string, optional)
797 -> { "execute": "blockdev-snapshot-delete-internal-sync",
798 "arguments": { "device": "ide-hd0",
799 "name": "snapshot0" }
815 Start mirroring a block device's writes to a new destination. target
816 specifies the target of the new image. If the file exists, or if it is
817 a device, it will be used as the new destination for writes. If it does not
818 exist, a new file will be created. format specifies the format of the
819 mirror image, default is to probe if mode='existing', else the format
824 - "job-id": Identifier for the newly-created block job. If omitted,
825 the device name will be used. (json-string, optional)
826 - "device": the device name or node-name of a root node whose writes should be
827 mirrored. (json-string)
828 - "target": name of new image file (json-string)
829 - "format": format of new image (json-string, optional)
830 - "node-name": the name of the new block driver state in the node graph
831 (json-string, optional)
832 - "replaces": the block driver node name to replace when finished
833 (json-string, optional)
834 - "mode": how an image file should be created into the target
835 file/device (NewImageMode, optional, default 'absolute-paths')
836 - "speed": maximum speed of the streaming job, in bytes per second
838 - "granularity": granularity of the dirty bitmap, in bytes (json-int, optional)
839 - "buf-size": maximum amount of data in flight from source to target, in bytes
840 (json-int, default 10M)
841 - "sync": what parts of the disk image should be copied to the destination;
842 possibilities include "full" for all the disk, "top" for only the sectors
843 allocated in the topmost image, or "none" to only replicate new I/O
845 - "on-source-error": the action to take on an error on the source
846 (BlockdevOnError, default 'report')
847 - "on-target-error": the action to take on an error on the target
848 (BlockdevOnError, default 'report')
849 - "unmap": whether the target sectors should be discarded where source has only
850 zeroes. (json-bool, optional, default true)
852 The default value of the granularity is the image cluster size clamped
853 between 4096 and 65536, if the image format defines one. If the format
854 does not define a cluster size, the default value of the granularity
860 -> { "execute": "drive-mirror", "arguments": { "device": "ide-hd0",
861 "target": "/some/place/my-image",
863 "format": "qcow2" } }
869 Start mirroring a block device's writes to another block device. target
870 specifies the target of mirror operation.
874 - "job-id": Identifier for the newly-created block job. If omitted,
875 the device name will be used. (json-string, optional)
876 - "device": The device name or node-name of a root node whose writes should be
877 mirrored (json-string)
878 - "target": device name to mirror to (json-string)
879 - "replaces": the block driver node name to replace when finished
880 (json-string, optional)
881 - "speed": maximum speed of the streaming job, in bytes per second
883 - "granularity": granularity of the dirty bitmap, in bytes (json-int, optional)
884 - "buf_size": maximum amount of data in flight from source to target, in bytes
885 (json-int, default 10M)
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 sectors
888 allocated in the topmost image, or "none" to only replicate new I/O
890 - "on-source-error": the action to take on an error on the source
891 (BlockdevOnError, default 'report')
892 - "on-target-error": the action to take on an error on the target
893 (BlockdevOnError, default 'report')
895 The default value of the granularity is the image cluster size clamped
896 between 4096 and 65536, if the image format defines one. If the format
897 does not define a cluster size, the default value of the granularity
902 -> { "execute": "blockdev-mirror", "arguments": { "device": "ide-hd0",
911 Change the backing file in the image file metadata. This does not cause
912 QEMU to reopen the image file to reparse the backing filename (it may,
913 however, perform a reopen to change permissions from r/o -> r/w -> r/o,
914 if needed). The new backing file string is written into the image file
915 metadata, and the QEMU internal strings are updated.
919 - "image-node-name": The name of the block driver state node of the
920 image to modify. The "device" is argument is used to
921 verify "image-node-name" is in the chain described by
923 (json-string, optional)
925 - "device": The device name or node-name of the root node that owns
929 - "backing-file": The string to write as the backing file. This string is
930 not validated, so care should be taken when specifying
931 the string or the image chain may not be able to be
935 Returns: Nothing on success
936 If "device" does not exist or cannot be determined, DeviceNotFound
941 Receive a file descriptor via SCM rights and assign it a name.
945 - "fdname": file descriptor name (json-string)
949 -> { "execute": "getfd", "arguments": { "fdname": "fd1" } }
954 (1) If the name specified by the "fdname" argument already exists,
955 the file descriptor assigned to it will be closed and replaced
956 by the received file descriptor.
957 (2) The 'closefd' command can be used to explicitly close the file
958 descriptor when it is no longer needed.
963 Close a file descriptor previously passed via SCM rights.
967 - "fdname": file descriptor name (json-string)
971 -> { "execute": "closefd", "arguments": { "fdname": "fd1" } }
977 Add a file descriptor, that was passed via SCM rights, to an fd set.
981 - "fdset-id": The ID of the fd set to add the file descriptor to.
983 - "opaque": A free-form string that can be used to describe the fd.
984 (json-string, optional)
986 Return a json-object with the following information:
988 - "fdset-id": The ID of the fd set that the fd was added to. (json-int)
989 - "fd": The file descriptor that was received via SCM rights and added to the
994 -> { "execute": "add-fd", "arguments": { "fdset-id": 1 } }
995 <- { "return": { "fdset-id": 1, "fd": 3 } }
999 (1) The list of fd sets is shared by all monitor connections.
1000 (2) If "fdset-id" is not specified, a new fd set will be created.
1005 Remove a file descriptor from an fd set.
1009 - "fdset-id": The ID of the fd set that the file descriptor belongs to.
1011 - "fd": The file descriptor that is to be removed. (json-int, optional)
1015 -> { "execute": "remove-fd", "arguments": { "fdset-id": 1, "fd": 3 } }
1020 (1) The list of fd sets is shared by all monitor connections.
1021 (2) If "fd" is not specified, all file descriptors in "fdset-id" will be
1027 Return information describing all fd sets.
1033 -> { "execute": "query-fdsets" }
1039 "opaque": "rdonly:/path/to/file"
1043 "opaque": "rdwr:/path/to/file"
1062 Note: The list of fd sets is shared by all monitor connections.
1067 Set the password of encrypted block devices.
1071 - "device": device name (json-string)
1072 - "node-name": name in the block driver state graph (json-string)
1073 - "password": password (json-string)
1077 -> { "execute": "block_passwd", "arguments": { "device": "ide0-hd0",
1078 "password": "12345" } }
1081 block_set_io_throttle
1084 Change I/O throttle limits for a block drive.
1088 - "device": block device name (deprecated, use @id instead)
1089 (json-string, optional)
1090 - "id": the name or QOM path of the guest device (json-string, optional)
1091 - "bps": total throughput limit in bytes per second (json-int)
1092 - "bps_rd": read throughput limit in bytes per second (json-int)
1093 - "bps_wr": write throughput limit in bytes per second (json-int)
1094 - "iops": total I/O operations per second (json-int)
1095 - "iops_rd": read I/O operations per second (json-int)
1096 - "iops_wr": write I/O operations per second (json-int)
1097 - "bps_max": total throughput limit during bursts, in bytes (json-int, optional)
1098 - "bps_rd_max": read throughput limit during bursts, in bytes (json-int, optional)
1099 - "bps_wr_max": write throughput limit during bursts, in bytes (json-int, optional)
1100 - "iops_max": total I/O operations per second during bursts (json-int, optional)
1101 - "iops_rd_max": read I/O operations per second during bursts (json-int, optional)
1102 - "iops_wr_max": write I/O operations per second during bursts (json-int, optional)
1103 - "bps_max_length": maximum length of the @bps_max burst period, in seconds (json-int, optional)
1104 - "bps_rd_max_length": maximum length of the @bps_rd_max burst period, in seconds (json-int, optional)
1105 - "bps_wr_max_length": maximum length of the @bps_wr_max burst period, in seconds (json-int, optional)
1106 - "iops_max_length": maximum length of the @iops_max burst period, in seconds (json-int, optional)
1107 - "iops_rd_max_length": maximum length of the @iops_rd_max burst period, in seconds (json-int, optional)
1108 - "iops_wr_max_length": maximum length of the @iops_wr_max burst period, in seconds (json-int, optional)
1109 - "iops_size": I/O size in bytes when limiting (json-int, optional)
1110 - "group": throttle group name (json-string, optional)
1114 -> { "execute": "block_set_io_throttle", "arguments": { "id": "ide0-1-0",
1127 "bps_max_length": 60,
1134 Set the password expire time for vnc/spice protocols.
1138 - "protocol": protocol name (json-string)
1139 - "time": [ now | never | +secs | secs ] (json-string)
1143 -> { "execute": "expire_password", "arguments": { "protocol": "vnc",
1150 Enable QMP capabilities.
1156 -> { "execute": "qmp_capabilities" }
1159 Note: This command must be issued before issuing any other command.
1170 Return a json-object with the following information:
1172 - "qemu": A json-object containing three integer values:
1173 - "major": QEMU's major version (json-int)
1174 - "minor": QEMU's minor version (json-int)
1175 - "micro": QEMU's micro version (json-int)
1176 - "package": package's version (json-string)
1180 -> { "execute": "query-version" }
1195 List QMP available commands.
1197 Each command is represented by a json-object, the returned value is a json-array
1200 Each json-object contain:
1202 - "name": command's name (json-string)
1206 -> { "execute": "query-commands" }
1210 "name":"query-balloon"
1213 "name":"system_powerdown"
1218 Note: This example has been shortened as the real response is too long.
1223 Return the QMP wire schema. The returned value is a json-array of
1224 named schema entities. Entities are commands, events and various
1225 types. See docs/qapi-code-gen.txt for information on their structure
1231 Show the block devices.
1233 Each block device information is stored in a json-object and the returned value
1234 is a json-array of all devices.
1236 Each json-object contain the following:
1238 - "device": device name (json-string)
1239 - "type": device type (json-string)
1240 - deprecated, retained for backward compatibility
1241 - Possible values: "unknown"
1242 - "removable": true if the device is removable, false otherwise (json-bool)
1243 - "locked": true if the device is locked, false otherwise (json-bool)
1244 - "tray_open": only present if removable, true if the device has a tray,
1245 and it is open (json-bool)
1246 - "inserted": only present if the device is inserted, it is a json-object
1247 containing the following:
1248 - "file": device file name (json-string)
1249 - "ro": true if read-only, false otherwise (json-bool)
1250 - "drv": driver format name (json-string)
1251 - Possible values: "blkdebug", "bochs", "cloop", "dmg",
1252 "file", "file", "ftp", "ftps", "host_cdrom",
1253 "host_device", "http", "https",
1254 "nbd", "parallels", "qcow", "qcow2", "raw",
1255 "vdi", "vmdk", "vpc", "vvfat"
1256 - "backing_file": backing file name (json-string, optional)
1257 - "backing_file_depth": number of files in the backing file chain (json-int)
1258 - "encrypted": true if encrypted, false otherwise (json-bool)
1259 - "bps": limit total bytes per second (json-int)
1260 - "bps_rd": limit read bytes per second (json-int)
1261 - "bps_wr": limit write bytes per second (json-int)
1262 - "iops": limit total I/O operations per second (json-int)
1263 - "iops_rd": limit read operations per second (json-int)
1264 - "iops_wr": limit write operations per second (json-int)
1265 - "bps_max": total max in bytes (json-int)
1266 - "bps_rd_max": read max in bytes (json-int)
1267 - "bps_wr_max": write max in bytes (json-int)
1268 - "iops_max": total I/O operations max (json-int)
1269 - "iops_rd_max": read I/O operations max (json-int)
1270 - "iops_wr_max": write I/O operations max (json-int)
1271 - "iops_size": I/O size when limiting by iops (json-int)
1272 - "detect_zeroes": detect and optimize zero writing (json-string)
1273 - Possible values: "off", "on", "unmap"
1274 - "write_threshold": write offset threshold in bytes, a event will be
1275 emitted if crossed. Zero if disabled (json-int)
1276 - "image": the detail of the image, it is a json-object containing
1278 - "filename": image file name (json-string)
1279 - "format": image format (json-string)
1280 - "virtual-size": image capacity in bytes (json-int)
1281 - "dirty-flag": true if image is not cleanly closed, not present
1282 means clean (json-bool, optional)
1283 - "actual-size": actual size on disk in bytes of the image, not
1284 present when image does not support thin
1285 provision (json-int, optional)
1286 - "cluster-size": size of a cluster in bytes, not present if image
1287 format does not support it (json-int, optional)
1288 - "encrypted": true if the image is encrypted, not present means
1289 false or the image format does not support
1290 encryption (json-bool, optional)
1291 - "backing_file": backing file name, not present means no backing
1292 file is used or the image format does not
1293 support backing file chain
1294 (json-string, optional)
1295 - "full-backing-filename": full path of the backing file, not
1296 present if it equals backing_file or no
1297 backing file is used
1298 (json-string, optional)
1299 - "backing-filename-format": the format of the backing file, not
1300 present means unknown or no backing
1301 file (json-string, optional)
1302 - "snapshots": the internal snapshot info, it is an optional list
1303 of json-object containing the following:
1304 - "id": unique snapshot id (json-string)
1305 - "name": snapshot name (json-string)
1306 - "vm-state-size": size of the VM state in bytes (json-int)
1307 - "date-sec": UTC date of the snapshot in seconds (json-int)
1308 - "date-nsec": fractional part in nanoseconds to be used with
1310 - "vm-clock-sec": VM clock relative to boot in seconds
1312 - "vm-clock-nsec": fractional part in nanoseconds to be used
1313 with vm-clock-sec (json-int)
1314 - "backing-image": the detail of the backing image, it is an
1315 optional json-object only present when a
1316 backing image present for this image
1318 - "io-status": I/O operation status, only present if the device supports it
1319 and the VM is configured to stop on errors. It's always reset
1320 to "ok" when the "cont" command is issued (json_string, optional)
1321 - Possible values: "ok", "failed", "nospace"
1325 -> { "execute": "query-block" }
1330 "device":"ide0-hd0",
1337 "file":"disks/test.qcow2",
1338 "backing_file_depth":1,
1352 "detect_zeroes": "on",
1353 "write_threshold": 0,
1355 "filename":"disks/test.qcow2",
1357 "virtual-size":2048000,
1358 "backing_file":"base.qcow2",
1359 "full-backing-filename":"disks/base.qcow2",
1360 "backing-filename-format":"qcow2",
1364 "name": "snapshot1",
1366 "date-sec": 10000200,
1368 "vm-clock-sec": 206,
1373 "filename":"disks/base.qcow2",
1375 "virtual-size":2048000
1383 "device":"ide1-cd0",
1406 Show block device statistics.
1408 Each device statistic information is stored in a json-object and the returned
1409 value is a json-array of all devices.
1411 Each json-object contain the following:
1413 - "device": device name (json-string)
1414 - "stats": A json-object with the statistics information, it contains:
1415 - "rd_bytes": bytes read (json-int)
1416 - "wr_bytes": bytes written (json-int)
1417 - "rd_operations": read operations (json-int)
1418 - "wr_operations": write operations (json-int)
1419 - "flush_operations": cache flush operations (json-int)
1420 - "wr_total_time_ns": total time spend on writes in nano-seconds (json-int)
1421 - "rd_total_time_ns": total time spend on reads in nano-seconds (json-int)
1422 - "flush_total_time_ns": total time spend on cache flushes in nano-seconds (json-int)
1423 - "wr_highest_offset": The offset after the greatest byte written to the
1424 BlockDriverState since it has been opened (json-int)
1425 - "rd_merged": number of read requests that have been merged into
1426 another request (json-int)
1427 - "wr_merged": number of write requests that have been merged into
1428 another request (json-int)
1429 - "idle_time_ns": time since the last I/O operation, in
1430 nanoseconds. If the field is absent it means
1431 that there haven't been any operations yet
1432 (json-int, optional)
1433 - "failed_rd_operations": number of failed read operations
1435 - "failed_wr_operations": number of failed write operations
1437 - "failed_flush_operations": number of failed flush operations
1439 - "invalid_rd_operations": number of invalid read operations
1441 - "invalid_wr_operations": number of invalid write operations
1443 - "invalid_flush_operations": number of invalid flush operations
1445 - "account_invalid": whether invalid operations are included in
1446 the last access statistics (json-bool)
1447 - "account_failed": whether failed operations are included in the
1448 latency and last access statistics
1450 - "timed_stats": A json-array containing statistics collected in
1451 specific intervals, with the following members:
1452 - "interval_length": interval used for calculating the
1453 statistics, in seconds (json-int)
1454 - "min_rd_latency_ns": minimum latency of read operations in
1455 the defined interval, in nanoseconds
1457 - "min_wr_latency_ns": minimum latency of write operations in
1458 the defined interval, in nanoseconds
1460 - "min_flush_latency_ns": minimum latency of flush operations
1461 in the defined interval, in
1462 nanoseconds (json-int)
1463 - "max_rd_latency_ns": maximum latency of read operations in
1464 the defined interval, in nanoseconds
1466 - "max_wr_latency_ns": maximum latency of write operations in
1467 the defined interval, in nanoseconds
1469 - "max_flush_latency_ns": maximum latency of flush operations
1470 in the defined interval, in
1471 nanoseconds (json-int)
1472 - "avg_rd_latency_ns": average latency of read operations in
1473 the defined interval, in nanoseconds
1475 - "avg_wr_latency_ns": average latency of write operations in
1476 the defined interval, in nanoseconds
1478 - "avg_flush_latency_ns": average latency of flush operations
1479 in the defined interval, in
1480 nanoseconds (json-int)
1481 - "avg_rd_queue_depth": average number of pending read
1482 operations in the defined interval
1484 - "avg_wr_queue_depth": average number of pending write
1485 operations in the defined interval
1487 - "parent": Contains recursively the statistics of the underlying
1488 protocol (e.g. the host file for a qcow2 image). If there is
1489 no underlying protocol, this field is omitted
1490 (json-object, optional)
1494 -> { "execute": "query-blockstats" }
1498 "device":"ide0-hd0",
1501 "wr_highest_offset":3686448128,
1503 "wr_operations":751,
1504 "rd_bytes":122567168,
1505 "rd_operations":36772
1506 "wr_total_times_ns":313253456
1507 "rd_total_times_ns":3465673657
1508 "flush_total_times_ns":49653
1509 "flush_operations":61,
1512 "idle_time_ns":2953431879,
1513 "account_invalid":true,
1514 "account_failed":false
1518 "wr_highest_offset":2821110784,
1520 "wr_operations":692,
1521 "rd_bytes":122739200,
1522 "rd_operations":36604
1523 "flush_operations":51,
1524 "wr_total_times_ns":313253456
1525 "rd_total_times_ns":3465673657
1526 "flush_total_times_ns":49653,
1529 "idle_time_ns":2953431879,
1530 "account_invalid":true,
1531 "account_failed":false
1535 "device":"ide1-cd0",
1537 "wr_highest_offset":0,
1542 "flush_operations":0,
1543 "wr_total_times_ns":0
1544 "rd_total_times_ns":0
1545 "flush_total_times_ns":0,
1548 "account_invalid":false,
1549 "account_failed":false
1555 "wr_highest_offset":0,
1560 "flush_operations":0,
1561 "wr_total_times_ns":0
1562 "rd_total_times_ns":0
1563 "flush_total_times_ns":0,
1566 "account_invalid":false,
1567 "account_failed":false
1573 "wr_highest_offset":0,
1578 "flush_operations":0,
1579 "wr_total_times_ns":0
1580 "rd_total_times_ns":0
1581 "flush_total_times_ns":0,
1584 "account_invalid":false,
1585 "account_failed":false
1591 query-command-line-options
1592 --------------------------
1594 Show command line option schema.
1596 Return a json-array of command line option schema for all options (or for
1597 the given option), returning an error if the given option doesn't exist.
1599 Each array entry contains the following:
1601 - "option": option name (json-string)
1602 - "parameters": a json-array describes all parameters of the option:
1603 - "name": parameter name (json-string)
1604 - "type": parameter type (one of 'string', 'boolean', 'number',
1606 - "help": human readable description of the parameter
1607 (json-string, optional)
1608 - "default": default value string for the parameter
1609 (json-string, optional)
1613 -> { "execute": "query-command-line-options", "arguments": { "option": "option-rom" } }
1622 "name": "bootindex",
1626 "option": "option-rom"
1634 Return information about the TPM device.
1640 -> { "execute": "query-tpm" }
1643 { "model": "tpm-tis",
1645 { "type": "passthrough",
1647 { "cancel-path": "/sys/class/misc/tpm0/device/cancel",
1659 Return a list of supported TPM models.
1665 -> { "execute": "query-tpm-models" }
1666 <- { "return": [ "tpm-tis" ] }
1671 Return a list of supported TPM types.
1677 -> { "execute": "query-tpm-types" }
1678 <- { "return": [ "passthrough" ] }
1687 - "id": the chardev's ID, must be unique (json-string)
1688 - "backend": chardev backend type + parameters
1692 -> { "execute" : "chardev-add",
1693 "arguments" : { "id" : "foo",
1694 "backend" : { "type" : "null", "data" : {} } } }
1697 -> { "execute" : "chardev-add",
1698 "arguments" : { "id" : "bar",
1699 "backend" : { "type" : "file",
1700 "data" : { "out" : "/tmp/bar.log" } } } }
1703 -> { "execute" : "chardev-add",
1704 "arguments" : { "id" : "baz",
1705 "backend" : { "type" : "pty", "data" : {} } } }
1706 <- { "return": { "pty" : "/dev/pty/42" } }
1715 - "id": the chardev's ID, must exist and not be in use (json-string)
1719 -> { "execute": "chardev-remove", "arguments": { "id" : "foo" } }
1725 Show rx-filter information.
1727 Returns a json-array of rx-filter information for all NICs (or for the
1728 given NIC), returning an error if the given NIC doesn't exist, or
1729 given NIC doesn't support rx-filter querying, or given net client
1732 The query will clear the event notification flag of each NIC, then qemu
1733 will start to emit event to QMP monitor.
1735 Each array entry contains the following:
1737 - "name": net client name (json-string)
1738 - "promiscuous": promiscuous mode is enabled (json-bool)
1739 - "multicast": multicast receive state (one of 'normal', 'none', 'all')
1740 - "unicast": unicast receive state (one of 'normal', 'none', 'all')
1741 - "vlan": vlan receive state (one of 'normal', 'none', 'all') (Since 2.0)
1742 - "broadcast-allowed": allow to receive broadcast (json-bool)
1743 - "multicast-overflow": multicast table is overflowed (json-bool)
1744 - "unicast-overflow": unicast table is overflowed (json-bool)
1745 - "main-mac": main macaddr string (json-string)
1746 - "vlan-table": a json-array of active vlan id
1747 - "unicast-table": a json-array of unicast macaddr string
1748 - "multicast-table": a json-array of multicast macaddr string
1752 -> { "execute": "query-rx-filter", "arguments": { "name": "vnet0" } }
1755 "promiscuous": true,
1757 "main-mac": "52:54:00:12:34:56",
1758 "unicast": "normal",
1766 "multicast": "normal",
1767 "multicast-overflow": false,
1768 "unicast-overflow": false,
1769 "multicast-table": [
1770 "01:00:5e:00:00:01",
1771 "33:33:00:00:00:01",
1774 "broadcast-allowed": false
1784 This command is still a work in progress. It doesn't support all
1785 block drivers among other things. Stay away from it unless you want
1786 to help with its development.
1788 For the arguments, see the QAPI schema documentation of BlockdevOptions.
1792 -> { "execute": "blockdev-add",
1793 "arguments": { "driver": "qcow2",
1794 "file": { "driver": "file",
1795 "filename": "test.qcow2" } } }
1800 -> { "execute": "blockdev-add",
1803 "node-name": "my_disk",
1811 "filename": "/tmp/test.qcow2"
1817 "filename": "/dev/fdset/4"
1829 Deletes a block device that has been added using blockdev-add.
1830 The command will fail if the node is attached to a device or is
1831 otherwise being used.
1833 This command is still a work in progress and is considered
1834 experimental. Stay away from it unless you want to help with its
1839 - "node-name": Name of the graph node to delete (json-string)
1843 -> { "execute": "blockdev-add",
1846 "node-name": "node0",
1849 "filename": "test.qcow2"
1856 -> { "execute": "x-blockdev-del",
1857 "arguments": { "node-name": "node0" }
1864 Opens a block device's tray. If there is a block driver state tree inserted as a
1865 medium, it will become inaccessible to the guest (but it will remain associated
1866 to the block device, so closing the tray will make it accessible again).
1868 If the tray was already open before, this will be a no-op.
1870 Once the tray opens, a DEVICE_TRAY_MOVED event is emitted. There are cases in
1871 which no such event will be generated, these include:
1872 - if the guest has locked the tray, @force is false and the guest does not
1873 respond to the eject request
1874 - if the BlockBackend denoted by @device does not have a guest device attached
1876 - if the guest device does not have an actual tray and is empty, for instance
1877 for floppy disk drives
1881 - "device": block device name (deprecated, use @id instead)
1882 (json-string, optional)
1883 - "id": the name or QOM path of the guest device (json-string, optional)
1884 - "force": if false (the default), an eject request will be sent to the guest if
1885 it has locked the tray (and the tray will not be opened immediately);
1886 if true, the tray will be opened regardless of whether it is locked
1887 (json-bool, optional)
1891 -> { "execute": "blockdev-open-tray",
1892 "arguments": { "id": "ide0-1-0" } }
1894 <- { "timestamp": { "seconds": 1418751016,
1895 "microseconds": 716996 },
1896 "event": "DEVICE_TRAY_MOVED",
1897 "data": { "device": "ide1-cd0",
1899 "tray-open": true } }
1906 Closes a block device's tray. If there is a block driver state tree associated
1907 with the block device (which is currently ejected), that tree will be loaded as
1910 If the tray was already closed before, this will be a no-op.
1914 - "device": block device name (deprecated, use @id instead)
1915 (json-string, optional)
1916 - "id": the name or QOM path of the guest device (json-string, optional)
1920 -> { "execute": "blockdev-close-tray",
1921 "arguments": { "id": "ide0-1-0" } }
1923 <- { "timestamp": { "seconds": 1418751345,
1924 "microseconds": 272147 },
1925 "event": "DEVICE_TRAY_MOVED",
1926 "data": { "device": "ide1-cd0",
1928 "tray-open": false } }
1932 x-blockdev-remove-medium
1933 ------------------------
1935 Removes a medium (a block driver state tree) from a block device. That block
1936 device's tray must currently be open (unless there is no attached guest device).
1938 If the tray is open and there is no medium inserted, this will be a no-op.
1940 This command is still a work in progress and is considered experimental.
1941 Stay away from it unless you want to help with its development.
1945 - "device": block device name (deprecated, use @id instead)
1946 (json-string, optional)
1947 - "id": the name or QOM path of the guest device (json-string, optional)
1951 -> { "execute": "x-blockdev-remove-medium",
1952 "arguments": { "id": "ide0-1-0" } }
1954 <- { "error": { "class": "GenericError",
1955 "desc": "Tray of device 'ide0-1-0' is not open" } }
1957 -> { "execute": "blockdev-open-tray",
1958 "arguments": { "id": "ide0-1-0" } }
1960 <- { "timestamp": { "seconds": 1418751627,
1961 "microseconds": 549958 },
1962 "event": "DEVICE_TRAY_MOVED",
1963 "data": { "device": "ide1-cd0",
1965 "tray-open": true } }
1969 -> { "execute": "x-blockdev-remove-medium",
1970 "arguments": { "device": "ide0-1-0" } }
1974 x-blockdev-insert-medium
1975 ------------------------
1977 Inserts a medium (a block driver state tree) into a block device. That block
1978 device's tray must currently be open (unless there is no attached guest device)
1979 and there must be no medium inserted already.
1981 This command is still a work in progress and is considered experimental.
1982 Stay away from it unless you want to help with its development.
1986 - "device": block device name (deprecated, use @id instead)
1987 (json-string, optional)
1988 - "id": the name or QOM path of the guest device (json-string, optional)
1989 - "node-name": root node of the BDS tree to insert into the block device
1993 -> { "execute": "blockdev-add",
1994 "arguments": { { "node-name": "node0",
1996 "file": { "driver": "file",
1997 "filename": "fedora.iso" } } }
2001 -> { "execute": "x-blockdev-insert-medium",
2002 "arguments": { "id": "ide0-1-0",
2003 "node-name": "node0" } }
2010 Dynamically reconfigure the block driver state graph. It can be used
2011 to add, remove, insert or replace a graph node. Currently only the
2012 Quorum driver implements this feature to add or remove its child. This
2013 is useful to fix a broken quorum child.
2015 If @node is specified, it will be inserted under @parent. @child
2016 may not be specified in this case. If both @parent and @child are
2017 specified but @node is not, @child will be detached from @parent.
2020 - "parent": the id or name of the parent node (json-string)
2021 - "child": the name of a child under the given parent node (json-string, optional)
2022 - "node": the name of the node that will be added (json-string, optional)
2024 Note: this command is experimental, and not a stable API. It doesn't
2025 support all kinds of operations, all kinds of children, nor all block
2028 Warning: The data in a new quorum child MUST be consistent with that of
2029 the rest of the array.
2033 Add a new node to a quorum
2034 -> { "execute": "blockdev-add",
2035 "arguments": { "driver": "raw",
2036 "node-name": "new_node",
2037 "file": { "driver": "file",
2038 "filename": "test.raw" } } }
2040 -> { "execute": "x-blockdev-change",
2041 "arguments": { "parent": "disk1",
2042 "node": "new_node" } }
2045 Delete a quorum's node
2046 -> { "execute": "x-blockdev-change",
2047 "arguments": { "parent": "disk1",
2048 "child": "children.1" } }
2051 query-named-block-nodes
2052 -----------------------
2054 Return a list of BlockDeviceInfo for all the named block driver nodes
2058 -> { "execute": "query-named-block-nodes" }
2059 <- { "return": [ { "ro":false,
2062 "file":"disks/test.qcow2",
2063 "node-name": "my-node",
2064 "backing_file_depth":1,
2078 "write_threshold": 0,
2080 "filename":"disks/test.qcow2",
2082 "virtual-size":2048000,
2083 "backing_file":"base.qcow2",
2084 "full-backing-filename":"disks/base.qcow2",
2085 "backing-filename-format":"qcow2",
2089 "name": "snapshot1",
2091 "date-sec": 10000200,
2093 "vm-clock-sec": 206,
2098 "filename":"disks/base.qcow2",
2100 "virtual-size":2048000
2104 blockdev-change-medium
2105 ----------------------
2107 Changes the medium inserted into a block device by ejecting the current medium
2108 and loading a new image file which is inserted as the new medium.
2112 - "device": block device name (deprecated, use @id instead)
2113 (json-string, optional)
2114 - "id": the name or QOM path of the guest device (json-string, optional)
2115 - "filename": filename of the new image (json-string)
2116 - "format": format of the new image (json-string, optional)
2117 - "read-only-mode": new read-only mode (json-string, optional)
2118 - Possible values: "retain" (default), "read-only", "read-write"
2122 1. Change a removable medium
2124 -> { "execute": "blockdev-change-medium",
2125 "arguments": { "id": "ide0-1-0",
2126 "filename": "/srv/images/Fedora-12-x86_64-DVD.iso",
2130 2. Load a read-only medium into a writable drive
2132 -> { "execute": "blockdev-change-medium",
2133 "arguments": { "id": "floppyA",
2134 "filename": "/srv/images/ro.img",
2136 "read-only-mode": "retain" } }
2139 { "class": "GenericError",
2140 "desc": "Could not open '/srv/images/ro.img': Permission denied" } }
2142 -> { "execute": "blockdev-change-medium",
2143 "arguments": { "id": "floppyA",
2144 "filename": "/srv/images/ro.img",
2146 "read-only-mode": "read-only" } }
2153 Show memory devices information.
2158 -> { "execute": "query-memdev" }
2165 "host-nodes": [0, 1],
2174 "host-nodes": [2, 3],
2175 "policy": "preferred"
2180 query-memory-devices
2181 --------------------
2183 Return a list of memory devices.
2186 -> { "execute": "query-memory-devices" }
2187 <- { "return": [ { "data":
2188 { "addr": 5368709120,
2189 "hotpluggable": true,
2192 "memdev": "/objects/memX",
2199 query-acpi-ospm-status
2200 ----------------------
2202 Return list of ACPIOSTInfo for devices that support status reporting
2203 via ACPI _OST method.
2206 -> { "execute": "query-acpi-ospm-status" }
2207 <- { "return": [ { "device": "d1", "slot": "0", "slot-type": "DIMM", "source": 1, "status": 0},
2208 { "slot": "1", "slot-type": "DIMM", "source": 0, "status": 0},
2209 { "slot": "2", "slot-type": "DIMM", "source": 0, "status": 0},
2210 { "slot": "3", "slot-type": "DIMM", "source": 0, "status": 0}
2213 rtc-reset-reinjection
2214 ---------------------
2216 Reset the RTC interrupt reinjection backlog.
2222 -> { "execute": "rtc-reset-reinjection" }
2225 trace-event-get-state
2226 ---------------------
2228 Query the state of events.
2232 - "name": Event name pattern (json-string).
2233 - "vcpu": The vCPU to query, any vCPU by default (json-int, optional).
2235 An event is returned if:
2236 - its name matches the "name" pattern, and
2237 - if "vcpu" is given, the event has the "vcpu" property.
2239 Therefore, if "vcpu" is given, the operation will only match per-vCPU events,
2240 returning their state on the specified vCPU. Special case: if "name" is an exact
2241 match, "vcpu" is given and the event does not have the "vcpu" property, an error
2246 -> { "execute": "trace-event-get-state", "arguments": { "name": "qemu_memalign" } }
2247 <- { "return": [ { "name": "qemu_memalign", "state": "disabled" } ] }
2249 trace-event-set-state
2250 ---------------------
2252 Set the state of events.
2256 - "name": Event name pattern (json-string).
2257 - "enable": Whether to enable or disable the event (json-bool).
2258 - "ignore-unavailable": Whether to ignore errors for events that cannot be
2259 changed (json-bool, optional).
2260 - "vcpu": The vCPU to act upon, all vCPUs by default (json-int, optional).
2262 An event's state is modified if:
2263 - its name matches the "name" pattern, and
2264 - if "vcpu" is given, the event has the "vcpu" property.
2266 Therefore, if "vcpu" is given, the operation will only match per-vCPU events,
2267 setting their state on the specified vCPU. Special case: if "name" is an exact
2268 match, "vcpu" is given and the event does not have the "vcpu" property, an error
2273 -> { "execute": "trace-event-set-state", "arguments": { "name": "qemu_memalign", "enable": "true" } }
2279 Send input event to guest.
2283 - "device": display device (json-string, optional)
2284 - "head": display head (json-int, optional)
2285 - "events": list of input events
2287 The consoles are visible in the qom tree, under
2288 /backend/console[$index]. They have a device link and head property, so
2289 it is possible to map which console belongs to which device and display.
2293 Press left mouse button.
2295 -> { "execute": "input-send-event",
2296 "arguments": { "device": "video0",
2297 "events": [ { "type": "btn",
2298 "data" : { "down": true, "button": "left" } } ] } }
2301 -> { "execute": "input-send-event",
2302 "arguments": { "device": "video0",
2303 "events": [ { "type": "btn",
2304 "data" : { "down": false, "button": "left" } } ] } }
2311 -> { "execute": "input-send-event",
2312 "arguments": { "events": [
2313 { "type": "key", "data" : { "down": true,
2314 "key": {"type": "qcode", "data": "ctrl" } } },
2315 { "type": "key", "data" : { "down": true,
2316 "key": {"type": "qcode", "data": "alt" } } },
2317 { "type": "key", "data" : { "down": true,
2318 "key": {"type": "qcode", "data": "delete" } } } ] } }
2323 Move mouse pointer to absolute coordinates (20000, 400).
2325 -> { "execute": "input-send-event" ,
2326 "arguments": { "events": [
2327 { "type": "abs", "data" : { "axis": "x", "value" : 20000 } },
2328 { "type": "abs", "data" : { "axis": "y", "value" : 400 } } ] } }
2331 block-set-write-threshold
2334 Change the write threshold for a block drive. The threshold is an offset,
2335 thus must be non-negative. Default is no write threshold.
2336 Setting the threshold to zero disables it.
2340 - "node-name": the node name in the block driver state graph (json-string)
2341 - "write-threshold": the write threshold in bytes (json-int)
2345 -> { "execute": "block-set-write-threshold",
2346 "arguments": { "node-name": "mydev",
2347 "write-threshold": 17179869184 } }
2355 - "name": switch name
2359 -> { "execute": "query-rocker", "arguments": { "name": "sw1" } }
2360 <- { "return": {"name": "sw1", "ports": 2, "id": 1327446905938}}
2362 Show rocker switch ports
2363 ------------------------
2367 - "name": switch name
2371 -> { "execute": "query-rocker-ports", "arguments": { "name": "sw1" } }
2372 <- { "return": [ {"duplex": "full", "enabled": true, "name": "sw1.1",
2373 "autoneg": "off", "link-up": true, "speed": 10000},
2374 {"duplex": "full", "enabled": true, "name": "sw1.2",
2375 "autoneg": "off", "link-up": true, "speed": 10000}
2378 Show rocker switch OF-DPA flow tables
2379 -------------------------------------
2383 - "name": switch name
2384 - "tbl-id": (optional) flow table ID
2388 -> { "execute": "query-rocker-of-dpa-flows", "arguments": { "name": "sw1" } }
2389 <- { "return": [ {"key": {"in-pport": 0, "priority": 1, "tbl-id": 0},
2392 "action": {"goto-tbl": 10},
2393 "mask": {"in-pport": 4294901760}
2398 Show rocker OF-DPA group tables
2399 -------------------------------
2403 - "name": switch name
2404 - "type": (optional) group type
2408 -> { "execute": "query-rocker-of-dpa-groups", "arguments": { "name": "sw1" } }
2409 <- { "return": [ {"type": 0, "out-pport": 2, "pport": 2, "vlan-id": 3841,
2410 "pop-vlan": 1, "id": 251723778},
2411 {"type": 0, "out-pport": 0, "pport": 0, "vlan-id": 3841,
2412 "pop-vlan": 1, "id": 251723776},
2413 {"type": 0, "out-pport": 1, "pport": 1, "vlan-id": 3840,
2414 "pop-vlan": 1, "id": 251658241},
2415 {"type": 0, "out-pport": 0, "pport": 0, "vlan-id": 3840,
2416 "pop-vlan": 1, "id": 251658240}
2419 query-gic-capabilities
2422 Return a list of GICCapability objects, describing supported GIC
2423 (Generic Interrupt Controller) versions.
2429 -> { "execute": "query-gic-capabilities" }
2430 <- { "return": [{ "version": 2, "emulated": true, "kernel": false },
2431 { "version": 3, "emulated": false, "kernel": true } ] }
2433 Show existing/possible CPUs
2434 ---------------------------
2438 Example for pseries machine type started with
2439 -smp 2,cores=2,maxcpus=4 -cpu POWER8:
2441 -> { "execute": "query-hotpluggable-cpus" }
2443 { "props": { "core-id": 8 }, "type": "POWER8-spapr-cpu-core",
2445 { "props": { "core-id": 0 }, "type": "POWER8-spapr-cpu-core",
2446 "vcpus-count": 1, "qom-path": "/machine/unattached/device[0]"}
2449 Example for pc machine type started with
2451 -> { "execute": "query-hotpluggable-cpus" }
2454 "type": "qemu64-x86_64-cpu", "vcpus-count": 1,
2455 "props": {"core-id": 0, "socket-id": 1, "thread-id": 0}
2458 "qom-path": "/machine/unattached/device[0]",
2459 "type": "qemu64-x86_64-cpu", "vcpus-count": 1,
2460 "props": {"core-id": 0, "socket-id": 0, "thread-id": 0}