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 Save screen into PPM image.
82 - "filename": file path (json-string)
86 -> { "execute": "screendump", "arguments": { "filename": "/tmp/image" } }
96 - "driver": the name of the new device's driver (json-string)
97 - "bus": the device's parent bus (device tree path, json-string, optional)
98 - "id": the device's ID, must be unique (json-string)
103 -> { "execute": "device_add", "arguments": { "driver": "e1000", "id": "net1" } }
108 (1) For detailed information about this command, please refer to the
109 'docs/qdev-device-use.txt' file.
111 (2) It's possible to list device properties by running QEMU with the
112 "-device DEVICE,\?" command-line argument, where DEVICE is the device's name
121 - "id": the device's ID or QOM path (json-string)
125 -> { "execute": "device_del", "arguments": { "id": "net1" } }
130 -> { "execute": "device_del", "arguments": { "id": "/machine/peripheral-anon/device[0]" } }
141 - "key": key sequence (a json-array of key union values,
142 union can be number or qcode enum)
144 - hold-time: time to delay key up events, milliseconds. Defaults to 100
149 -> { "execute": "send-key",
150 "arguments": { "keys": [ { "type": "qcode", "data": "ctrl" },
151 { "type": "qcode", "data": "alt" },
152 { "type": "qcode", "data": "delete" } ] } }
162 - "index": the CPU's index (json-int)
166 -> { "execute": "cpu", "arguments": { "index": 0 } }
169 Note: CPUs' indexes are obtained with the 'query-cpus' command.
171 xen-load-devices-state
172 ----------------------
174 Load the state of all devices from file. The RAM and the block devices
175 of the VM are not loaded by this command.
179 - "filename": the file to load the state of the devices from as binary
180 data. See xen-save-devices-state.txt for a description of the binary
185 -> { "execute": "xen-load-devices-state",
186 "arguments": { "filename": "/tmp/resume" } }
189 xen-set-global-dirty-log
192 Enable or disable the global dirty log mode.
196 - "enable": Enable it or disable it.
200 -> { "execute": "xen-set-global-dirty-log",
201 "arguments": { "enable": true } }
204 migrate-set-cache-size
205 ----------------------
207 Set cache size to be used by XBZRLE migration, the cache size will be rounded
208 down to the nearest power of 2
212 - "value": cache size in bytes (json-int)
216 -> { "execute": "migrate-set-cache-size", "arguments": { "value": 536870912 } }
219 x-colo-lost-heartbeat
222 Tell COLO that heartbeat is lost, a failover or takeover is needed.
226 -> { "execute": "x-colo-lost-heartbeat" }
232 Dump guest memory to file. The file can be processed with crash or gdb.
236 - "paging": do paging to get guest's memory mapping (json-bool)
237 - "protocol": destination file(started with "file:") or destination file
238 descriptor (started with "fd:") (json-string)
239 - "detach": if specified, command will return immediately, without waiting
240 for the dump to finish. The user can track progress using
241 "query-dump". (json-bool)
242 - "begin": the starting physical address. It's optional, and should be specified
243 with length together (json-int)
244 - "length": the memory size, in bytes. It's optional, and should be specified
245 with begin together (json-int)
246 - "format": the format of guest memory dump. It's optional, and can be
247 elf|kdump-zlib|kdump-lzo|kdump-snappy, but non-elf formats will
248 conflict with paging and filter, ie. begin and length (json-string)
252 -> { "execute": "dump-guest-memory", "arguments": { "protocol": "fd:dump" } }
257 (1) All boolean arguments default to false
259 query-dump-guest-memory-capability
262 Show available formats for 'dump-guest-memory'
266 -> { "execute": "query-dump-guest-memory-capability" }
267 <- { "return": { "formats":
268 ["elf", "kdump-zlib", "kdump-lzo", "kdump-snappy"] }
273 Query background dump status.
279 -> { "execute": "query-dump" }
280 <- { "return": { "status": "active", "completed": 1024000,
286 Save guest storage keys to file.
290 - "filename": file path (json-string)
294 -> { "execute": "dump-skeys", "arguments": { "filename": "/tmp/skeys" } }
300 Add host network device.
304 - "type": the device type, "tap", "user", ... (json-string)
305 - "id": the device's ID, must be unique (json-string)
310 -> { "execute": "netdev_add",
311 "arguments": { "type": "user", "id": "netdev1",
312 "dnssearch": "example.org" } }
315 Note: The supported device options are the same ones supported by the '-netdev'
316 command-line argument, which are listed in the '-help' output or QEMU's
322 Remove host network device.
326 - "id": the device's ID, must be unique (json-string)
330 -> { "execute": "netdev_del", "arguments": { "id": "netdev1" } }
341 - "qom-type": the object's QOM type, i.e. the class name (json-string)
342 - "id": the object's ID, must be unique (json-string)
343 - "props": a dictionary of object property values (optional, json-dict)
347 -> { "execute": "object-add", "arguments": { "qom-type": "rng-random", "id": "rng1",
348 "props": { "filename": "/dev/hwrng" } } }
358 - "id": the object's ID (json-string)
362 -> { "execute": "object-del", "arguments": { "id": "rng1" } }
369 Resize a block image while a guest is running.
373 - "device": the device's ID, must be unique (json-string)
374 - "node-name": the node name in the block driver state graph (json-string)
379 -> { "execute": "block_resize", "arguments": { "device": "scratch", "size": 1073741824 } }
385 Copy data from a backing file into a block device.
389 - "job-id": Identifier for the newly-created block job. If omitted,
390 the device name will be used. (json-string, optional)
391 - "device": The device name or node-name of a root node (json-string)
392 - "base": The file name of the backing image above which copying starts.
393 It cannot be set if 'base-node' is also set (json-string, optional)
394 - "base-node": the node name of the backing image above which copying starts.
395 It cannot be set if 'base' is also set.
396 (json-string, optional) (Since 2.8)
397 - "backing-file": The backing file string to write into the active layer. This
398 filename is not validated.
400 If a pathname string is such that it cannot be resolved by
401 QEMU, that means that subsequent QMP or HMP commands must use
402 node-names for the image in question, as filename lookup
405 If not specified, QEMU will automatically determine the
406 backing file string to use, or error out if there is no
407 obvious choice. Care should be taken when specifying the
408 string, to specify a valid filename or protocol.
409 (json-string, optional) (Since 2.1)
410 - "speed": the maximum speed, in bytes per second (json-int, optional)
411 - "on-error": the action to take on an error (default 'report'). 'stop' and
412 'enospc' can only be used if the block device supports io-status.
413 (json-string, optional) (Since 2.1)
417 -> { "execute": "block-stream", "arguments": { "device": "virtio0",
418 "base": "/tmp/master.qcow2" } }
424 Live commit of data from overlay image nodes into backing nodes - i.e., writes
425 data between 'top' and 'base' into 'base'.
429 - "job-id": Identifier for the newly-created block job. If omitted,
430 the device name will be used. (json-string, optional)
431 - "device": The device name or node-name of a root node (json-string)
432 - "base": The file name of the backing image to write data into.
433 If not specified, this is the deepest backing image
434 (json-string, optional)
435 - "top": The file name of the backing image within the image chain,
436 which contains the topmost data to be committed down. If
437 not specified, this is the active layer. (json-string, optional)
439 - backing-file: The backing file string to write into the overlay
440 image of 'top'. If 'top' is the active layer,
441 specifying a backing file string is an error. This
442 filename is not validated.
444 If a pathname string is such that it cannot be
445 resolved by QEMU, that means that subsequent QMP or
446 HMP commands must use node-names for the image in
447 question, as filename lookup methods will fail.
449 If not specified, QEMU will automatically determine
450 the backing file string to use, or error out if
451 there is no obvious choice. Care should be taken
452 when specifying the string, to specify a valid
453 filename or protocol.
454 (json-string, optional) (Since 2.1)
456 If top == base, that is an error.
457 If top == active, the job will not be completed by itself,
458 user needs to complete the job with the block-job-complete
459 command after getting the ready event. (Since 2.0)
461 If the base image is smaller than top, then the base image
462 will be resized to be the same size as top. If top is
463 smaller than the base image, the base will not be
464 truncated. If you want the base image size to match the
465 size of the smaller top, you can safely truncate it
466 yourself once the commit operation successfully completes.
468 - "speed": the maximum speed, in bytes per second (json-int, optional)
473 -> { "execute": "block-commit", "arguments": { "device": "virtio0",
474 "top": "/tmp/snap1.qcow2" } }
480 Start a point-in-time copy of a block device to a new destination. The
481 status of ongoing drive-backup operations can be checked with
482 query-block-jobs where the BlockJobInfo.type field has the value 'backup'.
483 The operation can be stopped before it has completed using the
484 block-job-cancel command.
488 - "job-id": Identifier for the newly-created block job. If omitted,
489 the device name will be used. (json-string, optional)
490 - "device": the device name or node-name of a root node which should be copied.
492 - "target": the target of the new image. If the file exists, or if it is a
493 device, the existing file/device will be used as the new
494 destination. If it does not exist, a new file will be created.
496 - "format": the format of the new destination, default is to probe if 'mode' is
497 'existing', else the format of the source
498 (json-string, optional)
499 - "sync": what parts of the disk image should be copied to the destination;
500 possibilities include "full" for all the disk, "top" for only the sectors
501 allocated in the topmost image, "incremental" for only the dirty sectors in
502 the bitmap, or "none" to only replicate new I/O (MirrorSyncMode).
503 - "bitmap": dirty bitmap name for sync==incremental. Must be present if sync
504 is "incremental", must NOT be present otherwise.
505 - "mode": whether and how QEMU should create a new image
506 (NewImageMode, optional, default 'absolute-paths')
507 - "speed": the maximum speed, in bytes per second (json-int, optional)
508 - "compress": true to compress data, if the target format supports it.
509 (json-bool, optional, default false)
510 - "on-source-error": the action to take on an error on the source, default
511 'report'. 'stop' and 'enospc' can only be used
512 if the block device supports io-status.
513 (BlockdevOnError, optional)
514 - "on-target-error": the action to take on an error on the target, default
515 'report' (no limitations, since this applies to
516 a different block device than device).
517 (BlockdevOnError, optional)
520 -> { "execute": "drive-backup", "arguments": { "device": "drive0",
522 "target": "backup.img" } }
528 The device version of drive-backup: this command takes an existing named device
533 - "job-id": Identifier for the newly-created block job. If omitted,
534 the device name will be used. (json-string, optional)
535 - "device": the device name or node-name of a root node which should be copied.
537 - "target": the name of the backup target device. (json-string)
538 - "sync": what parts of the disk image should be copied to the destination;
539 possibilities include "full" for all the disk, "top" for only the
540 sectors allocated in the topmost image, or "none" to only replicate
541 new I/O (MirrorSyncMode).
542 - "speed": the maximum speed, in bytes per second (json-int, optional)
543 - "compress": true to compress data, if the target format supports it.
544 (json-bool, optional, default false)
545 - "on-source-error": the action to take on an error on the source, default
546 'report'. 'stop' and 'enospc' can only be used
547 if the block device supports io-status.
548 (BlockdevOnError, optional)
549 - "on-target-error": the action to take on an error on the target, default
550 'report' (no limitations, since this applies to
551 a different block device than device).
552 (BlockdevOnError, optional)
555 -> { "execute": "blockdev-backup", "arguments": { "device": "src-id",
557 "target": "tgt-id" } }
560 block-dirty-bitmap-add
561 ----------------------
564 Create a dirty bitmap with a name on the device, and start tracking the writes.
568 - "node": device/node on which to create dirty bitmap (json-string)
569 - "name": name of the new dirty bitmap (json-string)
570 - "granularity": granularity to track writes with (int, optional)
574 -> { "execute": "block-dirty-bitmap-add", "arguments": { "node": "drive0",
575 "name": "bitmap0" } }
578 block-dirty-bitmap-remove
579 -------------------------
582 Stop write tracking and remove the dirty bitmap that was created with
583 block-dirty-bitmap-add.
587 - "node": device/node on which to remove dirty bitmap (json-string)
588 - "name": name of the dirty bitmap to remove (json-string)
592 -> { "execute": "block-dirty-bitmap-remove", "arguments": { "node": "drive0",
593 "name": "bitmap0" } }
596 block-dirty-bitmap-clear
597 ------------------------
600 Reset the dirty bitmap associated with a node so that an incremental backup
601 from this point in time forward will only backup clusters modified after this
606 - "node": device/node on which to remove dirty bitmap (json-string)
607 - "name": name of the dirty bitmap to remove (json-string)
611 -> { "execute": "block-dirty-bitmap-clear", "arguments": { "node": "drive0",
612 "name": "bitmap0" } }
615 blockdev-snapshot-sync
616 ----------------------
618 Synchronous snapshot of a block device. snapshot-file specifies the
619 target of the new image. If the file exists, or if it is a device, the
620 snapshot will be created in the existing file/device. If does not
621 exist, a new file will be created. format specifies the format of the
622 snapshot image, default is qcow2.
626 - "device": device name to snapshot (json-string)
627 - "node-name": graph node name to snapshot (json-string)
628 - "snapshot-file": name of new image file (json-string)
629 - "snapshot-node-name": graph node name of the new snapshot (json-string)
630 - "mode": whether and how QEMU should create the snapshot file
631 (NewImageMode, optional, default "absolute-paths")
632 - "format": format of new image (json-string, optional)
636 -> { "execute": "blockdev-snapshot-sync", "arguments": { "device": "ide-hd0",
638 "/some/place/my-image",
639 "format": "qcow2" } }
646 Create a snapshot, by installing 'node' as the backing image of
647 'overlay'. Additionally, if 'node' is associated with a block
648 device, the block device changes to using 'overlay' as its new active
653 - "node": device that will have a snapshot created (json-string)
654 - "overlay": device that will have 'node' as its backing image (json-string)
658 -> { "execute": "blockdev-add",
659 "arguments": { "driver": "qcow2",
660 "node-name": "node1534",
661 "file": { "driver": "file",
662 "filename": "hd1.qcow2" },
667 -> { "execute": "blockdev-snapshot", "arguments": { "node": "ide-hd0",
668 "overlay": "node1534" } }
671 blockdev-snapshot-internal-sync
672 -------------------------------
674 Synchronously take an internal snapshot of a block device when the format of
675 image used supports it. If the name is an empty string, or a snapshot with
676 name already exists, the operation will fail.
680 - "device": the device name or node-name of a root node to snapshot
682 - "name": name of the new snapshot (json-string)
686 -> { "execute": "blockdev-snapshot-internal-sync",
687 "arguments": { "device": "ide-hd0",
688 "name": "snapshot0" }
692 blockdev-snapshot-delete-internal-sync
693 --------------------------------------
695 Synchronously delete an internal snapshot of a block device when the format of
696 image used supports it. The snapshot is identified by name or id or both. One
697 of name or id is required. If the snapshot is not found, the operation will
702 - "device": the device name or node-name of a root node (json-string)
703 - "id": ID of the snapshot (json-string, optional)
704 - "name": name of the snapshot (json-string, optional)
708 -> { "execute": "blockdev-snapshot-delete-internal-sync",
709 "arguments": { "device": "ide-hd0",
710 "name": "snapshot0" }
726 Start mirroring a block device's writes to a new destination. target
727 specifies the target of the new image. If the file exists, or if it is
728 a device, it will be used as the new destination for writes. If it does not
729 exist, a new file will be created. format specifies the format of the
730 mirror image, default is to probe if mode='existing', else the format
735 - "job-id": Identifier for the newly-created block job. If omitted,
736 the device name will be used. (json-string, optional)
737 - "device": the device name or node-name of a root node whose writes should be
738 mirrored. (json-string)
739 - "target": name of new image file (json-string)
740 - "format": format of new image (json-string, optional)
741 - "node-name": the name of the new block driver state in the node graph
742 (json-string, optional)
743 - "replaces": the block driver node name to replace when finished
744 (json-string, optional)
745 - "mode": how an image file should be created into the target
746 file/device (NewImageMode, optional, default 'absolute-paths')
747 - "speed": maximum speed of the streaming job, in bytes per second
749 - "granularity": granularity of the dirty bitmap, in bytes (json-int, optional)
750 - "buf-size": maximum amount of data in flight from source to target, in bytes
751 (json-int, default 10M)
752 - "sync": what parts of the disk image should be copied to the destination;
753 possibilities include "full" for all the disk, "top" for only the sectors
754 allocated in the topmost image, or "none" to only replicate new I/O
756 - "on-source-error": the action to take on an error on the source
757 (BlockdevOnError, default 'report')
758 - "on-target-error": the action to take on an error on the target
759 (BlockdevOnError, default 'report')
760 - "unmap": whether the target sectors should be discarded where source has only
761 zeroes. (json-bool, optional, default true)
763 The default value of the granularity is the image cluster size clamped
764 between 4096 and 65536, if the image format defines one. If the format
765 does not define a cluster size, the default value of the granularity
771 -> { "execute": "drive-mirror", "arguments": { "device": "ide-hd0",
772 "target": "/some/place/my-image",
774 "format": "qcow2" } }
780 Start mirroring a block device's writes to another block device. target
781 specifies the target of mirror operation.
785 - "job-id": Identifier for the newly-created block job. If omitted,
786 the device name will be used. (json-string, optional)
787 - "device": The device name or node-name of a root node whose writes should be
788 mirrored (json-string)
789 - "target": device name to mirror to (json-string)
790 - "replaces": the block driver node name to replace when finished
791 (json-string, optional)
792 - "speed": maximum speed of the streaming job, in bytes per second
794 - "granularity": granularity of the dirty bitmap, in bytes (json-int, optional)
795 - "buf_size": maximum amount of data in flight from source to target, in bytes
796 (json-int, default 10M)
797 - "sync": what parts of the disk image should be copied to the destination;
798 possibilities include "full" for all the disk, "top" for only the sectors
799 allocated in the topmost image, or "none" to only replicate new I/O
801 - "on-source-error": the action to take on an error on the source
802 (BlockdevOnError, default 'report')
803 - "on-target-error": the action to take on an error on the target
804 (BlockdevOnError, default 'report')
806 The default value of the granularity is the image cluster size clamped
807 between 4096 and 65536, if the image format defines one. If the format
808 does not define a cluster size, the default value of the granularity
813 -> { "execute": "blockdev-mirror", "arguments": { "device": "ide-hd0",
822 Change the backing file in the image file metadata. This does not cause
823 QEMU to reopen the image file to reparse the backing filename (it may,
824 however, perform a reopen to change permissions from r/o -> r/w -> r/o,
825 if needed). The new backing file string is written into the image file
826 metadata, and the QEMU internal strings are updated.
830 - "image-node-name": The name of the block driver state node of the
831 image to modify. The "device" is argument is used to
832 verify "image-node-name" is in the chain described by
834 (json-string, optional)
836 - "device": The device name or node-name of the root node that owns
840 - "backing-file": The string to write as the backing file. This string is
841 not validated, so care should be taken when specifying
842 the string or the image chain may not be able to be
846 Returns: Nothing on success
847 If "device" does not exist or cannot be determined, DeviceNotFound
852 Receive a file descriptor via SCM rights and assign it a name.
856 - "fdname": file descriptor name (json-string)
860 -> { "execute": "getfd", "arguments": { "fdname": "fd1" } }
865 (1) If the name specified by the "fdname" argument already exists,
866 the file descriptor assigned to it will be closed and replaced
867 by the received file descriptor.
868 (2) The 'closefd' command can be used to explicitly close the file
869 descriptor when it is no longer needed.
874 Close a file descriptor previously passed via SCM rights.
878 - "fdname": file descriptor name (json-string)
882 -> { "execute": "closefd", "arguments": { "fdname": "fd1" } }
888 Add a file descriptor, that was passed via SCM rights, to an fd set.
892 - "fdset-id": The ID of the fd set to add the file descriptor to.
894 - "opaque": A free-form string that can be used to describe the fd.
895 (json-string, optional)
897 Return a json-object with the following information:
899 - "fdset-id": The ID of the fd set that the fd was added to. (json-int)
900 - "fd": The file descriptor that was received via SCM rights and added to the
905 -> { "execute": "add-fd", "arguments": { "fdset-id": 1 } }
906 <- { "return": { "fdset-id": 1, "fd": 3 } }
910 (1) The list of fd sets is shared by all monitor connections.
911 (2) If "fdset-id" is not specified, a new fd set will be created.
916 Remove a file descriptor from an fd set.
920 - "fdset-id": The ID of the fd set that the file descriptor belongs to.
922 - "fd": The file descriptor that is to be removed. (json-int, optional)
926 -> { "execute": "remove-fd", "arguments": { "fdset-id": 1, "fd": 3 } }
931 (1) The list of fd sets is shared by all monitor connections.
932 (2) If "fd" is not specified, all file descriptors in "fdset-id" will be
938 Return information describing all fd sets.
944 -> { "execute": "query-fdsets" }
950 "opaque": "rdonly:/path/to/file"
954 "opaque": "rdwr:/path/to/file"
973 Note: The list of fd sets is shared by all monitor connections.
978 Set the password of encrypted block devices.
982 - "device": device name (json-string)
983 - "node-name": name in the block driver state graph (json-string)
984 - "password": password (json-string)
988 -> { "execute": "block_passwd", "arguments": { "device": "ide0-hd0",
989 "password": "12345" } }
992 block_set_io_throttle
995 Change I/O throttle limits for a block drive.
999 - "device": block device name (deprecated, use @id instead)
1000 (json-string, optional)
1001 - "id": the name or QOM path of the guest device (json-string, optional)
1002 - "bps": total throughput limit in bytes per second (json-int)
1003 - "bps_rd": read throughput limit in bytes per second (json-int)
1004 - "bps_wr": write throughput limit in bytes per second (json-int)
1005 - "iops": total I/O operations per second (json-int)
1006 - "iops_rd": read I/O operations per second (json-int)
1007 - "iops_wr": write I/O operations per second (json-int)
1008 - "bps_max": total throughput limit during bursts, in bytes (json-int, optional)
1009 - "bps_rd_max": read throughput limit during bursts, in bytes (json-int, optional)
1010 - "bps_wr_max": write throughput limit during bursts, in bytes (json-int, optional)
1011 - "iops_max": total I/O operations per second during bursts (json-int, optional)
1012 - "iops_rd_max": read I/O operations per second during bursts (json-int, optional)
1013 - "iops_wr_max": write I/O operations per second during bursts (json-int, optional)
1014 - "bps_max_length": maximum length of the @bps_max burst period, in seconds (json-int, optional)
1015 - "bps_rd_max_length": maximum length of the @bps_rd_max burst period, in seconds (json-int, optional)
1016 - "bps_wr_max_length": maximum length of the @bps_wr_max burst period, in seconds (json-int, optional)
1017 - "iops_max_length": maximum length of the @iops_max burst period, in seconds (json-int, optional)
1018 - "iops_rd_max_length": maximum length of the @iops_rd_max burst period, in seconds (json-int, optional)
1019 - "iops_wr_max_length": maximum length of the @iops_wr_max burst period, in seconds (json-int, optional)
1020 - "iops_size": I/O size in bytes when limiting (json-int, optional)
1021 - "group": throttle group name (json-string, optional)
1025 -> { "execute": "block_set_io_throttle", "arguments": { "id": "ide0-1-0",
1038 "bps_max_length": 60,
1045 Enable QMP capabilities.
1051 -> { "execute": "qmp_capabilities" }
1054 Note: This command must be issued before issuing any other command.
1065 Return a json-object with the following information:
1067 - "qemu": A json-object containing three integer values:
1068 - "major": QEMU's major version (json-int)
1069 - "minor": QEMU's minor version (json-int)
1070 - "micro": QEMU's micro version (json-int)
1071 - "package": package's version (json-string)
1075 -> { "execute": "query-version" }
1090 List QMP available commands.
1092 Each command is represented by a json-object, the returned value is a json-array
1095 Each json-object contain:
1097 - "name": command's name (json-string)
1101 -> { "execute": "query-commands" }
1105 "name":"query-balloon"
1108 "name":"system_powerdown"
1113 Note: This example has been shortened as the real response is too long.
1118 Return the QMP wire schema. The returned value is a json-array of
1119 named schema entities. Entities are commands, events and various
1120 types. See docs/qapi-code-gen.txt for information on their structure
1126 Show the block devices.
1128 Each block device information is stored in a json-object and the returned value
1129 is a json-array of all devices.
1131 Each json-object contain the following:
1133 - "device": device name (json-string)
1134 - "type": device type (json-string)
1135 - deprecated, retained for backward compatibility
1136 - Possible values: "unknown"
1137 - "removable": true if the device is removable, false otherwise (json-bool)
1138 - "locked": true if the device is locked, false otherwise (json-bool)
1139 - "tray_open": only present if removable, true if the device has a tray,
1140 and it is open (json-bool)
1141 - "inserted": only present if the device is inserted, it is a json-object
1142 containing the following:
1143 - "file": device file name (json-string)
1144 - "ro": true if read-only, false otherwise (json-bool)
1145 - "drv": driver format name (json-string)
1146 - Possible values: "blkdebug", "bochs", "cloop", "dmg",
1147 "file", "file", "ftp", "ftps", "host_cdrom",
1148 "host_device", "http", "https",
1149 "nbd", "parallels", "qcow", "qcow2", "raw",
1150 "vdi", "vmdk", "vpc", "vvfat"
1151 - "backing_file": backing file name (json-string, optional)
1152 - "backing_file_depth": number of files in the backing file chain (json-int)
1153 - "encrypted": true if encrypted, false otherwise (json-bool)
1154 - "bps": limit total bytes per second (json-int)
1155 - "bps_rd": limit read bytes per second (json-int)
1156 - "bps_wr": limit write bytes per second (json-int)
1157 - "iops": limit total I/O operations per second (json-int)
1158 - "iops_rd": limit read operations per second (json-int)
1159 - "iops_wr": limit write operations per second (json-int)
1160 - "bps_max": total max in bytes (json-int)
1161 - "bps_rd_max": read max in bytes (json-int)
1162 - "bps_wr_max": write max in bytes (json-int)
1163 - "iops_max": total I/O operations max (json-int)
1164 - "iops_rd_max": read I/O operations max (json-int)
1165 - "iops_wr_max": write I/O operations max (json-int)
1166 - "iops_size": I/O size when limiting by iops (json-int)
1167 - "detect_zeroes": detect and optimize zero writing (json-string)
1168 - Possible values: "off", "on", "unmap"
1169 - "write_threshold": write offset threshold in bytes, a event will be
1170 emitted if crossed. Zero if disabled (json-int)
1171 - "image": the detail of the image, it is a json-object containing
1173 - "filename": image file name (json-string)
1174 - "format": image format (json-string)
1175 - "virtual-size": image capacity in bytes (json-int)
1176 - "dirty-flag": true if image is not cleanly closed, not present
1177 means clean (json-bool, optional)
1178 - "actual-size": actual size on disk in bytes of the image, not
1179 present when image does not support thin
1180 provision (json-int, optional)
1181 - "cluster-size": size of a cluster in bytes, not present if image
1182 format does not support it (json-int, optional)
1183 - "encrypted": true if the image is encrypted, not present means
1184 false or the image format does not support
1185 encryption (json-bool, optional)
1186 - "backing_file": backing file name, not present means no backing
1187 file is used or the image format does not
1188 support backing file chain
1189 (json-string, optional)
1190 - "full-backing-filename": full path of the backing file, not
1191 present if it equals backing_file or no
1192 backing file is used
1193 (json-string, optional)
1194 - "backing-filename-format": the format of the backing file, not
1195 present means unknown or no backing
1196 file (json-string, optional)
1197 - "snapshots": the internal snapshot info, it is an optional list
1198 of json-object containing the following:
1199 - "id": unique snapshot id (json-string)
1200 - "name": snapshot name (json-string)
1201 - "vm-state-size": size of the VM state in bytes (json-int)
1202 - "date-sec": UTC date of the snapshot in seconds (json-int)
1203 - "date-nsec": fractional part in nanoseconds to be used with
1205 - "vm-clock-sec": VM clock relative to boot in seconds
1207 - "vm-clock-nsec": fractional part in nanoseconds to be used
1208 with vm-clock-sec (json-int)
1209 - "backing-image": the detail of the backing image, it is an
1210 optional json-object only present when a
1211 backing image present for this image
1213 - "io-status": I/O operation status, only present if the device supports it
1214 and the VM is configured to stop on errors. It's always reset
1215 to "ok" when the "cont" command is issued (json_string, optional)
1216 - Possible values: "ok", "failed", "nospace"
1220 -> { "execute": "query-block" }
1225 "device":"ide0-hd0",
1232 "file":"disks/test.qcow2",
1233 "backing_file_depth":1,
1247 "detect_zeroes": "on",
1248 "write_threshold": 0,
1250 "filename":"disks/test.qcow2",
1252 "virtual-size":2048000,
1253 "backing_file":"base.qcow2",
1254 "full-backing-filename":"disks/base.qcow2",
1255 "backing-filename-format":"qcow2",
1259 "name": "snapshot1",
1261 "date-sec": 10000200,
1263 "vm-clock-sec": 206,
1268 "filename":"disks/base.qcow2",
1270 "virtual-size":2048000
1278 "device":"ide1-cd0",
1301 Show block device statistics.
1303 Each device statistic information is stored in a json-object and the returned
1304 value is a json-array of all devices.
1306 Each json-object contain the following:
1308 - "device": device name (json-string)
1309 - "stats": A json-object with the statistics information, it contains:
1310 - "rd_bytes": bytes read (json-int)
1311 - "wr_bytes": bytes written (json-int)
1312 - "rd_operations": read operations (json-int)
1313 - "wr_operations": write operations (json-int)
1314 - "flush_operations": cache flush operations (json-int)
1315 - "wr_total_time_ns": total time spend on writes in nano-seconds (json-int)
1316 - "rd_total_time_ns": total time spend on reads in nano-seconds (json-int)
1317 - "flush_total_time_ns": total time spend on cache flushes in nano-seconds (json-int)
1318 - "wr_highest_offset": The offset after the greatest byte written to the
1319 BlockDriverState since it has been opened (json-int)
1320 - "rd_merged": number of read requests that have been merged into
1321 another request (json-int)
1322 - "wr_merged": number of write requests that have been merged into
1323 another request (json-int)
1324 - "idle_time_ns": time since the last I/O operation, in
1325 nanoseconds. If the field is absent it means
1326 that there haven't been any operations yet
1327 (json-int, optional)
1328 - "failed_rd_operations": number of failed read operations
1330 - "failed_wr_operations": number of failed write operations
1332 - "failed_flush_operations": number of failed flush operations
1334 - "invalid_rd_operations": number of invalid read operations
1336 - "invalid_wr_operations": number of invalid write operations
1338 - "invalid_flush_operations": number of invalid flush operations
1340 - "account_invalid": whether invalid operations are included in
1341 the last access statistics (json-bool)
1342 - "account_failed": whether failed operations are included in the
1343 latency and last access statistics
1345 - "timed_stats": A json-array containing statistics collected in
1346 specific intervals, with the following members:
1347 - "interval_length": interval used for calculating the
1348 statistics, in seconds (json-int)
1349 - "min_rd_latency_ns": minimum latency of read operations in
1350 the defined interval, in nanoseconds
1352 - "min_wr_latency_ns": minimum latency of write operations in
1353 the defined interval, in nanoseconds
1355 - "min_flush_latency_ns": minimum latency of flush operations
1356 in the defined interval, in
1357 nanoseconds (json-int)
1358 - "max_rd_latency_ns": maximum latency of read operations in
1359 the defined interval, in nanoseconds
1361 - "max_wr_latency_ns": maximum latency of write operations in
1362 the defined interval, in nanoseconds
1364 - "max_flush_latency_ns": maximum latency of flush operations
1365 in the defined interval, in
1366 nanoseconds (json-int)
1367 - "avg_rd_latency_ns": average latency of read operations in
1368 the defined interval, in nanoseconds
1370 - "avg_wr_latency_ns": average latency of write operations in
1371 the defined interval, in nanoseconds
1373 - "avg_flush_latency_ns": average latency of flush operations
1374 in the defined interval, in
1375 nanoseconds (json-int)
1376 - "avg_rd_queue_depth": average number of pending read
1377 operations in the defined interval
1379 - "avg_wr_queue_depth": average number of pending write
1380 operations in the defined interval
1382 - "parent": Contains recursively the statistics of the underlying
1383 protocol (e.g. the host file for a qcow2 image). If there is
1384 no underlying protocol, this field is omitted
1385 (json-object, optional)
1389 -> { "execute": "query-blockstats" }
1393 "device":"ide0-hd0",
1396 "wr_highest_offset":3686448128,
1398 "wr_operations":751,
1399 "rd_bytes":122567168,
1400 "rd_operations":36772
1401 "wr_total_times_ns":313253456
1402 "rd_total_times_ns":3465673657
1403 "flush_total_times_ns":49653
1404 "flush_operations":61,
1407 "idle_time_ns":2953431879,
1408 "account_invalid":true,
1409 "account_failed":false
1413 "wr_highest_offset":2821110784,
1415 "wr_operations":692,
1416 "rd_bytes":122739200,
1417 "rd_operations":36604
1418 "flush_operations":51,
1419 "wr_total_times_ns":313253456
1420 "rd_total_times_ns":3465673657
1421 "flush_total_times_ns":49653,
1424 "idle_time_ns":2953431879,
1425 "account_invalid":true,
1426 "account_failed":false
1430 "device":"ide1-cd0",
1432 "wr_highest_offset":0,
1437 "flush_operations":0,
1438 "wr_total_times_ns":0
1439 "rd_total_times_ns":0
1440 "flush_total_times_ns":0,
1443 "account_invalid":false,
1444 "account_failed":false
1450 "wr_highest_offset":0,
1455 "flush_operations":0,
1456 "wr_total_times_ns":0
1457 "rd_total_times_ns":0
1458 "flush_total_times_ns":0,
1461 "account_invalid":false,
1462 "account_failed":false
1468 "wr_highest_offset":0,
1473 "flush_operations":0,
1474 "wr_total_times_ns":0
1475 "rd_total_times_ns":0
1476 "flush_total_times_ns":0,
1479 "account_invalid":false,
1480 "account_failed":false
1486 query-command-line-options
1487 --------------------------
1489 Show command line option schema.
1491 Return a json-array of command line option schema for all options (or for
1492 the given option), returning an error if the given option doesn't exist.
1494 Each array entry contains the following:
1496 - "option": option name (json-string)
1497 - "parameters": a json-array describes all parameters of the option:
1498 - "name": parameter name (json-string)
1499 - "type": parameter type (one of 'string', 'boolean', 'number',
1501 - "help": human readable description of the parameter
1502 (json-string, optional)
1503 - "default": default value string for the parameter
1504 (json-string, optional)
1508 -> { "execute": "query-command-line-options", "arguments": { "option": "option-rom" } }
1517 "name": "bootindex",
1521 "option": "option-rom"
1529 Return information about the TPM device.
1535 -> { "execute": "query-tpm" }
1538 { "model": "tpm-tis",
1540 { "type": "passthrough",
1542 { "cancel-path": "/sys/class/misc/tpm0/device/cancel",
1554 Return a list of supported TPM models.
1560 -> { "execute": "query-tpm-models" }
1561 <- { "return": [ "tpm-tis" ] }
1566 Return a list of supported TPM types.
1572 -> { "execute": "query-tpm-types" }
1573 <- { "return": [ "passthrough" ] }
1582 - "id": the chardev's ID, must be unique (json-string)
1583 - "backend": chardev backend type + parameters
1587 -> { "execute" : "chardev-add",
1588 "arguments" : { "id" : "foo",
1589 "backend" : { "type" : "null", "data" : {} } } }
1592 -> { "execute" : "chardev-add",
1593 "arguments" : { "id" : "bar",
1594 "backend" : { "type" : "file",
1595 "data" : { "out" : "/tmp/bar.log" } } } }
1598 -> { "execute" : "chardev-add",
1599 "arguments" : { "id" : "baz",
1600 "backend" : { "type" : "pty", "data" : {} } } }
1601 <- { "return": { "pty" : "/dev/pty/42" } }
1610 - "id": the chardev's ID, must exist and not be in use (json-string)
1614 -> { "execute": "chardev-remove", "arguments": { "id" : "foo" } }
1620 Show rx-filter information.
1622 Returns a json-array of rx-filter information for all NICs (or for the
1623 given NIC), returning an error if the given NIC doesn't exist, or
1624 given NIC doesn't support rx-filter querying, or given net client
1627 The query will clear the event notification flag of each NIC, then qemu
1628 will start to emit event to QMP monitor.
1630 Each array entry contains the following:
1632 - "name": net client name (json-string)
1633 - "promiscuous": promiscuous mode is enabled (json-bool)
1634 - "multicast": multicast receive state (one of 'normal', 'none', 'all')
1635 - "unicast": unicast receive state (one of 'normal', 'none', 'all')
1636 - "vlan": vlan receive state (one of 'normal', 'none', 'all') (Since 2.0)
1637 - "broadcast-allowed": allow to receive broadcast (json-bool)
1638 - "multicast-overflow": multicast table is overflowed (json-bool)
1639 - "unicast-overflow": unicast table is overflowed (json-bool)
1640 - "main-mac": main macaddr string (json-string)
1641 - "vlan-table": a json-array of active vlan id
1642 - "unicast-table": a json-array of unicast macaddr string
1643 - "multicast-table": a json-array of multicast macaddr string
1647 -> { "execute": "query-rx-filter", "arguments": { "name": "vnet0" } }
1650 "promiscuous": true,
1652 "main-mac": "52:54:00:12:34:56",
1653 "unicast": "normal",
1661 "multicast": "normal",
1662 "multicast-overflow": false,
1663 "unicast-overflow": false,
1664 "multicast-table": [
1665 "01:00:5e:00:00:01",
1666 "33:33:00:00:00:01",
1669 "broadcast-allowed": false
1679 This command is still a work in progress. It doesn't support all
1680 block drivers among other things. Stay away from it unless you want
1681 to help with its development.
1683 For the arguments, see the QAPI schema documentation of BlockdevOptions.
1687 -> { "execute": "blockdev-add",
1688 "arguments": { "driver": "qcow2",
1689 "file": { "driver": "file",
1690 "filename": "test.qcow2" } } }
1695 -> { "execute": "blockdev-add",
1698 "node-name": "my_disk",
1706 "filename": "/tmp/test.qcow2"
1712 "filename": "/dev/fdset/4"
1724 Deletes a block device that has been added using blockdev-add.
1725 The command will fail if the node is attached to a device or is
1726 otherwise being used.
1728 This command is still a work in progress and is considered
1729 experimental. Stay away from it unless you want to help with its
1734 - "node-name": Name of the graph node to delete (json-string)
1738 -> { "execute": "blockdev-add",
1741 "node-name": "node0",
1744 "filename": "test.qcow2"
1751 -> { "execute": "x-blockdev-del",
1752 "arguments": { "node-name": "node0" }
1759 Opens a block device's tray. If there is a block driver state tree inserted as a
1760 medium, it will become inaccessible to the guest (but it will remain associated
1761 to the block device, so closing the tray will make it accessible again).
1763 If the tray was already open before, this will be a no-op.
1765 Once the tray opens, a DEVICE_TRAY_MOVED event is emitted. There are cases in
1766 which no such event will be generated, these include:
1767 - if the guest has locked the tray, @force is false and the guest does not
1768 respond to the eject request
1769 - if the BlockBackend denoted by @device does not have a guest device attached
1771 - if the guest device does not have an actual tray and is empty, for instance
1772 for floppy disk drives
1776 - "device": block device name (deprecated, use @id instead)
1777 (json-string, optional)
1778 - "id": the name or QOM path of the guest device (json-string, optional)
1779 - "force": if false (the default), an eject request will be sent to the guest if
1780 it has locked the tray (and the tray will not be opened immediately);
1781 if true, the tray will be opened regardless of whether it is locked
1782 (json-bool, optional)
1786 -> { "execute": "blockdev-open-tray",
1787 "arguments": { "id": "ide0-1-0" } }
1789 <- { "timestamp": { "seconds": 1418751016,
1790 "microseconds": 716996 },
1791 "event": "DEVICE_TRAY_MOVED",
1792 "data": { "device": "ide1-cd0",
1794 "tray-open": true } }
1801 Closes a block device's tray. If there is a block driver state tree associated
1802 with the block device (which is currently ejected), that tree will be loaded as
1805 If the tray was already closed before, this will be a no-op.
1809 - "device": block device name (deprecated, use @id instead)
1810 (json-string, optional)
1811 - "id": the name or QOM path of the guest device (json-string, optional)
1815 -> { "execute": "blockdev-close-tray",
1816 "arguments": { "id": "ide0-1-0" } }
1818 <- { "timestamp": { "seconds": 1418751345,
1819 "microseconds": 272147 },
1820 "event": "DEVICE_TRAY_MOVED",
1821 "data": { "device": "ide1-cd0",
1823 "tray-open": false } }
1827 x-blockdev-remove-medium
1828 ------------------------
1830 Removes a medium (a block driver state tree) from a block device. That block
1831 device's tray must currently be open (unless there is no attached guest device).
1833 If the tray is open and there is no medium inserted, this will be a no-op.
1835 This command is still a work in progress and is considered experimental.
1836 Stay away from it unless you want to help with its development.
1840 - "device": block device name (deprecated, use @id instead)
1841 (json-string, optional)
1842 - "id": the name or QOM path of the guest device (json-string, optional)
1846 -> { "execute": "x-blockdev-remove-medium",
1847 "arguments": { "id": "ide0-1-0" } }
1849 <- { "error": { "class": "GenericError",
1850 "desc": "Tray of device 'ide0-1-0' is not open" } }
1852 -> { "execute": "blockdev-open-tray",
1853 "arguments": { "id": "ide0-1-0" } }
1855 <- { "timestamp": { "seconds": 1418751627,
1856 "microseconds": 549958 },
1857 "event": "DEVICE_TRAY_MOVED",
1858 "data": { "device": "ide1-cd0",
1860 "tray-open": true } }
1864 -> { "execute": "x-blockdev-remove-medium",
1865 "arguments": { "device": "ide0-1-0" } }
1869 x-blockdev-insert-medium
1870 ------------------------
1872 Inserts a medium (a block driver state tree) into a block device. That block
1873 device's tray must currently be open (unless there is no attached guest device)
1874 and there must be no medium inserted already.
1876 This command is still a work in progress and is considered experimental.
1877 Stay away from it unless you want to help with its development.
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 - "node-name": root node of the BDS tree to insert into the block device
1888 -> { "execute": "blockdev-add",
1889 "arguments": { { "node-name": "node0",
1891 "file": { "driver": "file",
1892 "filename": "fedora.iso" } } }
1896 -> { "execute": "x-blockdev-insert-medium",
1897 "arguments": { "id": "ide0-1-0",
1898 "node-name": "node0" } }
1905 Dynamically reconfigure the block driver state graph. It can be used
1906 to add, remove, insert or replace a graph node. Currently only the
1907 Quorum driver implements this feature to add or remove its child. This
1908 is useful to fix a broken quorum child.
1910 If @node is specified, it will be inserted under @parent. @child
1911 may not be specified in this case. If both @parent and @child are
1912 specified but @node is not, @child will be detached from @parent.
1915 - "parent": the id or name of the parent node (json-string)
1916 - "child": the name of a child under the given parent node (json-string, optional)
1917 - "node": the name of the node that will be added (json-string, optional)
1919 Note: this command is experimental, and not a stable API. It doesn't
1920 support all kinds of operations, all kinds of children, nor all block
1923 Warning: The data in a new quorum child MUST be consistent with that of
1924 the rest of the array.
1928 Add a new node to a quorum
1929 -> { "execute": "blockdev-add",
1930 "arguments": { "driver": "raw",
1931 "node-name": "new_node",
1932 "file": { "driver": "file",
1933 "filename": "test.raw" } } }
1935 -> { "execute": "x-blockdev-change",
1936 "arguments": { "parent": "disk1",
1937 "node": "new_node" } }
1940 Delete a quorum's node
1941 -> { "execute": "x-blockdev-change",
1942 "arguments": { "parent": "disk1",
1943 "child": "children.1" } }
1946 query-named-block-nodes
1947 -----------------------
1949 Return a list of BlockDeviceInfo for all the named block driver nodes
1953 -> { "execute": "query-named-block-nodes" }
1954 <- { "return": [ { "ro":false,
1957 "file":"disks/test.qcow2",
1958 "node-name": "my-node",
1959 "backing_file_depth":1,
1973 "write_threshold": 0,
1975 "filename":"disks/test.qcow2",
1977 "virtual-size":2048000,
1978 "backing_file":"base.qcow2",
1979 "full-backing-filename":"disks/base.qcow2",
1980 "backing-filename-format":"qcow2",
1984 "name": "snapshot1",
1986 "date-sec": 10000200,
1988 "vm-clock-sec": 206,
1993 "filename":"disks/base.qcow2",
1995 "virtual-size":2048000
1999 blockdev-change-medium
2000 ----------------------
2002 Changes the medium inserted into a block device by ejecting the current medium
2003 and loading a new image file which is inserted as the new medium.
2007 - "device": block device name (deprecated, use @id instead)
2008 (json-string, optional)
2009 - "id": the name or QOM path of the guest device (json-string, optional)
2010 - "filename": filename of the new image (json-string)
2011 - "format": format of the new image (json-string, optional)
2012 - "read-only-mode": new read-only mode (json-string, optional)
2013 - Possible values: "retain" (default), "read-only", "read-write"
2017 1. Change a removable medium
2019 -> { "execute": "blockdev-change-medium",
2020 "arguments": { "id": "ide0-1-0",
2021 "filename": "/srv/images/Fedora-12-x86_64-DVD.iso",
2025 2. Load a read-only medium into a writable drive
2027 -> { "execute": "blockdev-change-medium",
2028 "arguments": { "id": "floppyA",
2029 "filename": "/srv/images/ro.img",
2031 "read-only-mode": "retain" } }
2034 { "class": "GenericError",
2035 "desc": "Could not open '/srv/images/ro.img': Permission denied" } }
2037 -> { "execute": "blockdev-change-medium",
2038 "arguments": { "id": "floppyA",
2039 "filename": "/srv/images/ro.img",
2041 "read-only-mode": "read-only" } }
2048 Show memory devices information.
2053 -> { "execute": "query-memdev" }
2060 "host-nodes": [0, 1],
2069 "host-nodes": [2, 3],
2070 "policy": "preferred"
2075 query-memory-devices
2076 --------------------
2078 Return a list of memory devices.
2081 -> { "execute": "query-memory-devices" }
2082 <- { "return": [ { "data":
2083 { "addr": 5368709120,
2084 "hotpluggable": true,
2087 "memdev": "/objects/memX",
2094 query-acpi-ospm-status
2095 ----------------------
2097 Return list of ACPIOSTInfo for devices that support status reporting
2098 via ACPI _OST method.
2101 -> { "execute": "query-acpi-ospm-status" }
2102 <- { "return": [ { "device": "d1", "slot": "0", "slot-type": "DIMM", "source": 1, "status": 0},
2103 { "slot": "1", "slot-type": "DIMM", "source": 0, "status": 0},
2104 { "slot": "2", "slot-type": "DIMM", "source": 0, "status": 0},
2105 { "slot": "3", "slot-type": "DIMM", "source": 0, "status": 0}
2108 rtc-reset-reinjection
2109 ---------------------
2111 Reset the RTC interrupt reinjection backlog.
2117 -> { "execute": "rtc-reset-reinjection" }
2120 trace-event-get-state
2121 ---------------------
2123 Query the state of events.
2127 - "name": Event name pattern (json-string).
2128 - "vcpu": The vCPU to query, any vCPU by default (json-int, optional).
2130 An event is returned if:
2131 - its name matches the "name" pattern, and
2132 - if "vcpu" is given, the event has the "vcpu" property.
2134 Therefore, if "vcpu" is given, the operation will only match per-vCPU events,
2135 returning their state on the specified vCPU. Special case: if "name" is an exact
2136 match, "vcpu" is given and the event does not have the "vcpu" property, an error
2141 -> { "execute": "trace-event-get-state", "arguments": { "name": "qemu_memalign" } }
2142 <- { "return": [ { "name": "qemu_memalign", "state": "disabled" } ] }
2144 trace-event-set-state
2145 ---------------------
2147 Set the state of events.
2151 - "name": Event name pattern (json-string).
2152 - "enable": Whether to enable or disable the event (json-bool).
2153 - "ignore-unavailable": Whether to ignore errors for events that cannot be
2154 changed (json-bool, optional).
2155 - "vcpu": The vCPU to act upon, all vCPUs by default (json-int, optional).
2157 An event's state is modified if:
2158 - its name matches the "name" pattern, and
2159 - if "vcpu" is given, the event has the "vcpu" property.
2161 Therefore, if "vcpu" is given, the operation will only match per-vCPU events,
2162 setting their state on the specified vCPU. Special case: if "name" is an exact
2163 match, "vcpu" is given and the event does not have the "vcpu" property, an error
2168 -> { "execute": "trace-event-set-state", "arguments": { "name": "qemu_memalign", "enable": "true" } }
2174 Send input event to guest.
2178 - "device": display device (json-string, optional)
2179 - "head": display head (json-int, optional)
2180 - "events": list of input events
2182 The consoles are visible in the qom tree, under
2183 /backend/console[$index]. They have a device link and head property, so
2184 it is possible to map which console belongs to which device and display.
2188 Press left mouse button.
2190 -> { "execute": "input-send-event",
2191 "arguments": { "device": "video0",
2192 "events": [ { "type": "btn",
2193 "data" : { "down": true, "button": "left" } } ] } }
2196 -> { "execute": "input-send-event",
2197 "arguments": { "device": "video0",
2198 "events": [ { "type": "btn",
2199 "data" : { "down": false, "button": "left" } } ] } }
2206 -> { "execute": "input-send-event",
2207 "arguments": { "events": [
2208 { "type": "key", "data" : { "down": true,
2209 "key": {"type": "qcode", "data": "ctrl" } } },
2210 { "type": "key", "data" : { "down": true,
2211 "key": {"type": "qcode", "data": "alt" } } },
2212 { "type": "key", "data" : { "down": true,
2213 "key": {"type": "qcode", "data": "delete" } } } ] } }
2218 Move mouse pointer to absolute coordinates (20000, 400).
2220 -> { "execute": "input-send-event" ,
2221 "arguments": { "events": [
2222 { "type": "abs", "data" : { "axis": "x", "value" : 20000 } },
2223 { "type": "abs", "data" : { "axis": "y", "value" : 400 } } ] } }
2226 block-set-write-threshold
2229 Change the write threshold for a block drive. The threshold is an offset,
2230 thus must be non-negative. Default is no write threshold.
2231 Setting the threshold to zero disables it.
2235 - "node-name": the node name in the block driver state graph (json-string)
2236 - "write-threshold": the write threshold in bytes (json-int)
2240 -> { "execute": "block-set-write-threshold",
2241 "arguments": { "node-name": "mydev",
2242 "write-threshold": 17179869184 } }
2250 - "name": switch name
2254 -> { "execute": "query-rocker", "arguments": { "name": "sw1" } }
2255 <- { "return": {"name": "sw1", "ports": 2, "id": 1327446905938}}
2257 Show rocker switch ports
2258 ------------------------
2262 - "name": switch name
2266 -> { "execute": "query-rocker-ports", "arguments": { "name": "sw1" } }
2267 <- { "return": [ {"duplex": "full", "enabled": true, "name": "sw1.1",
2268 "autoneg": "off", "link-up": true, "speed": 10000},
2269 {"duplex": "full", "enabled": true, "name": "sw1.2",
2270 "autoneg": "off", "link-up": true, "speed": 10000}
2273 Show rocker switch OF-DPA flow tables
2274 -------------------------------------
2278 - "name": switch name
2279 - "tbl-id": (optional) flow table ID
2283 -> { "execute": "query-rocker-of-dpa-flows", "arguments": { "name": "sw1" } }
2284 <- { "return": [ {"key": {"in-pport": 0, "priority": 1, "tbl-id": 0},
2287 "action": {"goto-tbl": 10},
2288 "mask": {"in-pport": 4294901760}
2293 Show rocker OF-DPA group tables
2294 -------------------------------
2298 - "name": switch name
2299 - "type": (optional) group type
2303 -> { "execute": "query-rocker-of-dpa-groups", "arguments": { "name": "sw1" } }
2304 <- { "return": [ {"type": 0, "out-pport": 2, "pport": 2, "vlan-id": 3841,
2305 "pop-vlan": 1, "id": 251723778},
2306 {"type": 0, "out-pport": 0, "pport": 0, "vlan-id": 3841,
2307 "pop-vlan": 1, "id": 251723776},
2308 {"type": 0, "out-pport": 1, "pport": 1, "vlan-id": 3840,
2309 "pop-vlan": 1, "id": 251658241},
2310 {"type": 0, "out-pport": 0, "pport": 0, "vlan-id": 3840,
2311 "pop-vlan": 1, "id": 251658240}
2314 query-gic-capabilities
2317 Return a list of GICCapability objects, describing supported GIC
2318 (Generic Interrupt Controller) versions.
2324 -> { "execute": "query-gic-capabilities" }
2325 <- { "return": [{ "version": 2, "emulated": true, "kernel": false },
2326 { "version": 3, "emulated": false, "kernel": true } ] }
2328 Show existing/possible CPUs
2329 ---------------------------
2333 Example for pseries machine type started with
2334 -smp 2,cores=2,maxcpus=4 -cpu POWER8:
2336 -> { "execute": "query-hotpluggable-cpus" }
2338 { "props": { "core-id": 8 }, "type": "POWER8-spapr-cpu-core",
2340 { "props": { "core-id": 0 }, "type": "POWER8-spapr-cpu-core",
2341 "vcpus-count": 1, "qom-path": "/machine/unattached/device[0]"}
2344 Example for pc machine type started with
2346 -> { "execute": "query-hotpluggable-cpus" }
2349 "type": "qemu64-x86_64-cpu", "vcpus-count": 1,
2350 "props": {"core-id": 0, "socket-id": 1, "thread-id": 0}
2353 "qom-path": "/machine/unattached/device[0]",
2354 "type": "qemu64-x86_64-cpu", "vcpus-count": 1,
2355 "props": {"core-id": 0, "socket-id": 0, "thread-id": 0}