target-i386: Fix eflags.TF/#DB handling of syscall/sysret insns
[qemu/ar7.git] / docs / qmp-commands.txt
blobabf210a59657fe5871faab3d40f2d44b921668eb
1                         QMP Supported Commands
2                         ----------------------
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
42        QEMU is available
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)
50 2. Regular Commands
51 ===================
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.
56 quit
57 ----
59 Quit the emulator.
61 Arguments: None.
63 Example:
65 -> { "execute": "quit" }
66 <- { "return": {} }
68 eject
69 -----
71 Eject a removable medium.
73 Arguments:
75 - "force": force ejection (json-bool, optional)
76 - "device": block device name (deprecated, use @id instead)
77             (json-string, optional)
78 - "id": the name or QOM path of the guest device (json-string, optional)
80 Example:
82 -> { "execute": "eject", "arguments": { "id": "ide0-1-0" } }
83 <- { "return": {} }
85 Note: The "force" argument defaults to false.
87 change
88 ------
90 Change a removable medium or VNC configuration.
92 Arguments:
94 - "device": device name (json-string)
95 - "target": filename or item (json-string)
96 - "arg": additional argument (json-string, optional)
98 Examples:
100 1. Change a removable medium
102 -> { "execute": "change",
103              "arguments": { "device": "ide1-cd0",
104                             "target": "/srv/images/Fedora-12-x86_64-DVD.iso" } }
105 <- { "return": {} }
107 2. Change VNC password
109 -> { "execute": "change",
110              "arguments": { "device": "vnc", "target": "password",
111                             "arg": "foobar1" } }
112 <- { "return": {} }
114 screendump
115 ----------
117 Save screen into PPM image.
119 Arguments:
121 - "filename": file path (json-string)
123 Example:
125 -> { "execute": "screendump", "arguments": { "filename": "/tmp/image" } }
126 <- { "return": {} }
128 stop
129 ----
131 Stop the emulator.
133 Arguments: None.
135 Example:
137 -> { "execute": "stop" }
138 <- { "return": {} }
140 cont
141 ----
143 Resume emulation.
145 Arguments: None.
147 Example:
149 -> { "execute": "cont" }
150 <- { "return": {} }
152 system_wakeup
153 -------------
155 Wakeup guest from suspend.
157 Arguments: None.
159 Example:
161 -> { "execute": "system_wakeup" }
162 <- { "return": {} }
164 system_reset
165 ------------
167 Reset the system.
169 Arguments: None.
171 Example:
173 -> { "execute": "system_reset" }
174 <- { "return": {} }
176 system_powerdown
177 ----------------
179 Send system power down event.
181 Arguments: None.
183 Example:
185 -> { "execute": "system_powerdown" }
186 <- { "return": {} }
188 device_add
189 ----------
191 Add a device.
193 Arguments:
195 - "driver": the name of the new device's driver (json-string)
196 - "bus": the device's parent bus (device tree path, json-string, optional)
197 - "id": the device's ID, must be unique (json-string)
198 - device properties
200 Example:
202 -> { "execute": "device_add", "arguments": { "driver": "e1000", "id": "net1" } }
203 <- { "return": {} }
205 Notes:
207 (1) For detailed information about this command, please refer to the
208     'docs/qdev-device-use.txt' file.
210 (2) It's possible to list device properties by running QEMU with the
211     "-device DEVICE,\?" command-line argument, where DEVICE is the device's name
213 device_del
214 ----------
216 Remove a device.
218 Arguments:
220 - "id": the device's ID or QOM path (json-string)
222 Example:
224 -> { "execute": "device_del", "arguments": { "id": "net1" } }
225 <- { "return": {} }
227 Example:
229 -> { "execute": "device_del", "arguments": { "id": "/machine/peripheral-anon/device[0]" } }
230 <- { "return": {} }
232 send-key
233 ----------
235 Send keys to VM.
237 Arguments:
239 keys array:
240     - "key": key sequence (a json-array of key union values,
241              union can be number or qcode enum)
243 - hold-time: time to delay key up events, milliseconds. Defaults to 100
244              (json-int, optional)
246 Example:
248 -> { "execute": "send-key",
249      "arguments": { "keys": [ { "type": "qcode", "data": "ctrl" },
250                               { "type": "qcode", "data": "alt" },
251                               { "type": "qcode", "data": "delete" } ] } }
252 <- { "return": {} }
257 Set the default CPU.
259 Arguments:
261 - "index": the CPU's index (json-int)
263 Example:
265 -> { "execute": "cpu", "arguments": { "index": 0 } }
266 <- { "return": {} }
268 Note: CPUs' indexes are obtained with the 'query-cpus' command.
270 cpu-add
271 -------
273 Adds virtual cpu
275 Arguments:
277 - "id": cpu id (json-int)
279 Example:
281 -> { "execute": "cpu-add", "arguments": { "id": 2 } }
282 <- { "return": {} }
284 memsave
285 -------
287 Save to disk virtual memory dump starting at 'val' of size 'size'.
289 Arguments:
291 - "val": the starting address (json-int)
292 - "size": the memory size, in bytes (json-int)
293 - "filename": file path (json-string)
294 - "cpu": virtual CPU index (json-int, optional)
296 Example:
298 -> { "execute": "memsave",
299              "arguments": { "val": 10,
300                             "size": 100,
301                             "filename": "/tmp/virtual-mem-dump" } }
302 <- { "return": {} }
304 pmemsave
305 --------
307 Save to disk physical memory dump starting at 'val' of size 'size'.
309 Arguments:
311 - "val": the starting address (json-int)
312 - "size": the memory size, in bytes (json-int)
313 - "filename": file path (json-string)
315 Example:
317 -> { "execute": "pmemsave",
318              "arguments": { "val": 10,
319                             "size": 100,
320                             "filename": "/tmp/physical-mem-dump" } }
321 <- { "return": {} }
323 inject-nmi
324 ----------
326 Inject an NMI on the default CPU (x86/s390) or all CPUs (ppc64).
328 Arguments: None.
330 Example:
332 -> { "execute": "inject-nmi" }
333 <- { "return": {} }
335 Note: inject-nmi fails when the guest doesn't support injecting.
337 ringbuf-write
338 -------------
340 Write to a ring buffer character device.
342 Arguments:
344 - "device": ring buffer character device name (json-string)
345 - "data": data to write (json-string)
346 - "format": data format (json-string, optional)
347           - Possible values: "utf8" (default), "base64"
349 Example:
351 -> { "execute": "ringbuf-write",
352                 "arguments": { "device": "foo",
353                                "data": "abcdefgh",
354                                "format": "utf8" } }
355 <- { "return": {} }
357 ringbuf-read
358 -------------
360 Read from a ring buffer character device.
362 Arguments:
364 - "device": ring buffer character device name (json-string)
365 - "size": how many bytes to read at most (json-int)
366           - Number of data bytes, not number of characters in encoded data
367 - "format": data format (json-string, optional)
368           - Possible values: "utf8" (default), "base64"
369           - Naturally, format "utf8" works only when the ring buffer
370             contains valid UTF-8 text.  Invalid UTF-8 sequences get
371             replaced.  Bug: replacement doesn't work.  Bug: can screw
372             up on encountering NUL characters, after the ring buffer
373             lost data, and when reading stops because the size limit
374             is reached.
376 Example:
378 -> { "execute": "ringbuf-read",
379                 "arguments": { "device": "foo",
380                                "size": 1000,
381                                "format": "utf8" } }
382 <- {"return": "abcdefgh"}
384 xen-save-devices-state
385 -------
387 Save the state of all devices to file. The RAM and the block devices
388 of the VM are not saved by this command.
390 Arguments:
392 - "filename": the file to save the state of the devices to as binary
393 data. See xen-save-devices-state.txt for a description of the binary
394 format.
396 Example:
398 -> { "execute": "xen-save-devices-state",
399      "arguments": { "filename": "/tmp/save" } }
400 <- { "return": {} }
402 xen-load-devices-state
403 ----------------------
405 Load the state of all devices from file. The RAM and the block devices
406 of the VM are not loaded by this command.
408 Arguments:
410 - "filename": the file to load the state of the devices from as binary
411 data. See xen-save-devices-state.txt for a description of the binary
412 format.
414 Example:
416 -> { "execute": "xen-load-devices-state",
417      "arguments": { "filename": "/tmp/resume" } }
418 <- { "return": {} }
420 xen-set-global-dirty-log
421 -------
423 Enable or disable the global dirty log mode.
425 Arguments:
427 - "enable": Enable it or disable it.
429 Example:
431 -> { "execute": "xen-set-global-dirty-log",
432      "arguments": { "enable": true } }
433 <- { "return": {} }
435 migrate
436 -------
438 Migrate to URI.
440 Arguments:
442 - "blk": block migration, full disk copy (json-bool, optional)
443 - "inc": incremental disk copy (json-bool, optional)
444 - "uri": Destination URI (json-string)
446 Example:
448 -> { "execute": "migrate", "arguments": { "uri": "tcp:0:4446" } }
449 <- { "return": {} }
451 Notes:
453 (1) The 'query-migrate' command should be used to check migration's progress
454     and final result (this information is provided by the 'status' member)
455 (2) All boolean arguments default to false
456 (3) The user Monitor's "detach" argument is invalid in QMP and should not
457     be used
459 migrate_cancel
460 --------------
462 Cancel the current migration.
464 Arguments: None.
466 Example:
468 -> { "execute": "migrate_cancel" }
469 <- { "return": {} }
471 migrate-incoming
472 ----------------
474 Continue an incoming migration
476 Arguments:
478 - "uri": Source/listening URI (json-string)
480 Example:
482 -> { "execute": "migrate-incoming", "arguments": { "uri": "tcp::4446" } }
483 <- { "return": {} }
485 Notes:
487 (1) QEMU must be started with -incoming defer to allow migrate-incoming to
488     be used
489 (2) The uri format is the same as for -incoming
491 migrate-set-cache-size
492 ----------------------
494 Set cache size to be used by XBZRLE migration, the cache size will be rounded
495 down to the nearest power of 2
497 Arguments:
499 - "value": cache size in bytes (json-int)
501 Example:
503 -> { "execute": "migrate-set-cache-size", "arguments": { "value": 536870912 } }
504 <- { "return": {} }
506 migrate-start-postcopy
507 ----------------------
509 Switch an in-progress migration to postcopy mode. Ignored after the end of
510 migration (or once already in postcopy).
512 Example:
513 -> { "execute": "migrate-start-postcopy" }
514 <- { "return": {} }
516 query-migrate-cache-size
517 ------------------------
519 Show cache size to be used by XBZRLE migration
521 returns a json-object with the following information:
522 - "size" : json-int
524 Example:
526 -> { "execute": "query-migrate-cache-size" }
527 <- { "return": 67108864 }
529 migrate_set_speed
530 -----------------
532 Set maximum speed for migrations.
534 Arguments:
536 - "value": maximum speed, in bytes per second (json-int)
538 Example:
540 -> { "execute": "migrate_set_speed", "arguments": { "value": 1024 } }
541 <- { "return": {} }
543 migrate_set_downtime
544 --------------------
546 Set maximum tolerated downtime (in seconds) for migrations.
548 Arguments:
550 - "value": maximum downtime (json-number)
552 Example:
554 -> { "execute": "migrate_set_downtime", "arguments": { "value": 0.1 } }
555 <- { "return": {} }
557 x-colo-lost-heartbeat
558 --------------------
560 Tell COLO that heartbeat is lost, a failover or takeover is needed.
562 Example:
564 -> { "execute": "x-colo-lost-heartbeat" }
565 <- { "return": {} }
567 client_migrate_info
568 -------------------
570 Set migration information for remote display.  This makes the server
571 ask the client to automatically reconnect using the new parameters
572 once migration finished successfully.  Only implemented for SPICE.
574 Arguments:
576 - "protocol":     must be "spice" (json-string)
577 - "hostname":     migration target hostname (json-string)
578 - "port":         spice tcp port for plaintext channels (json-int, optional)
579 - "tls-port":     spice tcp port for tls-secured channels (json-int, optional)
580 - "cert-subject": server certificate subject (json-string, optional)
582 Example:
584 -> { "execute": "client_migrate_info",
585      "arguments": { "protocol": "spice",
586                     "hostname": "virt42.lab.kraxel.org",
587                     "port": 1234 } }
588 <- { "return": {} }
590 dump
593 Dump guest memory to file. The file can be processed with crash or gdb.
595 Arguments:
597 - "paging": do paging to get guest's memory mapping (json-bool)
598 - "protocol": destination file(started with "file:") or destination file
599               descriptor (started with "fd:") (json-string)
600 - "detach": if specified, command will return immediately, without waiting
601             for the dump to finish. The user can track progress using
602             "query-dump". (json-bool)
603 - "begin": the starting physical address. It's optional, and should be specified
604            with length together (json-int)
605 - "length": the memory size, in bytes. It's optional, and should be specified
606             with begin together (json-int)
607 - "format": the format of guest memory dump. It's optional, and can be
608             elf|kdump-zlib|kdump-lzo|kdump-snappy, but non-elf formats will
609             conflict with paging and filter, ie. begin and length (json-string)
611 Example:
613 -> { "execute": "dump-guest-memory", "arguments": { "protocol": "fd:dump" } }
614 <- { "return": {} }
616 Notes:
618 (1) All boolean arguments default to false
620 query-dump-guest-memory-capability
621 ----------
623 Show available formats for 'dump-guest-memory'
625 Example:
627 -> { "execute": "query-dump-guest-memory-capability" }
628 <- { "return": { "formats":
629                     ["elf", "kdump-zlib", "kdump-lzo", "kdump-snappy"] }
631 query-dump
632 ----------
634 Query background dump status.
636 Arguments: None.
638 Example:
640 -> { "execute": "query-dump" }
641 <- { "return": { "status": "active", "completed": 1024000,
642                  "total": 2048000 } }
644 dump-skeys
645 ----------
647 Save guest storage keys to file.
649 Arguments:
651 - "filename": file path (json-string)
653 Example:
655 -> { "execute": "dump-skeys", "arguments": { "filename": "/tmp/skeys" } }
656 <- { "return": {} }
658 netdev_add
659 ----------
661 Add host network device.
663 Arguments:
665 - "type": the device type, "tap", "user", ... (json-string)
666 - "id": the device's ID, must be unique (json-string)
667 - device options
669 Example:
671 -> { "execute": "netdev_add",
672      "arguments": { "type": "user", "id": "netdev1",
673                     "dnssearch": "example.org" } }
674 <- { "return": {} }
676 Note: The supported device options are the same ones supported by the '-netdev'
677       command-line argument, which are listed in the '-help' output or QEMU's
678       manual
680 netdev_del
681 ----------
683 Remove host network device.
685 Arguments:
687 - "id": the device's ID, must be unique (json-string)
689 Example:
691 -> { "execute": "netdev_del", "arguments": { "id": "netdev1" } }
692 <- { "return": {} }
695 object-add
696 ----------
698 Create QOM object.
700 Arguments:
702 - "qom-type": the object's QOM type, i.e. the class name (json-string)
703 - "id": the object's ID, must be unique (json-string)
704 - "props": a dictionary of object property values (optional, json-dict)
706 Example:
708 -> { "execute": "object-add", "arguments": { "qom-type": "rng-random", "id": "rng1",
709      "props": { "filename": "/dev/hwrng" } } }
710 <- { "return": {} }
712 object-del
713 ----------
715 Remove QOM object.
717 Arguments:
719 - "id": the object's ID (json-string)
721 Example:
723 -> { "execute": "object-del", "arguments": { "id": "rng1" } }
724 <- { "return": {} }
727 block_resize
728 ------------
730 Resize a block image while a guest is running.
732 Arguments:
734 - "device": the device's ID, must be unique (json-string)
735 - "node-name": the node name in the block driver state graph (json-string)
736 - "size": new size
738 Example:
740 -> { "execute": "block_resize", "arguments": { "device": "scratch", "size": 1073741824 } }
741 <- { "return": {} }
743 block-stream
744 ------------
746 Copy data from a backing file into a block device.
748 Arguments:
750 - "job-id": Identifier for the newly-created block job. If omitted,
751             the device name will be used. (json-string, optional)
752 - "device": The device name or node-name of a root node (json-string)
753 - "base": The file name of the backing image above which copying starts.
754           It cannot be set if 'base-node' is also set (json-string, optional)
755 - "base-node": the node name of the backing image above which copying starts.
756                It cannot be set if 'base' is also set.
757                (json-string, optional) (Since 2.8)
758 - "backing-file": The backing file string to write into the active layer. This
759                   filename is not validated.
761                   If a pathname string is such that it cannot be resolved by
762                   QEMU, that means that subsequent QMP or HMP commands must use
763                   node-names for the image in question, as filename lookup
764                   methods will fail.
766                   If not specified, QEMU will automatically determine the
767                   backing file string to use, or error out if there is no
768                   obvious choice.  Care should be taken when specifying the
769                   string, to specify a valid filename or protocol.
770                   (json-string, optional) (Since 2.1)
771 - "speed":  the maximum speed, in bytes per second (json-int, optional)
772 - "on-error": the action to take on an error (default 'report').  'stop' and
773               'enospc' can only be used if the block device supports io-status.
774               (json-string, optional) (Since 2.1)
776 Example:
778 -> { "execute": "block-stream", "arguments": { "device": "virtio0",
779                                                "base": "/tmp/master.qcow2" } }
780 <- { "return": {} }
782 block-commit
783 ------------
785 Live commit of data from overlay image nodes into backing nodes - i.e., writes
786 data between 'top' and 'base' into 'base'.
788 Arguments:
790 - "job-id": Identifier for the newly-created block job. If omitted,
791             the device name will be used. (json-string, optional)
792 - "device": The device name or node-name of a root node (json-string)
793 - "base": The file name of the backing image to write data into.
794           If not specified, this is the deepest backing image
795           (json-string, optional)
796 - "top":  The file name of the backing image within the image chain,
797           which contains the topmost data to be committed down. If
798           not specified, this is the active layer. (json-string, optional)
800 - backing-file:     The backing file string to write into the overlay
801                     image of 'top'.  If 'top' is the active layer,
802                     specifying a backing file string is an error. This
803                     filename is not validated.
805                     If a pathname string is such that it cannot be
806                     resolved by QEMU, that means that subsequent QMP or
807                     HMP commands must use node-names for the image in
808                     question, as filename lookup methods will fail.
810                     If not specified, QEMU will automatically determine
811                     the backing file string to use, or error out if
812                     there is no obvious choice. Care should be taken
813                     when specifying the string, to specify a valid
814                     filename or protocol.
815                     (json-string, optional) (Since 2.1)
817           If top == base, that is an error.
818           If top == active, the job will not be completed by itself,
819           user needs to complete the job with the block-job-complete
820           command after getting the ready event. (Since 2.0)
822           If the base image is smaller than top, then the base image
823           will be resized to be the same size as top.  If top is
824           smaller than the base image, the base will not be
825           truncated.  If you want the base image size to match the
826           size of the smaller top, you can safely truncate it
827           yourself once the commit operation successfully completes.
828           (json-string)
829 - "speed":  the maximum speed, in bytes per second (json-int, optional)
832 Example:
834 -> { "execute": "block-commit", "arguments": { "device": "virtio0",
835                                               "top": "/tmp/snap1.qcow2" } }
836 <- { "return": {} }
838 drive-backup
839 ------------
841 Start a point-in-time copy of a block device to a new destination.  The
842 status of ongoing drive-backup operations can be checked with
843 query-block-jobs where the BlockJobInfo.type field has the value 'backup'.
844 The operation can be stopped before it has completed using the
845 block-job-cancel command.
847 Arguments:
849 - "job-id": Identifier for the newly-created block job. If omitted,
850             the device name will be used. (json-string, optional)
851 - "device": the device name or node-name of a root node which should be copied.
852             (json-string)
853 - "target": the target of the new image. If the file exists, or if it is a
854             device, the existing file/device will be used as the new
855             destination.  If it does not exist, a new file will be created.
856             (json-string)
857 - "format": the format of the new destination, default is to probe if 'mode' is
858             'existing', else the format of the source
859             (json-string, optional)
860 - "sync": what parts of the disk image should be copied to the destination;
861   possibilities include "full" for all the disk, "top" for only the sectors
862   allocated in the topmost image, "incremental" for only the dirty sectors in
863   the bitmap, or "none" to only replicate new I/O (MirrorSyncMode).
864 - "bitmap": dirty bitmap name for sync==incremental. Must be present if sync
865             is "incremental", must NOT be present otherwise.
866 - "mode": whether and how QEMU should create a new image
867           (NewImageMode, optional, default 'absolute-paths')
868 - "speed": the maximum speed, in bytes per second (json-int, optional)
869 - "compress": true to compress data, if the target format supports it.
870               (json-bool, optional, default false)
871 - "on-source-error": the action to take on an error on the source, default
872                      'report'.  'stop' and 'enospc' can only be used
873                      if the block device supports io-status.
874                      (BlockdevOnError, optional)
875 - "on-target-error": the action to take on an error on the target, default
876                      'report' (no limitations, since this applies to
877                      a different block device than device).
878                      (BlockdevOnError, optional)
880 Example:
881 -> { "execute": "drive-backup", "arguments": { "device": "drive0",
882                                                "sync": "full",
883                                                "target": "backup.img" } }
884 <- { "return": {} }
886 blockdev-backup
887 ---------------
889 The device version of drive-backup: this command takes an existing named device
890 as backup target.
892 Arguments:
894 - "job-id": Identifier for the newly-created block job. If omitted,
895             the device name will be used. (json-string, optional)
896 - "device": the device name or node-name of a root node which should be copied.
897             (json-string)
898 - "target": the name of the backup target device. (json-string)
899 - "sync": what parts of the disk image should be copied to the destination;
900           possibilities include "full" for all the disk, "top" for only the
901           sectors allocated in the topmost image, or "none" to only replicate
902           new I/O (MirrorSyncMode).
903 - "speed": the maximum speed, in bytes per second (json-int, optional)
904 - "compress": true to compress data, if the target format supports it.
905               (json-bool, optional, default false)
906 - "on-source-error": the action to take on an error on the source, default
907                      'report'.  'stop' and 'enospc' can only be used
908                      if the block device supports io-status.
909                      (BlockdevOnError, optional)
910 - "on-target-error": the action to take on an error on the target, default
911                      'report' (no limitations, since this applies to
912                      a different block device than device).
913                      (BlockdevOnError, optional)
915 Example:
916 -> { "execute": "blockdev-backup", "arguments": { "device": "src-id",
917                                                   "sync": "full",
918                                                   "target": "tgt-id" } }
919 <- { "return": {} }
921 transaction
922 -----------
924 Atomically operate on one or more block devices.  Operations that are
925 currently supported:
927     - drive-backup
928     - blockdev-backup
929     - blockdev-snapshot-sync
930     - blockdev-snapshot-internal-sync
931     - abort
932     - block-dirty-bitmap-add
933     - block-dirty-bitmap-clear
935 Refer to the qemu/qapi-schema.json file for minimum required QEMU
936 versions for these operations.  A list of dictionaries is accepted,
937 that contains the actions to be performed.  If there is any failure
938 performing any of the operations, all operations for the group are
939 abandoned.
941 For external snapshots, the dictionary contains the device, the file to use for
942 the new snapshot, and the format.  The default format, if not specified, is
943 qcow2.
945 Each new snapshot defaults to being created by QEMU (wiping any
946 contents if the file already exists), but it is also possible to reuse
947 an externally-created file.  In the latter case, you should ensure that
948 the new image file has the same contents as the current one; QEMU cannot
949 perform any meaningful check.  Typically this is achieved by using the
950 current image file as the backing file for the new image.
952 On failure, the original disks pre-snapshot attempt will be used.
954 For internal snapshots, the dictionary contains the device and the snapshot's
955 name.  If an internal snapshot matching name already exists, the request will
956 be rejected.  Only some image formats support it, for example, qcow2, rbd,
957 and sheepdog.
959 On failure, qemu will try delete the newly created internal snapshot in the
960 transaction.  When an I/O error occurs during deletion, the user needs to fix
961 it later with qemu-img or other command.
963 Arguments:
965 actions array:
966     - "type": the operation to perform (json-string).  Possible
967               values: "drive-backup", "blockdev-backup",
968                       "blockdev-snapshot-sync",
969                       "blockdev-snapshot-internal-sync",
970                       "abort", "block-dirty-bitmap-add",
971                       "block-dirty-bitmap-clear"
972     - "data": a dictionary.  The contents depend on the value
973       of "type".  When "type" is "blockdev-snapshot-sync":
974       - "device": device name to snapshot (json-string)
975       - "node-name": graph node name to snapshot (json-string)
976       - "snapshot-file": name of new image file (json-string)
977       - "snapshot-node-name": graph node name of the new snapshot (json-string)
978       - "format": format of new image (json-string, optional)
979       - "mode": whether and how QEMU should create the snapshot file
980         (NewImageMode, optional, default "absolute-paths")
981       When "type" is "blockdev-snapshot-internal-sync":
982       - "device": the device name or node-name of a root node to snapshot
983                   (json-string)
984       - "name": name of the new snapshot (json-string)
986 Example:
988 -> { "execute": "transaction",
989      "arguments": { "actions": [
990          { "type": "blockdev-snapshot-sync", "data" : { "device": "ide-hd0",
991                                          "snapshot-file": "/some/place/my-image",
992                                          "format": "qcow2" } },
993          { "type": "blockdev-snapshot-sync", "data" : { "node-name": "myfile",
994                                          "snapshot-file": "/some/place/my-image2",
995                                          "snapshot-node-name": "node3432",
996                                          "mode": "existing",
997                                          "format": "qcow2" } },
998          { "type": "blockdev-snapshot-sync", "data" : { "device": "ide-hd1",
999                                          "snapshot-file": "/some/place/my-image2",
1000                                          "mode": "existing",
1001                                          "format": "qcow2" } },
1002          { "type": "blockdev-snapshot-internal-sync", "data" : {
1003                                          "device": "ide-hd2",
1004                                          "name": "snapshot0" } } ] } }
1005 <- { "return": {} }
1007 block-dirty-bitmap-add
1008 ----------------------
1009 Since 2.4
1011 Create a dirty bitmap with a name on the device, and start tracking the writes.
1013 Arguments:
1015 - "node": device/node on which to create dirty bitmap (json-string)
1016 - "name": name of the new dirty bitmap (json-string)
1017 - "granularity": granularity to track writes with (int, optional)
1019 Example:
1021 -> { "execute": "block-dirty-bitmap-add", "arguments": { "node": "drive0",
1022                                                    "name": "bitmap0" } }
1023 <- { "return": {} }
1025 block-dirty-bitmap-remove
1026 -------------------------
1027 Since 2.4
1029 Stop write tracking and remove the dirty bitmap that was created with
1030 block-dirty-bitmap-add.
1032 Arguments:
1034 - "node": device/node on which to remove dirty bitmap (json-string)
1035 - "name": name of the dirty bitmap to remove (json-string)
1037 Example:
1039 -> { "execute": "block-dirty-bitmap-remove", "arguments": { "node": "drive0",
1040                                                       "name": "bitmap0" } }
1041 <- { "return": {} }
1043 block-dirty-bitmap-clear
1044 ------------------------
1045 Since 2.4
1047 Reset the dirty bitmap associated with a node so that an incremental backup
1048 from this point in time forward will only backup clusters modified after this
1049 clear operation.
1051 Arguments:
1053 - "node": device/node on which to remove dirty bitmap (json-string)
1054 - "name": name of the dirty bitmap to remove (json-string)
1056 Example:
1058 -> { "execute": "block-dirty-bitmap-clear", "arguments": { "node": "drive0",
1059                                                            "name": "bitmap0" } }
1060 <- { "return": {} }
1062 blockdev-snapshot-sync
1063 ----------------------
1065 Synchronous snapshot of a block device. snapshot-file specifies the
1066 target of the new image. If the file exists, or if it is a device, the
1067 snapshot will be created in the existing file/device. If does not
1068 exist, a new file will be created. format specifies the format of the
1069 snapshot image, default is qcow2.
1071 Arguments:
1073 - "device": device name to snapshot (json-string)
1074 - "node-name": graph node name to snapshot (json-string)
1075 - "snapshot-file": name of new image file (json-string)
1076 - "snapshot-node-name": graph node name of the new snapshot (json-string)
1077 - "mode": whether and how QEMU should create the snapshot file
1078   (NewImageMode, optional, default "absolute-paths")
1079 - "format": format of new image (json-string, optional)
1081 Example:
1083 -> { "execute": "blockdev-snapshot-sync", "arguments": { "device": "ide-hd0",
1084                                                          "snapshot-file":
1085                                                         "/some/place/my-image",
1086                                                         "format": "qcow2" } }
1087 <- { "return": {} }
1089 blockdev-snapshot
1090 -----------------
1091 Since 2.5
1093 Create a snapshot, by installing 'node' as the backing image of
1094 'overlay'. Additionally, if 'node' is associated with a block
1095 device, the block device changes to using 'overlay' as its new active
1096 image.
1098 Arguments:
1100 - "node": device that will have a snapshot created (json-string)
1101 - "overlay": device that will have 'node' as its backing image (json-string)
1103 Example:
1105 -> { "execute": "blockdev-add",
1106                 "arguments": { "driver": "qcow2",
1107                                "node-name": "node1534",
1108                                "file": { "driver": "file",
1109                                          "filename": "hd1.qcow2" },
1110                                "backing": "" } }
1112 <- { "return": {} }
1114 -> { "execute": "blockdev-snapshot", "arguments": { "node": "ide-hd0",
1115                                                     "overlay": "node1534" } }
1116 <- { "return": {} }
1118 blockdev-snapshot-internal-sync
1119 -------------------------------
1121 Synchronously take an internal snapshot of a block device when the format of
1122 image used supports it.  If the name is an empty string, or a snapshot with
1123 name already exists, the operation will fail.
1125 Arguments:
1127 - "device": the device name or node-name of a root node to snapshot
1128             (json-string)
1129 - "name": name of the new snapshot (json-string)
1131 Example:
1133 -> { "execute": "blockdev-snapshot-internal-sync",
1134                 "arguments": { "device": "ide-hd0",
1135                                "name": "snapshot0" }
1136    }
1137 <- { "return": {} }
1139 blockdev-snapshot-delete-internal-sync
1140 --------------------------------------
1142 Synchronously delete an internal snapshot of a block device when the format of
1143 image used supports it.  The snapshot is identified by name or id or both.  One
1144 of name or id is required.  If the snapshot is not found, the operation will
1145 fail.
1147 Arguments:
1149 - "device": the device name or node-name of a root node (json-string)
1150 - "id": ID of the snapshot (json-string, optional)
1151 - "name": name of the snapshot (json-string, optional)
1153 Example:
1155 -> { "execute": "blockdev-snapshot-delete-internal-sync",
1156                 "arguments": { "device": "ide-hd0",
1157                                "name": "snapshot0" }
1158    }
1159 <- { "return": {
1160                    "id": "1",
1161                    "name": "snapshot0",
1162                    "vm-state-size": 0,
1163                    "date-sec": 1000012,
1164                    "date-nsec": 10,
1165                    "vm-clock-sec": 100,
1166                    "vm-clock-nsec": 20
1167      }
1168    }
1170 drive-mirror
1171 ------------
1173 Start mirroring a block device's writes to a new destination. target
1174 specifies the target of the new image. If the file exists, or if it is
1175 a device, it will be used as the new destination for writes. If it does not
1176 exist, a new file will be created. format specifies the format of the
1177 mirror image, default is to probe if mode='existing', else the format
1178 of the source.
1180 Arguments:
1182 - "job-id": Identifier for the newly-created block job. If omitted,
1183             the device name will be used. (json-string, optional)
1184 - "device": the device name or node-name of a root node whose writes should be
1185             mirrored. (json-string)
1186 - "target": name of new image file (json-string)
1187 - "format": format of new image (json-string, optional)
1188 - "node-name": the name of the new block driver state in the node graph
1189                (json-string, optional)
1190 - "replaces": the block driver node name to replace when finished
1191               (json-string, optional)
1192 - "mode": how an image file should be created into the target
1193   file/device (NewImageMode, optional, default 'absolute-paths')
1194 - "speed": maximum speed of the streaming job, in bytes per second
1195   (json-int)
1196 - "granularity": granularity of the dirty bitmap, in bytes (json-int, optional)
1197 - "buf-size": maximum amount of data in flight from source to target, in bytes
1198   (json-int, default 10M)
1199 - "sync": what parts of the disk image should be copied to the destination;
1200   possibilities include "full" for all the disk, "top" for only the sectors
1201   allocated in the topmost image, or "none" to only replicate new I/O
1202   (MirrorSyncMode).
1203 - "on-source-error": the action to take on an error on the source
1204   (BlockdevOnError, default 'report')
1205 - "on-target-error": the action to take on an error on the target
1206   (BlockdevOnError, default 'report')
1207 - "unmap": whether the target sectors should be discarded where source has only
1208   zeroes. (json-bool, optional, default true)
1210 The default value of the granularity is the image cluster size clamped
1211 between 4096 and 65536, if the image format defines one.  If the format
1212 does not define a cluster size, the default value of the granularity
1213 is 65536.
1216 Example:
1218 -> { "execute": "drive-mirror", "arguments": { "device": "ide-hd0",
1219                                                "target": "/some/place/my-image",
1220                                                "sync": "full",
1221                                                "format": "qcow2" } }
1222 <- { "return": {} }
1224 blockdev-mirror
1225 ------------
1227 Start mirroring a block device's writes to another block device. target
1228 specifies the target of mirror operation.
1230 Arguments:
1232 - "job-id": Identifier for the newly-created block job. If omitted,
1233             the device name will be used. (json-string, optional)
1234 - "device": The device name or node-name of a root node whose writes should be
1235             mirrored (json-string)
1236 - "target": device name to mirror to (json-string)
1237 - "replaces": the block driver node name to replace when finished
1238               (json-string, optional)
1239 - "speed": maximum speed of the streaming job, in bytes per second
1240   (json-int)
1241 - "granularity": granularity of the dirty bitmap, in bytes (json-int, optional)
1242 - "buf_size": maximum amount of data in flight from source to target, in bytes
1243   (json-int, default 10M)
1244 - "sync": what parts of the disk image should be copied to the destination;
1245   possibilities include "full" for all the disk, "top" for only the sectors
1246   allocated in the topmost image, or "none" to only replicate new I/O
1247   (MirrorSyncMode).
1248 - "on-source-error": the action to take on an error on the source
1249   (BlockdevOnError, default 'report')
1250 - "on-target-error": the action to take on an error on the target
1251   (BlockdevOnError, default 'report')
1253 The default value of the granularity is the image cluster size clamped
1254 between 4096 and 65536, if the image format defines one.  If the format
1255 does not define a cluster size, the default value of the granularity
1256 is 65536.
1258 Example:
1260 -> { "execute": "blockdev-mirror", "arguments": { "device": "ide-hd0",
1261                                                   "target": "target0",
1262                                                   "sync": "full" } }
1263 <- { "return": {} }
1265 change-backing-file
1266 -------------------
1267 Since: 2.1
1269 Change the backing file in the image file metadata.  This does not cause
1270 QEMU to reopen the image file to reparse the backing filename (it may,
1271 however, perform a reopen to change permissions from r/o -> r/w -> r/o,
1272 if needed). The new backing file string is written into the image file
1273 metadata, and the QEMU internal strings are updated.
1275 Arguments:
1277 - "image-node-name":    The name of the block driver state node of the
1278                         image to modify.  The "device" is argument is used to
1279                         verify "image-node-name" is in the chain described by
1280                         "device".
1281                         (json-string, optional)
1283 - "device":             The device name or node-name of the root node that owns
1284                         image-node-name.
1285                         (json-string)
1287 - "backing-file":       The string to write as the backing file.  This string is
1288                         not validated, so care should be taken when specifying
1289                         the string or the image chain may not be able to be
1290                         reopened again.
1291                         (json-string)
1293 Returns: Nothing on success
1294          If "device" does not exist or cannot be determined, DeviceNotFound
1296 balloon
1297 -------
1299 Request VM to change its memory allocation (in bytes).
1301 Arguments:
1303 - "value": New memory allocation (json-int)
1305 Example:
1307 -> { "execute": "balloon", "arguments": { "value": 536870912 } }
1308 <- { "return": {} }
1310 set_link
1311 --------
1313 Change the link status of a network adapter.
1315 Arguments:
1317 - "name": network device name (json-string)
1318 - "up": status is up (json-bool)
1320 Example:
1322 -> { "execute": "set_link", "arguments": { "name": "e1000.0", "up": false } }
1323 <- { "return": {} }
1325 getfd
1326 -----
1328 Receive a file descriptor via SCM rights and assign it a name.
1330 Arguments:
1332 - "fdname": file descriptor name (json-string)
1334 Example:
1336 -> { "execute": "getfd", "arguments": { "fdname": "fd1" } }
1337 <- { "return": {} }
1339 Notes:
1341 (1) If the name specified by the "fdname" argument already exists,
1342     the file descriptor assigned to it will be closed and replaced
1343     by the received file descriptor.
1344 (2) The 'closefd' command can be used to explicitly close the file
1345     descriptor when it is no longer needed.
1347 closefd
1348 -------
1350 Close a file descriptor previously passed via SCM rights.
1352 Arguments:
1354 - "fdname": file descriptor name (json-string)
1356 Example:
1358 -> { "execute": "closefd", "arguments": { "fdname": "fd1" } }
1359 <- { "return": {} }
1361 add-fd
1362 -------
1364 Add a file descriptor, that was passed via SCM rights, to an fd set.
1366 Arguments:
1368 - "fdset-id": The ID of the fd set to add the file descriptor to.
1369               (json-int, optional)
1370 - "opaque": A free-form string that can be used to describe the fd.
1371             (json-string, optional)
1373 Return a json-object with the following information:
1375 - "fdset-id": The ID of the fd set that the fd was added to. (json-int)
1376 - "fd": The file descriptor that was received via SCM rights and added to the
1377         fd set. (json-int)
1379 Example:
1381 -> { "execute": "add-fd", "arguments": { "fdset-id": 1 } }
1382 <- { "return": { "fdset-id": 1, "fd": 3 } }
1384 Notes:
1386 (1) The list of fd sets is shared by all monitor connections.
1387 (2) If "fdset-id" is not specified, a new fd set will be created.
1389 remove-fd
1390 ---------
1392 Remove a file descriptor from an fd set.
1394 Arguments:
1396 - "fdset-id": The ID of the fd set that the file descriptor belongs to.
1397               (json-int)
1398 - "fd": The file descriptor that is to be removed. (json-int, optional)
1400 Example:
1402 -> { "execute": "remove-fd", "arguments": { "fdset-id": 1, "fd": 3 } }
1403 <- { "return": {} }
1405 Notes:
1407 (1) The list of fd sets is shared by all monitor connections.
1408 (2) If "fd" is not specified, all file descriptors in "fdset-id" will be
1409     removed.
1411 query-fdsets
1412 -------------
1414 Return information describing all fd sets.
1416 Arguments: None
1418 Example:
1420 -> { "execute": "query-fdsets" }
1421 <- { "return": [
1422        {
1423          "fds": [
1424            {
1425              "fd": 30,
1426              "opaque": "rdonly:/path/to/file"
1427            },
1428            {
1429              "fd": 24,
1430              "opaque": "rdwr:/path/to/file"
1431            }
1432          ],
1433          "fdset-id": 1
1434        },
1435        {
1436          "fds": [
1437            {
1438              "fd": 28
1439            },
1440            {
1441              "fd": 29
1442            }
1443          ],
1444          "fdset-id": 0
1445        }
1446      ]
1447    }
1449 Note: The list of fd sets is shared by all monitor connections.
1451 block_passwd
1452 ------------
1454 Set the password of encrypted block devices.
1456 Arguments:
1458 - "device": device name (json-string)
1459 - "node-name": name in the block driver state graph (json-string)
1460 - "password": password (json-string)
1462 Example:
1464 -> { "execute": "block_passwd", "arguments": { "device": "ide0-hd0",
1465                                                "password": "12345" } }
1466 <- { "return": {} }
1468 block_set_io_throttle
1469 ------------
1471 Change I/O throttle limits for a block drive.
1473 Arguments:
1475 - "device": block device name (deprecated, use @id instead)
1476             (json-string, optional)
1477 - "id": the name or QOM path of the guest device (json-string, optional)
1478 - "bps": total throughput limit in bytes per second (json-int)
1479 - "bps_rd": read throughput limit in bytes per second (json-int)
1480 - "bps_wr": write throughput limit in bytes per second (json-int)
1481 - "iops": total I/O operations per second (json-int)
1482 - "iops_rd": read I/O operations per second (json-int)
1483 - "iops_wr": write I/O operations per second (json-int)
1484 - "bps_max": total throughput limit during bursts, in bytes (json-int, optional)
1485 - "bps_rd_max": read throughput limit during bursts, in bytes (json-int, optional)
1486 - "bps_wr_max": write throughput limit during bursts, in bytes (json-int, optional)
1487 - "iops_max": total I/O operations per second during bursts (json-int, optional)
1488 - "iops_rd_max": read I/O operations per second during bursts (json-int, optional)
1489 - "iops_wr_max": write I/O operations per second during bursts (json-int, optional)
1490 - "bps_max_length": maximum length of the @bps_max burst period, in seconds (json-int, optional)
1491 - "bps_rd_max_length": maximum length of the @bps_rd_max burst period, in seconds (json-int, optional)
1492 - "bps_wr_max_length": maximum length of the @bps_wr_max burst period, in seconds (json-int, optional)
1493 - "iops_max_length": maximum length of the @iops_max burst period, in seconds (json-int, optional)
1494 - "iops_rd_max_length": maximum length of the @iops_rd_max burst period, in seconds (json-int, optional)
1495 - "iops_wr_max_length": maximum length of the @iops_wr_max burst period, in seconds (json-int, optional)
1496 - "iops_size":  I/O size in bytes when limiting (json-int, optional)
1497 - "group": throttle group name (json-string, optional)
1499 Example:
1501 -> { "execute": "block_set_io_throttle", "arguments": { "id": "ide0-1-0",
1502                                                "bps": 1000000,
1503                                                "bps_rd": 0,
1504                                                "bps_wr": 0,
1505                                                "iops": 0,
1506                                                "iops_rd": 0,
1507                                                "iops_wr": 0,
1508                                                "bps_max": 8000000,
1509                                                "bps_rd_max": 0,
1510                                                "bps_wr_max": 0,
1511                                                "iops_max": 0,
1512                                                "iops_rd_max": 0,
1513                                                "iops_wr_max": 0,
1514                                                "bps_max_length": 60,
1515                                                "iops_size": 0 } }
1516 <- { "return": {} }
1518 set_password
1519 ------------
1521 Set the password for vnc/spice protocols.
1523 Arguments:
1525 - "protocol": protocol name (json-string)
1526 - "password": password (json-string)
1527 - "connected": [ keep | disconnect | fail ] (json-string, optional)
1529 Example:
1531 -> { "execute": "set_password", "arguments": { "protocol": "vnc",
1532                                                "password": "secret" } }
1533 <- { "return": {} }
1535 expire_password
1536 ---------------
1538 Set the password expire time for vnc/spice protocols.
1540 Arguments:
1542 - "protocol": protocol name (json-string)
1543 - "time": [ now | never | +secs | secs ] (json-string)
1545 Example:
1547 -> { "execute": "expire_password", "arguments": { "protocol": "vnc",
1548                                                   "time": "+60" } }
1549 <- { "return": {} }
1551 add_client
1552 ----------
1554 Add a graphics client
1556 Arguments:
1558 - "protocol": protocol name (json-string)
1559 - "fdname": file descriptor name (json-string)
1560 - "skipauth": whether to skip authentication (json-bool, optional)
1561 - "tls": whether to perform TLS (json-bool, optional)
1563 Example:
1565 -> { "execute": "add_client", "arguments": { "protocol": "vnc",
1566                                              "fdname": "myclient" } }
1567 <- { "return": {} }
1569 qmp_capabilities
1570 ----------------
1572 Enable QMP capabilities.
1574 Arguments: None.
1576 Example:
1578 -> { "execute": "qmp_capabilities" }
1579 <- { "return": {} }
1581 Note: This command must be issued before issuing any other command.
1583 human-monitor-command
1584 ---------------------
1586 Execute a Human Monitor command.
1588 Arguments:
1590 - command-line: the command name and its arguments, just like the
1591                 Human Monitor's shell (json-string)
1592 - cpu-index: select the CPU number to be used by commands which access CPU
1593              data, like 'info registers'. The Monitor selects CPU 0 if this
1594              argument is not provided (json-int, optional)
1596 Example:
1598 -> { "execute": "human-monitor-command", "arguments": { "command-line": "info kvm" } }
1599 <- { "return": "kvm support: enabled\r\n" }
1601 Notes:
1603 (1) The Human Monitor is NOT an stable interface, this means that command
1604     names, arguments and responses can change or be removed at ANY time.
1605     Applications that rely on long term stability guarantees should NOT
1606     use this command
1608 (2) Limitations:
1610     o This command is stateless, this means that commands that depend
1611       on state information (such as getfd) might not work
1613     o Commands that prompt the user for data (eg. 'cont' when the block
1614       device is encrypted) don't currently work
1616 3. Query Commands
1617 =================
1620 query-version
1621 -------------
1623 Show QEMU version.
1625 Return a json-object with the following information:
1627 - "qemu": A json-object containing three integer values:
1628     - "major": QEMU's major version (json-int)
1629     - "minor": QEMU's minor version (json-int)
1630     - "micro": QEMU's micro version (json-int)
1631 - "package": package's version (json-string)
1633 Example:
1635 -> { "execute": "query-version" }
1636 <- {
1637       "return":{
1638          "qemu":{
1639             "major":0,
1640             "minor":11,
1641             "micro":5
1642          },
1643          "package":""
1644       }
1645    }
1647 query-commands
1648 --------------
1650 List QMP available commands.
1652 Each command is represented by a json-object, the returned value is a json-array
1653 of all commands.
1655 Each json-object contain:
1657 - "name": command's name (json-string)
1659 Example:
1661 -> { "execute": "query-commands" }
1662 <- {
1663       "return":[
1664          {
1665             "name":"query-balloon"
1666          },
1667          {
1668             "name":"system_powerdown"
1669          }
1670       ]
1671    }
1673 Note: This example has been shortened as the real response is too long.
1675 query-events
1676 --------------
1678 List QMP available events.
1680 Each event is represented by a json-object, the returned value is a json-array
1681 of all events.
1683 Each json-object contains:
1685 - "name": event's name (json-string)
1687 Example:
1689 -> { "execute": "query-events" }
1690 <- {
1691       "return":[
1692          {
1693             "name":"SHUTDOWN"
1694          },
1695          {
1696             "name":"RESET"
1697          }
1698       ]
1699    }
1701 Note: This example has been shortened as the real response is too long.
1703 query-qmp-schema
1704 ----------------
1706 Return the QMP wire schema.  The returned value is a json-array of
1707 named schema entities.  Entities are commands, events and various
1708 types.  See docs/qapi-code-gen.txt for information on their structure
1709 and intended use.
1711 query-chardev
1712 -------------
1714 Each device is represented by a json-object. The returned value is a json-array
1715 of all devices.
1717 Each json-object contain the following:
1719 - "label": device's label (json-string)
1720 - "filename": device's file (json-string)
1721 - "frontend-open": open/closed state of the frontend device attached to this
1722                    backend (json-bool)
1724 Example:
1726 -> { "execute": "query-chardev" }
1727 <- {
1728       "return": [
1729          {
1730             "label": "charchannel0",
1731             "filename": "unix:/var/lib/libvirt/qemu/seabios.rhel6.agent,server",
1732             "frontend-open": false
1733          },
1734          {
1735             "label": "charmonitor",
1736             "filename": "unix:/var/lib/libvirt/qemu/seabios.rhel6.monitor,server",
1737             "frontend-open": true
1738          },
1739          {
1740             "label": "charserial0",
1741             "filename": "pty:/dev/pts/2",
1742             "frontend-open": true
1743          }
1744       ]
1745    }
1747 query-chardev-backends
1748 -------------
1750 List available character device backends.
1752 Each backend is represented by a json-object, the returned value is a json-array
1753 of all backends.
1755 Each json-object contains:
1757 - "name": backend name (json-string)
1759 Example:
1761 -> { "execute": "query-chardev-backends" }
1762 <- {
1763       "return":[
1764          {
1765             "name":"udp"
1766          },
1767          {
1768             "name":"tcp"
1769          },
1770          {
1771             "name":"unix"
1772          },
1773          {
1774             "name":"spiceport"
1775          }
1776       ]
1777    }
1779 query-block
1780 -----------
1782 Show the block devices.
1784 Each block device information is stored in a json-object and the returned value
1785 is a json-array of all devices.
1787 Each json-object contain the following:
1789 - "device": device name (json-string)
1790 - "type": device type (json-string)
1791          - deprecated, retained for backward compatibility
1792          - Possible values: "unknown"
1793 - "removable": true if the device is removable, false otherwise (json-bool)
1794 - "locked": true if the device is locked, false otherwise (json-bool)
1795 - "tray_open": only present if removable, true if the device has a tray,
1796                and it is open (json-bool)
1797 - "inserted": only present if the device is inserted, it is a json-object
1798    containing the following:
1799          - "file": device file name (json-string)
1800          - "ro": true if read-only, false otherwise (json-bool)
1801          - "drv": driver format name (json-string)
1802              - Possible values: "blkdebug", "bochs", "cloop", "dmg",
1803                                 "file", "file", "ftp", "ftps", "host_cdrom",
1804                                 "host_device", "http", "https",
1805                                 "nbd", "parallels", "qcow", "qcow2", "raw",
1806                                 "vdi", "vmdk", "vpc", "vvfat"
1807          - "backing_file": backing file name (json-string, optional)
1808          - "backing_file_depth": number of files in the backing file chain (json-int)
1809          - "encrypted": true if encrypted, false otherwise (json-bool)
1810          - "bps": limit total bytes per second (json-int)
1811          - "bps_rd": limit read bytes per second (json-int)
1812          - "bps_wr": limit write bytes per second (json-int)
1813          - "iops": limit total I/O operations per second (json-int)
1814          - "iops_rd": limit read operations per second (json-int)
1815          - "iops_wr": limit write operations per second (json-int)
1816          - "bps_max":  total max in bytes (json-int)
1817          - "bps_rd_max":  read max in bytes (json-int)
1818          - "bps_wr_max":  write max in bytes (json-int)
1819          - "iops_max":  total I/O operations max (json-int)
1820          - "iops_rd_max":  read I/O operations max (json-int)
1821          - "iops_wr_max":  write I/O operations max (json-int)
1822          - "iops_size": I/O size when limiting by iops (json-int)
1823          - "detect_zeroes": detect and optimize zero writing (json-string)
1824              - Possible values: "off", "on", "unmap"
1825          - "write_threshold": write offset threshold in bytes, a event will be
1826                               emitted if crossed. Zero if disabled (json-int)
1827          - "image": the detail of the image, it is a json-object containing
1828             the following:
1829              - "filename": image file name (json-string)
1830              - "format": image format (json-string)
1831              - "virtual-size": image capacity in bytes (json-int)
1832              - "dirty-flag": true if image is not cleanly closed, not present
1833                              means clean (json-bool, optional)
1834              - "actual-size": actual size on disk in bytes of the image, not
1835                               present when image does not support thin
1836                               provision (json-int, optional)
1837              - "cluster-size": size of a cluster in bytes, not present if image
1838                                format does not support it (json-int, optional)
1839              - "encrypted": true if the image is encrypted, not present means
1840                             false or the image format does not support
1841                             encryption (json-bool, optional)
1842              - "backing_file": backing file name, not present means no backing
1843                                file is used or the image format does not
1844                                support backing file chain
1845                                (json-string, optional)
1846              - "full-backing-filename": full path of the backing file, not
1847                                         present if it equals backing_file or no
1848                                         backing file is used
1849                                         (json-string, optional)
1850              - "backing-filename-format": the format of the backing file, not
1851                                           present means unknown or no backing
1852                                           file (json-string, optional)
1853              - "snapshots": the internal snapshot info, it is an optional list
1854                 of json-object containing the following:
1855                  - "id": unique snapshot id (json-string)
1856                  - "name": snapshot name (json-string)
1857                  - "vm-state-size": size of the VM state in bytes (json-int)
1858                  - "date-sec": UTC date of the snapshot in seconds (json-int)
1859                  - "date-nsec": fractional part in nanoseconds to be used with
1860                                 date-sec (json-int)
1861                  - "vm-clock-sec": VM clock relative to boot in seconds
1862                                    (json-int)
1863                  - "vm-clock-nsec": fractional part in nanoseconds to be used
1864                                     with vm-clock-sec (json-int)
1865              - "backing-image": the detail of the backing image, it is an
1866                                 optional json-object only present when a
1867                                 backing image present for this image
1869 - "io-status": I/O operation status, only present if the device supports it
1870                and the VM is configured to stop on errors. It's always reset
1871                to "ok" when the "cont" command is issued (json_string, optional)
1872              - Possible values: "ok", "failed", "nospace"
1874 Example:
1876 -> { "execute": "query-block" }
1877 <- {
1878       "return":[
1879          {
1880             "io-status": "ok",
1881             "device":"ide0-hd0",
1882             "locked":false,
1883             "removable":false,
1884             "inserted":{
1885                "ro":false,
1886                "drv":"qcow2",
1887                "encrypted":false,
1888                "file":"disks/test.qcow2",
1889                "backing_file_depth":1,
1890                "bps":1000000,
1891                "bps_rd":0,
1892                "bps_wr":0,
1893                "iops":1000000,
1894                "iops_rd":0,
1895                "iops_wr":0,
1896                "bps_max": 8000000,
1897                "bps_rd_max": 0,
1898                "bps_wr_max": 0,
1899                "iops_max": 0,
1900                "iops_rd_max": 0,
1901                "iops_wr_max": 0,
1902                "iops_size": 0,
1903                "detect_zeroes": "on",
1904                "write_threshold": 0,
1905                "image":{
1906                   "filename":"disks/test.qcow2",
1907                   "format":"qcow2",
1908                   "virtual-size":2048000,
1909                   "backing_file":"base.qcow2",
1910                   "full-backing-filename":"disks/base.qcow2",
1911                   "backing-filename-format":"qcow2",
1912                   "snapshots":[
1913                      {
1914                         "id": "1",
1915                         "name": "snapshot1",
1916                         "vm-state-size": 0,
1917                         "date-sec": 10000200,
1918                         "date-nsec": 12,
1919                         "vm-clock-sec": 206,
1920                         "vm-clock-nsec": 30
1921                      }
1922                   ],
1923                   "backing-image":{
1924                       "filename":"disks/base.qcow2",
1925                       "format":"qcow2",
1926                       "virtual-size":2048000
1927                   }
1928                }
1929             },
1930             "type":"unknown"
1931          },
1932          {
1933             "io-status": "ok",
1934             "device":"ide1-cd0",
1935             "locked":false,
1936             "removable":true,
1937             "type":"unknown"
1938          },
1939          {
1940             "device":"floppy0",
1941             "locked":false,
1942             "removable":true,
1943             "type":"unknown"
1944          },
1945          {
1946             "device":"sd0",
1947             "locked":false,
1948             "removable":true,
1949             "type":"unknown"
1950          }
1951       ]
1952    }
1954 query-blockstats
1955 ----------------
1957 Show block device statistics.
1959 Each device statistic information is stored in a json-object and the returned
1960 value is a json-array of all devices.
1962 Each json-object contain the following:
1964 - "device": device name (json-string)
1965 - "stats": A json-object with the statistics information, it contains:
1966     - "rd_bytes": bytes read (json-int)
1967     - "wr_bytes": bytes written (json-int)
1968     - "rd_operations": read operations (json-int)
1969     - "wr_operations": write operations (json-int)
1970     - "flush_operations": cache flush operations (json-int)
1971     - "wr_total_time_ns": total time spend on writes in nano-seconds (json-int)
1972     - "rd_total_time_ns": total time spend on reads in nano-seconds (json-int)
1973     - "flush_total_time_ns": total time spend on cache flushes in nano-seconds (json-int)
1974     - "wr_highest_offset": The offset after the greatest byte written to the
1975                            BlockDriverState since it has been opened (json-int)
1976     - "rd_merged": number of read requests that have been merged into
1977                    another request (json-int)
1978     - "wr_merged": number of write requests that have been merged into
1979                    another request (json-int)
1980     - "idle_time_ns": time since the last I/O operation, in
1981                       nanoseconds. If the field is absent it means
1982                       that there haven't been any operations yet
1983                       (json-int, optional)
1984     - "failed_rd_operations": number of failed read operations
1985                               (json-int)
1986     - "failed_wr_operations": number of failed write operations
1987                               (json-int)
1988     - "failed_flush_operations": number of failed flush operations
1989                                (json-int)
1990     - "invalid_rd_operations": number of invalid read operations
1991                                (json-int)
1992     - "invalid_wr_operations": number of invalid write operations
1993                                (json-int)
1994     - "invalid_flush_operations": number of invalid flush operations
1995                                   (json-int)
1996     - "account_invalid": whether invalid operations are included in
1997                          the last access statistics (json-bool)
1998     - "account_failed": whether failed operations are included in the
1999                          latency and last access statistics
2000                          (json-bool)
2001     - "timed_stats": A json-array containing statistics collected in
2002                      specific intervals, with the following members:
2003         - "interval_length": interval used for calculating the
2004                              statistics, in seconds (json-int)
2005         - "min_rd_latency_ns": minimum latency of read operations in
2006                                the defined interval, in nanoseconds
2007                                (json-int)
2008         - "min_wr_latency_ns": minimum latency of write operations in
2009                                the defined interval, in nanoseconds
2010                                (json-int)
2011         - "min_flush_latency_ns": minimum latency of flush operations
2012                                   in the defined interval, in
2013                                   nanoseconds (json-int)
2014         - "max_rd_latency_ns": maximum latency of read operations in
2015                                the defined interval, in nanoseconds
2016                                (json-int)
2017         - "max_wr_latency_ns": maximum latency of write operations in
2018                                the defined interval, in nanoseconds
2019                                (json-int)
2020         - "max_flush_latency_ns": maximum latency of flush operations
2021                                   in the defined interval, in
2022                                   nanoseconds (json-int)
2023         - "avg_rd_latency_ns": average latency of read operations in
2024                                the defined interval, in nanoseconds
2025                                (json-int)
2026         - "avg_wr_latency_ns": average latency of write operations in
2027                                the defined interval, in nanoseconds
2028                                (json-int)
2029         - "avg_flush_latency_ns": average latency of flush operations
2030                                   in the defined interval, in
2031                                   nanoseconds (json-int)
2032         - "avg_rd_queue_depth": average number of pending read
2033                                 operations in the defined interval
2034                                 (json-number)
2035         - "avg_wr_queue_depth": average number of pending write
2036                                 operations in the defined interval
2037                                 (json-number).
2038 - "parent": Contains recursively the statistics of the underlying
2039             protocol (e.g. the host file for a qcow2 image). If there is
2040             no underlying protocol, this field is omitted
2041             (json-object, optional)
2043 Example:
2045 -> { "execute": "query-blockstats" }
2046 <- {
2047       "return":[
2048          {
2049             "device":"ide0-hd0",
2050             "parent":{
2051                "stats":{
2052                   "wr_highest_offset":3686448128,
2053                   "wr_bytes":9786368,
2054                   "wr_operations":751,
2055                   "rd_bytes":122567168,
2056                   "rd_operations":36772
2057                   "wr_total_times_ns":313253456
2058                   "rd_total_times_ns":3465673657
2059                   "flush_total_times_ns":49653
2060                   "flush_operations":61,
2061                   "rd_merged":0,
2062                   "wr_merged":0,
2063                   "idle_time_ns":2953431879,
2064                   "account_invalid":true,
2065                   "account_failed":false
2066                }
2067             },
2068             "stats":{
2069                "wr_highest_offset":2821110784,
2070                "wr_bytes":9786368,
2071                "wr_operations":692,
2072                "rd_bytes":122739200,
2073                "rd_operations":36604
2074                "flush_operations":51,
2075                "wr_total_times_ns":313253456
2076                "rd_total_times_ns":3465673657
2077                "flush_total_times_ns":49653,
2078                "rd_merged":0,
2079                "wr_merged":0,
2080                "idle_time_ns":2953431879,
2081                "account_invalid":true,
2082                "account_failed":false
2083             }
2084          },
2085          {
2086             "device":"ide1-cd0",
2087             "stats":{
2088                "wr_highest_offset":0,
2089                "wr_bytes":0,
2090                "wr_operations":0,
2091                "rd_bytes":0,
2092                "rd_operations":0
2093                "flush_operations":0,
2094                "wr_total_times_ns":0
2095                "rd_total_times_ns":0
2096                "flush_total_times_ns":0,
2097                "rd_merged":0,
2098                "wr_merged":0,
2099                "account_invalid":false,
2100                "account_failed":false
2101             }
2102          },
2103          {
2104             "device":"floppy0",
2105             "stats":{
2106                "wr_highest_offset":0,
2107                "wr_bytes":0,
2108                "wr_operations":0,
2109                "rd_bytes":0,
2110                "rd_operations":0
2111                "flush_operations":0,
2112                "wr_total_times_ns":0
2113                "rd_total_times_ns":0
2114                "flush_total_times_ns":0,
2115                "rd_merged":0,
2116                "wr_merged":0,
2117                "account_invalid":false,
2118                "account_failed":false
2119             }
2120          },
2121          {
2122             "device":"sd0",
2123             "stats":{
2124                "wr_highest_offset":0,
2125                "wr_bytes":0,
2126                "wr_operations":0,
2127                "rd_bytes":0,
2128                "rd_operations":0
2129                "flush_operations":0,
2130                "wr_total_times_ns":0
2131                "rd_total_times_ns":0
2132                "flush_total_times_ns":0,
2133                "rd_merged":0,
2134                "wr_merged":0,
2135                "account_invalid":false,
2136                "account_failed":false
2137             }
2138          }
2139       ]
2140    }
2142 query-cpus
2143 ----------
2145 Show CPU information.
2147 Return a json-array. Each CPU is represented by a json-object, which contains:
2149 - "CPU": CPU index (json-int)
2150 - "current": true if this is the current CPU, false otherwise (json-bool)
2151 - "halted": true if the cpu is halted, false otherwise (json-bool)
2152 - "qom_path": path to the CPU object in the QOM tree (json-str)
2153 - "arch": architecture of the cpu, which determines what additional
2154           keys will be present (json-str)
2155 - Current program counter. The key's name depends on the architecture:
2156      "pc": i386/x86_64 (json-int)
2157      "nip": PPC (json-int)
2158      "pc" and "npc": sparc (json-int)
2159      "PC": mips (json-int)
2160 - "thread_id": ID of the underlying host thread (json-int)
2162 Example:
2164 -> { "execute": "query-cpus" }
2165 <- {
2166       "return":[
2167          {
2168             "CPU":0,
2169             "current":true,
2170             "halted":false,
2171             "qom_path":"/machine/unattached/device[0]",
2172             "arch":"x86",
2173             "pc":3227107138,
2174             "thread_id":3134
2175          },
2176          {
2177             "CPU":1,
2178             "current":false,
2179             "halted":true,
2180             "qom_path":"/machine/unattached/device[2]",
2181             "arch":"x86",
2182             "pc":7108165,
2183             "thread_id":3135
2184          }
2185       ]
2186    }
2188 query-iothreads
2189 ---------------
2191 Returns a list of information about each iothread.
2193 Note this list excludes the QEMU main loop thread, which is not declared
2194 using the -object iothread command-line option.  It is always the main thread
2195 of the process.
2197 Return a json-array. Each iothread is represented by a json-object, which contains:
2199 - "id": name of iothread (json-str)
2200 - "thread-id": ID of the underlying host thread (json-int)
2202 Example:
2204 -> { "execute": "query-iothreads" }
2205 <- {
2206       "return":[
2207          {
2208             "id":"iothread0",
2209             "thread-id":3134
2210          },
2211          {
2212             "id":"iothread1",
2213             "thread-id":3135
2214          }
2215       ]
2216    }
2218 query-pci
2219 ---------
2221 PCI buses and devices information.
2223 The returned value is a json-array of all buses. Each bus is represented by
2224 a json-object, which has a key with a json-array of all PCI devices attached
2225 to it. Each device is represented by a json-object.
2227 The bus json-object contains the following:
2229 - "bus": bus number (json-int)
2230 - "devices": a json-array of json-objects, each json-object represents a
2231              PCI device
2233 The PCI device json-object contains the following:
2235 - "bus": identical to the parent's bus number (json-int)
2236 - "slot": slot number (json-int)
2237 - "function": function number (json-int)
2238 - "class_info": a json-object containing:
2239      - "desc": device class description (json-string, optional)
2240      - "class": device class number (json-int)
2241 - "id": a json-object containing:
2242      - "device": device ID (json-int)
2243      - "vendor": vendor ID (json-int)
2244 - "irq": device's IRQ if assigned (json-int, optional)
2245 - "qdev_id": qdev id string (json-string)
2246 - "pci_bridge": It's a json-object, only present if this device is a
2247                 PCI bridge, contains:
2248      - "bus": bus number (json-int)
2249      - "secondary": secondary bus number (json-int)
2250      - "subordinate": subordinate bus number (json-int)
2251      - "io_range": I/O memory range information, a json-object with the
2252                    following members:
2253                  - "base": base address, in bytes (json-int)
2254                  - "limit": limit address, in bytes (json-int)
2255      - "memory_range": memory range information, a json-object with the
2256                        following members:
2257                  - "base": base address, in bytes (json-int)
2258                  - "limit": limit address, in bytes (json-int)
2259      - "prefetchable_range": Prefetchable memory range information, a
2260                              json-object with the following members:
2261                  - "base": base address, in bytes (json-int)
2262                  - "limit": limit address, in bytes (json-int)
2263      - "devices": a json-array of PCI devices if there's any attached, each
2264                   each element is represented by a json-object, which contains
2265                   the same members of the 'PCI device json-object' described
2266                   above (optional)
2267 - "regions": a json-array of json-objects, each json-object represents a
2268              memory region of this device
2270 The memory range json-object contains the following:
2272 - "base": base memory address (json-int)
2273 - "limit": limit value (json-int)
2275 The region json-object can be an I/O region or a memory region, an I/O region
2276 json-object contains the following:
2278 - "type": "io" (json-string, fixed)
2279 - "bar": BAR number (json-int)
2280 - "address": memory address (json-int)
2281 - "size": memory size (json-int)
2283 A memory region json-object contains the following:
2285 - "type": "memory" (json-string, fixed)
2286 - "bar": BAR number (json-int)
2287 - "address": memory address (json-int)
2288 - "size": memory size (json-int)
2289 - "mem_type_64": true or false (json-bool)
2290 - "prefetch": true or false (json-bool)
2292 Example:
2294 -> { "execute": "query-pci" }
2295 <- {
2296       "return":[
2297          {
2298             "bus":0,
2299             "devices":[
2300                {
2301                   "bus":0,
2302                   "qdev_id":"",
2303                   "slot":0,
2304                   "class_info":{
2305                      "class":1536,
2306                      "desc":"Host bridge"
2307                   },
2308                   "id":{
2309                      "device":32902,
2310                      "vendor":4663
2311                   },
2312                   "function":0,
2313                   "regions":[
2315                   ]
2316                },
2317                {
2318                   "bus":0,
2319                   "qdev_id":"",
2320                   "slot":1,
2321                   "class_info":{
2322                      "class":1537,
2323                      "desc":"ISA bridge"
2324                   },
2325                   "id":{
2326                      "device":32902,
2327                      "vendor":28672
2328                   },
2329                   "function":0,
2330                   "regions":[
2332                   ]
2333                },
2334                {
2335                   "bus":0,
2336                   "qdev_id":"",
2337                   "slot":1,
2338                   "class_info":{
2339                      "class":257,
2340                      "desc":"IDE controller"
2341                   },
2342                   "id":{
2343                      "device":32902,
2344                      "vendor":28688
2345                   },
2346                   "function":1,
2347                   "regions":[
2348                      {
2349                         "bar":4,
2350                         "size":16,
2351                         "address":49152,
2352                         "type":"io"
2353                      }
2354                   ]
2355                },
2356                {
2357                   "bus":0,
2358                   "qdev_id":"",
2359                   "slot":2,
2360                   "class_info":{
2361                      "class":768,
2362                      "desc":"VGA controller"
2363                   },
2364                   "id":{
2365                      "device":4115,
2366                      "vendor":184
2367                   },
2368                   "function":0,
2369                   "regions":[
2370                      {
2371                         "prefetch":true,
2372                         "mem_type_64":false,
2373                         "bar":0,
2374                         "size":33554432,
2375                         "address":4026531840,
2376                         "type":"memory"
2377                      },
2378                      {
2379                         "prefetch":false,
2380                         "mem_type_64":false,
2381                         "bar":1,
2382                         "size":4096,
2383                         "address":4060086272,
2384                         "type":"memory"
2385                      },
2386                      {
2387                         "prefetch":false,
2388                         "mem_type_64":false,
2389                         "bar":6,
2390                         "size":65536,
2391                         "address":-1,
2392                         "type":"memory"
2393                      }
2394                   ]
2395                },
2396                {
2397                   "bus":0,
2398                   "qdev_id":"",
2399                   "irq":11,
2400                   "slot":4,
2401                   "class_info":{
2402                      "class":1280,
2403                      "desc":"RAM controller"
2404                   },
2405                   "id":{
2406                      "device":6900,
2407                      "vendor":4098
2408                   },
2409                   "function":0,
2410                   "regions":[
2411                      {
2412                         "bar":0,
2413                         "size":32,
2414                         "address":49280,
2415                         "type":"io"
2416                      }
2417                   ]
2418                }
2419             ]
2420          }
2421       ]
2422    }
2424 Note: This example has been shortened as the real response is too long.
2426 query-kvm
2427 ---------
2429 Show KVM information.
2431 Return a json-object with the following information:
2433 - "enabled": true if KVM support is enabled, false otherwise (json-bool)
2434 - "present": true if QEMU has KVM support, false otherwise (json-bool)
2436 Example:
2438 -> { "execute": "query-kvm" }
2439 <- { "return": { "enabled": true, "present": true } }
2441 query-status
2442 ------------
2444 Return a json-object with the following information:
2446 - "running": true if the VM is running, or false if it is paused (json-bool)
2447 - "singlestep": true if the VM is in single step mode,
2448                 false otherwise (json-bool)
2449 - "status": one of the following values (json-string)
2450     "debug" - QEMU is running on a debugger
2451     "inmigrate" - guest is paused waiting for an incoming migration
2452     "internal-error" - An internal error that prevents further guest
2453     execution has occurred
2454     "io-error" - the last IOP has failed and the device is configured
2455     to pause on I/O errors
2456     "paused" - guest has been paused via the 'stop' command
2457     "postmigrate" - guest is paused following a successful 'migrate'
2458     "prelaunch" - QEMU was started with -S and guest has not started
2459     "finish-migrate" - guest is paused to finish the migration process
2460     "restore-vm" - guest is paused to restore VM state
2461     "running" - guest is actively running
2462     "save-vm" - guest is paused to save the VM state
2463     "shutdown" - guest is shut down (and -no-shutdown is in use)
2464     "watchdog" - the watchdog action is configured to pause and
2465      has been triggered
2467 Example:
2469 -> { "execute": "query-status" }
2470 <- { "return": { "running": true, "singlestep": false, "status": "running" } }
2472 query-mice
2473 ----------
2475 Show VM mice information.
2477 Each mouse is represented by a json-object, the returned value is a json-array
2478 of all mice.
2480 The mouse json-object contains the following:
2482 - "name": mouse's name (json-string)
2483 - "index": mouse's index (json-int)
2484 - "current": true if this mouse is receiving events, false otherwise (json-bool)
2485 - "absolute": true if the mouse generates absolute input events (json-bool)
2487 Example:
2489 -> { "execute": "query-mice" }
2490 <- {
2491       "return":[
2492          {
2493             "name":"QEMU Microsoft Mouse",
2494             "index":0,
2495             "current":false,
2496             "absolute":false
2497          },
2498          {
2499             "name":"QEMU PS/2 Mouse",
2500             "index":1,
2501             "current":true,
2502             "absolute":true
2503          }
2504       ]
2505    }
2507 query-vnc
2508 ---------
2510 Show VNC server information.
2512 Return a json-object with server information. Connected clients are returned
2513 as a json-array of json-objects.
2515 The main json-object contains the following:
2517 - "enabled": true or false (json-bool)
2518 - "host": server's IP address (json-string)
2519 - "family": address family (json-string)
2520          - Possible values: "ipv4", "ipv6", "unix", "unknown"
2521 - "service": server's port number (json-string)
2522 - "auth": authentication method (json-string)
2523          - Possible values: "invalid", "none", "ra2", "ra2ne", "sasl", "tight",
2524                             "tls", "ultra", "unknown", "vencrypt", "vencrypt",
2525                             "vencrypt+plain", "vencrypt+tls+none",
2526                             "vencrypt+tls+plain", "vencrypt+tls+sasl",
2527                             "vencrypt+tls+vnc", "vencrypt+x509+none",
2528                             "vencrypt+x509+plain", "vencrypt+x509+sasl",
2529                             "vencrypt+x509+vnc", "vnc"
2530 - "clients": a json-array of all connected clients
2532 Clients are described by a json-object, each one contain the following:
2534 - "host": client's IP address (json-string)
2535 - "family": address family (json-string)
2536          - Possible values: "ipv4", "ipv6", "unix", "unknown"
2537 - "service": client's port number (json-string)
2538 - "x509_dname": TLS dname (json-string, optional)
2539 - "sasl_username": SASL username (json-string, optional)
2541 Example:
2543 -> { "execute": "query-vnc" }
2544 <- {
2545       "return":{
2546          "enabled":true,
2547          "host":"0.0.0.0",
2548          "service":"50402",
2549          "auth":"vnc",
2550          "family":"ipv4",
2551          "clients":[
2552             {
2553                "host":"127.0.0.1",
2554                "service":"50401",
2555                "family":"ipv4"
2556             }
2557          ]
2558       }
2559    }
2561 query-spice
2562 -----------
2564 Show SPICE server information.
2566 Return a json-object with server information. Connected clients are returned
2567 as a json-array of json-objects.
2569 The main json-object contains the following:
2571 - "enabled": true or false (json-bool)
2572 - "host": server's IP address (json-string)
2573 - "port": server's port number (json-int, optional)
2574 - "tls-port": server's port number (json-int, optional)
2575 - "auth": authentication method (json-string)
2576          - Possible values: "none", "spice"
2577 - "channels": a json-array of all active channels clients
2579 Channels are described by a json-object, each one contain the following:
2581 - "host": client's IP address (json-string)
2582 - "family": address family (json-string)
2583          - Possible values: "ipv4", "ipv6", "unix", "unknown"
2584 - "port": client's port number (json-string)
2585 - "connection-id": spice connection id.  All channels with the same id
2586                    belong to the same spice session (json-int)
2587 - "channel-type": channel type.  "1" is the main control channel, filter for
2588                   this one if you want track spice sessions only (json-int)
2589 - "channel-id": channel id.  Usually "0", might be different needed when
2590                 multiple channels of the same type exist, such as multiple
2591                 display channels in a multihead setup (json-int)
2592 - "tls": whether the channel is encrypted (json-bool)
2594 Example:
2596 -> { "execute": "query-spice" }
2597 <- {
2598       "return": {
2599          "enabled": true,
2600          "auth": "spice",
2601          "port": 5920,
2602          "tls-port": 5921,
2603          "host": "0.0.0.0",
2604          "channels": [
2605             {
2606                "port": "54924",
2607                "family": "ipv4",
2608                "channel-type": 1,
2609                "connection-id": 1804289383,
2610                "host": "127.0.0.1",
2611                "channel-id": 0,
2612                "tls": true
2613             },
2614             {
2615                "port": "36710",
2616                "family": "ipv4",
2617                "channel-type": 4,
2618                "connection-id": 1804289383,
2619                "host": "127.0.0.1",
2620                "channel-id": 0,
2621                "tls": false
2622             },
2623             [ ... more channels follow ... ]
2624          ]
2625       }
2626    }
2628 query-name
2629 ----------
2631 Show VM name.
2633 Return a json-object with the following information:
2635 - "name": VM's name (json-string, optional)
2637 Example:
2639 -> { "execute": "query-name" }
2640 <- { "return": { "name": "qemu-name" } }
2642 query-uuid
2643 ----------
2645 Show VM UUID.
2647 Return a json-object with the following information:
2649 - "UUID": Universally Unique Identifier (json-string)
2651 Example:
2653 -> { "execute": "query-uuid" }
2654 <- { "return": { "UUID": "550e8400-e29b-41d4-a716-446655440000" } }
2656 query-command-line-options
2657 --------------------------
2659 Show command line option schema.
2661 Return a json-array of command line option schema for all options (or for
2662 the given option), returning an error if the given option doesn't exist.
2664 Each array entry contains the following:
2666 - "option": option name (json-string)
2667 - "parameters": a json-array describes all parameters of the option:
2668     - "name": parameter name (json-string)
2669     - "type": parameter type (one of 'string', 'boolean', 'number',
2670               or 'size')
2671     - "help": human readable description of the parameter
2672               (json-string, optional)
2673     - "default": default value string for the parameter
2674                  (json-string, optional)
2676 Example:
2678 -> { "execute": "query-command-line-options", "arguments": { "option": "option-rom" } }
2679 <- { "return": [
2680         {
2681             "parameters": [
2682                 {
2683                     "name": "romfile",
2684                     "type": "string"
2685                 },
2686                 {
2687                     "name": "bootindex",
2688                     "type": "number"
2689                 }
2690             ],
2691             "option": "option-rom"
2692         }
2693      ]
2694    }
2696 query-migrate
2697 -------------
2699 Migration status.
2701 Return a json-object. If migration is active there will be another json-object
2702 with RAM migration status and if block migration is active another one with
2703 block migration status.
2705 The main json-object contains the following:
2707 - "status": migration status (json-string)
2708      - Possible values: "setup", "active", "completed", "failed", "cancelled"
2709 - "total-time": total amount of ms since migration started.  If
2710                 migration has ended, it returns the total migration
2711                 time (json-int)
2712 - "setup-time" amount of setup time in milliseconds _before_ the
2713                iterations begin but _after_ the QMP command is issued.
2714                This is designed to provide an accounting of any activities
2715                (such as RDMA pinning) which may be expensive, but do not
2716                actually occur during the iterative migration rounds
2717                themselves. (json-int)
2718 - "downtime": only present when migration has finished correctly
2719               total amount in ms for downtime that happened (json-int)
2720 - "expected-downtime": only present while migration is active
2721                 total amount in ms for downtime that was calculated on
2722                 the last bitmap round (json-int)
2723 - "ram": only present if "status" is "active", it is a json-object with the
2724   following RAM information:
2725          - "transferred": amount transferred in bytes (json-int)
2726          - "remaining": amount remaining to transfer in bytes (json-int)
2727          - "total": total amount of memory in bytes (json-int)
2728          - "duplicate": number of pages filled entirely with the same
2729             byte (json-int)
2730             These are sent over the wire much more efficiently.
2731          - "skipped": number of skipped zero pages (json-int)
2732          - "normal" : number of whole pages transferred.  I.e. they
2733             were not sent as duplicate or xbzrle pages (json-int)
2734          - "normal-bytes" : number of bytes transferred in whole
2735             pages. This is just normal pages times size of one page,
2736             but this way upper levels don't need to care about page
2737             size (json-int)
2738          - "dirty-sync-count": times that dirty ram was synchronized (json-int)
2739 - "disk": only present if "status" is "active" and it is a block migration,
2740   it is a json-object with the following disk information:
2741          - "transferred": amount transferred in bytes (json-int)
2742          - "remaining": amount remaining to transfer in bytes json-int)
2743          - "total": total disk size in bytes (json-int)
2744 - "xbzrle-cache": only present if XBZRLE is active.
2745   It is a json-object with the following XBZRLE information:
2746          - "cache-size": XBZRLE cache size in bytes
2747          - "bytes": number of bytes transferred for XBZRLE compressed pages
2748          - "pages": number of XBZRLE compressed pages
2749          - "cache-miss": number of XBRZRLE page cache misses
2750          - "cache-miss-rate": rate of XBRZRLE page cache misses
2751          - "overflow": number of times XBZRLE overflows.  This means
2752            that the XBZRLE encoding was bigger than just sent the
2753            whole page, and then we sent the whole page instead (as as
2754            normal page).
2756 Examples:
2758 1. Before the first migration
2760 -> { "execute": "query-migrate" }
2761 <- { "return": {} }
2763 2. Migration is done and has succeeded
2765 -> { "execute": "query-migrate" }
2766 <- { "return": {
2767         "status": "completed",
2768         "ram":{
2769           "transferred":123,
2770           "remaining":123,
2771           "total":246,
2772           "total-time":12345,
2773           "setup-time":12345,
2774           "downtime":12345,
2775           "duplicate":123,
2776           "normal":123,
2777           "normal-bytes":123456,
2778           "dirty-sync-count":15
2779         }
2780      }
2781    }
2783 3. Migration is done and has failed
2785 -> { "execute": "query-migrate" }
2786 <- { "return": { "status": "failed" } }
2788 4. Migration is being performed and is not a block migration:
2790 -> { "execute": "query-migrate" }
2791 <- {
2792       "return":{
2793          "status":"active",
2794          "ram":{
2795             "transferred":123,
2796             "remaining":123,
2797             "total":246,
2798             "total-time":12345,
2799             "setup-time":12345,
2800             "expected-downtime":12345,
2801             "duplicate":123,
2802             "normal":123,
2803             "normal-bytes":123456,
2804             "dirty-sync-count":15
2805          }
2806       }
2807    }
2809 5. Migration is being performed and is a block migration:
2811 -> { "execute": "query-migrate" }
2812 <- {
2813       "return":{
2814          "status":"active",
2815          "ram":{
2816             "total":1057024,
2817             "remaining":1053304,
2818             "transferred":3720,
2819             "total-time":12345,
2820             "setup-time":12345,
2821             "expected-downtime":12345,
2822             "duplicate":123,
2823             "normal":123,
2824             "normal-bytes":123456,
2825             "dirty-sync-count":15
2826          },
2827          "disk":{
2828             "total":20971520,
2829             "remaining":20880384,
2830             "transferred":91136
2831          }
2832       }
2833    }
2835 6. Migration is being performed and XBZRLE is active:
2837 -> { "execute": "query-migrate" }
2838 <- {
2839       "return":{
2840          "status":"active",
2841          "capabilities" : [ { "capability": "xbzrle", "state" : true } ],
2842          "ram":{
2843             "total":1057024,
2844             "remaining":1053304,
2845             "transferred":3720,
2846             "total-time":12345,
2847             "setup-time":12345,
2848             "expected-downtime":12345,
2849             "duplicate":10,
2850             "normal":3333,
2851             "normal-bytes":3412992,
2852             "dirty-sync-count":15
2853          },
2854          "xbzrle-cache":{
2855             "cache-size":67108864,
2856             "bytes":20971520,
2857             "pages":2444343,
2858             "cache-miss":2244,
2859             "cache-miss-rate":0.123,
2860             "overflow":34434
2861          }
2862       }
2863    }
2865 migrate-set-capabilities
2866 ------------------------
2868 Enable/Disable migration capabilities
2870 - "xbzrle": XBZRLE support
2871 - "rdma-pin-all": pin all pages when using RDMA during migration
2872 - "auto-converge": throttle down guest to help convergence of migration
2873 - "zero-blocks": compress zero blocks during block migration
2874 - "compress": use multiple compression threads to accelerate live migration
2875 - "events": generate events for each migration state change
2876 - "postcopy-ram": postcopy mode for live migration
2877 - "x-colo": COarse-Grain LOck Stepping (COLO) for Non-stop Service
2879 Arguments:
2881 Example:
2883 -> { "execute": "migrate-set-capabilities" , "arguments":
2884      { "capabilities": [ { "capability": "xbzrle", "state": true } ] } }
2886 query-migrate-capabilities
2887 --------------------------
2889 Query current migration capabilities
2891 - "capabilities": migration capabilities state
2892          - "xbzrle" : XBZRLE state (json-bool)
2893          - "rdma-pin-all" : RDMA Pin Page state (json-bool)
2894          - "auto-converge" : Auto Converge state (json-bool)
2895          - "zero-blocks" : Zero Blocks state (json-bool)
2896          - "compress": Multiple compression threads state (json-bool)
2897          - "events": Migration state change event state (json-bool)
2898          - "postcopy-ram": postcopy ram state (json-bool)
2899          - "x-colo": COarse-Grain LOck Stepping for Non-stop Service (json-bool)
2901 Arguments:
2903 Example:
2905 -> { "execute": "query-migrate-capabilities" }
2906 <- {"return": [
2907      {"state": false, "capability": "xbzrle"},
2908      {"state": false, "capability": "rdma-pin-all"},
2909      {"state": false, "capability": "auto-converge"},
2910      {"state": false, "capability": "zero-blocks"},
2911      {"state": false, "capability": "compress"},
2912      {"state": true, "capability": "events"},
2913      {"state": false, "capability": "postcopy-ram"},
2914      {"state": false, "capability": "x-colo"}
2915    ]}
2917 migrate-set-parameters
2918 ----------------------
2920 Set migration parameters
2922 - "compress-level": set compression level during migration (json-int)
2923 - "compress-threads": set compression thread count for migration (json-int)
2924 - "decompress-threads": set decompression thread count for migration (json-int)
2925 - "cpu-throttle-initial": set initial percentage of time guest cpus are
2926                           throttled for auto-converge (json-int)
2927 - "cpu-throttle-increment": set throttle increasing percentage for
2928                             auto-converge (json-int)
2929 - "max-bandwidth": set maximum speed for migrations (in bytes/sec) (json-int)
2930 - "downtime-limit": set maximum tolerated downtime (in milliseconds) for
2931                     migrations (json-int)
2932 - "x-checkpoint-delay": set the delay time for periodic checkpoint (json-int)
2934 Arguments:
2936 Example:
2938 -> { "execute": "migrate-set-parameters" , "arguments":
2939       { "compress-level": 1 } }
2941 query-migrate-parameters
2942 ------------------------
2944 Query current migration parameters
2946 - "parameters": migration parameters value
2947          - "compress-level" : compression level value (json-int)
2948          - "compress-threads" : compression thread count value (json-int)
2949          - "decompress-threads" : decompression thread count value (json-int)
2950          - "cpu-throttle-initial" : initial percentage of time guest cpus are
2951                                     throttled (json-int)
2952          - "cpu-throttle-increment" : throttle increasing percentage for
2953                                       auto-converge (json-int)
2954          - "max-bandwidth" : maximium migration speed in bytes per second
2955                              (json-int)
2956          - "downtime-limit" : maximum tolerated downtime of migration in
2957                               milliseconds (json-int)
2958 Arguments:
2960 Example:
2962 -> { "execute": "query-migrate-parameters" }
2963 <- {
2964       "return": {
2965          "decompress-threads": 2,
2966          "cpu-throttle-increment": 10,
2967          "compress-threads": 8,
2968          "compress-level": 1,
2969          "cpu-throttle-initial": 20,
2970          "max-bandwidth": 33554432,
2971          "downtime-limit": 300
2972       }
2973    }
2975 query-balloon
2976 -------------
2978 Show balloon information.
2980 Make an asynchronous request for balloon info. When the request completes a
2981 json-object will be returned containing the following data:
2983 - "actual": current balloon value in bytes (json-int)
2985 Example:
2987 -> { "execute": "query-balloon" }
2988 <- {
2989       "return":{
2990          "actual":1073741824,
2991       }
2992    }
2994 query-tpm
2995 ---------
2997 Return information about the TPM device.
2999 Arguments: None
3001 Example:
3003 -> { "execute": "query-tpm" }
3004 <- { "return":
3005      [
3006        { "model": "tpm-tis",
3007          "options":
3008            { "type": "passthrough",
3009              "data":
3010                { "cancel-path": "/sys/class/misc/tpm0/device/cancel",
3011                  "path": "/dev/tpm0"
3012                }
3013            },
3014          "id": "tpm0"
3015        }
3016      ]
3017    }
3019 query-tpm-models
3020 ----------------
3022 Return a list of supported TPM models.
3024 Arguments: None
3026 Example:
3028 -> { "execute": "query-tpm-models" }
3029 <- { "return": [ "tpm-tis" ] }
3031 query-tpm-types
3032 ---------------
3034 Return a list of supported TPM types.
3036 Arguments: None
3038 Example:
3040 -> { "execute": "query-tpm-types" }
3041 <- { "return": [ "passthrough" ] }
3043 chardev-add
3044 ----------------
3046 Add a chardev.
3048 Arguments:
3050 - "id": the chardev's ID, must be unique (json-string)
3051 - "backend": chardev backend type + parameters
3053 Examples:
3055 -> { "execute" : "chardev-add",
3056      "arguments" : { "id" : "foo",
3057                      "backend" : { "type" : "null", "data" : {} } } }
3058 <- { "return": {} }
3060 -> { "execute" : "chardev-add",
3061      "arguments" : { "id" : "bar",
3062                      "backend" : { "type" : "file",
3063                                    "data" : { "out" : "/tmp/bar.log" } } } }
3064 <- { "return": {} }
3066 -> { "execute" : "chardev-add",
3067      "arguments" : { "id" : "baz",
3068                      "backend" : { "type" : "pty", "data" : {} } } }
3069 <- { "return": { "pty" : "/dev/pty/42" } }
3071 chardev-remove
3072 --------------
3074 Remove a chardev.
3076 Arguments:
3078 - "id": the chardev's ID, must exist and not be in use (json-string)
3080 Example:
3082 -> { "execute": "chardev-remove", "arguments": { "id" : "foo" } }
3083 <- { "return": {} }
3085 query-rx-filter
3086 ---------------
3088 Show rx-filter information.
3090 Returns a json-array of rx-filter information for all NICs (or for the
3091 given NIC), returning an error if the given NIC doesn't exist, or
3092 given NIC doesn't support rx-filter querying, or given net client
3093 isn't a NIC.
3095 The query will clear the event notification flag of each NIC, then qemu
3096 will start to emit event to QMP monitor.
3098 Each array entry contains the following:
3100 - "name": net client name (json-string)
3101 - "promiscuous": promiscuous mode is enabled (json-bool)
3102 - "multicast": multicast receive state (one of 'normal', 'none', 'all')
3103 - "unicast": unicast receive state  (one of 'normal', 'none', 'all')
3104 - "vlan": vlan receive state (one of 'normal', 'none', 'all') (Since 2.0)
3105 - "broadcast-allowed": allow to receive broadcast (json-bool)
3106 - "multicast-overflow": multicast table is overflowed (json-bool)
3107 - "unicast-overflow": unicast table is overflowed (json-bool)
3108 - "main-mac": main macaddr string (json-string)
3109 - "vlan-table": a json-array of active vlan id
3110 - "unicast-table": a json-array of unicast macaddr string
3111 - "multicast-table": a json-array of multicast macaddr string
3113 Example:
3115 -> { "execute": "query-rx-filter", "arguments": { "name": "vnet0" } }
3116 <- { "return": [
3117         {
3118             "promiscuous": true,
3119             "name": "vnet0",
3120             "main-mac": "52:54:00:12:34:56",
3121             "unicast": "normal",
3122             "vlan": "normal",
3123             "vlan-table": [
3124                 4,
3125                 0
3126             ],
3127             "unicast-table": [
3128             ],
3129             "multicast": "normal",
3130             "multicast-overflow": false,
3131             "unicast-overflow": false,
3132             "multicast-table": [
3133                 "01:00:5e:00:00:01",
3134                 "33:33:00:00:00:01",
3135                 "33:33:ff:12:34:56"
3136             ],
3137             "broadcast-allowed": false
3138         }
3139       ]
3140    }
3142 blockdev-add
3143 ------------
3145 Add a block device.
3147 This command is still a work in progress.  It doesn't support all
3148 block drivers among other things.  Stay away from it unless you want
3149 to help with its development.
3151 For the arguments, see the QAPI schema documentation of BlockdevOptions.
3153 Example (1):
3155 -> { "execute": "blockdev-add",
3156     "arguments": { "driver": "qcow2",
3157                    "file": { "driver": "file",
3158                              "filename": "test.qcow2" } } }
3159 <- { "return": {} }
3161 Example (2):
3163 -> { "execute": "blockdev-add",
3164      "arguments": {
3165          "driver": "qcow2",
3166          "node-name": "my_disk",
3167          "discard": "unmap",
3168          "cache": {
3169              "direct": true,
3170              "writeback": true
3171          },
3172          "file": {
3173              "driver": "file",
3174              "filename": "/tmp/test.qcow2"
3175          },
3176          "backing": {
3177              "driver": "raw",
3178              "file": {
3179                  "driver": "file",
3180                  "filename": "/dev/fdset/4"
3181              }
3182          }
3183        }
3184      }
3186 <- { "return": {} }
3188 x-blockdev-del
3189 ------------
3190 Since 2.5
3192 Deletes a block device that has been added using blockdev-add.
3193 The command will fail if the node is attached to a device or is
3194 otherwise being used.
3196 This command is still a work in progress and is considered
3197 experimental. Stay away from it unless you want to help with its
3198 development.
3200 Arguments:
3202 - "node-name": Name of the graph node to delete (json-string)
3204 Example:
3206 -> { "execute": "blockdev-add",
3207      "arguments": {
3208          "driver": "qcow2",
3209          "node-name": "node0",
3210          "file": {
3211              "driver": "file",
3212              "filename": "test.qcow2"
3213          }
3214      }
3215    }
3217 <- { "return": {} }
3219 -> { "execute": "x-blockdev-del",
3220      "arguments": { "node-name": "node0" }
3221    }
3222 <- { "return": {} }
3224 blockdev-open-tray
3225 ------------------
3227 Opens a block device's tray. If there is a block driver state tree inserted as a
3228 medium, it will become inaccessible to the guest (but it will remain associated
3229 to the block device, so closing the tray will make it accessible again).
3231 If the tray was already open before, this will be a no-op.
3233 Once the tray opens, a DEVICE_TRAY_MOVED event is emitted. There are cases in
3234 which no such event will be generated, these include:
3235 - if the guest has locked the tray, @force is false and the guest does not
3236   respond to the eject request
3237 - if the BlockBackend denoted by @device does not have a guest device attached
3238   to it
3239 - if the guest device does not have an actual tray and is empty, for instance
3240   for floppy disk drives
3242 Arguments:
3244 - "device": block device name (deprecated, use @id instead)
3245             (json-string, optional)
3246 - "id": the name or QOM path of the guest device (json-string, optional)
3247 - "force": if false (the default), an eject request will be sent to the guest if
3248            it has locked the tray (and the tray will not be opened immediately);
3249            if true, the tray will be opened regardless of whether it is locked
3250            (json-bool, optional)
3252 Example:
3254 -> { "execute": "blockdev-open-tray",
3255      "arguments": { "id": "ide0-1-0" } }
3257 <- { "timestamp": { "seconds": 1418751016,
3258                     "microseconds": 716996 },
3259      "event": "DEVICE_TRAY_MOVED",
3260      "data": { "device": "ide1-cd0",
3261                "id": "ide0-1-0",
3262                "tray-open": true } }
3264 <- { "return": {} }
3266 blockdev-close-tray
3267 -------------------
3269 Closes a block device's tray. If there is a block driver state tree associated
3270 with the block device (which is currently ejected), that tree will be loaded as
3271 the medium.
3273 If the tray was already closed before, this will be a no-op.
3275 Arguments:
3277 - "device": block device name (deprecated, use @id instead)
3278             (json-string, optional)
3279 - "id": the name or QOM path of the guest device (json-string, optional)
3281 Example:
3283 -> { "execute": "blockdev-close-tray",
3284      "arguments": { "id": "ide0-1-0" } }
3286 <- { "timestamp": { "seconds": 1418751345,
3287                     "microseconds": 272147 },
3288      "event": "DEVICE_TRAY_MOVED",
3289      "data": { "device": "ide1-cd0",
3290                "id": "ide0-1-0",
3291                "tray-open": false } }
3293 <- { "return": {} }
3295 x-blockdev-remove-medium
3296 ------------------------
3298 Removes a medium (a block driver state tree) from a block device. That block
3299 device's tray must currently be open (unless there is no attached guest device).
3301 If the tray is open and there is no medium inserted, this will be a no-op.
3303 This command is still a work in progress and is considered experimental.
3304 Stay away from it unless you want to help with its development.
3306 Arguments:
3308 - "device": block device name (deprecated, use @id instead)
3309             (json-string, optional)
3310 - "id": the name or QOM path of the guest device (json-string, optional)
3312 Example:
3314 -> { "execute": "x-blockdev-remove-medium",
3315      "arguments": { "id": "ide0-1-0" } }
3317 <- { "error": { "class": "GenericError",
3318                 "desc": "Tray of device 'ide0-1-0' is not open" } }
3320 -> { "execute": "blockdev-open-tray",
3321      "arguments": { "id": "ide0-1-0" } }
3323 <- { "timestamp": { "seconds": 1418751627,
3324                     "microseconds": 549958 },
3325      "event": "DEVICE_TRAY_MOVED",
3326      "data": { "device": "ide1-cd0",
3327                "id": "ide0-1-0",
3328                "tray-open": true } }
3330 <- { "return": {} }
3332 -> { "execute": "x-blockdev-remove-medium",
3333      "arguments": { "device": "ide0-1-0" } }
3335 <- { "return": {} }
3337 x-blockdev-insert-medium
3338 ------------------------
3340 Inserts a medium (a block driver state tree) into a block device. That block
3341 device's tray must currently be open (unless there is no attached guest device)
3342 and there must be no medium inserted already.
3344 This command is still a work in progress and is considered experimental.
3345 Stay away from it unless you want to help with its development.
3347 Arguments:
3349 - "device": block device name (deprecated, use @id instead)
3350             (json-string, optional)
3351 - "id": the name or QOM path of the guest device (json-string, optional)
3352 - "node-name": root node of the BDS tree to insert into the block device
3354 Example:
3356 -> { "execute": "blockdev-add",
3357      "arguments": { { "node-name": "node0",
3358                       "driver": "raw",
3359                       "file": { "driver": "file",
3360                                 "filename": "fedora.iso" } } }
3362 <- { "return": {} }
3364 -> { "execute": "x-blockdev-insert-medium",
3365      "arguments": { "id": "ide0-1-0",
3366                     "node-name": "node0" } }
3368 <- { "return": {} }
3370 x-blockdev-change
3371 -----------------
3373 Dynamically reconfigure the block driver state graph. It can be used
3374 to add, remove, insert or replace a graph node. Currently only the
3375 Quorum driver implements this feature to add or remove its child. This
3376 is useful to fix a broken quorum child.
3378 If @node is specified, it will be inserted under @parent. @child
3379 may not be specified in this case. If both @parent and @child are
3380 specified but @node is not, @child will be detached from @parent.
3382 Arguments:
3383 - "parent": the id or name of the parent node (json-string)
3384 - "child": the name of a child under the given parent node (json-string, optional)
3385 - "node": the name of the node that will be added (json-string, optional)
3387 Note: this command is experimental, and not a stable API. It doesn't
3388 support all kinds of operations, all kinds of children, nor all block
3389 drivers.
3391 Warning: The data in a new quorum child MUST be consistent with that of
3392 the rest of the array.
3394 Example:
3396 Add a new node to a quorum
3397 -> { "execute": "blockdev-add",
3398      "arguments": { "driver": "raw",
3399                     "node-name": "new_node",
3400                     "file": { "driver": "file",
3401                               "filename": "test.raw" } } }
3402 <- { "return": {} }
3403 -> { "execute": "x-blockdev-change",
3404      "arguments": { "parent": "disk1",
3405                     "node": "new_node" } }
3406 <- { "return": {} }
3408 Delete a quorum's node
3409 -> { "execute": "x-blockdev-change",
3410      "arguments": { "parent": "disk1",
3411                     "child": "children.1" } }
3412 <- { "return": {} }
3414 query-named-block-nodes
3415 -----------------------
3417 Return a list of BlockDeviceInfo for all the named block driver nodes
3419 Example:
3421 -> { "execute": "query-named-block-nodes" }
3422 <- { "return": [ { "ro":false,
3423                    "drv":"qcow2",
3424                    "encrypted":false,
3425                    "file":"disks/test.qcow2",
3426                    "node-name": "my-node",
3427                    "backing_file_depth":1,
3428                    "bps":1000000,
3429                    "bps_rd":0,
3430                    "bps_wr":0,
3431                    "iops":1000000,
3432                    "iops_rd":0,
3433                    "iops_wr":0,
3434                    "bps_max": 8000000,
3435                    "bps_rd_max": 0,
3436                    "bps_wr_max": 0,
3437                    "iops_max": 0,
3438                    "iops_rd_max": 0,
3439                    "iops_wr_max": 0,
3440                    "iops_size": 0,
3441                    "write_threshold": 0,
3442                    "image":{
3443                       "filename":"disks/test.qcow2",
3444                       "format":"qcow2",
3445                       "virtual-size":2048000,
3446                       "backing_file":"base.qcow2",
3447                       "full-backing-filename":"disks/base.qcow2",
3448                       "backing-filename-format":"qcow2",
3449                       "snapshots":[
3450                          {
3451                             "id": "1",
3452                             "name": "snapshot1",
3453                             "vm-state-size": 0,
3454                             "date-sec": 10000200,
3455                             "date-nsec": 12,
3456                             "vm-clock-sec": 206,
3457                             "vm-clock-nsec": 30
3458                          }
3459                       ],
3460                       "backing-image":{
3461                           "filename":"disks/base.qcow2",
3462                           "format":"qcow2",
3463                           "virtual-size":2048000
3464                       }
3465                    } } ] }
3467 blockdev-change-medium
3468 ----------------------
3470 Changes the medium inserted into a block device by ejecting the current medium
3471 and loading a new image file which is inserted as the new medium.
3473 Arguments:
3475 - "device": block device name (deprecated, use @id instead)
3476             (json-string, optional)
3477 - "id": the name or QOM path of the guest device (json-string, optional)
3478 - "filename": filename of the new image (json-string)
3479 - "format": format of the new image (json-string, optional)
3480 - "read-only-mode": new read-only mode (json-string, optional)
3481           - Possible values: "retain" (default), "read-only", "read-write"
3483 Examples:
3485 1. Change a removable medium
3487 -> { "execute": "blockdev-change-medium",
3488              "arguments": { "id": "ide0-1-0",
3489                             "filename": "/srv/images/Fedora-12-x86_64-DVD.iso",
3490                             "format": "raw" } }
3491 <- { "return": {} }
3493 2. Load a read-only medium into a writable drive
3495 -> { "execute": "blockdev-change-medium",
3496              "arguments": { "id": "floppyA",
3497                             "filename": "/srv/images/ro.img",
3498                             "format": "raw",
3499                             "read-only-mode": "retain" } }
3501 <- { "error":
3502      { "class": "GenericError",
3503        "desc": "Could not open '/srv/images/ro.img': Permission denied" } }
3505 -> { "execute": "blockdev-change-medium",
3506              "arguments": { "id": "floppyA",
3507                             "filename": "/srv/images/ro.img",
3508                             "format": "raw",
3509                             "read-only-mode": "read-only" } }
3511 <- { "return": {} }
3513 query-memdev
3514 ------------
3516 Show memory devices information.
3519 Example (1):
3521 -> { "execute": "query-memdev" }
3522 <- { "return": [
3523        {
3524          "size": 536870912,
3525          "merge": false,
3526          "dump": true,
3527          "prealloc": false,
3528          "host-nodes": [0, 1],
3529          "policy": "bind"
3530        },
3531        {
3532          "size": 536870912,
3533          "merge": false,
3534          "dump": true,
3535          "prealloc": true,
3536          "host-nodes": [2, 3],
3537          "policy": "preferred"
3538        }
3539      ]
3540    }
3542 query-memory-devices
3543 --------------------
3545 Return a list of memory devices.
3547 Example:
3548 -> { "execute": "query-memory-devices" }
3549 <- { "return": [ { "data":
3550                       { "addr": 5368709120,
3551                         "hotpluggable": true,
3552                         "hotplugged": true,
3553                         "id": "d1",
3554                         "memdev": "/objects/memX",
3555                         "node": 0,
3556                         "size": 1073741824,
3557                         "slot": 0},
3558                    "type": "dimm"
3559                  } ] }
3561 query-acpi-ospm-status
3562 ----------------------
3564 Return list of ACPIOSTInfo for devices that support status reporting
3565 via ACPI _OST method.
3567 Example:
3568 -> { "execute": "query-acpi-ospm-status" }
3569 <- { "return": [ { "device": "d1", "slot": "0", "slot-type": "DIMM", "source": 1, "status": 0},
3570                  { "slot": "1", "slot-type": "DIMM", "source": 0, "status": 0},
3571                  { "slot": "2", "slot-type": "DIMM", "source": 0, "status": 0},
3572                  { "slot": "3", "slot-type": "DIMM", "source": 0, "status": 0}
3573    ]}
3575 rtc-reset-reinjection
3576 ---------------------
3578 Reset the RTC interrupt reinjection backlog.
3580 Arguments: None.
3582 Example:
3584 -> { "execute": "rtc-reset-reinjection" }
3585 <- { "return": {} }
3587 trace-event-get-state
3588 ---------------------
3590 Query the state of events.
3592 Arguments:
3594 - "name": Event name pattern (json-string).
3595 - "vcpu": The vCPU to query, any vCPU by default (json-int, optional).
3597 An event is returned if:
3598 - its name matches the "name" pattern, and
3599 - if "vcpu" is given, the event has the "vcpu" property.
3601 Therefore, if "vcpu" is given, the operation will only match per-vCPU events,
3602 returning their state on the specified vCPU. Special case: if "name" is an exact
3603 match, "vcpu" is given and the event does not have the "vcpu" property, an error
3604 is returned.
3606 Example:
3608 -> { "execute": "trace-event-get-state", "arguments": { "name": "qemu_memalign" } }
3609 <- { "return": [ { "name": "qemu_memalign", "state": "disabled" } ] }
3611 trace-event-set-state
3612 ---------------------
3614 Set the state of events.
3616 Arguments:
3618 - "name": Event name pattern (json-string).
3619 - "enable": Whether to enable or disable the event (json-bool).
3620 - "ignore-unavailable": Whether to ignore errors for events that cannot be
3621   changed (json-bool, optional).
3622 - "vcpu": The vCPU to act upon, all vCPUs by default (json-int, optional).
3624 An event's state is modified if:
3625 - its name matches the "name" pattern, and
3626 - if "vcpu" is given, the event has the "vcpu" property.
3628 Therefore, if "vcpu" is given, the operation will only match per-vCPU events,
3629 setting their state on the specified vCPU. Special case: if "name" is an exact
3630 match, "vcpu" is given and the event does not have the "vcpu" property, an error
3631 is returned.
3633 Example:
3635 -> { "execute": "trace-event-set-state", "arguments": { "name": "qemu_memalign", "enable": "true" } }
3636 <- { "return": {} }
3638 input-send-event
3639 ----------------
3641 Send input event to guest.
3643 Arguments:
3645 - "device": display device (json-string, optional)
3646 - "head": display head (json-int, optional)
3647 - "events": list of input events
3649 The consoles are visible in the qom tree, under
3650 /backend/console[$index]. They have a device link and head property, so
3651 it is possible to map which console belongs to which device and display.
3653 Example (1):
3655 Press left mouse button.
3657 -> { "execute": "input-send-event",
3658     "arguments": { "device": "video0",
3659                    "events": [ { "type": "btn",
3660                    "data" : { "down": true, "button": "left" } } ] } }
3661 <- { "return": {} }
3663 -> { "execute": "input-send-event",
3664     "arguments": { "device": "video0",
3665                    "events": [ { "type": "btn",
3666                    "data" : { "down": false, "button": "left" } } ] } }
3667 <- { "return": {} }
3669 Example (2):
3671 Press ctrl-alt-del.
3673 -> { "execute": "input-send-event",
3674      "arguments": { "events": [
3675         { "type": "key", "data" : { "down": true,
3676           "key": {"type": "qcode", "data": "ctrl" } } },
3677         { "type": "key", "data" : { "down": true,
3678           "key": {"type": "qcode", "data": "alt" } } },
3679         { "type": "key", "data" : { "down": true,
3680           "key": {"type": "qcode", "data": "delete" } } } ] } }
3681 <- { "return": {} }
3683 Example (3):
3685 Move mouse pointer to absolute coordinates (20000, 400).
3687 -> { "execute": "input-send-event" ,
3688   "arguments": { "events": [
3689                { "type": "abs", "data" : { "axis": "x", "value" : 20000 } },
3690                { "type": "abs", "data" : { "axis": "y", "value" : 400 } } ] } }
3691 <- { "return": {} }
3693 block-set-write-threshold
3694 ------------
3696 Change the write threshold for a block drive. The threshold is an offset,
3697 thus must be non-negative. Default is no write threshold.
3698 Setting the threshold to zero disables it.
3700 Arguments:
3702 - "node-name": the node name in the block driver state graph (json-string)
3703 - "write-threshold": the write threshold in bytes (json-int)
3705 Example:
3707 -> { "execute": "block-set-write-threshold",
3708   "arguments": { "node-name": "mydev",
3709                  "write-threshold": 17179869184 } }
3710 <- { "return": {} }
3712 Show rocker switch
3713 ------------------
3715 Arguments:
3717 - "name": switch name
3719 Example:
3721 -> { "execute": "query-rocker", "arguments": { "name": "sw1" } }
3722 <- { "return": {"name": "sw1", "ports": 2, "id": 1327446905938}}
3724 Show rocker switch ports
3725 ------------------------
3727 Arguments:
3729 - "name": switch name
3731 Example:
3733 -> { "execute": "query-rocker-ports", "arguments": { "name": "sw1" } }
3734 <- { "return": [ {"duplex": "full", "enabled": true, "name": "sw1.1",
3735                   "autoneg": "off", "link-up": true, "speed": 10000},
3736                  {"duplex": "full", "enabled": true, "name": "sw1.2",
3737                   "autoneg": "off", "link-up": true, "speed": 10000}
3738    ]}
3740 Show rocker switch OF-DPA flow tables
3741 -------------------------------------
3743 Arguments:
3745 - "name": switch name
3746 - "tbl-id": (optional) flow table ID
3748 Example:
3750 -> { "execute": "query-rocker-of-dpa-flows", "arguments": { "name": "sw1" } }
3751 <- { "return": [ {"key": {"in-pport": 0, "priority": 1, "tbl-id": 0},
3752                   "hits": 138,
3753                   "cookie": 0,
3754                   "action": {"goto-tbl": 10},
3755                   "mask": {"in-pport": 4294901760}
3756                  },
3757                  {...more...},
3758    ]}
3760 Show rocker OF-DPA group tables
3761 -------------------------------
3763 Arguments:
3765 - "name": switch name
3766 - "type": (optional) group type
3768 Example:
3770 -> { "execute": "query-rocker-of-dpa-groups", "arguments": { "name": "sw1" } }
3771 <- { "return": [ {"type": 0, "out-pport": 2, "pport": 2, "vlan-id": 3841,
3772                   "pop-vlan": 1, "id": 251723778},
3773                  {"type": 0, "out-pport": 0, "pport": 0, "vlan-id": 3841,
3774                   "pop-vlan": 1, "id": 251723776},
3775                  {"type": 0, "out-pport": 1, "pport": 1, "vlan-id": 3840,
3776                   "pop-vlan": 1, "id": 251658241},
3777                  {"type": 0, "out-pport": 0, "pport": 0, "vlan-id": 3840,
3778                   "pop-vlan": 1, "id": 251658240}
3779    ]}
3781 query-gic-capabilities
3782 ---------------
3784 Return a list of GICCapability objects, describing supported GIC
3785 (Generic Interrupt Controller) versions.
3787 Arguments: None
3789 Example:
3791 -> { "execute": "query-gic-capabilities" }
3792 <- { "return": [{ "version": 2, "emulated": true, "kernel": false },
3793                 { "version": 3, "emulated": false, "kernel": true } ] }
3795 Show existing/possible CPUs
3796 ---------------------------
3798 Arguments: None.
3800 Example for pseries machine type started with
3801 -smp 2,cores=2,maxcpus=4 -cpu POWER8:
3803 -> { "execute": "query-hotpluggable-cpus" }
3804 <- {"return": [
3805      { "props": { "core-id": 8 }, "type": "POWER8-spapr-cpu-core",
3806        "vcpus-count": 1 },
3807      { "props": { "core-id": 0 }, "type": "POWER8-spapr-cpu-core",
3808        "vcpus-count": 1, "qom-path": "/machine/unattached/device[0]"}
3809    ]}'
3811 Example for pc machine type started with
3812 -smp 1,maxcpus=2:
3813     -> { "execute": "query-hotpluggable-cpus" }
3814     <- {"return": [
3815          {
3816             "type": "qemu64-x86_64-cpu", "vcpus-count": 1,
3817             "props": {"core-id": 0, "socket-id": 1, "thread-id": 0}
3818          },
3819          {
3820             "qom-path": "/machine/unattached/device[0]",
3821             "type": "qemu64-x86_64-cpu", "vcpus-count": 1,
3822             "props": {"core-id": 0, "socket-id": 0, "thread-id": 0}
3823          }
3824        ]}