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 query-migrate-cache-size
309 ------------------------
311 Show cache size to be used by XBZRLE migration
313 returns a json-object with the following information:
318 -> { "execute": "query-migrate-cache-size" }
319 <- { "return": 67108864 }
321 x-colo-lost-heartbeat
324 Tell COLO that heartbeat is lost, a failover or takeover is needed.
328 -> { "execute": "x-colo-lost-heartbeat" }
334 Dump guest memory to file. The file can be processed with crash or gdb.
338 - "paging": do paging to get guest's memory mapping (json-bool)
339 - "protocol": destination file(started with "file:") or destination file
340 descriptor (started with "fd:") (json-string)
341 - "detach": if specified, command will return immediately, without waiting
342 for the dump to finish. The user can track progress using
343 "query-dump". (json-bool)
344 - "begin": the starting physical address. It's optional, and should be specified
345 with length together (json-int)
346 - "length": the memory size, in bytes. It's optional, and should be specified
347 with begin together (json-int)
348 - "format": the format of guest memory dump. It's optional, and can be
349 elf|kdump-zlib|kdump-lzo|kdump-snappy, but non-elf formats will
350 conflict with paging and filter, ie. begin and length (json-string)
354 -> { "execute": "dump-guest-memory", "arguments": { "protocol": "fd:dump" } }
359 (1) All boolean arguments default to false
361 query-dump-guest-memory-capability
364 Show available formats for 'dump-guest-memory'
368 -> { "execute": "query-dump-guest-memory-capability" }
369 <- { "return": { "formats":
370 ["elf", "kdump-zlib", "kdump-lzo", "kdump-snappy"] }
375 Query background dump status.
381 -> { "execute": "query-dump" }
382 <- { "return": { "status": "active", "completed": 1024000,
388 Save guest storage keys to file.
392 - "filename": file path (json-string)
396 -> { "execute": "dump-skeys", "arguments": { "filename": "/tmp/skeys" } }
402 Add host network device.
406 - "type": the device type, "tap", "user", ... (json-string)
407 - "id": the device's ID, must be unique (json-string)
412 -> { "execute": "netdev_add",
413 "arguments": { "type": "user", "id": "netdev1",
414 "dnssearch": "example.org" } }
417 Note: The supported device options are the same ones supported by the '-netdev'
418 command-line argument, which are listed in the '-help' output or QEMU's
424 Remove host network device.
428 - "id": the device's ID, must be unique (json-string)
432 -> { "execute": "netdev_del", "arguments": { "id": "netdev1" } }
443 - "qom-type": the object's QOM type, i.e. the class name (json-string)
444 - "id": the object's ID, must be unique (json-string)
445 - "props": a dictionary of object property values (optional, json-dict)
449 -> { "execute": "object-add", "arguments": { "qom-type": "rng-random", "id": "rng1",
450 "props": { "filename": "/dev/hwrng" } } }
460 - "id": the object's ID (json-string)
464 -> { "execute": "object-del", "arguments": { "id": "rng1" } }
471 Resize a block image while a guest is running.
475 - "device": the device's ID, must be unique (json-string)
476 - "node-name": the node name in the block driver state graph (json-string)
481 -> { "execute": "block_resize", "arguments": { "device": "scratch", "size": 1073741824 } }
487 Copy data from a backing file into a block device.
491 - "job-id": Identifier for the newly-created block job. If omitted,
492 the device name will be used. (json-string, optional)
493 - "device": The device name or node-name of a root node (json-string)
494 - "base": The file name of the backing image above which copying starts.
495 It cannot be set if 'base-node' is also set (json-string, optional)
496 - "base-node": the node name of the backing image above which copying starts.
497 It cannot be set if 'base' is also set.
498 (json-string, optional) (Since 2.8)
499 - "backing-file": The backing file string to write into the active layer. This
500 filename is not validated.
502 If a pathname string is such that it cannot be resolved by
503 QEMU, that means that subsequent QMP or HMP commands must use
504 node-names for the image in question, as filename lookup
507 If not specified, QEMU will automatically determine the
508 backing file string to use, or error out if there is no
509 obvious choice. Care should be taken when specifying the
510 string, to specify a valid filename or protocol.
511 (json-string, optional) (Since 2.1)
512 - "speed": the maximum speed, in bytes per second (json-int, optional)
513 - "on-error": the action to take on an error (default 'report'). 'stop' and
514 'enospc' can only be used if the block device supports io-status.
515 (json-string, optional) (Since 2.1)
519 -> { "execute": "block-stream", "arguments": { "device": "virtio0",
520 "base": "/tmp/master.qcow2" } }
526 Live commit of data from overlay image nodes into backing nodes - i.e., writes
527 data between 'top' and 'base' into 'base'.
531 - "job-id": Identifier for the newly-created block job. If omitted,
532 the device name will be used. (json-string, optional)
533 - "device": The device name or node-name of a root node (json-string)
534 - "base": The file name of the backing image to write data into.
535 If not specified, this is the deepest backing image
536 (json-string, optional)
537 - "top": The file name of the backing image within the image chain,
538 which contains the topmost data to be committed down. If
539 not specified, this is the active layer. (json-string, optional)
541 - backing-file: The backing file string to write into the overlay
542 image of 'top'. If 'top' is the active layer,
543 specifying a backing file string is an error. This
544 filename is not validated.
546 If a pathname string is such that it cannot be
547 resolved by QEMU, that means that subsequent QMP or
548 HMP commands must use node-names for the image in
549 question, as filename lookup methods will fail.
551 If not specified, QEMU will automatically determine
552 the backing file string to use, or error out if
553 there is no obvious choice. Care should be taken
554 when specifying the string, to specify a valid
555 filename or protocol.
556 (json-string, optional) (Since 2.1)
558 If top == base, that is an error.
559 If top == active, the job will not be completed by itself,
560 user needs to complete the job with the block-job-complete
561 command after getting the ready event. (Since 2.0)
563 If the base image is smaller than top, then the base image
564 will be resized to be the same size as top. If top is
565 smaller than the base image, the base will not be
566 truncated. If you want the base image size to match the
567 size of the smaller top, you can safely truncate it
568 yourself once the commit operation successfully completes.
570 - "speed": the maximum speed, in bytes per second (json-int, optional)
575 -> { "execute": "block-commit", "arguments": { "device": "virtio0",
576 "top": "/tmp/snap1.qcow2" } }
582 Start a point-in-time copy of a block device to a new destination. The
583 status of ongoing drive-backup operations can be checked with
584 query-block-jobs where the BlockJobInfo.type field has the value 'backup'.
585 The operation can be stopped before it has completed using the
586 block-job-cancel command.
590 - "job-id": Identifier for the newly-created block job. If omitted,
591 the device name will be used. (json-string, optional)
592 - "device": the device name or node-name of a root node which should be copied.
594 - "target": the target of the new image. If the file exists, or if it is a
595 device, the existing file/device will be used as the new
596 destination. If it does not exist, a new file will be created.
598 - "format": the format of the new destination, default is to probe if 'mode' is
599 'existing', else the format of the source
600 (json-string, optional)
601 - "sync": what parts of the disk image should be copied to the destination;
602 possibilities include "full" for all the disk, "top" for only the sectors
603 allocated in the topmost image, "incremental" for only the dirty sectors in
604 the bitmap, or "none" to only replicate new I/O (MirrorSyncMode).
605 - "bitmap": dirty bitmap name for sync==incremental. Must be present if sync
606 is "incremental", must NOT be present otherwise.
607 - "mode": whether and how QEMU should create a new image
608 (NewImageMode, optional, default 'absolute-paths')
609 - "speed": the maximum speed, in bytes per second (json-int, optional)
610 - "compress": true to compress data, if the target format supports it.
611 (json-bool, optional, default false)
612 - "on-source-error": the action to take on an error on the source, default
613 'report'. 'stop' and 'enospc' can only be used
614 if the block device supports io-status.
615 (BlockdevOnError, optional)
616 - "on-target-error": the action to take on an error on the target, default
617 'report' (no limitations, since this applies to
618 a different block device than device).
619 (BlockdevOnError, optional)
622 -> { "execute": "drive-backup", "arguments": { "device": "drive0",
624 "target": "backup.img" } }
630 The device version of drive-backup: this command takes an existing named device
635 - "job-id": Identifier for the newly-created block job. If omitted,
636 the device name will be used. (json-string, optional)
637 - "device": the device name or node-name of a root node which should be copied.
639 - "target": the name of the backup target device. (json-string)
640 - "sync": what parts of the disk image should be copied to the destination;
641 possibilities include "full" for all the disk, "top" for only the
642 sectors allocated in the topmost image, or "none" to only replicate
643 new I/O (MirrorSyncMode).
644 - "speed": the maximum speed, in bytes per second (json-int, optional)
645 - "compress": true to compress data, if the target format supports it.
646 (json-bool, optional, default false)
647 - "on-source-error": the action to take on an error on the source, default
648 'report'. 'stop' and 'enospc' can only be used
649 if the block device supports io-status.
650 (BlockdevOnError, optional)
651 - "on-target-error": the action to take on an error on the target, default
652 'report' (no limitations, since this applies to
653 a different block device than device).
654 (BlockdevOnError, optional)
657 -> { "execute": "blockdev-backup", "arguments": { "device": "src-id",
659 "target": "tgt-id" } }
662 block-dirty-bitmap-add
663 ----------------------
666 Create a dirty bitmap with a name on the device, and start tracking the writes.
670 - "node": device/node on which to create dirty bitmap (json-string)
671 - "name": name of the new dirty bitmap (json-string)
672 - "granularity": granularity to track writes with (int, optional)
676 -> { "execute": "block-dirty-bitmap-add", "arguments": { "node": "drive0",
677 "name": "bitmap0" } }
680 block-dirty-bitmap-remove
681 -------------------------
684 Stop write tracking and remove the dirty bitmap that was created with
685 block-dirty-bitmap-add.
689 - "node": device/node on which to remove dirty bitmap (json-string)
690 - "name": name of the dirty bitmap to remove (json-string)
694 -> { "execute": "block-dirty-bitmap-remove", "arguments": { "node": "drive0",
695 "name": "bitmap0" } }
698 block-dirty-bitmap-clear
699 ------------------------
702 Reset the dirty bitmap associated with a node so that an incremental backup
703 from this point in time forward will only backup clusters modified after this
708 - "node": device/node on which to remove dirty bitmap (json-string)
709 - "name": name of the dirty bitmap to remove (json-string)
713 -> { "execute": "block-dirty-bitmap-clear", "arguments": { "node": "drive0",
714 "name": "bitmap0" } }
717 blockdev-snapshot-sync
718 ----------------------
720 Synchronous snapshot of a block device. snapshot-file specifies the
721 target of the new image. If the file exists, or if it is a device, the
722 snapshot will be created in the existing file/device. If does not
723 exist, a new file will be created. format specifies the format of the
724 snapshot image, default is qcow2.
728 - "device": device name to snapshot (json-string)
729 - "node-name": graph node name to snapshot (json-string)
730 - "snapshot-file": name of new image file (json-string)
731 - "snapshot-node-name": graph node name of the new snapshot (json-string)
732 - "mode": whether and how QEMU should create the snapshot file
733 (NewImageMode, optional, default "absolute-paths")
734 - "format": format of new image (json-string, optional)
738 -> { "execute": "blockdev-snapshot-sync", "arguments": { "device": "ide-hd0",
740 "/some/place/my-image",
741 "format": "qcow2" } }
748 Create a snapshot, by installing 'node' as the backing image of
749 'overlay'. Additionally, if 'node' is associated with a block
750 device, the block device changes to using 'overlay' as its new active
755 - "node": device that will have a snapshot created (json-string)
756 - "overlay": device that will have 'node' as its backing image (json-string)
760 -> { "execute": "blockdev-add",
761 "arguments": { "driver": "qcow2",
762 "node-name": "node1534",
763 "file": { "driver": "file",
764 "filename": "hd1.qcow2" },
769 -> { "execute": "blockdev-snapshot", "arguments": { "node": "ide-hd0",
770 "overlay": "node1534" } }
773 blockdev-snapshot-internal-sync
774 -------------------------------
776 Synchronously take an internal snapshot of a block device when the format of
777 image used supports it. If the name is an empty string, or a snapshot with
778 name already exists, the operation will fail.
782 - "device": the device name or node-name of a root node to snapshot
784 - "name": name of the new snapshot (json-string)
788 -> { "execute": "blockdev-snapshot-internal-sync",
789 "arguments": { "device": "ide-hd0",
790 "name": "snapshot0" }
794 blockdev-snapshot-delete-internal-sync
795 --------------------------------------
797 Synchronously delete an internal snapshot of a block device when the format of
798 image used supports it. The snapshot is identified by name or id or both. One
799 of name or id is required. If the snapshot is not found, the operation will
804 - "device": the device name or node-name of a root node (json-string)
805 - "id": ID of the snapshot (json-string, optional)
806 - "name": name of the snapshot (json-string, optional)
810 -> { "execute": "blockdev-snapshot-delete-internal-sync",
811 "arguments": { "device": "ide-hd0",
812 "name": "snapshot0" }
828 Start mirroring a block device's writes to a new destination. target
829 specifies the target of the new image. If the file exists, or if it is
830 a device, it will be used as the new destination for writes. If it does not
831 exist, a new file will be created. format specifies the format of the
832 mirror image, default is to probe if mode='existing', else the format
837 - "job-id": Identifier for the newly-created block job. If omitted,
838 the device name will be used. (json-string, optional)
839 - "device": the device name or node-name of a root node whose writes should be
840 mirrored. (json-string)
841 - "target": name of new image file (json-string)
842 - "format": format of new image (json-string, optional)
843 - "node-name": the name of the new block driver state in the node graph
844 (json-string, optional)
845 - "replaces": the block driver node name to replace when finished
846 (json-string, optional)
847 - "mode": how an image file should be created into the target
848 file/device (NewImageMode, optional, default 'absolute-paths')
849 - "speed": maximum speed of the streaming job, in bytes per second
851 - "granularity": granularity of the dirty bitmap, in bytes (json-int, optional)
852 - "buf-size": maximum amount of data in flight from source to target, in bytes
853 (json-int, default 10M)
854 - "sync": what parts of the disk image should be copied to the destination;
855 possibilities include "full" for all the disk, "top" for only the sectors
856 allocated in the topmost image, or "none" to only replicate new I/O
858 - "on-source-error": the action to take on an error on the source
859 (BlockdevOnError, default 'report')
860 - "on-target-error": the action to take on an error on the target
861 (BlockdevOnError, default 'report')
862 - "unmap": whether the target sectors should be discarded where source has only
863 zeroes. (json-bool, optional, default true)
865 The default value of the granularity is the image cluster size clamped
866 between 4096 and 65536, if the image format defines one. If the format
867 does not define a cluster size, the default value of the granularity
873 -> { "execute": "drive-mirror", "arguments": { "device": "ide-hd0",
874 "target": "/some/place/my-image",
876 "format": "qcow2" } }
882 Start mirroring a block device's writes to another block device. target
883 specifies the target of mirror operation.
887 - "job-id": Identifier for the newly-created block job. If omitted,
888 the device name will be used. (json-string, optional)
889 - "device": The device name or node-name of a root node whose writes should be
890 mirrored (json-string)
891 - "target": device name to mirror to (json-string)
892 - "replaces": the block driver node name to replace when finished
893 (json-string, optional)
894 - "speed": maximum speed of the streaming job, in bytes per second
896 - "granularity": granularity of the dirty bitmap, in bytes (json-int, optional)
897 - "buf_size": maximum amount of data in flight from source to target, in bytes
898 (json-int, default 10M)
899 - "sync": what parts of the disk image should be copied to the destination;
900 possibilities include "full" for all the disk, "top" for only the sectors
901 allocated in the topmost image, or "none" to only replicate new I/O
903 - "on-source-error": the action to take on an error on the source
904 (BlockdevOnError, default 'report')
905 - "on-target-error": the action to take on an error on the target
906 (BlockdevOnError, default 'report')
908 The default value of the granularity is the image cluster size clamped
909 between 4096 and 65536, if the image format defines one. If the format
910 does not define a cluster size, the default value of the granularity
915 -> { "execute": "blockdev-mirror", "arguments": { "device": "ide-hd0",
924 Change the backing file in the image file metadata. This does not cause
925 QEMU to reopen the image file to reparse the backing filename (it may,
926 however, perform a reopen to change permissions from r/o -> r/w -> r/o,
927 if needed). The new backing file string is written into the image file
928 metadata, and the QEMU internal strings are updated.
932 - "image-node-name": The name of the block driver state node of the
933 image to modify. The "device" is argument is used to
934 verify "image-node-name" is in the chain described by
936 (json-string, optional)
938 - "device": The device name or node-name of the root node that owns
942 - "backing-file": The string to write as the backing file. This string is
943 not validated, so care should be taken when specifying
944 the string or the image chain may not be able to be
948 Returns: Nothing on success
949 If "device" does not exist or cannot be determined, DeviceNotFound
954 Receive a file descriptor via SCM rights and assign it a name.
958 - "fdname": file descriptor name (json-string)
962 -> { "execute": "getfd", "arguments": { "fdname": "fd1" } }
967 (1) If the name specified by the "fdname" argument already exists,
968 the file descriptor assigned to it will be closed and replaced
969 by the received file descriptor.
970 (2) The 'closefd' command can be used to explicitly close the file
971 descriptor when it is no longer needed.
976 Close a file descriptor previously passed via SCM rights.
980 - "fdname": file descriptor name (json-string)
984 -> { "execute": "closefd", "arguments": { "fdname": "fd1" } }
990 Add a file descriptor, that was passed via SCM rights, to an fd set.
994 - "fdset-id": The ID of the fd set to add the file descriptor to.
996 - "opaque": A free-form string that can be used to describe the fd.
997 (json-string, optional)
999 Return a json-object with the following information:
1001 - "fdset-id": The ID of the fd set that the fd was added to. (json-int)
1002 - "fd": The file descriptor that was received via SCM rights and added to the
1007 -> { "execute": "add-fd", "arguments": { "fdset-id": 1 } }
1008 <- { "return": { "fdset-id": 1, "fd": 3 } }
1012 (1) The list of fd sets is shared by all monitor connections.
1013 (2) If "fdset-id" is not specified, a new fd set will be created.
1018 Remove a file descriptor from an fd set.
1022 - "fdset-id": The ID of the fd set that the file descriptor belongs to.
1024 - "fd": The file descriptor that is to be removed. (json-int, optional)
1028 -> { "execute": "remove-fd", "arguments": { "fdset-id": 1, "fd": 3 } }
1033 (1) The list of fd sets is shared by all monitor connections.
1034 (2) If "fd" is not specified, all file descriptors in "fdset-id" will be
1040 Return information describing all fd sets.
1046 -> { "execute": "query-fdsets" }
1052 "opaque": "rdonly:/path/to/file"
1056 "opaque": "rdwr:/path/to/file"
1075 Note: The list of fd sets is shared by all monitor connections.
1080 Set the password of encrypted block devices.
1084 - "device": device name (json-string)
1085 - "node-name": name in the block driver state graph (json-string)
1086 - "password": password (json-string)
1090 -> { "execute": "block_passwd", "arguments": { "device": "ide0-hd0",
1091 "password": "12345" } }
1094 block_set_io_throttle
1097 Change I/O throttle limits for a block drive.
1101 - "device": block device name (deprecated, use @id instead)
1102 (json-string, optional)
1103 - "id": the name or QOM path of the guest device (json-string, optional)
1104 - "bps": total throughput limit in bytes per second (json-int)
1105 - "bps_rd": read throughput limit in bytes per second (json-int)
1106 - "bps_wr": write throughput limit in bytes per second (json-int)
1107 - "iops": total I/O operations per second (json-int)
1108 - "iops_rd": read I/O operations per second (json-int)
1109 - "iops_wr": write I/O operations per second (json-int)
1110 - "bps_max": total throughput limit during bursts, in bytes (json-int, optional)
1111 - "bps_rd_max": read throughput limit during bursts, in bytes (json-int, optional)
1112 - "bps_wr_max": write throughput limit during bursts, in bytes (json-int, optional)
1113 - "iops_max": total I/O operations per second during bursts (json-int, optional)
1114 - "iops_rd_max": read I/O operations per second during bursts (json-int, optional)
1115 - "iops_wr_max": write I/O operations per second during bursts (json-int, optional)
1116 - "bps_max_length": maximum length of the @bps_max burst period, in seconds (json-int, optional)
1117 - "bps_rd_max_length": maximum length of the @bps_rd_max burst period, in seconds (json-int, optional)
1118 - "bps_wr_max_length": maximum length of the @bps_wr_max burst period, in seconds (json-int, optional)
1119 - "iops_max_length": maximum length of the @iops_max burst period, in seconds (json-int, optional)
1120 - "iops_rd_max_length": maximum length of the @iops_rd_max burst period, in seconds (json-int, optional)
1121 - "iops_wr_max_length": maximum length of the @iops_wr_max burst period, in seconds (json-int, optional)
1122 - "iops_size": I/O size in bytes when limiting (json-int, optional)
1123 - "group": throttle group name (json-string, optional)
1127 -> { "execute": "block_set_io_throttle", "arguments": { "id": "ide0-1-0",
1140 "bps_max_length": 60,
1147 Set the password for vnc/spice protocols.
1151 - "protocol": protocol name (json-string)
1152 - "password": password (json-string)
1153 - "connected": [ keep | disconnect | fail ] (json-string, optional)
1157 -> { "execute": "set_password", "arguments": { "protocol": "vnc",
1158 "password": "secret" } }
1164 Set the password expire time for vnc/spice protocols.
1168 - "protocol": protocol name (json-string)
1169 - "time": [ now | never | +secs | secs ] (json-string)
1173 -> { "execute": "expire_password", "arguments": { "protocol": "vnc",
1180 Enable QMP capabilities.
1186 -> { "execute": "qmp_capabilities" }
1189 Note: This command must be issued before issuing any other command.
1200 Return a json-object with the following information:
1202 - "qemu": A json-object containing three integer values:
1203 - "major": QEMU's major version (json-int)
1204 - "minor": QEMU's minor version (json-int)
1205 - "micro": QEMU's micro version (json-int)
1206 - "package": package's version (json-string)
1210 -> { "execute": "query-version" }
1225 List QMP available commands.
1227 Each command is represented by a json-object, the returned value is a json-array
1230 Each json-object contain:
1232 - "name": command's name (json-string)
1236 -> { "execute": "query-commands" }
1240 "name":"query-balloon"
1243 "name":"system_powerdown"
1248 Note: This example has been shortened as the real response is too long.
1253 Return the QMP wire schema. The returned value is a json-array of
1254 named schema entities. Entities are commands, events and various
1255 types. See docs/qapi-code-gen.txt for information on their structure
1261 Show the block devices.
1263 Each block device information is stored in a json-object and the returned value
1264 is a json-array of all devices.
1266 Each json-object contain the following:
1268 - "device": device name (json-string)
1269 - "type": device type (json-string)
1270 - deprecated, retained for backward compatibility
1271 - Possible values: "unknown"
1272 - "removable": true if the device is removable, false otherwise (json-bool)
1273 - "locked": true if the device is locked, false otherwise (json-bool)
1274 - "tray_open": only present if removable, true if the device has a tray,
1275 and it is open (json-bool)
1276 - "inserted": only present if the device is inserted, it is a json-object
1277 containing the following:
1278 - "file": device file name (json-string)
1279 - "ro": true if read-only, false otherwise (json-bool)
1280 - "drv": driver format name (json-string)
1281 - Possible values: "blkdebug", "bochs", "cloop", "dmg",
1282 "file", "file", "ftp", "ftps", "host_cdrom",
1283 "host_device", "http", "https",
1284 "nbd", "parallels", "qcow", "qcow2", "raw",
1285 "vdi", "vmdk", "vpc", "vvfat"
1286 - "backing_file": backing file name (json-string, optional)
1287 - "backing_file_depth": number of files in the backing file chain (json-int)
1288 - "encrypted": true if encrypted, false otherwise (json-bool)
1289 - "bps": limit total bytes per second (json-int)
1290 - "bps_rd": limit read bytes per second (json-int)
1291 - "bps_wr": limit write bytes per second (json-int)
1292 - "iops": limit total I/O operations per second (json-int)
1293 - "iops_rd": limit read operations per second (json-int)
1294 - "iops_wr": limit write operations per second (json-int)
1295 - "bps_max": total max in bytes (json-int)
1296 - "bps_rd_max": read max in bytes (json-int)
1297 - "bps_wr_max": write max in bytes (json-int)
1298 - "iops_max": total I/O operations max (json-int)
1299 - "iops_rd_max": read I/O operations max (json-int)
1300 - "iops_wr_max": write I/O operations max (json-int)
1301 - "iops_size": I/O size when limiting by iops (json-int)
1302 - "detect_zeroes": detect and optimize zero writing (json-string)
1303 - Possible values: "off", "on", "unmap"
1304 - "write_threshold": write offset threshold in bytes, a event will be
1305 emitted if crossed. Zero if disabled (json-int)
1306 - "image": the detail of the image, it is a json-object containing
1308 - "filename": image file name (json-string)
1309 - "format": image format (json-string)
1310 - "virtual-size": image capacity in bytes (json-int)
1311 - "dirty-flag": true if image is not cleanly closed, not present
1312 means clean (json-bool, optional)
1313 - "actual-size": actual size on disk in bytes of the image, not
1314 present when image does not support thin
1315 provision (json-int, optional)
1316 - "cluster-size": size of a cluster in bytes, not present if image
1317 format does not support it (json-int, optional)
1318 - "encrypted": true if the image is encrypted, not present means
1319 false or the image format does not support
1320 encryption (json-bool, optional)
1321 - "backing_file": backing file name, not present means no backing
1322 file is used or the image format does not
1323 support backing file chain
1324 (json-string, optional)
1325 - "full-backing-filename": full path of the backing file, not
1326 present if it equals backing_file or no
1327 backing file is used
1328 (json-string, optional)
1329 - "backing-filename-format": the format of the backing file, not
1330 present means unknown or no backing
1331 file (json-string, optional)
1332 - "snapshots": the internal snapshot info, it is an optional list
1333 of json-object containing the following:
1334 - "id": unique snapshot id (json-string)
1335 - "name": snapshot name (json-string)
1336 - "vm-state-size": size of the VM state in bytes (json-int)
1337 - "date-sec": UTC date of the snapshot in seconds (json-int)
1338 - "date-nsec": fractional part in nanoseconds to be used with
1340 - "vm-clock-sec": VM clock relative to boot in seconds
1342 - "vm-clock-nsec": fractional part in nanoseconds to be used
1343 with vm-clock-sec (json-int)
1344 - "backing-image": the detail of the backing image, it is an
1345 optional json-object only present when a
1346 backing image present for this image
1348 - "io-status": I/O operation status, only present if the device supports it
1349 and the VM is configured to stop on errors. It's always reset
1350 to "ok" when the "cont" command is issued (json_string, optional)
1351 - Possible values: "ok", "failed", "nospace"
1355 -> { "execute": "query-block" }
1360 "device":"ide0-hd0",
1367 "file":"disks/test.qcow2",
1368 "backing_file_depth":1,
1382 "detect_zeroes": "on",
1383 "write_threshold": 0,
1385 "filename":"disks/test.qcow2",
1387 "virtual-size":2048000,
1388 "backing_file":"base.qcow2",
1389 "full-backing-filename":"disks/base.qcow2",
1390 "backing-filename-format":"qcow2",
1394 "name": "snapshot1",
1396 "date-sec": 10000200,
1398 "vm-clock-sec": 206,
1403 "filename":"disks/base.qcow2",
1405 "virtual-size":2048000
1413 "device":"ide1-cd0",
1436 Show block device statistics.
1438 Each device statistic information is stored in a json-object and the returned
1439 value is a json-array of all devices.
1441 Each json-object contain the following:
1443 - "device": device name (json-string)
1444 - "stats": A json-object with the statistics information, it contains:
1445 - "rd_bytes": bytes read (json-int)
1446 - "wr_bytes": bytes written (json-int)
1447 - "rd_operations": read operations (json-int)
1448 - "wr_operations": write operations (json-int)
1449 - "flush_operations": cache flush operations (json-int)
1450 - "wr_total_time_ns": total time spend on writes in nano-seconds (json-int)
1451 - "rd_total_time_ns": total time spend on reads in nano-seconds (json-int)
1452 - "flush_total_time_ns": total time spend on cache flushes in nano-seconds (json-int)
1453 - "wr_highest_offset": The offset after the greatest byte written to the
1454 BlockDriverState since it has been opened (json-int)
1455 - "rd_merged": number of read requests that have been merged into
1456 another request (json-int)
1457 - "wr_merged": number of write requests that have been merged into
1458 another request (json-int)
1459 - "idle_time_ns": time since the last I/O operation, in
1460 nanoseconds. If the field is absent it means
1461 that there haven't been any operations yet
1462 (json-int, optional)
1463 - "failed_rd_operations": number of failed read operations
1465 - "failed_wr_operations": number of failed write operations
1467 - "failed_flush_operations": number of failed flush operations
1469 - "invalid_rd_operations": number of invalid read operations
1471 - "invalid_wr_operations": number of invalid write operations
1473 - "invalid_flush_operations": number of invalid flush operations
1475 - "account_invalid": whether invalid operations are included in
1476 the last access statistics (json-bool)
1477 - "account_failed": whether failed operations are included in the
1478 latency and last access statistics
1480 - "timed_stats": A json-array containing statistics collected in
1481 specific intervals, with the following members:
1482 - "interval_length": interval used for calculating the
1483 statistics, in seconds (json-int)
1484 - "min_rd_latency_ns": minimum latency of read operations in
1485 the defined interval, in nanoseconds
1487 - "min_wr_latency_ns": minimum latency of write operations in
1488 the defined interval, in nanoseconds
1490 - "min_flush_latency_ns": minimum latency of flush operations
1491 in the defined interval, in
1492 nanoseconds (json-int)
1493 - "max_rd_latency_ns": maximum latency of read operations in
1494 the defined interval, in nanoseconds
1496 - "max_wr_latency_ns": maximum latency of write operations in
1497 the defined interval, in nanoseconds
1499 - "max_flush_latency_ns": maximum latency of flush operations
1500 in the defined interval, in
1501 nanoseconds (json-int)
1502 - "avg_rd_latency_ns": average latency of read operations in
1503 the defined interval, in nanoseconds
1505 - "avg_wr_latency_ns": average latency of write operations in
1506 the defined interval, in nanoseconds
1508 - "avg_flush_latency_ns": average latency of flush operations
1509 in the defined interval, in
1510 nanoseconds (json-int)
1511 - "avg_rd_queue_depth": average number of pending read
1512 operations in the defined interval
1514 - "avg_wr_queue_depth": average number of pending write
1515 operations in the defined interval
1517 - "parent": Contains recursively the statistics of the underlying
1518 protocol (e.g. the host file for a qcow2 image). If there is
1519 no underlying protocol, this field is omitted
1520 (json-object, optional)
1524 -> { "execute": "query-blockstats" }
1528 "device":"ide0-hd0",
1531 "wr_highest_offset":3686448128,
1533 "wr_operations":751,
1534 "rd_bytes":122567168,
1535 "rd_operations":36772
1536 "wr_total_times_ns":313253456
1537 "rd_total_times_ns":3465673657
1538 "flush_total_times_ns":49653
1539 "flush_operations":61,
1542 "idle_time_ns":2953431879,
1543 "account_invalid":true,
1544 "account_failed":false
1548 "wr_highest_offset":2821110784,
1550 "wr_operations":692,
1551 "rd_bytes":122739200,
1552 "rd_operations":36604
1553 "flush_operations":51,
1554 "wr_total_times_ns":313253456
1555 "rd_total_times_ns":3465673657
1556 "flush_total_times_ns":49653,
1559 "idle_time_ns":2953431879,
1560 "account_invalid":true,
1561 "account_failed":false
1565 "device":"ide1-cd0",
1567 "wr_highest_offset":0,
1572 "flush_operations":0,
1573 "wr_total_times_ns":0
1574 "rd_total_times_ns":0
1575 "flush_total_times_ns":0,
1578 "account_invalid":false,
1579 "account_failed":false
1585 "wr_highest_offset":0,
1590 "flush_operations":0,
1591 "wr_total_times_ns":0
1592 "rd_total_times_ns":0
1593 "flush_total_times_ns":0,
1596 "account_invalid":false,
1597 "account_failed":false
1603 "wr_highest_offset":0,
1608 "flush_operations":0,
1609 "wr_total_times_ns":0
1610 "rd_total_times_ns":0
1611 "flush_total_times_ns":0,
1614 "account_invalid":false,
1615 "account_failed":false
1621 query-command-line-options
1622 --------------------------
1624 Show command line option schema.
1626 Return a json-array of command line option schema for all options (or for
1627 the given option), returning an error if the given option doesn't exist.
1629 Each array entry contains the following:
1631 - "option": option name (json-string)
1632 - "parameters": a json-array describes all parameters of the option:
1633 - "name": parameter name (json-string)
1634 - "type": parameter type (one of 'string', 'boolean', 'number',
1636 - "help": human readable description of the parameter
1637 (json-string, optional)
1638 - "default": default value string for the parameter
1639 (json-string, optional)
1643 -> { "execute": "query-command-line-options", "arguments": { "option": "option-rom" } }
1652 "name": "bootindex",
1656 "option": "option-rom"
1664 Return information about the TPM device.
1670 -> { "execute": "query-tpm" }
1673 { "model": "tpm-tis",
1675 { "type": "passthrough",
1677 { "cancel-path": "/sys/class/misc/tpm0/device/cancel",
1689 Return a list of supported TPM models.
1695 -> { "execute": "query-tpm-models" }
1696 <- { "return": [ "tpm-tis" ] }
1701 Return a list of supported TPM types.
1707 -> { "execute": "query-tpm-types" }
1708 <- { "return": [ "passthrough" ] }
1717 - "id": the chardev's ID, must be unique (json-string)
1718 - "backend": chardev backend type + parameters
1722 -> { "execute" : "chardev-add",
1723 "arguments" : { "id" : "foo",
1724 "backend" : { "type" : "null", "data" : {} } } }
1727 -> { "execute" : "chardev-add",
1728 "arguments" : { "id" : "bar",
1729 "backend" : { "type" : "file",
1730 "data" : { "out" : "/tmp/bar.log" } } } }
1733 -> { "execute" : "chardev-add",
1734 "arguments" : { "id" : "baz",
1735 "backend" : { "type" : "pty", "data" : {} } } }
1736 <- { "return": { "pty" : "/dev/pty/42" } }
1745 - "id": the chardev's ID, must exist and not be in use (json-string)
1749 -> { "execute": "chardev-remove", "arguments": { "id" : "foo" } }
1755 Show rx-filter information.
1757 Returns a json-array of rx-filter information for all NICs (or for the
1758 given NIC), returning an error if the given NIC doesn't exist, or
1759 given NIC doesn't support rx-filter querying, or given net client
1762 The query will clear the event notification flag of each NIC, then qemu
1763 will start to emit event to QMP monitor.
1765 Each array entry contains the following:
1767 - "name": net client name (json-string)
1768 - "promiscuous": promiscuous mode is enabled (json-bool)
1769 - "multicast": multicast receive state (one of 'normal', 'none', 'all')
1770 - "unicast": unicast receive state (one of 'normal', 'none', 'all')
1771 - "vlan": vlan receive state (one of 'normal', 'none', 'all') (Since 2.0)
1772 - "broadcast-allowed": allow to receive broadcast (json-bool)
1773 - "multicast-overflow": multicast table is overflowed (json-bool)
1774 - "unicast-overflow": unicast table is overflowed (json-bool)
1775 - "main-mac": main macaddr string (json-string)
1776 - "vlan-table": a json-array of active vlan id
1777 - "unicast-table": a json-array of unicast macaddr string
1778 - "multicast-table": a json-array of multicast macaddr string
1782 -> { "execute": "query-rx-filter", "arguments": { "name": "vnet0" } }
1785 "promiscuous": true,
1787 "main-mac": "52:54:00:12:34:56",
1788 "unicast": "normal",
1796 "multicast": "normal",
1797 "multicast-overflow": false,
1798 "unicast-overflow": false,
1799 "multicast-table": [
1800 "01:00:5e:00:00:01",
1801 "33:33:00:00:00:01",
1804 "broadcast-allowed": false
1814 This command is still a work in progress. It doesn't support all
1815 block drivers among other things. Stay away from it unless you want
1816 to help with its development.
1818 For the arguments, see the QAPI schema documentation of BlockdevOptions.
1822 -> { "execute": "blockdev-add",
1823 "arguments": { "driver": "qcow2",
1824 "file": { "driver": "file",
1825 "filename": "test.qcow2" } } }
1830 -> { "execute": "blockdev-add",
1833 "node-name": "my_disk",
1841 "filename": "/tmp/test.qcow2"
1847 "filename": "/dev/fdset/4"
1859 Deletes a block device that has been added using blockdev-add.
1860 The command will fail if the node is attached to a device or is
1861 otherwise being used.
1863 This command is still a work in progress and is considered
1864 experimental. Stay away from it unless you want to help with its
1869 - "node-name": Name of the graph node to delete (json-string)
1873 -> { "execute": "blockdev-add",
1876 "node-name": "node0",
1879 "filename": "test.qcow2"
1886 -> { "execute": "x-blockdev-del",
1887 "arguments": { "node-name": "node0" }
1894 Opens a block device's tray. If there is a block driver state tree inserted as a
1895 medium, it will become inaccessible to the guest (but it will remain associated
1896 to the block device, so closing the tray will make it accessible again).
1898 If the tray was already open before, this will be a no-op.
1900 Once the tray opens, a DEVICE_TRAY_MOVED event is emitted. There are cases in
1901 which no such event will be generated, these include:
1902 - if the guest has locked the tray, @force is false and the guest does not
1903 respond to the eject request
1904 - if the BlockBackend denoted by @device does not have a guest device attached
1906 - if the guest device does not have an actual tray and is empty, for instance
1907 for floppy disk drives
1911 - "device": block device name (deprecated, use @id instead)
1912 (json-string, optional)
1913 - "id": the name or QOM path of the guest device (json-string, optional)
1914 - "force": if false (the default), an eject request will be sent to the guest if
1915 it has locked the tray (and the tray will not be opened immediately);
1916 if true, the tray will be opened regardless of whether it is locked
1917 (json-bool, optional)
1921 -> { "execute": "blockdev-open-tray",
1922 "arguments": { "id": "ide0-1-0" } }
1924 <- { "timestamp": { "seconds": 1418751016,
1925 "microseconds": 716996 },
1926 "event": "DEVICE_TRAY_MOVED",
1927 "data": { "device": "ide1-cd0",
1929 "tray-open": true } }
1936 Closes a block device's tray. If there is a block driver state tree associated
1937 with the block device (which is currently ejected), that tree will be loaded as
1940 If the tray was already closed before, this will be a no-op.
1944 - "device": block device name (deprecated, use @id instead)
1945 (json-string, optional)
1946 - "id": the name or QOM path of the guest device (json-string, optional)
1950 -> { "execute": "blockdev-close-tray",
1951 "arguments": { "id": "ide0-1-0" } }
1953 <- { "timestamp": { "seconds": 1418751345,
1954 "microseconds": 272147 },
1955 "event": "DEVICE_TRAY_MOVED",
1956 "data": { "device": "ide1-cd0",
1958 "tray-open": false } }
1962 x-blockdev-remove-medium
1963 ------------------------
1965 Removes a medium (a block driver state tree) from a block device. That block
1966 device's tray must currently be open (unless there is no attached guest device).
1968 If the tray is open and there is no medium inserted, this will be a no-op.
1970 This command is still a work in progress and is considered experimental.
1971 Stay away from it unless you want to help with its development.
1975 - "device": block device name (deprecated, use @id instead)
1976 (json-string, optional)
1977 - "id": the name or QOM path of the guest device (json-string, optional)
1981 -> { "execute": "x-blockdev-remove-medium",
1982 "arguments": { "id": "ide0-1-0" } }
1984 <- { "error": { "class": "GenericError",
1985 "desc": "Tray of device 'ide0-1-0' is not open" } }
1987 -> { "execute": "blockdev-open-tray",
1988 "arguments": { "id": "ide0-1-0" } }
1990 <- { "timestamp": { "seconds": 1418751627,
1991 "microseconds": 549958 },
1992 "event": "DEVICE_TRAY_MOVED",
1993 "data": { "device": "ide1-cd0",
1995 "tray-open": true } }
1999 -> { "execute": "x-blockdev-remove-medium",
2000 "arguments": { "device": "ide0-1-0" } }
2004 x-blockdev-insert-medium
2005 ------------------------
2007 Inserts a medium (a block driver state tree) into a block device. That block
2008 device's tray must currently be open (unless there is no attached guest device)
2009 and there must be no medium inserted already.
2011 This command is still a work in progress and is considered experimental.
2012 Stay away from it unless you want to help with its development.
2016 - "device": block device name (deprecated, use @id instead)
2017 (json-string, optional)
2018 - "id": the name or QOM path of the guest device (json-string, optional)
2019 - "node-name": root node of the BDS tree to insert into the block device
2023 -> { "execute": "blockdev-add",
2024 "arguments": { { "node-name": "node0",
2026 "file": { "driver": "file",
2027 "filename": "fedora.iso" } } }
2031 -> { "execute": "x-blockdev-insert-medium",
2032 "arguments": { "id": "ide0-1-0",
2033 "node-name": "node0" } }
2040 Dynamically reconfigure the block driver state graph. It can be used
2041 to add, remove, insert or replace a graph node. Currently only the
2042 Quorum driver implements this feature to add or remove its child. This
2043 is useful to fix a broken quorum child.
2045 If @node is specified, it will be inserted under @parent. @child
2046 may not be specified in this case. If both @parent and @child are
2047 specified but @node is not, @child will be detached from @parent.
2050 - "parent": the id or name of the parent node (json-string)
2051 - "child": the name of a child under the given parent node (json-string, optional)
2052 - "node": the name of the node that will be added (json-string, optional)
2054 Note: this command is experimental, and not a stable API. It doesn't
2055 support all kinds of operations, all kinds of children, nor all block
2058 Warning: The data in a new quorum child MUST be consistent with that of
2059 the rest of the array.
2063 Add a new node to a quorum
2064 -> { "execute": "blockdev-add",
2065 "arguments": { "driver": "raw",
2066 "node-name": "new_node",
2067 "file": { "driver": "file",
2068 "filename": "test.raw" } } }
2070 -> { "execute": "x-blockdev-change",
2071 "arguments": { "parent": "disk1",
2072 "node": "new_node" } }
2075 Delete a quorum's node
2076 -> { "execute": "x-blockdev-change",
2077 "arguments": { "parent": "disk1",
2078 "child": "children.1" } }
2081 query-named-block-nodes
2082 -----------------------
2084 Return a list of BlockDeviceInfo for all the named block driver nodes
2088 -> { "execute": "query-named-block-nodes" }
2089 <- { "return": [ { "ro":false,
2092 "file":"disks/test.qcow2",
2093 "node-name": "my-node",
2094 "backing_file_depth":1,
2108 "write_threshold": 0,
2110 "filename":"disks/test.qcow2",
2112 "virtual-size":2048000,
2113 "backing_file":"base.qcow2",
2114 "full-backing-filename":"disks/base.qcow2",
2115 "backing-filename-format":"qcow2",
2119 "name": "snapshot1",
2121 "date-sec": 10000200,
2123 "vm-clock-sec": 206,
2128 "filename":"disks/base.qcow2",
2130 "virtual-size":2048000
2134 blockdev-change-medium
2135 ----------------------
2137 Changes the medium inserted into a block device by ejecting the current medium
2138 and loading a new image file which is inserted as the new medium.
2142 - "device": block device name (deprecated, use @id instead)
2143 (json-string, optional)
2144 - "id": the name or QOM path of the guest device (json-string, optional)
2145 - "filename": filename of the new image (json-string)
2146 - "format": format of the new image (json-string, optional)
2147 - "read-only-mode": new read-only mode (json-string, optional)
2148 - Possible values: "retain" (default), "read-only", "read-write"
2152 1. Change a removable medium
2154 -> { "execute": "blockdev-change-medium",
2155 "arguments": { "id": "ide0-1-0",
2156 "filename": "/srv/images/Fedora-12-x86_64-DVD.iso",
2160 2. Load a read-only medium into a writable drive
2162 -> { "execute": "blockdev-change-medium",
2163 "arguments": { "id": "floppyA",
2164 "filename": "/srv/images/ro.img",
2166 "read-only-mode": "retain" } }
2169 { "class": "GenericError",
2170 "desc": "Could not open '/srv/images/ro.img': Permission denied" } }
2172 -> { "execute": "blockdev-change-medium",
2173 "arguments": { "id": "floppyA",
2174 "filename": "/srv/images/ro.img",
2176 "read-only-mode": "read-only" } }
2183 Show memory devices information.
2188 -> { "execute": "query-memdev" }
2195 "host-nodes": [0, 1],
2204 "host-nodes": [2, 3],
2205 "policy": "preferred"
2210 query-memory-devices
2211 --------------------
2213 Return a list of memory devices.
2216 -> { "execute": "query-memory-devices" }
2217 <- { "return": [ { "data":
2218 { "addr": 5368709120,
2219 "hotpluggable": true,
2222 "memdev": "/objects/memX",
2229 query-acpi-ospm-status
2230 ----------------------
2232 Return list of ACPIOSTInfo for devices that support status reporting
2233 via ACPI _OST method.
2236 -> { "execute": "query-acpi-ospm-status" }
2237 <- { "return": [ { "device": "d1", "slot": "0", "slot-type": "DIMM", "source": 1, "status": 0},
2238 { "slot": "1", "slot-type": "DIMM", "source": 0, "status": 0},
2239 { "slot": "2", "slot-type": "DIMM", "source": 0, "status": 0},
2240 { "slot": "3", "slot-type": "DIMM", "source": 0, "status": 0}
2243 rtc-reset-reinjection
2244 ---------------------
2246 Reset the RTC interrupt reinjection backlog.
2252 -> { "execute": "rtc-reset-reinjection" }
2255 trace-event-get-state
2256 ---------------------
2258 Query the state of events.
2262 - "name": Event name pattern (json-string).
2263 - "vcpu": The vCPU to query, any vCPU by default (json-int, optional).
2265 An event is returned if:
2266 - its name matches the "name" pattern, and
2267 - if "vcpu" is given, the event has the "vcpu" property.
2269 Therefore, if "vcpu" is given, the operation will only match per-vCPU events,
2270 returning their state on the specified vCPU. Special case: if "name" is an exact
2271 match, "vcpu" is given and the event does not have the "vcpu" property, an error
2276 -> { "execute": "trace-event-get-state", "arguments": { "name": "qemu_memalign" } }
2277 <- { "return": [ { "name": "qemu_memalign", "state": "disabled" } ] }
2279 trace-event-set-state
2280 ---------------------
2282 Set the state of events.
2286 - "name": Event name pattern (json-string).
2287 - "enable": Whether to enable or disable the event (json-bool).
2288 - "ignore-unavailable": Whether to ignore errors for events that cannot be
2289 changed (json-bool, optional).
2290 - "vcpu": The vCPU to act upon, all vCPUs by default (json-int, optional).
2292 An event's state is modified if:
2293 - its name matches the "name" pattern, and
2294 - if "vcpu" is given, the event has the "vcpu" property.
2296 Therefore, if "vcpu" is given, the operation will only match per-vCPU events,
2297 setting their state on the specified vCPU. Special case: if "name" is an exact
2298 match, "vcpu" is given and the event does not have the "vcpu" property, an error
2303 -> { "execute": "trace-event-set-state", "arguments": { "name": "qemu_memalign", "enable": "true" } }
2309 Send input event to guest.
2313 - "device": display device (json-string, optional)
2314 - "head": display head (json-int, optional)
2315 - "events": list of input events
2317 The consoles are visible in the qom tree, under
2318 /backend/console[$index]. They have a device link and head property, so
2319 it is possible to map which console belongs to which device and display.
2323 Press left mouse button.
2325 -> { "execute": "input-send-event",
2326 "arguments": { "device": "video0",
2327 "events": [ { "type": "btn",
2328 "data" : { "down": true, "button": "left" } } ] } }
2331 -> { "execute": "input-send-event",
2332 "arguments": { "device": "video0",
2333 "events": [ { "type": "btn",
2334 "data" : { "down": false, "button": "left" } } ] } }
2341 -> { "execute": "input-send-event",
2342 "arguments": { "events": [
2343 { "type": "key", "data" : { "down": true,
2344 "key": {"type": "qcode", "data": "ctrl" } } },
2345 { "type": "key", "data" : { "down": true,
2346 "key": {"type": "qcode", "data": "alt" } } },
2347 { "type": "key", "data" : { "down": true,
2348 "key": {"type": "qcode", "data": "delete" } } } ] } }
2353 Move mouse pointer to absolute coordinates (20000, 400).
2355 -> { "execute": "input-send-event" ,
2356 "arguments": { "events": [
2357 { "type": "abs", "data" : { "axis": "x", "value" : 20000 } },
2358 { "type": "abs", "data" : { "axis": "y", "value" : 400 } } ] } }
2361 block-set-write-threshold
2364 Change the write threshold for a block drive. The threshold is an offset,
2365 thus must be non-negative. Default is no write threshold.
2366 Setting the threshold to zero disables it.
2370 - "node-name": the node name in the block driver state graph (json-string)
2371 - "write-threshold": the write threshold in bytes (json-int)
2375 -> { "execute": "block-set-write-threshold",
2376 "arguments": { "node-name": "mydev",
2377 "write-threshold": 17179869184 } }
2385 - "name": switch name
2389 -> { "execute": "query-rocker", "arguments": { "name": "sw1" } }
2390 <- { "return": {"name": "sw1", "ports": 2, "id": 1327446905938}}
2392 Show rocker switch ports
2393 ------------------------
2397 - "name": switch name
2401 -> { "execute": "query-rocker-ports", "arguments": { "name": "sw1" } }
2402 <- { "return": [ {"duplex": "full", "enabled": true, "name": "sw1.1",
2403 "autoneg": "off", "link-up": true, "speed": 10000},
2404 {"duplex": "full", "enabled": true, "name": "sw1.2",
2405 "autoneg": "off", "link-up": true, "speed": 10000}
2408 Show rocker switch OF-DPA flow tables
2409 -------------------------------------
2413 - "name": switch name
2414 - "tbl-id": (optional) flow table ID
2418 -> { "execute": "query-rocker-of-dpa-flows", "arguments": { "name": "sw1" } }
2419 <- { "return": [ {"key": {"in-pport": 0, "priority": 1, "tbl-id": 0},
2422 "action": {"goto-tbl": 10},
2423 "mask": {"in-pport": 4294901760}
2428 Show rocker OF-DPA group tables
2429 -------------------------------
2433 - "name": switch name
2434 - "type": (optional) group type
2438 -> { "execute": "query-rocker-of-dpa-groups", "arguments": { "name": "sw1" } }
2439 <- { "return": [ {"type": 0, "out-pport": 2, "pport": 2, "vlan-id": 3841,
2440 "pop-vlan": 1, "id": 251723778},
2441 {"type": 0, "out-pport": 0, "pport": 0, "vlan-id": 3841,
2442 "pop-vlan": 1, "id": 251723776},
2443 {"type": 0, "out-pport": 1, "pport": 1, "vlan-id": 3840,
2444 "pop-vlan": 1, "id": 251658241},
2445 {"type": 0, "out-pport": 0, "pport": 0, "vlan-id": 3840,
2446 "pop-vlan": 1, "id": 251658240}
2449 query-gic-capabilities
2452 Return a list of GICCapability objects, describing supported GIC
2453 (Generic Interrupt Controller) versions.
2459 -> { "execute": "query-gic-capabilities" }
2460 <- { "return": [{ "version": 2, "emulated": true, "kernel": false },
2461 { "version": 3, "emulated": false, "kernel": true } ] }
2463 Show existing/possible CPUs
2464 ---------------------------
2468 Example for pseries machine type started with
2469 -smp 2,cores=2,maxcpus=4 -cpu POWER8:
2471 -> { "execute": "query-hotpluggable-cpus" }
2473 { "props": { "core-id": 8 }, "type": "POWER8-spapr-cpu-core",
2475 { "props": { "core-id": 0 }, "type": "POWER8-spapr-cpu-core",
2476 "vcpus-count": 1, "qom-path": "/machine/unattached/device[0]"}
2479 Example for pc machine type started with
2481 -> { "execute": "query-hotpluggable-cpus" }
2484 "type": "qemu64-x86_64-cpu", "vcpus-count": 1,
2485 "props": {"core-id": 0, "socket-id": 1, "thread-id": 0}
2488 "qom-path": "/machine/unattached/device[0]",
2489 "type": "qemu64-x86_64-cpu", "vcpus-count": 1,
2490 "props": {"core-id": 0, "socket-id": 0, "thread-id": 0}