Merge remote-tracking branch 'remotes/kraxel/tags/pull-input-20160928-1' into staging
[qemu/kevin.git] / docs / qmp-commands.txt
blobe0adcebc67c0869ddfd052e7ad0ff64891f84a14
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 (QMP/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 client_migrate_info
558 -------------------
560 Set migration information for remote display.  This makes the server
561 ask the client to automatically reconnect using the new parameters
562 once migration finished successfully.  Only implemented for SPICE.
564 Arguments:
566 - "protocol":     must be "spice" (json-string)
567 - "hostname":     migration target hostname (json-string)
568 - "port":         spice tcp port for plaintext channels (json-int, optional)
569 - "tls-port":     spice tcp port for tls-secured channels (json-int, optional)
570 - "cert-subject": server certificate subject (json-string, optional)
572 Example:
574 -> { "execute": "client_migrate_info",
575      "arguments": { "protocol": "spice",
576                     "hostname": "virt42.lab.kraxel.org",
577                     "port": 1234 } }
578 <- { "return": {} }
580 dump
583 Dump guest memory to file. The file can be processed with crash or gdb.
585 Arguments:
587 - "paging": do paging to get guest's memory mapping (json-bool)
588 - "protocol": destination file(started with "file:") or destination file
589               descriptor (started with "fd:") (json-string)
590 - "detach": if specified, command will return immediately, without waiting
591             for the dump to finish. The user can track progress using
592             "query-dump". (json-bool)
593 - "begin": the starting physical address. It's optional, and should be specified
594            with length together (json-int)
595 - "length": the memory size, in bytes. It's optional, and should be specified
596             with begin together (json-int)
597 - "format": the format of guest memory dump. It's optional, and can be
598             elf|kdump-zlib|kdump-lzo|kdump-snappy, but non-elf formats will
599             conflict with paging and filter, ie. begin and length (json-string)
601 Example:
603 -> { "execute": "dump-guest-memory", "arguments": { "protocol": "fd:dump" } }
604 <- { "return": {} }
606 Notes:
608 (1) All boolean arguments default to false
610 query-dump-guest-memory-capability
611 ----------
613 Show available formats for 'dump-guest-memory'
615 Example:
617 -> { "execute": "query-dump-guest-memory-capability" }
618 <- { "return": { "formats":
619                     ["elf", "kdump-zlib", "kdump-lzo", "kdump-snappy"] }
621 query-dump
622 ----------
624 Query background dump status.
626 Arguments: None.
628 Example:
630 -> { "execute": "query-dump" }
631 <- { "return": { "status": "active", "completed": 1024000,
632                  "total": 2048000 } }
634 dump-skeys
635 ----------
637 Save guest storage keys to file.
639 Arguments:
641 - "filename": file path (json-string)
643 Example:
645 -> { "execute": "dump-skeys", "arguments": { "filename": "/tmp/skeys" } }
646 <- { "return": {} }
648 netdev_add
649 ----------
651 Add host network device.
653 Arguments:
655 - "type": the device type, "tap", "user", ... (json-string)
656 - "id": the device's ID, must be unique (json-string)
657 - device options
659 Example:
661 -> { "execute": "netdev_add",
662      "arguments": { "type": "user", "id": "netdev1",
663                     "dnssearch": "example.org" } }
664 <- { "return": {} }
666 Note: The supported device options are the same ones supported by the '-netdev'
667       command-line argument, which are listed in the '-help' output or QEMU's
668       manual
670 netdev_del
671 ----------
673 Remove host network device.
675 Arguments:
677 - "id": the device's ID, must be unique (json-string)
679 Example:
681 -> { "execute": "netdev_del", "arguments": { "id": "netdev1" } }
682 <- { "return": {} }
685 object-add
686 ----------
688 Create QOM object.
690 Arguments:
692 - "qom-type": the object's QOM type, i.e. the class name (json-string)
693 - "id": the object's ID, must be unique (json-string)
694 - "props": a dictionary of object property values (optional, json-dict)
696 Example:
698 -> { "execute": "object-add", "arguments": { "qom-type": "rng-random", "id": "rng1",
699      "props": { "filename": "/dev/hwrng" } } }
700 <- { "return": {} }
702 object-del
703 ----------
705 Remove QOM object.
707 Arguments:
709 - "id": the object's ID (json-string)
711 Example:
713 -> { "execute": "object-del", "arguments": { "id": "rng1" } }
714 <- { "return": {} }
717 block_resize
718 ------------
720 Resize a block image while a guest is running.
722 Arguments:
724 - "device": the device's ID, must be unique (json-string)
725 - "node-name": the node name in the block driver state graph (json-string)
726 - "size": new size
728 Example:
730 -> { "execute": "block_resize", "arguments": { "device": "scratch", "size": 1073741824 } }
731 <- { "return": {} }
733 block-stream
734 ------------
736 Copy data from a backing file into a block device.
738 Arguments:
740 - "job-id": Identifier for the newly-created block job. If omitted,
741             the device name will be used. (json-string, optional)
742 - "device": The device name or node-name of a root node (json-string)
743 - "base": The file name of the backing image above which copying starts
744           (json-string, optional)
745 - "backing-file": The backing file string to write into the active layer. This
746                   filename is not validated.
748                   If a pathname string is such that it cannot be resolved by
749                   QEMU, that means that subsequent QMP or HMP commands must use
750                   node-names for the image in question, as filename lookup
751                   methods will fail.
753                   If not specified, QEMU will automatically determine the
754                   backing file string to use, or error out if there is no
755                   obvious choice.  Care should be taken when specifying the
756                   string, to specify a valid filename or protocol.
757                   (json-string, optional) (Since 2.1)
758 - "speed":  the maximum speed, in bytes per second (json-int, optional)
759 - "on-error": the action to take on an error (default 'report').  'stop' and
760               'enospc' can only be used if the block device supports io-status.
761               (json-string, optional) (Since 2.1)
763 Example:
765 -> { "execute": "block-stream", "arguments": { "device": "virtio0",
766                                                "base": "/tmp/master.qcow2" } }
767 <- { "return": {} }
769 block-commit
770 ------------
772 Live commit of data from overlay image nodes into backing nodes - i.e., writes
773 data between 'top' and 'base' into 'base'.
775 Arguments:
777 - "job-id": Identifier for the newly-created block job. If omitted,
778             the device name will be used. (json-string, optional)
779 - "device": The device name or node-name of a root node (json-string)
780 - "base": The file name of the backing image to write data into.
781           If not specified, this is the deepest backing image
782           (json-string, optional)
783 - "top":  The file name of the backing image within the image chain,
784           which contains the topmost data to be committed down. If
785           not specified, this is the active layer. (json-string, optional)
787 - backing-file:     The backing file string to write into the overlay
788                     image of 'top'.  If 'top' is the active layer,
789                     specifying a backing file string is an error. This
790                     filename is not validated.
792                     If a pathname string is such that it cannot be
793                     resolved by QEMU, that means that subsequent QMP or
794                     HMP commands must use node-names for the image in
795                     question, as filename lookup methods will fail.
797                     If not specified, QEMU will automatically determine
798                     the backing file string to use, or error out if
799                     there is no obvious choice. Care should be taken
800                     when specifying the string, to specify a valid
801                     filename or protocol.
802                     (json-string, optional) (Since 2.1)
804           If top == base, that is an error.
805           If top == active, the job will not be completed by itself,
806           user needs to complete the job with the block-job-complete
807           command after getting the ready event. (Since 2.0)
809           If the base image is smaller than top, then the base image
810           will be resized to be the same size as top.  If top is
811           smaller than the base image, the base will not be
812           truncated.  If you want the base image size to match the
813           size of the smaller top, you can safely truncate it
814           yourself once the commit operation successfully completes.
815           (json-string)
816 - "speed":  the maximum speed, in bytes per second (json-int, optional)
819 Example:
821 -> { "execute": "block-commit", "arguments": { "device": "virtio0",
822                                               "top": "/tmp/snap1.qcow2" } }
823 <- { "return": {} }
825 drive-backup
826 ------------
828 Start a point-in-time copy of a block device to a new destination.  The
829 status of ongoing drive-backup operations can be checked with
830 query-block-jobs where the BlockJobInfo.type field has the value 'backup'.
831 The operation can be stopped before it has completed using the
832 block-job-cancel command.
834 Arguments:
836 - "job-id": Identifier for the newly-created block job. If omitted,
837             the device name will be used. (json-string, optional)
838 - "device": the device name or node-name of a root node which should be copied.
839             (json-string)
840 - "target": the target of the new image. If the file exists, or if it is a
841             device, the existing file/device will be used as the new
842             destination.  If it does not exist, a new file will be created.
843             (json-string)
844 - "format": the format of the new destination, default is to probe if 'mode' is
845             'existing', else the format of the source
846             (json-string, optional)
847 - "sync": what parts of the disk image should be copied to the destination;
848   possibilities include "full" for all the disk, "top" for only the sectors
849   allocated in the topmost image, "incremental" for only the dirty sectors in
850   the bitmap, or "none" to only replicate new I/O (MirrorSyncMode).
851 - "bitmap": dirty bitmap name for sync==incremental. Must be present if sync
852             is "incremental", must NOT be present otherwise.
853 - "mode": whether and how QEMU should create a new image
854           (NewImageMode, optional, default 'absolute-paths')
855 - "speed": the maximum speed, in bytes per second (json-int, optional)
856 - "compress": true to compress data, if the target format supports it.
857               (json-bool, optional, default false)
858 - "on-source-error": the action to take on an error on the source, default
859                      'report'.  'stop' and 'enospc' can only be used
860                      if the block device supports io-status.
861                      (BlockdevOnError, optional)
862 - "on-target-error": the action to take on an error on the target, default
863                      'report' (no limitations, since this applies to
864                      a different block device than device).
865                      (BlockdevOnError, optional)
867 Example:
868 -> { "execute": "drive-backup", "arguments": { "device": "drive0",
869                                                "sync": "full",
870                                                "target": "backup.img" } }
871 <- { "return": {} }
873 blockdev-backup
874 ---------------
876 The device version of drive-backup: this command takes an existing named device
877 as backup target.
879 Arguments:
881 - "job-id": Identifier for the newly-created block job. If omitted,
882             the device name will be used. (json-string, optional)
883 - "device": the device name or node-name of a root node which should be copied.
884             (json-string)
885 - "target": the name of the backup target device. (json-string)
886 - "sync": what parts of the disk image should be copied to the destination;
887           possibilities include "full" for all the disk, "top" for only the
888           sectors allocated in the topmost image, or "none" to only replicate
889           new I/O (MirrorSyncMode).
890 - "speed": the maximum speed, in bytes per second (json-int, optional)
891 - "compress": true to compress data, if the target format supports it.
892               (json-bool, optional, default false)
893 - "on-source-error": the action to take on an error on the source, default
894                      'report'.  'stop' and 'enospc' can only be used
895                      if the block device supports io-status.
896                      (BlockdevOnError, optional)
897 - "on-target-error": the action to take on an error on the target, default
898                      'report' (no limitations, since this applies to
899                      a different block device than device).
900                      (BlockdevOnError, optional)
902 Example:
903 -> { "execute": "blockdev-backup", "arguments": { "device": "src-id",
904                                                   "sync": "full",
905                                                   "target": "tgt-id" } }
906 <- { "return": {} }
908 transaction
909 -----------
911 Atomically operate on one or more block devices.  Operations that are
912 currently supported:
914     - drive-backup
915     - blockdev-backup
916     - blockdev-snapshot-sync
917     - blockdev-snapshot-internal-sync
918     - abort
919     - block-dirty-bitmap-add
920     - block-dirty-bitmap-clear
922 Refer to the qemu/qapi-schema.json file for minimum required QEMU
923 versions for these operations.  A list of dictionaries is accepted,
924 that contains the actions to be performed.  If there is any failure
925 performing any of the operations, all operations for the group are
926 abandoned.
928 For external snapshots, the dictionary contains the device, the file to use for
929 the new snapshot, and the format.  The default format, if not specified, is
930 qcow2.
932 Each new snapshot defaults to being created by QEMU (wiping any
933 contents if the file already exists), but it is also possible to reuse
934 an externally-created file.  In the latter case, you should ensure that
935 the new image file has the same contents as the current one; QEMU cannot
936 perform any meaningful check.  Typically this is achieved by using the
937 current image file as the backing file for the new image.
939 On failure, the original disks pre-snapshot attempt will be used.
941 For internal snapshots, the dictionary contains the device and the snapshot's
942 name.  If an internal snapshot matching name already exists, the request will
943 be rejected.  Only some image formats support it, for example, qcow2, rbd,
944 and sheepdog.
946 On failure, qemu will try delete the newly created internal snapshot in the
947 transaction.  When an I/O error occurs during deletion, the user needs to fix
948 it later with qemu-img or other command.
950 Arguments:
952 actions array:
953     - "type": the operation to perform (json-string).  Possible
954               values: "drive-backup", "blockdev-backup",
955                       "blockdev-snapshot-sync",
956                       "blockdev-snapshot-internal-sync",
957                       "abort", "block-dirty-bitmap-add",
958                       "block-dirty-bitmap-clear"
959     - "data": a dictionary.  The contents depend on the value
960       of "type".  When "type" is "blockdev-snapshot-sync":
961       - "device": device name to snapshot (json-string)
962       - "node-name": graph node name to snapshot (json-string)
963       - "snapshot-file": name of new image file (json-string)
964       - "snapshot-node-name": graph node name of the new snapshot (json-string)
965       - "format": format of new image (json-string, optional)
966       - "mode": whether and how QEMU should create the snapshot file
967         (NewImageMode, optional, default "absolute-paths")
968       When "type" is "blockdev-snapshot-internal-sync":
969       - "device": the device name or node-name of a root node to snapshot
970                   (json-string)
971       - "name": name of the new snapshot (json-string)
973 Example:
975 -> { "execute": "transaction",
976      "arguments": { "actions": [
977          { "type": "blockdev-snapshot-sync", "data" : { "device": "ide-hd0",
978                                          "snapshot-file": "/some/place/my-image",
979                                          "format": "qcow2" } },
980          { "type": "blockdev-snapshot-sync", "data" : { "node-name": "myfile",
981                                          "snapshot-file": "/some/place/my-image2",
982                                          "snapshot-node-name": "node3432",
983                                          "mode": "existing",
984                                          "format": "qcow2" } },
985          { "type": "blockdev-snapshot-sync", "data" : { "device": "ide-hd1",
986                                          "snapshot-file": "/some/place/my-image2",
987                                          "mode": "existing",
988                                          "format": "qcow2" } },
989          { "type": "blockdev-snapshot-internal-sync", "data" : {
990                                          "device": "ide-hd2",
991                                          "name": "snapshot0" } } ] } }
992 <- { "return": {} }
994 block-dirty-bitmap-add
995 ----------------------
996 Since 2.4
998 Create a dirty bitmap with a name on the device, and start tracking the writes.
1000 Arguments:
1002 - "node": device/node on which to create dirty bitmap (json-string)
1003 - "name": name of the new dirty bitmap (json-string)
1004 - "granularity": granularity to track writes with (int, optional)
1006 Example:
1008 -> { "execute": "block-dirty-bitmap-add", "arguments": { "node": "drive0",
1009                                                    "name": "bitmap0" } }
1010 <- { "return": {} }
1012 block-dirty-bitmap-remove
1013 -------------------------
1014 Since 2.4
1016 Stop write tracking and remove the dirty bitmap that was created with
1017 block-dirty-bitmap-add.
1019 Arguments:
1021 - "node": device/node on which to remove dirty bitmap (json-string)
1022 - "name": name of the dirty bitmap to remove (json-string)
1024 Example:
1026 -> { "execute": "block-dirty-bitmap-remove", "arguments": { "node": "drive0",
1027                                                       "name": "bitmap0" } }
1028 <- { "return": {} }
1030 block-dirty-bitmap-clear
1031 ------------------------
1032 Since 2.4
1034 Reset the dirty bitmap associated with a node so that an incremental backup
1035 from this point in time forward will only backup clusters modified after this
1036 clear operation.
1038 Arguments:
1040 - "node": device/node on which to remove dirty bitmap (json-string)
1041 - "name": name of the dirty bitmap to remove (json-string)
1043 Example:
1045 -> { "execute": "block-dirty-bitmap-clear", "arguments": { "node": "drive0",
1046                                                            "name": "bitmap0" } }
1047 <- { "return": {} }
1049 blockdev-snapshot-sync
1050 ----------------------
1052 Synchronous snapshot of a block device. snapshot-file specifies the
1053 target of the new image. If the file exists, or if it is a device, the
1054 snapshot will be created in the existing file/device. If does not
1055 exist, a new file will be created. format specifies the format of the
1056 snapshot image, default is qcow2.
1058 Arguments:
1060 - "device": device name to snapshot (json-string)
1061 - "node-name": graph node name to snapshot (json-string)
1062 - "snapshot-file": name of new image file (json-string)
1063 - "snapshot-node-name": graph node name of the new snapshot (json-string)
1064 - "mode": whether and how QEMU should create the snapshot file
1065   (NewImageMode, optional, default "absolute-paths")
1066 - "format": format of new image (json-string, optional)
1068 Example:
1070 -> { "execute": "blockdev-snapshot-sync", "arguments": { "device": "ide-hd0",
1071                                                          "snapshot-file":
1072                                                         "/some/place/my-image",
1073                                                         "format": "qcow2" } }
1074 <- { "return": {} }
1076 blockdev-snapshot
1077 -----------------
1078 Since 2.5
1080 Create a snapshot, by installing 'node' as the backing image of
1081 'overlay'. Additionally, if 'node' is associated with a block
1082 device, the block device changes to using 'overlay' as its new active
1083 image.
1085 Arguments:
1087 - "node": device that will have a snapshot created (json-string)
1088 - "overlay": device that will have 'node' as its backing image (json-string)
1090 Example:
1092 -> { "execute": "blockdev-add",
1093                 "arguments": { "options": { "driver": "qcow2",
1094                                             "node-name": "node1534",
1095                                             "file": { "driver": "file",
1096                                                       "filename": "hd1.qcow2" },
1097                                             "backing": "" } } }
1099 <- { "return": {} }
1101 -> { "execute": "blockdev-snapshot", "arguments": { "node": "ide-hd0",
1102                                                     "overlay": "node1534" } }
1103 <- { "return": {} }
1105 blockdev-snapshot-internal-sync
1106 -------------------------------
1108 Synchronously take an internal snapshot of a block device when the format of
1109 image used supports it.  If the name is an empty string, or a snapshot with
1110 name already exists, the operation will fail.
1112 Arguments:
1114 - "device": the device name or node-name of a root node to snapshot
1115             (json-string)
1116 - "name": name of the new snapshot (json-string)
1118 Example:
1120 -> { "execute": "blockdev-snapshot-internal-sync",
1121                 "arguments": { "device": "ide-hd0",
1122                                "name": "snapshot0" }
1123    }
1124 <- { "return": {} }
1126 blockdev-snapshot-delete-internal-sync
1127 --------------------------------------
1129 Synchronously delete an internal snapshot of a block device when the format of
1130 image used supports it.  The snapshot is identified by name or id or both.  One
1131 of name or id is required.  If the snapshot is not found, the operation will
1132 fail.
1134 Arguments:
1136 - "device": the device name or node-name of a root node (json-string)
1137 - "id": ID of the snapshot (json-string, optional)
1138 - "name": name of the snapshot (json-string, optional)
1140 Example:
1142 -> { "execute": "blockdev-snapshot-delete-internal-sync",
1143                 "arguments": { "device": "ide-hd0",
1144                                "name": "snapshot0" }
1145    }
1146 <- { "return": {
1147                    "id": "1",
1148                    "name": "snapshot0",
1149                    "vm-state-size": 0,
1150                    "date-sec": 1000012,
1151                    "date-nsec": 10,
1152                    "vm-clock-sec": 100,
1153                    "vm-clock-nsec": 20
1154      }
1155    }
1157 drive-mirror
1158 ------------
1160 Start mirroring a block device's writes to a new destination. target
1161 specifies the target of the new image. If the file exists, or if it is
1162 a device, it will be used as the new destination for writes. If it does not
1163 exist, a new file will be created. format specifies the format of the
1164 mirror image, default is to probe if mode='existing', else the format
1165 of the source.
1167 Arguments:
1169 - "job-id": Identifier for the newly-created block job. If omitted,
1170             the device name will be used. (json-string, optional)
1171 - "device": the device name or node-name of a root node whose writes should be
1172             mirrored. (json-string)
1173 - "target": name of new image file (json-string)
1174 - "format": format of new image (json-string, optional)
1175 - "node-name": the name of the new block driver state in the node graph
1176                (json-string, optional)
1177 - "replaces": the block driver node name to replace when finished
1178               (json-string, optional)
1179 - "mode": how an image file should be created into the target
1180   file/device (NewImageMode, optional, default 'absolute-paths')
1181 - "speed": maximum speed of the streaming job, in bytes per second
1182   (json-int)
1183 - "granularity": granularity of the dirty bitmap, in bytes (json-int, optional)
1184 - "buf-size": maximum amount of data in flight from source to target, in bytes
1185   (json-int, default 10M)
1186 - "sync": what parts of the disk image should be copied to the destination;
1187   possibilities include "full" for all the disk, "top" for only the sectors
1188   allocated in the topmost image, or "none" to only replicate new I/O
1189   (MirrorSyncMode).
1190 - "on-source-error": the action to take on an error on the source
1191   (BlockdevOnError, default 'report')
1192 - "on-target-error": the action to take on an error on the target
1193   (BlockdevOnError, default 'report')
1194 - "unmap": whether the target sectors should be discarded where source has only
1195   zeroes. (json-bool, optional, default true)
1197 The default value of the granularity is the image cluster size clamped
1198 between 4096 and 65536, if the image format defines one.  If the format
1199 does not define a cluster size, the default value of the granularity
1200 is 65536.
1203 Example:
1205 -> { "execute": "drive-mirror", "arguments": { "device": "ide-hd0",
1206                                                "target": "/some/place/my-image",
1207                                                "sync": "full",
1208                                                "format": "qcow2" } }
1209 <- { "return": {} }
1211 blockdev-mirror
1212 ------------
1214 Start mirroring a block device's writes to another block device. target
1215 specifies the target of mirror operation.
1217 Arguments:
1219 - "job-id": Identifier for the newly-created block job. If omitted,
1220             the device name will be used. (json-string, optional)
1221 - "device": The device name or node-name of a root node whose writes should be
1222             mirrored (json-string)
1223 - "target": device name to mirror to (json-string)
1224 - "replaces": the block driver node name to replace when finished
1225               (json-string, optional)
1226 - "speed": maximum speed of the streaming job, in bytes per second
1227   (json-int)
1228 - "granularity": granularity of the dirty bitmap, in bytes (json-int, optional)
1229 - "buf_size": maximum amount of data in flight from source to target, in bytes
1230   (json-int, default 10M)
1231 - "sync": what parts of the disk image should be copied to the destination;
1232   possibilities include "full" for all the disk, "top" for only the sectors
1233   allocated in the topmost image, or "none" to only replicate new I/O
1234   (MirrorSyncMode).
1235 - "on-source-error": the action to take on an error on the source
1236   (BlockdevOnError, default 'report')
1237 - "on-target-error": the action to take on an error on the target
1238   (BlockdevOnError, default 'report')
1240 The default value of the granularity is the image cluster size clamped
1241 between 4096 and 65536, if the image format defines one.  If the format
1242 does not define a cluster size, the default value of the granularity
1243 is 65536.
1245 Example:
1247 -> { "execute": "blockdev-mirror", "arguments": { "device": "ide-hd0",
1248                                                   "target": "target0",
1249                                                   "sync": "full" } }
1250 <- { "return": {} }
1252 change-backing-file
1253 -------------------
1254 Since: 2.1
1256 Change the backing file in the image file metadata.  This does not cause
1257 QEMU to reopen the image file to reparse the backing filename (it may,
1258 however, perform a reopen to change permissions from r/o -> r/w -> r/o,
1259 if needed). The new backing file string is written into the image file
1260 metadata, and the QEMU internal strings are updated.
1262 Arguments:
1264 - "image-node-name":    The name of the block driver state node of the
1265                         image to modify.  The "device" is argument is used to
1266                         verify "image-node-name" is in the chain described by
1267                         "device".
1268                         (json-string, optional)
1270 - "device":             The device name or node-name of the root node that owns
1271                         image-node-name.
1272                         (json-string)
1274 - "backing-file":       The string to write as the backing file.  This string is
1275                         not validated, so care should be taken when specifying
1276                         the string or the image chain may not be able to be
1277                         reopened again.
1278                         (json-string)
1280 Returns: Nothing on success
1281          If "device" does not exist or cannot be determined, DeviceNotFound
1283 balloon
1284 -------
1286 Request VM to change its memory allocation (in bytes).
1288 Arguments:
1290 - "value": New memory allocation (json-int)
1292 Example:
1294 -> { "execute": "balloon", "arguments": { "value": 536870912 } }
1295 <- { "return": {} }
1297 set_link
1298 --------
1300 Change the link status of a network adapter.
1302 Arguments:
1304 - "name": network device name (json-string)
1305 - "up": status is up (json-bool)
1307 Example:
1309 -> { "execute": "set_link", "arguments": { "name": "e1000.0", "up": false } }
1310 <- { "return": {} }
1312 getfd
1313 -----
1315 Receive a file descriptor via SCM rights and assign it a name.
1317 Arguments:
1319 - "fdname": file descriptor name (json-string)
1321 Example:
1323 -> { "execute": "getfd", "arguments": { "fdname": "fd1" } }
1324 <- { "return": {} }
1326 Notes:
1328 (1) If the name specified by the "fdname" argument already exists,
1329     the file descriptor assigned to it will be closed and replaced
1330     by the received file descriptor.
1331 (2) The 'closefd' command can be used to explicitly close the file
1332     descriptor when it is no longer needed.
1334 closefd
1335 -------
1337 Close a file descriptor previously passed via SCM rights.
1339 Arguments:
1341 - "fdname": file descriptor name (json-string)
1343 Example:
1345 -> { "execute": "closefd", "arguments": { "fdname": "fd1" } }
1346 <- { "return": {} }
1348 add-fd
1349 -------
1351 Add a file descriptor, that was passed via SCM rights, to an fd set.
1353 Arguments:
1355 - "fdset-id": The ID of the fd set to add the file descriptor to.
1356               (json-int, optional)
1357 - "opaque": A free-form string that can be used to describe the fd.
1358             (json-string, optional)
1360 Return a json-object with the following information:
1362 - "fdset-id": The ID of the fd set that the fd was added to. (json-int)
1363 - "fd": The file descriptor that was received via SCM rights and added to the
1364         fd set. (json-int)
1366 Example:
1368 -> { "execute": "add-fd", "arguments": { "fdset-id": 1 } }
1369 <- { "return": { "fdset-id": 1, "fd": 3 } }
1371 Notes:
1373 (1) The list of fd sets is shared by all monitor connections.
1374 (2) If "fdset-id" is not specified, a new fd set will be created.
1376 remove-fd
1377 ---------
1379 Remove a file descriptor from an fd set.
1381 Arguments:
1383 - "fdset-id": The ID of the fd set that the file descriptor belongs to.
1384               (json-int)
1385 - "fd": The file descriptor that is to be removed. (json-int, optional)
1387 Example:
1389 -> { "execute": "remove-fd", "arguments": { "fdset-id": 1, "fd": 3 } }
1390 <- { "return": {} }
1392 Notes:
1394 (1) The list of fd sets is shared by all monitor connections.
1395 (2) If "fd" is not specified, all file descriptors in "fdset-id" will be
1396     removed.
1398 query-fdsets
1399 -------------
1401 Return information describing all fd sets.
1403 Arguments: None
1405 Example:
1407 -> { "execute": "query-fdsets" }
1408 <- { "return": [
1409        {
1410          "fds": [
1411            {
1412              "fd": 30,
1413              "opaque": "rdonly:/path/to/file"
1414            },
1415            {
1416              "fd": 24,
1417              "opaque": "rdwr:/path/to/file"
1418            }
1419          ],
1420          "fdset-id": 1
1421        },
1422        {
1423          "fds": [
1424            {
1425              "fd": 28
1426            },
1427            {
1428              "fd": 29
1429            }
1430          ],
1431          "fdset-id": 0
1432        }
1433      ]
1434    }
1436 Note: The list of fd sets is shared by all monitor connections.
1438 block_passwd
1439 ------------
1441 Set the password of encrypted block devices.
1443 Arguments:
1445 - "device": device name (json-string)
1446 - "node-name": name in the block driver state graph (json-string)
1447 - "password": password (json-string)
1449 Example:
1451 -> { "execute": "block_passwd", "arguments": { "device": "ide0-hd0",
1452                                                "password": "12345" } }
1453 <- { "return": {} }
1455 block_set_io_throttle
1456 ------------
1458 Change I/O throttle limits for a block drive.
1460 Arguments:
1462 - "device": block device name (deprecated, use @id instead)
1463             (json-string, optional)
1464 - "id": the name or QOM path of the guest device (json-string, optional)
1465 - "bps": total throughput limit in bytes per second (json-int)
1466 - "bps_rd": read throughput limit in bytes per second (json-int)
1467 - "bps_wr": write throughput limit in bytes per second (json-int)
1468 - "iops": total I/O operations per second (json-int)
1469 - "iops_rd": read I/O operations per second (json-int)
1470 - "iops_wr": write I/O operations per second (json-int)
1471 - "bps_max": total throughput limit during bursts, in bytes (json-int, optional)
1472 - "bps_rd_max": read throughput limit during bursts, in bytes (json-int, optional)
1473 - "bps_wr_max": write throughput limit during bursts, in bytes (json-int, optional)
1474 - "iops_max": total I/O operations per second during bursts (json-int, optional)
1475 - "iops_rd_max": read I/O operations per second during bursts (json-int, optional)
1476 - "iops_wr_max": write I/O operations per second during bursts (json-int, optional)
1477 - "bps_max_length": maximum length of the @bps_max burst period, in seconds (json-int, optional)
1478 - "bps_rd_max_length": maximum length of the @bps_rd_max burst period, in seconds (json-int, optional)
1479 - "bps_wr_max_length": maximum length of the @bps_wr_max burst period, in seconds (json-int, optional)
1480 - "iops_max_length": maximum length of the @iops_max burst period, in seconds (json-int, optional)
1481 - "iops_rd_max_length": maximum length of the @iops_rd_max burst period, in seconds (json-int, optional)
1482 - "iops_wr_max_length": maximum length of the @iops_wr_max burst period, in seconds (json-int, optional)
1483 - "iops_size":  I/O size in bytes when limiting (json-int, optional)
1484 - "group": throttle group name (json-string, optional)
1486 Example:
1488 -> { "execute": "block_set_io_throttle", "arguments": { "id": "ide0-1-0",
1489                                                "bps": 1000000,
1490                                                "bps_rd": 0,
1491                                                "bps_wr": 0,
1492                                                "iops": 0,
1493                                                "iops_rd": 0,
1494                                                "iops_wr": 0,
1495                                                "bps_max": 8000000,
1496                                                "bps_rd_max": 0,
1497                                                "bps_wr_max": 0,
1498                                                "iops_max": 0,
1499                                                "iops_rd_max": 0,
1500                                                "iops_wr_max": 0,
1501                                                "bps_max_length": 60,
1502                                                "iops_size": 0 } }
1503 <- { "return": {} }
1505 set_password
1506 ------------
1508 Set the password for vnc/spice protocols.
1510 Arguments:
1512 - "protocol": protocol name (json-string)
1513 - "password": password (json-string)
1514 - "connected": [ keep | disconnect | fail ] (json-string, optional)
1516 Example:
1518 -> { "execute": "set_password", "arguments": { "protocol": "vnc",
1519                                                "password": "secret" } }
1520 <- { "return": {} }
1522 expire_password
1523 ---------------
1525 Set the password expire time for vnc/spice protocols.
1527 Arguments:
1529 - "protocol": protocol name (json-string)
1530 - "time": [ now | never | +secs | secs ] (json-string)
1532 Example:
1534 -> { "execute": "expire_password", "arguments": { "protocol": "vnc",
1535                                                   "time": "+60" } }
1536 <- { "return": {} }
1538 add_client
1539 ----------
1541 Add a graphics client
1543 Arguments:
1545 - "protocol": protocol name (json-string)
1546 - "fdname": file descriptor name (json-string)
1547 - "skipauth": whether to skip authentication (json-bool, optional)
1548 - "tls": whether to perform TLS (json-bool, optional)
1550 Example:
1552 -> { "execute": "add_client", "arguments": { "protocol": "vnc",
1553                                              "fdname": "myclient" } }
1554 <- { "return": {} }
1556 qmp_capabilities
1557 ----------------
1559 Enable QMP capabilities.
1561 Arguments: None.
1563 Example:
1565 -> { "execute": "qmp_capabilities" }
1566 <- { "return": {} }
1568 Note: This command must be issued before issuing any other command.
1570 human-monitor-command
1571 ---------------------
1573 Execute a Human Monitor command.
1575 Arguments:
1577 - command-line: the command name and its arguments, just like the
1578                 Human Monitor's shell (json-string)
1579 - cpu-index: select the CPU number to be used by commands which access CPU
1580              data, like 'info registers'. The Monitor selects CPU 0 if this
1581              argument is not provided (json-int, optional)
1583 Example:
1585 -> { "execute": "human-monitor-command", "arguments": { "command-line": "info kvm" } }
1586 <- { "return": "kvm support: enabled\r\n" }
1588 Notes:
1590 (1) The Human Monitor is NOT an stable interface, this means that command
1591     names, arguments and responses can change or be removed at ANY time.
1592     Applications that rely on long term stability guarantees should NOT
1593     use this command
1595 (2) Limitations:
1597     o This command is stateless, this means that commands that depend
1598       on state information (such as getfd) might not work
1600     o Commands that prompt the user for data (eg. 'cont' when the block
1601       device is encrypted) don't currently work
1603 3. Query Commands
1604 =================
1607 query-version
1608 -------------
1610 Show QEMU version.
1612 Return a json-object with the following information:
1614 - "qemu": A json-object containing three integer values:
1615     - "major": QEMU's major version (json-int)
1616     - "minor": QEMU's minor version (json-int)
1617     - "micro": QEMU's micro version (json-int)
1618 - "package": package's version (json-string)
1620 Example:
1622 -> { "execute": "query-version" }
1623 <- {
1624       "return":{
1625          "qemu":{
1626             "major":0,
1627             "minor":11,
1628             "micro":5
1629          },
1630          "package":""
1631       }
1632    }
1634 query-commands
1635 --------------
1637 List QMP available commands.
1639 Each command is represented by a json-object, the returned value is a json-array
1640 of all commands.
1642 Each json-object contain:
1644 - "name": command's name (json-string)
1646 Example:
1648 -> { "execute": "query-commands" }
1649 <- {
1650       "return":[
1651          {
1652             "name":"query-balloon"
1653          },
1654          {
1655             "name":"system_powerdown"
1656          }
1657       ]
1658    }
1660 Note: This example has been shortened as the real response is too long.
1662 query-events
1663 --------------
1665 List QMP available events.
1667 Each event is represented by a json-object, the returned value is a json-array
1668 of all events.
1670 Each json-object contains:
1672 - "name": event's name (json-string)
1674 Example:
1676 -> { "execute": "query-events" }
1677 <- {
1678       "return":[
1679          {
1680             "name":"SHUTDOWN"
1681          },
1682          {
1683             "name":"RESET"
1684          }
1685       ]
1686    }
1688 Note: This example has been shortened as the real response is too long.
1690 query-qmp-schema
1691 ----------------
1693 Return the QMP wire schema.  The returned value is a json-array of
1694 named schema entities.  Entities are commands, events and various
1695 types.  See docs/qapi-code-gen.txt for information on their structure
1696 and intended use.
1698 query-chardev
1699 -------------
1701 Each device is represented by a json-object. The returned value is a json-array
1702 of all devices.
1704 Each json-object contain the following:
1706 - "label": device's label (json-string)
1707 - "filename": device's file (json-string)
1708 - "frontend-open": open/closed state of the frontend device attached to this
1709                    backend (json-bool)
1711 Example:
1713 -> { "execute": "query-chardev" }
1714 <- {
1715       "return": [
1716          {
1717             "label": "charchannel0",
1718             "filename": "unix:/var/lib/libvirt/qemu/seabios.rhel6.agent,server",
1719             "frontend-open": false
1720          },
1721          {
1722             "label": "charmonitor",
1723             "filename": "unix:/var/lib/libvirt/qemu/seabios.rhel6.monitor,server",
1724             "frontend-open": true
1725          },
1726          {
1727             "label": "charserial0",
1728             "filename": "pty:/dev/pts/2",
1729             "frontend-open": true
1730          }
1731       ]
1732    }
1734 query-chardev-backends
1735 -------------
1737 List available character device backends.
1739 Each backend is represented by a json-object, the returned value is a json-array
1740 of all backends.
1742 Each json-object contains:
1744 - "name": backend name (json-string)
1746 Example:
1748 -> { "execute": "query-chardev-backends" }
1749 <- {
1750       "return":[
1751          {
1752             "name":"udp"
1753          },
1754          {
1755             "name":"tcp"
1756          },
1757          {
1758             "name":"unix"
1759          },
1760          {
1761             "name":"spiceport"
1762          }
1763       ]
1764    }
1766 query-block
1767 -----------
1769 Show the block devices.
1771 Each block device information is stored in a json-object and the returned value
1772 is a json-array of all devices.
1774 Each json-object contain the following:
1776 - "device": device name (json-string)
1777 - "type": device type (json-string)
1778          - deprecated, retained for backward compatibility
1779          - Possible values: "unknown"
1780 - "removable": true if the device is removable, false otherwise (json-bool)
1781 - "locked": true if the device is locked, false otherwise (json-bool)
1782 - "tray_open": only present if removable, true if the device has a tray,
1783                and it is open (json-bool)
1784 - "inserted": only present if the device is inserted, it is a json-object
1785    containing the following:
1786          - "file": device file name (json-string)
1787          - "ro": true if read-only, false otherwise (json-bool)
1788          - "drv": driver format name (json-string)
1789              - Possible values: "blkdebug", "bochs", "cloop", "dmg",
1790                                 "file", "file", "ftp", "ftps", "host_cdrom",
1791                                 "host_device", "http", "https",
1792                                 "nbd", "parallels", "qcow", "qcow2", "raw",
1793                                 "tftp", "vdi", "vmdk", "vpc", "vvfat"
1794          - "backing_file": backing file name (json-string, optional)
1795          - "backing_file_depth": number of files in the backing file chain (json-int)
1796          - "encrypted": true if encrypted, false otherwise (json-bool)
1797          - "bps": limit total bytes per second (json-int)
1798          - "bps_rd": limit read bytes per second (json-int)
1799          - "bps_wr": limit write bytes per second (json-int)
1800          - "iops": limit total I/O operations per second (json-int)
1801          - "iops_rd": limit read operations per second (json-int)
1802          - "iops_wr": limit write operations per second (json-int)
1803          - "bps_max":  total max in bytes (json-int)
1804          - "bps_rd_max":  read max in bytes (json-int)
1805          - "bps_wr_max":  write max in bytes (json-int)
1806          - "iops_max":  total I/O operations max (json-int)
1807          - "iops_rd_max":  read I/O operations max (json-int)
1808          - "iops_wr_max":  write I/O operations max (json-int)
1809          - "iops_size": I/O size when limiting by iops (json-int)
1810          - "detect_zeroes": detect and optimize zero writing (json-string)
1811              - Possible values: "off", "on", "unmap"
1812          - "write_threshold": write offset threshold in bytes, a event will be
1813                               emitted if crossed. Zero if disabled (json-int)
1814          - "image": the detail of the image, it is a json-object containing
1815             the following:
1816              - "filename": image file name (json-string)
1817              - "format": image format (json-string)
1818              - "virtual-size": image capacity in bytes (json-int)
1819              - "dirty-flag": true if image is not cleanly closed, not present
1820                              means clean (json-bool, optional)
1821              - "actual-size": actual size on disk in bytes of the image, not
1822                               present when image does not support thin
1823                               provision (json-int, optional)
1824              - "cluster-size": size of a cluster in bytes, not present if image
1825                                format does not support it (json-int, optional)
1826              - "encrypted": true if the image is encrypted, not present means
1827                             false or the image format does not support
1828                             encryption (json-bool, optional)
1829              - "backing_file": backing file name, not present means no backing
1830                                file is used or the image format does not
1831                                support backing file chain
1832                                (json-string, optional)
1833              - "full-backing-filename": full path of the backing file, not
1834                                         present if it equals backing_file or no
1835                                         backing file is used
1836                                         (json-string, optional)
1837              - "backing-filename-format": the format of the backing file, not
1838                                           present means unknown or no backing
1839                                           file (json-string, optional)
1840              - "snapshots": the internal snapshot info, it is an optional list
1841                 of json-object containing the following:
1842                  - "id": unique snapshot id (json-string)
1843                  - "name": snapshot name (json-string)
1844                  - "vm-state-size": size of the VM state in bytes (json-int)
1845                  - "date-sec": UTC date of the snapshot in seconds (json-int)
1846                  - "date-nsec": fractional part in nanoseconds to be used with
1847                                 date-sec (json-int)
1848                  - "vm-clock-sec": VM clock relative to boot in seconds
1849                                    (json-int)
1850                  - "vm-clock-nsec": fractional part in nanoseconds to be used
1851                                     with vm-clock-sec (json-int)
1852              - "backing-image": the detail of the backing image, it is an
1853                                 optional json-object only present when a
1854                                 backing image present for this image
1856 - "io-status": I/O operation status, only present if the device supports it
1857                and the VM is configured to stop on errors. It's always reset
1858                to "ok" when the "cont" command is issued (json_string, optional)
1859              - Possible values: "ok", "failed", "nospace"
1861 Example:
1863 -> { "execute": "query-block" }
1864 <- {
1865       "return":[
1866          {
1867             "io-status": "ok",
1868             "device":"ide0-hd0",
1869             "locked":false,
1870             "removable":false,
1871             "inserted":{
1872                "ro":false,
1873                "drv":"qcow2",
1874                "encrypted":false,
1875                "file":"disks/test.qcow2",
1876                "backing_file_depth":1,
1877                "bps":1000000,
1878                "bps_rd":0,
1879                "bps_wr":0,
1880                "iops":1000000,
1881                "iops_rd":0,
1882                "iops_wr":0,
1883                "bps_max": 8000000,
1884                "bps_rd_max": 0,
1885                "bps_wr_max": 0,
1886                "iops_max": 0,
1887                "iops_rd_max": 0,
1888                "iops_wr_max": 0,
1889                "iops_size": 0,
1890                "detect_zeroes": "on",
1891                "write_threshold": 0,
1892                "image":{
1893                   "filename":"disks/test.qcow2",
1894                   "format":"qcow2",
1895                   "virtual-size":2048000,
1896                   "backing_file":"base.qcow2",
1897                   "full-backing-filename":"disks/base.qcow2",
1898                   "backing-filename-format":"qcow2",
1899                   "snapshots":[
1900                      {
1901                         "id": "1",
1902                         "name": "snapshot1",
1903                         "vm-state-size": 0,
1904                         "date-sec": 10000200,
1905                         "date-nsec": 12,
1906                         "vm-clock-sec": 206,
1907                         "vm-clock-nsec": 30
1908                      }
1909                   ],
1910                   "backing-image":{
1911                       "filename":"disks/base.qcow2",
1912                       "format":"qcow2",
1913                       "virtual-size":2048000
1914                   }
1915                }
1916             },
1917             "type":"unknown"
1918          },
1919          {
1920             "io-status": "ok",
1921             "device":"ide1-cd0",
1922             "locked":false,
1923             "removable":true,
1924             "type":"unknown"
1925          },
1926          {
1927             "device":"floppy0",
1928             "locked":false,
1929             "removable":true,
1930             "type":"unknown"
1931          },
1932          {
1933             "device":"sd0",
1934             "locked":false,
1935             "removable":true,
1936             "type":"unknown"
1937          }
1938       ]
1939    }
1941 query-blockstats
1942 ----------------
1944 Show block device statistics.
1946 Each device statistic information is stored in a json-object and the returned
1947 value is a json-array of all devices.
1949 Each json-object contain the following:
1951 - "device": device name (json-string)
1952 - "stats": A json-object with the statistics information, it contains:
1953     - "rd_bytes": bytes read (json-int)
1954     - "wr_bytes": bytes written (json-int)
1955     - "rd_operations": read operations (json-int)
1956     - "wr_operations": write operations (json-int)
1957     - "flush_operations": cache flush operations (json-int)
1958     - "wr_total_time_ns": total time spend on writes in nano-seconds (json-int)
1959     - "rd_total_time_ns": total time spend on reads in nano-seconds (json-int)
1960     - "flush_total_time_ns": total time spend on cache flushes in nano-seconds (json-int)
1961     - "wr_highest_offset": The offset after the greatest byte written to the
1962                            BlockDriverState since it has been opened (json-int)
1963     - "rd_merged": number of read requests that have been merged into
1964                    another request (json-int)
1965     - "wr_merged": number of write requests that have been merged into
1966                    another request (json-int)
1967     - "idle_time_ns": time since the last I/O operation, in
1968                       nanoseconds. If the field is absent it means
1969                       that there haven't been any operations yet
1970                       (json-int, optional)
1971     - "failed_rd_operations": number of failed read operations
1972                               (json-int)
1973     - "failed_wr_operations": number of failed write operations
1974                               (json-int)
1975     - "failed_flush_operations": number of failed flush operations
1976                                (json-int)
1977     - "invalid_rd_operations": number of invalid read operations
1978                                (json-int)
1979     - "invalid_wr_operations": number of invalid write operations
1980                                (json-int)
1981     - "invalid_flush_operations": number of invalid flush operations
1982                                   (json-int)
1983     - "account_invalid": whether invalid operations are included in
1984                          the last access statistics (json-bool)
1985     - "account_failed": whether failed operations are included in the
1986                          latency and last access statistics
1987                          (json-bool)
1988     - "timed_stats": A json-array containing statistics collected in
1989                      specific intervals, with the following members:
1990         - "interval_length": interval used for calculating the
1991                              statistics, in seconds (json-int)
1992         - "min_rd_latency_ns": minimum latency of read operations in
1993                                the defined interval, in nanoseconds
1994                                (json-int)
1995         - "min_wr_latency_ns": minimum latency of write operations in
1996                                the defined interval, in nanoseconds
1997                                (json-int)
1998         - "min_flush_latency_ns": minimum latency of flush operations
1999                                   in the defined interval, in
2000                                   nanoseconds (json-int)
2001         - "max_rd_latency_ns": maximum latency of read operations in
2002                                the defined interval, in nanoseconds
2003                                (json-int)
2004         - "max_wr_latency_ns": maximum latency of write operations in
2005                                the defined interval, in nanoseconds
2006                                (json-int)
2007         - "max_flush_latency_ns": maximum latency of flush operations
2008                                   in the defined interval, in
2009                                   nanoseconds (json-int)
2010         - "avg_rd_latency_ns": average latency of read operations in
2011                                the defined interval, in nanoseconds
2012                                (json-int)
2013         - "avg_wr_latency_ns": average latency of write operations in
2014                                the defined interval, in nanoseconds
2015                                (json-int)
2016         - "avg_flush_latency_ns": average latency of flush operations
2017                                   in the defined interval, in
2018                                   nanoseconds (json-int)
2019         - "avg_rd_queue_depth": average number of pending read
2020                                 operations in the defined interval
2021                                 (json-number)
2022         - "avg_wr_queue_depth": average number of pending write
2023                                 operations in the defined interval
2024                                 (json-number).
2025 - "parent": Contains recursively the statistics of the underlying
2026             protocol (e.g. the host file for a qcow2 image). If there is
2027             no underlying protocol, this field is omitted
2028             (json-object, optional)
2030 Example:
2032 -> { "execute": "query-blockstats" }
2033 <- {
2034       "return":[
2035          {
2036             "device":"ide0-hd0",
2037             "parent":{
2038                "stats":{
2039                   "wr_highest_offset":3686448128,
2040                   "wr_bytes":9786368,
2041                   "wr_operations":751,
2042                   "rd_bytes":122567168,
2043                   "rd_operations":36772
2044                   "wr_total_times_ns":313253456
2045                   "rd_total_times_ns":3465673657
2046                   "flush_total_times_ns":49653
2047                   "flush_operations":61,
2048                   "rd_merged":0,
2049                   "wr_merged":0,
2050                   "idle_time_ns":2953431879,
2051                   "account_invalid":true,
2052                   "account_failed":false
2053                }
2054             },
2055             "stats":{
2056                "wr_highest_offset":2821110784,
2057                "wr_bytes":9786368,
2058                "wr_operations":692,
2059                "rd_bytes":122739200,
2060                "rd_operations":36604
2061                "flush_operations":51,
2062                "wr_total_times_ns":313253456
2063                "rd_total_times_ns":3465673657
2064                "flush_total_times_ns":49653,
2065                "rd_merged":0,
2066                "wr_merged":0,
2067                "idle_time_ns":2953431879,
2068                "account_invalid":true,
2069                "account_failed":false
2070             }
2071          },
2072          {
2073             "device":"ide1-cd0",
2074             "stats":{
2075                "wr_highest_offset":0,
2076                "wr_bytes":0,
2077                "wr_operations":0,
2078                "rd_bytes":0,
2079                "rd_operations":0
2080                "flush_operations":0,
2081                "wr_total_times_ns":0
2082                "rd_total_times_ns":0
2083                "flush_total_times_ns":0,
2084                "rd_merged":0,
2085                "wr_merged":0,
2086                "account_invalid":false,
2087                "account_failed":false
2088             }
2089          },
2090          {
2091             "device":"floppy0",
2092             "stats":{
2093                "wr_highest_offset":0,
2094                "wr_bytes":0,
2095                "wr_operations":0,
2096                "rd_bytes":0,
2097                "rd_operations":0
2098                "flush_operations":0,
2099                "wr_total_times_ns":0
2100                "rd_total_times_ns":0
2101                "flush_total_times_ns":0,
2102                "rd_merged":0,
2103                "wr_merged":0,
2104                "account_invalid":false,
2105                "account_failed":false
2106             }
2107          },
2108          {
2109             "device":"sd0",
2110             "stats":{
2111                "wr_highest_offset":0,
2112                "wr_bytes":0,
2113                "wr_operations":0,
2114                "rd_bytes":0,
2115                "rd_operations":0
2116                "flush_operations":0,
2117                "wr_total_times_ns":0
2118                "rd_total_times_ns":0
2119                "flush_total_times_ns":0,
2120                "rd_merged":0,
2121                "wr_merged":0,
2122                "account_invalid":false,
2123                "account_failed":false
2124             }
2125          }
2126       ]
2127    }
2129 query-cpus
2130 ----------
2132 Show CPU information.
2134 Return a json-array. Each CPU is represented by a json-object, which contains:
2136 - "CPU": CPU index (json-int)
2137 - "current": true if this is the current CPU, false otherwise (json-bool)
2138 - "halted": true if the cpu is halted, false otherwise (json-bool)
2139 - "qom_path": path to the CPU object in the QOM tree (json-str)
2140 - "arch": architecture of the cpu, which determines what additional
2141           keys will be present (json-str)
2142 - Current program counter. The key's name depends on the architecture:
2143      "pc": i386/x86_64 (json-int)
2144      "nip": PPC (json-int)
2145      "pc" and "npc": sparc (json-int)
2146      "PC": mips (json-int)
2147 - "thread_id": ID of the underlying host thread (json-int)
2149 Example:
2151 -> { "execute": "query-cpus" }
2152 <- {
2153       "return":[
2154          {
2155             "CPU":0,
2156             "current":true,
2157             "halted":false,
2158             "qom_path":"/machine/unattached/device[0]",
2159             "arch":"x86",
2160             "pc":3227107138,
2161             "thread_id":3134
2162          },
2163          {
2164             "CPU":1,
2165             "current":false,
2166             "halted":true,
2167             "qom_path":"/machine/unattached/device[2]",
2168             "arch":"x86",
2169             "pc":7108165,
2170             "thread_id":3135
2171          }
2172       ]
2173    }
2175 query-iothreads
2176 ---------------
2178 Returns a list of information about each iothread.
2180 Note this list excludes the QEMU main loop thread, which is not declared
2181 using the -object iothread command-line option.  It is always the main thread
2182 of the process.
2184 Return a json-array. Each iothread is represented by a json-object, which contains:
2186 - "id": name of iothread (json-str)
2187 - "thread-id": ID of the underlying host thread (json-int)
2189 Example:
2191 -> { "execute": "query-iothreads" }
2192 <- {
2193       "return":[
2194          {
2195             "id":"iothread0",
2196             "thread-id":3134
2197          },
2198          {
2199             "id":"iothread1",
2200             "thread-id":3135
2201          }
2202       ]
2203    }
2205 query-pci
2206 ---------
2208 PCI buses and devices information.
2210 The returned value is a json-array of all buses. Each bus is represented by
2211 a json-object, which has a key with a json-array of all PCI devices attached
2212 to it. Each device is represented by a json-object.
2214 The bus json-object contains the following:
2216 - "bus": bus number (json-int)
2217 - "devices": a json-array of json-objects, each json-object represents a
2218              PCI device
2220 The PCI device json-object contains the following:
2222 - "bus": identical to the parent's bus number (json-int)
2223 - "slot": slot number (json-int)
2224 - "function": function number (json-int)
2225 - "class_info": a json-object containing:
2226      - "desc": device class description (json-string, optional)
2227      - "class": device class number (json-int)
2228 - "id": a json-object containing:
2229      - "device": device ID (json-int)
2230      - "vendor": vendor ID (json-int)
2231 - "irq": device's IRQ if assigned (json-int, optional)
2232 - "qdev_id": qdev id string (json-string)
2233 - "pci_bridge": It's a json-object, only present if this device is a
2234                 PCI bridge, contains:
2235      - "bus": bus number (json-int)
2236      - "secondary": secondary bus number (json-int)
2237      - "subordinate": subordinate bus number (json-int)
2238      - "io_range": I/O memory range information, a json-object with the
2239                    following members:
2240                  - "base": base address, in bytes (json-int)
2241                  - "limit": limit address, in bytes (json-int)
2242      - "memory_range": memory range information, a json-object with the
2243                        following members:
2244                  - "base": base address, in bytes (json-int)
2245                  - "limit": limit address, in bytes (json-int)
2246      - "prefetchable_range": Prefetchable memory range information, a
2247                              json-object with the following members:
2248                  - "base": base address, in bytes (json-int)
2249                  - "limit": limit address, in bytes (json-int)
2250      - "devices": a json-array of PCI devices if there's any attached, each
2251                   each element is represented by a json-object, which contains
2252                   the same members of the 'PCI device json-object' described
2253                   above (optional)
2254 - "regions": a json-array of json-objects, each json-object represents a
2255              memory region of this device
2257 The memory range json-object contains the following:
2259 - "base": base memory address (json-int)
2260 - "limit": limit value (json-int)
2262 The region json-object can be an I/O region or a memory region, an I/O region
2263 json-object contains the following:
2265 - "type": "io" (json-string, fixed)
2266 - "bar": BAR number (json-int)
2267 - "address": memory address (json-int)
2268 - "size": memory size (json-int)
2270 A memory region json-object contains the following:
2272 - "type": "memory" (json-string, fixed)
2273 - "bar": BAR number (json-int)
2274 - "address": memory address (json-int)
2275 - "size": memory size (json-int)
2276 - "mem_type_64": true or false (json-bool)
2277 - "prefetch": true or false (json-bool)
2279 Example:
2281 -> { "execute": "query-pci" }
2282 <- {
2283       "return":[
2284          {
2285             "bus":0,
2286             "devices":[
2287                {
2288                   "bus":0,
2289                   "qdev_id":"",
2290                   "slot":0,
2291                   "class_info":{
2292                      "class":1536,
2293                      "desc":"Host bridge"
2294                   },
2295                   "id":{
2296                      "device":32902,
2297                      "vendor":4663
2298                   },
2299                   "function":0,
2300                   "regions":[
2302                   ]
2303                },
2304                {
2305                   "bus":0,
2306                   "qdev_id":"",
2307                   "slot":1,
2308                   "class_info":{
2309                      "class":1537,
2310                      "desc":"ISA bridge"
2311                   },
2312                   "id":{
2313                      "device":32902,
2314                      "vendor":28672
2315                   },
2316                   "function":0,
2317                   "regions":[
2319                   ]
2320                },
2321                {
2322                   "bus":0,
2323                   "qdev_id":"",
2324                   "slot":1,
2325                   "class_info":{
2326                      "class":257,
2327                      "desc":"IDE controller"
2328                   },
2329                   "id":{
2330                      "device":32902,
2331                      "vendor":28688
2332                   },
2333                   "function":1,
2334                   "regions":[
2335                      {
2336                         "bar":4,
2337                         "size":16,
2338                         "address":49152,
2339                         "type":"io"
2340                      }
2341                   ]
2342                },
2343                {
2344                   "bus":0,
2345                   "qdev_id":"",
2346                   "slot":2,
2347                   "class_info":{
2348                      "class":768,
2349                      "desc":"VGA controller"
2350                   },
2351                   "id":{
2352                      "device":4115,
2353                      "vendor":184
2354                   },
2355                   "function":0,
2356                   "regions":[
2357                      {
2358                         "prefetch":true,
2359                         "mem_type_64":false,
2360                         "bar":0,
2361                         "size":33554432,
2362                         "address":4026531840,
2363                         "type":"memory"
2364                      },
2365                      {
2366                         "prefetch":false,
2367                         "mem_type_64":false,
2368                         "bar":1,
2369                         "size":4096,
2370                         "address":4060086272,
2371                         "type":"memory"
2372                      },
2373                      {
2374                         "prefetch":false,
2375                         "mem_type_64":false,
2376                         "bar":6,
2377                         "size":65536,
2378                         "address":-1,
2379                         "type":"memory"
2380                      }
2381                   ]
2382                },
2383                {
2384                   "bus":0,
2385                   "qdev_id":"",
2386                   "irq":11,
2387                   "slot":4,
2388                   "class_info":{
2389                      "class":1280,
2390                      "desc":"RAM controller"
2391                   },
2392                   "id":{
2393                      "device":6900,
2394                      "vendor":4098
2395                   },
2396                   "function":0,
2397                   "regions":[
2398                      {
2399                         "bar":0,
2400                         "size":32,
2401                         "address":49280,
2402                         "type":"io"
2403                      }
2404                   ]
2405                }
2406             ]
2407          }
2408       ]
2409    }
2411 Note: This example has been shortened as the real response is too long.
2413 query-kvm
2414 ---------
2416 Show KVM information.
2418 Return a json-object with the following information:
2420 - "enabled": true if KVM support is enabled, false otherwise (json-bool)
2421 - "present": true if QEMU has KVM support, false otherwise (json-bool)
2423 Example:
2425 -> { "execute": "query-kvm" }
2426 <- { "return": { "enabled": true, "present": true } }
2428 query-status
2429 ------------
2431 Return a json-object with the following information:
2433 - "running": true if the VM is running, or false if it is paused (json-bool)
2434 - "singlestep": true if the VM is in single step mode,
2435                 false otherwise (json-bool)
2436 - "status": one of the following values (json-string)
2437     "debug" - QEMU is running on a debugger
2438     "inmigrate" - guest is paused waiting for an incoming migration
2439     "internal-error" - An internal error that prevents further guest
2440     execution has occurred
2441     "io-error" - the last IOP has failed and the device is configured
2442     to pause on I/O errors
2443     "paused" - guest has been paused via the 'stop' command
2444     "postmigrate" - guest is paused following a successful 'migrate'
2445     "prelaunch" - QEMU was started with -S and guest has not started
2446     "finish-migrate" - guest is paused to finish the migration process
2447     "restore-vm" - guest is paused to restore VM state
2448     "running" - guest is actively running
2449     "save-vm" - guest is paused to save the VM state
2450     "shutdown" - guest is shut down (and -no-shutdown is in use)
2451     "watchdog" - the watchdog action is configured to pause and
2452      has been triggered
2454 Example:
2456 -> { "execute": "query-status" }
2457 <- { "return": { "running": true, "singlestep": false, "status": "running" } }
2459 query-mice
2460 ----------
2462 Show VM mice information.
2464 Each mouse is represented by a json-object, the returned value is a json-array
2465 of all mice.
2467 The mouse json-object contains the following:
2469 - "name": mouse's name (json-string)
2470 - "index": mouse's index (json-int)
2471 - "current": true if this mouse is receiving events, false otherwise (json-bool)
2472 - "absolute": true if the mouse generates absolute input events (json-bool)
2474 Example:
2476 -> { "execute": "query-mice" }
2477 <- {
2478       "return":[
2479          {
2480             "name":"QEMU Microsoft Mouse",
2481             "index":0,
2482             "current":false,
2483             "absolute":false
2484          },
2485          {
2486             "name":"QEMU PS/2 Mouse",
2487             "index":1,
2488             "current":true,
2489             "absolute":true
2490          }
2491       ]
2492    }
2494 query-vnc
2495 ---------
2497 Show VNC server information.
2499 Return a json-object with server information. Connected clients are returned
2500 as a json-array of json-objects.
2502 The main json-object contains the following:
2504 - "enabled": true or false (json-bool)
2505 - "host": server's IP address (json-string)
2506 - "family": address family (json-string)
2507          - Possible values: "ipv4", "ipv6", "unix", "unknown"
2508 - "service": server's port number (json-string)
2509 - "auth": authentication method (json-string)
2510          - Possible values: "invalid", "none", "ra2", "ra2ne", "sasl", "tight",
2511                             "tls", "ultra", "unknown", "vencrypt", "vencrypt",
2512                             "vencrypt+plain", "vencrypt+tls+none",
2513                             "vencrypt+tls+plain", "vencrypt+tls+sasl",
2514                             "vencrypt+tls+vnc", "vencrypt+x509+none",
2515                             "vencrypt+x509+plain", "vencrypt+x509+sasl",
2516                             "vencrypt+x509+vnc", "vnc"
2517 - "clients": a json-array of all connected clients
2519 Clients are described by a json-object, each one contain the following:
2521 - "host": client's IP address (json-string)
2522 - "family": address family (json-string)
2523          - Possible values: "ipv4", "ipv6", "unix", "unknown"
2524 - "service": client's port number (json-string)
2525 - "x509_dname": TLS dname (json-string, optional)
2526 - "sasl_username": SASL username (json-string, optional)
2528 Example:
2530 -> { "execute": "query-vnc" }
2531 <- {
2532       "return":{
2533          "enabled":true,
2534          "host":"0.0.0.0",
2535          "service":"50402",
2536          "auth":"vnc",
2537          "family":"ipv4",
2538          "clients":[
2539             {
2540                "host":"127.0.0.1",
2541                "service":"50401",
2542                "family":"ipv4"
2543             }
2544          ]
2545       }
2546    }
2548 query-spice
2549 -----------
2551 Show SPICE server information.
2553 Return a json-object with server information. Connected clients are returned
2554 as a json-array of json-objects.
2556 The main json-object contains the following:
2558 - "enabled": true or false (json-bool)
2559 - "host": server's IP address (json-string)
2560 - "port": server's port number (json-int, optional)
2561 - "tls-port": server's port number (json-int, optional)
2562 - "auth": authentication method (json-string)
2563          - Possible values: "none", "spice"
2564 - "channels": a json-array of all active channels clients
2566 Channels are described by a json-object, each one contain the following:
2568 - "host": client's IP address (json-string)
2569 - "family": address family (json-string)
2570          - Possible values: "ipv4", "ipv6", "unix", "unknown"
2571 - "port": client's port number (json-string)
2572 - "connection-id": spice connection id.  All channels with the same id
2573                    belong to the same spice session (json-int)
2574 - "channel-type": channel type.  "1" is the main control channel, filter for
2575                   this one if you want track spice sessions only (json-int)
2576 - "channel-id": channel id.  Usually "0", might be different needed when
2577                 multiple channels of the same type exist, such as multiple
2578                 display channels in a multihead setup (json-int)
2579 - "tls": whether the channel is encrypted (json-bool)
2581 Example:
2583 -> { "execute": "query-spice" }
2584 <- {
2585       "return": {
2586          "enabled": true,
2587          "auth": "spice",
2588          "port": 5920,
2589          "tls-port": 5921,
2590          "host": "0.0.0.0",
2591          "channels": [
2592             {
2593                "port": "54924",
2594                "family": "ipv4",
2595                "channel-type": 1,
2596                "connection-id": 1804289383,
2597                "host": "127.0.0.1",
2598                "channel-id": 0,
2599                "tls": true
2600             },
2601             {
2602                "port": "36710",
2603                "family": "ipv4",
2604                "channel-type": 4,
2605                "connection-id": 1804289383,
2606                "host": "127.0.0.1",
2607                "channel-id": 0,
2608                "tls": false
2609             },
2610             [ ... more channels follow ... ]
2611          ]
2612       }
2613    }
2615 query-name
2616 ----------
2618 Show VM name.
2620 Return a json-object with the following information:
2622 - "name": VM's name (json-string, optional)
2624 Example:
2626 -> { "execute": "query-name" }
2627 <- { "return": { "name": "qemu-name" } }
2629 query-uuid
2630 ----------
2632 Show VM UUID.
2634 Return a json-object with the following information:
2636 - "UUID": Universally Unique Identifier (json-string)
2638 Example:
2640 -> { "execute": "query-uuid" }
2641 <- { "return": { "UUID": "550e8400-e29b-41d4-a716-446655440000" } }
2643 query-command-line-options
2644 --------------------------
2646 Show command line option schema.
2648 Return a json-array of command line option schema for all options (or for
2649 the given option), returning an error if the given option doesn't exist.
2651 Each array entry contains the following:
2653 - "option": option name (json-string)
2654 - "parameters": a json-array describes all parameters of the option:
2655     - "name": parameter name (json-string)
2656     - "type": parameter type (one of 'string', 'boolean', 'number',
2657               or 'size')
2658     - "help": human readable description of the parameter
2659               (json-string, optional)
2660     - "default": default value string for the parameter
2661                  (json-string, optional)
2663 Example:
2665 -> { "execute": "query-command-line-options", "arguments": { "option": "option-rom" } }
2666 <- { "return": [
2667         {
2668             "parameters": [
2669                 {
2670                     "name": "romfile",
2671                     "type": "string"
2672                 },
2673                 {
2674                     "name": "bootindex",
2675                     "type": "number"
2676                 }
2677             ],
2678             "option": "option-rom"
2679         }
2680      ]
2681    }
2683 query-migrate
2684 -------------
2686 Migration status.
2688 Return a json-object. If migration is active there will be another json-object
2689 with RAM migration status and if block migration is active another one with
2690 block migration status.
2692 The main json-object contains the following:
2694 - "status": migration status (json-string)
2695      - Possible values: "setup", "active", "completed", "failed", "cancelled"
2696 - "total-time": total amount of ms since migration started.  If
2697                 migration has ended, it returns the total migration
2698                 time (json-int)
2699 - "setup-time" amount of setup time in milliseconds _before_ the
2700                iterations begin but _after_ the QMP command is issued.
2701                This is designed to provide an accounting of any activities
2702                (such as RDMA pinning) which may be expensive, but do not
2703                actually occur during the iterative migration rounds
2704                themselves. (json-int)
2705 - "downtime": only present when migration has finished correctly
2706               total amount in ms for downtime that happened (json-int)
2707 - "expected-downtime": only present while migration is active
2708                 total amount in ms for downtime that was calculated on
2709                 the last bitmap round (json-int)
2710 - "ram": only present if "status" is "active", it is a json-object with the
2711   following RAM information:
2712          - "transferred": amount transferred in bytes (json-int)
2713          - "remaining": amount remaining to transfer in bytes (json-int)
2714          - "total": total amount of memory in bytes (json-int)
2715          - "duplicate": number of pages filled entirely with the same
2716             byte (json-int)
2717             These are sent over the wire much more efficiently.
2718          - "skipped": number of skipped zero pages (json-int)
2719          - "normal" : number of whole pages transferred.  I.e. they
2720             were not sent as duplicate or xbzrle pages (json-int)
2721          - "normal-bytes" : number of bytes transferred in whole
2722             pages. This is just normal pages times size of one page,
2723             but this way upper levels don't need to care about page
2724             size (json-int)
2725          - "dirty-sync-count": times that dirty ram was synchronized (json-int)
2726 - "disk": only present if "status" is "active" and it is a block migration,
2727   it is a json-object with the following disk information:
2728          - "transferred": amount transferred in bytes (json-int)
2729          - "remaining": amount remaining to transfer in bytes json-int)
2730          - "total": total disk size in bytes (json-int)
2731 - "xbzrle-cache": only present if XBZRLE is active.
2732   It is a json-object with the following XBZRLE information:
2733          - "cache-size": XBZRLE cache size in bytes
2734          - "bytes": number of bytes transferred for XBZRLE compressed pages
2735          - "pages": number of XBZRLE compressed pages
2736          - "cache-miss": number of XBRZRLE page cache misses
2737          - "cache-miss-rate": rate of XBRZRLE page cache misses
2738          - "overflow": number of times XBZRLE overflows.  This means
2739            that the XBZRLE encoding was bigger than just sent the
2740            whole page, and then we sent the whole page instead (as as
2741            normal page).
2743 Examples:
2745 1. Before the first migration
2747 -> { "execute": "query-migrate" }
2748 <- { "return": {} }
2750 2. Migration is done and has succeeded
2752 -> { "execute": "query-migrate" }
2753 <- { "return": {
2754         "status": "completed",
2755         "ram":{
2756           "transferred":123,
2757           "remaining":123,
2758           "total":246,
2759           "total-time":12345,
2760           "setup-time":12345,
2761           "downtime":12345,
2762           "duplicate":123,
2763           "normal":123,
2764           "normal-bytes":123456,
2765           "dirty-sync-count":15
2766         }
2767      }
2768    }
2770 3. Migration is done and has failed
2772 -> { "execute": "query-migrate" }
2773 <- { "return": { "status": "failed" } }
2775 4. Migration is being performed and is not a block migration:
2777 -> { "execute": "query-migrate" }
2778 <- {
2779       "return":{
2780          "status":"active",
2781          "ram":{
2782             "transferred":123,
2783             "remaining":123,
2784             "total":246,
2785             "total-time":12345,
2786             "setup-time":12345,
2787             "expected-downtime":12345,
2788             "duplicate":123,
2789             "normal":123,
2790             "normal-bytes":123456,
2791             "dirty-sync-count":15
2792          }
2793       }
2794    }
2796 5. Migration is being performed and is a block migration:
2798 -> { "execute": "query-migrate" }
2799 <- {
2800       "return":{
2801          "status":"active",
2802          "ram":{
2803             "total":1057024,
2804             "remaining":1053304,
2805             "transferred":3720,
2806             "total-time":12345,
2807             "setup-time":12345,
2808             "expected-downtime":12345,
2809             "duplicate":123,
2810             "normal":123,
2811             "normal-bytes":123456,
2812             "dirty-sync-count":15
2813          },
2814          "disk":{
2815             "total":20971520,
2816             "remaining":20880384,
2817             "transferred":91136
2818          }
2819       }
2820    }
2822 6. Migration is being performed and XBZRLE is active:
2824 -> { "execute": "query-migrate" }
2825 <- {
2826       "return":{
2827          "status":"active",
2828          "capabilities" : [ { "capability": "xbzrle", "state" : true } ],
2829          "ram":{
2830             "total":1057024,
2831             "remaining":1053304,
2832             "transferred":3720,
2833             "total-time":12345,
2834             "setup-time":12345,
2835             "expected-downtime":12345,
2836             "duplicate":10,
2837             "normal":3333,
2838             "normal-bytes":3412992,
2839             "dirty-sync-count":15
2840          },
2841          "xbzrle-cache":{
2842             "cache-size":67108864,
2843             "bytes":20971520,
2844             "pages":2444343,
2845             "cache-miss":2244,
2846             "cache-miss-rate":0.123,
2847             "overflow":34434
2848          }
2849       }
2850    }
2852 migrate-set-capabilities
2853 ------------------------
2855 Enable/Disable migration capabilities
2857 - "xbzrle": XBZRLE support
2858 - "rdma-pin-all": pin all pages when using RDMA during migration
2859 - "auto-converge": throttle down guest to help convergence of migration
2860 - "zero-blocks": compress zero blocks during block migration
2861 - "compress": use multiple compression threads to accelerate live migration
2862 - "events": generate events for each migration state change
2863 - "postcopy-ram": postcopy mode for live migration
2865 Arguments:
2867 Example:
2869 -> { "execute": "migrate-set-capabilities" , "arguments":
2870      { "capabilities": [ { "capability": "xbzrle", "state": true } ] } }
2872 query-migrate-capabilities
2873 --------------------------
2875 Query current migration capabilities
2877 - "capabilities": migration capabilities state
2878          - "xbzrle" : XBZRLE state (json-bool)
2879          - "rdma-pin-all" : RDMA Pin Page state (json-bool)
2880          - "auto-converge" : Auto Converge state (json-bool)
2881          - "zero-blocks" : Zero Blocks state (json-bool)
2882          - "compress": Multiple compression threads state (json-bool)
2883          - "events": Migration state change event state (json-bool)
2884          - "postcopy-ram": postcopy ram state (json-bool)
2886 Arguments:
2888 Example:
2890 -> { "execute": "query-migrate-capabilities" }
2891 <- {"return": [
2892      {"state": false, "capability": "xbzrle"},
2893      {"state": false, "capability": "rdma-pin-all"},
2894      {"state": false, "capability": "auto-converge"},
2895      {"state": false, "capability": "zero-blocks"},
2896      {"state": false, "capability": "compress"},
2897      {"state": true, "capability": "events"},
2898      {"state": false, "capability": "postcopy-ram"}
2899    ]}
2901 migrate-set-parameters
2902 ----------------------
2904 Set migration parameters
2906 - "compress-level": set compression level during migration (json-int)
2907 - "compress-threads": set compression thread count for migration (json-int)
2908 - "decompress-threads": set decompression thread count for migration (json-int)
2909 - "cpu-throttle-initial": set initial percentage of time guest cpus are
2910                           throttled for auto-converge (json-int)
2911 - "cpu-throttle-increment": set throttle increasing percentage for
2912                             auto-converge (json-int)
2914 Arguments:
2916 Example:
2918 -> { "execute": "migrate-set-parameters" , "arguments":
2919       { "compress-level": 1 } }
2921 query-migrate-parameters
2922 ------------------------
2924 Query current migration parameters
2926 - "parameters": migration parameters value
2927          - "compress-level" : compression level value (json-int)
2928          - "compress-threads" : compression thread count value (json-int)
2929          - "decompress-threads" : decompression thread count value (json-int)
2930          - "cpu-throttle-initial" : initial percentage of time guest cpus are
2931                                     throttled (json-int)
2932          - "cpu-throttle-increment" : throttle increasing percentage for
2933                                       auto-converge (json-int)
2935 Arguments:
2937 Example:
2939 -> { "execute": "query-migrate-parameters" }
2940 <- {
2941       "return": {
2942          "decompress-threads": 2,
2943          "cpu-throttle-increment": 10,
2944          "compress-threads": 8,
2945          "compress-level": 1,
2946          "cpu-throttle-initial": 20
2947       }
2948    }
2950 query-balloon
2951 -------------
2953 Show balloon information.
2955 Make an asynchronous request for balloon info. When the request completes a
2956 json-object will be returned containing the following data:
2958 - "actual": current balloon value in bytes (json-int)
2960 Example:
2962 -> { "execute": "query-balloon" }
2963 <- {
2964       "return":{
2965          "actual":1073741824,
2966       }
2967    }
2969 query-tpm
2970 ---------
2972 Return information about the TPM device.
2974 Arguments: None
2976 Example:
2978 -> { "execute": "query-tpm" }
2979 <- { "return":
2980      [
2981        { "model": "tpm-tis",
2982          "options":
2983            { "type": "passthrough",
2984              "data":
2985                { "cancel-path": "/sys/class/misc/tpm0/device/cancel",
2986                  "path": "/dev/tpm0"
2987                }
2988            },
2989          "id": "tpm0"
2990        }
2991      ]
2992    }
2994 query-tpm-models
2995 ----------------
2997 Return a list of supported TPM models.
2999 Arguments: None
3001 Example:
3003 -> { "execute": "query-tpm-models" }
3004 <- { "return": [ "tpm-tis" ] }
3006 query-tpm-types
3007 ---------------
3009 Return a list of supported TPM types.
3011 Arguments: None
3013 Example:
3015 -> { "execute": "query-tpm-types" }
3016 <- { "return": [ "passthrough" ] }
3018 chardev-add
3019 ----------------
3021 Add a chardev.
3023 Arguments:
3025 - "id": the chardev's ID, must be unique (json-string)
3026 - "backend": chardev backend type + parameters
3028 Examples:
3030 -> { "execute" : "chardev-add",
3031      "arguments" : { "id" : "foo",
3032                      "backend" : { "type" : "null", "data" : {} } } }
3033 <- { "return": {} }
3035 -> { "execute" : "chardev-add",
3036      "arguments" : { "id" : "bar",
3037                      "backend" : { "type" : "file",
3038                                    "data" : { "out" : "/tmp/bar.log" } } } }
3039 <- { "return": {} }
3041 -> { "execute" : "chardev-add",
3042      "arguments" : { "id" : "baz",
3043                      "backend" : { "type" : "pty", "data" : {} } } }
3044 <- { "return": { "pty" : "/dev/pty/42" } }
3046 chardev-remove
3047 --------------
3049 Remove a chardev.
3051 Arguments:
3053 - "id": the chardev's ID, must exist and not be in use (json-string)
3055 Example:
3057 -> { "execute": "chardev-remove", "arguments": { "id" : "foo" } }
3058 <- { "return": {} }
3060 query-rx-filter
3061 ---------------
3063 Show rx-filter information.
3065 Returns a json-array of rx-filter information for all NICs (or for the
3066 given NIC), returning an error if the given NIC doesn't exist, or
3067 given NIC doesn't support rx-filter querying, or given net client
3068 isn't a NIC.
3070 The query will clear the event notification flag of each NIC, then qemu
3071 will start to emit event to QMP monitor.
3073 Each array entry contains the following:
3075 - "name": net client name (json-string)
3076 - "promiscuous": promiscuous mode is enabled (json-bool)
3077 - "multicast": multicast receive state (one of 'normal', 'none', 'all')
3078 - "unicast": unicast receive state  (one of 'normal', 'none', 'all')
3079 - "vlan": vlan receive state (one of 'normal', 'none', 'all') (Since 2.0)
3080 - "broadcast-allowed": allow to receive broadcast (json-bool)
3081 - "multicast-overflow": multicast table is overflowed (json-bool)
3082 - "unicast-overflow": unicast table is overflowed (json-bool)
3083 - "main-mac": main macaddr string (json-string)
3084 - "vlan-table": a json-array of active vlan id
3085 - "unicast-table": a json-array of unicast macaddr string
3086 - "multicast-table": a json-array of multicast macaddr string
3088 Example:
3090 -> { "execute": "query-rx-filter", "arguments": { "name": "vnet0" } }
3091 <- { "return": [
3092         {
3093             "promiscuous": true,
3094             "name": "vnet0",
3095             "main-mac": "52:54:00:12:34:56",
3096             "unicast": "normal",
3097             "vlan": "normal",
3098             "vlan-table": [
3099                 4,
3100                 0
3101             ],
3102             "unicast-table": [
3103             ],
3104             "multicast": "normal",
3105             "multicast-overflow": false,
3106             "unicast-overflow": false,
3107             "multicast-table": [
3108                 "01:00:5e:00:00:01",
3109                 "33:33:00:00:00:01",
3110                 "33:33:ff:12:34:56"
3111             ],
3112             "broadcast-allowed": false
3113         }
3114       ]
3115    }
3117 blockdev-add
3118 ------------
3120 Add a block device.
3122 This command is still a work in progress.  It doesn't support all
3123 block drivers among other things.  Stay away from it unless you want
3124 to help with its development.
3126 Arguments:
3128 - "options": block driver options
3130 Example (1):
3132 -> { "execute": "blockdev-add",
3133     "arguments": { "options" : { "driver": "qcow2",
3134                                  "file": { "driver": "file",
3135                                            "filename": "test.qcow2" } } } }
3136 <- { "return": {} }
3138 Example (2):
3140 -> { "execute": "blockdev-add",
3141      "arguments": {
3142          "options": {
3143            "driver": "qcow2",
3144            "node-name": "my_disk",
3145            "discard": "unmap",
3146            "cache": {
3147                "direct": true,
3148                "writeback": true
3149            },
3150            "file": {
3151                "driver": "file",
3152                "filename": "/tmp/test.qcow2"
3153            },
3154            "backing": {
3155                "driver": "raw",
3156                "file": {
3157                    "driver": "file",
3158                    "filename": "/dev/fdset/4"
3159                }
3160            }
3161          }
3162        }
3163      }
3165 <- { "return": {} }
3167 x-blockdev-del
3168 ------------
3169 Since 2.5
3171 Deletes a block device that has been added using blockdev-add.
3172 The command will fail if the node is attached to a device or is
3173 otherwise being used.
3175 This command is still a work in progress and is considered
3176 experimental. Stay away from it unless you want to help with its
3177 development.
3179 Arguments:
3181 - "node-name": Name of the graph node to delete (json-string)
3183 Example:
3185 -> { "execute": "blockdev-add",
3186      "arguments": {
3187          "options": {
3188              "driver": "qcow2",
3189              "node-name": "node0",
3190              "file": {
3191                  "driver": "file",
3192                  "filename": "test.qcow2"
3193              }
3194          }
3195      }
3196    }
3198 <- { "return": {} }
3200 -> { "execute": "x-blockdev-del",
3201      "arguments": { "node-name": "node0" }
3202    }
3203 <- { "return": {} }
3205 blockdev-open-tray
3206 ------------------
3208 Opens a block device's tray. If there is a block driver state tree inserted as a
3209 medium, it will become inaccessible to the guest (but it will remain associated
3210 to the block device, so closing the tray will make it accessible again).
3212 If the tray was already open before, this will be a no-op.
3214 Once the tray opens, a DEVICE_TRAY_MOVED event is emitted. There are cases in
3215 which no such event will be generated, these include:
3216 - if the guest has locked the tray, @force is false and the guest does not
3217   respond to the eject request
3218 - if the BlockBackend denoted by @device does not have a guest device attached
3219   to it
3220 - if the guest device does not have an actual tray and is empty, for instance
3221   for floppy disk drives
3223 Arguments:
3225 - "device": block device name (deprecated, use @id instead)
3226             (json-string, optional)
3227 - "id": the name or QOM path of the guest device (json-string, optional)
3228 - "force": if false (the default), an eject request will be sent to the guest if
3229            it has locked the tray (and the tray will not be opened immediately);
3230            if true, the tray will be opened regardless of whether it is locked
3231            (json-bool, optional)
3233 Example:
3235 -> { "execute": "blockdev-open-tray",
3236      "arguments": { "id": "ide0-1-0" } }
3238 <- { "timestamp": { "seconds": 1418751016,
3239                     "microseconds": 716996 },
3240      "event": "DEVICE_TRAY_MOVED",
3241      "data": { "device": "ide1-cd0",
3242                "tray-open": true } }
3244 <- { "return": {} }
3246 blockdev-close-tray
3247 -------------------
3249 Closes a block device's tray. If there is a block driver state tree associated
3250 with the block device (which is currently ejected), that tree will be loaded as
3251 the medium.
3253 If the tray was already closed before, this will be a no-op.
3255 Arguments:
3257 - "device": block device name (deprecated, use @id instead)
3258             (json-string, optional)
3259 - "id": the name or QOM path of the guest device (json-string, optional)
3261 Example:
3263 -> { "execute": "blockdev-close-tray",
3264      "arguments": { "id": "ide0-1-0" } }
3266 <- { "timestamp": { "seconds": 1418751345,
3267                     "microseconds": 272147 },
3268      "event": "DEVICE_TRAY_MOVED",
3269      "data": { "device": "ide1-cd0",
3270                "tray-open": false } }
3272 <- { "return": {} }
3274 x-blockdev-remove-medium
3275 ------------------------
3277 Removes a medium (a block driver state tree) from a block device. That block
3278 device's tray must currently be open (unless there is no attached guest device).
3280 If the tray is open and there is no medium inserted, this will be a no-op.
3282 This command is still a work in progress and is considered experimental.
3283 Stay away from it unless you want to help with its development.
3285 Arguments:
3287 - "device": block device name (deprecated, use @id instead)
3288             (json-string, optional)
3289 - "id": the name or QOM path of the guest device (json-string, optional)
3291 Example:
3293 -> { "execute": "x-blockdev-remove-medium",
3294      "arguments": { "id": "ide0-1-0" } }
3296 <- { "error": { "class": "GenericError",
3297                 "desc": "Tray of device 'ide0-1-0' is not open" } }
3299 -> { "execute": "blockdev-open-tray",
3300      "arguments": { "id": "ide0-1-0" } }
3302 <- { "timestamp": { "seconds": 1418751627,
3303                     "microseconds": 549958 },
3304      "event": "DEVICE_TRAY_MOVED",
3305      "data": { "device": "ide1-cd0",
3306                "tray-open": true } }
3308 <- { "return": {} }
3310 -> { "execute": "x-blockdev-remove-medium",
3311      "arguments": { "device": "ide0-1-0" } }
3313 <- { "return": {} }
3315 x-blockdev-insert-medium
3316 ------------------------
3318 Inserts a medium (a block driver state tree) into a block device. That block
3319 device's tray must currently be open (unless there is no attached guest device)
3320 and there must be no medium inserted already.
3322 This command is still a work in progress and is considered experimental.
3323 Stay away from it unless you want to help with its development.
3325 Arguments:
3327 - "device": block device name (deprecated, use @id instead)
3328             (json-string, optional)
3329 - "id": the name or QOM path of the guest device (json-string, optional)
3330 - "node-name": root node of the BDS tree to insert into the block device
3332 Example:
3334 -> { "execute": "blockdev-add",
3335      "arguments": { "options": { "node-name": "node0",
3336                                  "driver": "raw",
3337                                  "file": { "driver": "file",
3338                                            "filename": "fedora.iso" } } } }
3340 <- { "return": {} }
3342 -> { "execute": "x-blockdev-insert-medium",
3343      "arguments": { "id": "ide0-1-0",
3344                     "node-name": "node0" } }
3346 <- { "return": {} }
3348 x-blockdev-change
3349 -----------------
3351 Dynamically reconfigure the block driver state graph. It can be used
3352 to add, remove, insert or replace a graph node. Currently only the
3353 Quorum driver implements this feature to add or remove its child. This
3354 is useful to fix a broken quorum child.
3356 If @node is specified, it will be inserted under @parent. @child
3357 may not be specified in this case. If both @parent and @child are
3358 specified but @node is not, @child will be detached from @parent.
3360 Arguments:
3361 - "parent": the id or name of the parent node (json-string)
3362 - "child": the name of a child under the given parent node (json-string, optional)
3363 - "node": the name of the node that will be added (json-string, optional)
3365 Note: this command is experimental, and not a stable API. It doesn't
3366 support all kinds of operations, all kinds of children, nor all block
3367 drivers.
3369 Warning: The data in a new quorum child MUST be consistent with that of
3370 the rest of the array.
3372 Example:
3374 Add a new node to a quorum
3375 -> { "execute": "blockdev-add",
3376      "arguments": { "options": { "driver": "raw",
3377                                  "node-name": "new_node",
3378                                  "file": { "driver": "file",
3379                                            "filename": "test.raw" } } } }
3380 <- { "return": {} }
3381 -> { "execute": "x-blockdev-change",
3382      "arguments": { "parent": "disk1",
3383                     "node": "new_node" } }
3384 <- { "return": {} }
3386 Delete a quorum's node
3387 -> { "execute": "x-blockdev-change",
3388      "arguments": { "parent": "disk1",
3389                     "child": "children.1" } }
3390 <- { "return": {} }
3392 query-named-block-nodes
3393 -----------------------
3395 Return a list of BlockDeviceInfo for all the named block driver nodes
3397 Example:
3399 -> { "execute": "query-named-block-nodes" }
3400 <- { "return": [ { "ro":false,
3401                    "drv":"qcow2",
3402                    "encrypted":false,
3403                    "file":"disks/test.qcow2",
3404                    "node-name": "my-node",
3405                    "backing_file_depth":1,
3406                    "bps":1000000,
3407                    "bps_rd":0,
3408                    "bps_wr":0,
3409                    "iops":1000000,
3410                    "iops_rd":0,
3411                    "iops_wr":0,
3412                    "bps_max": 8000000,
3413                    "bps_rd_max": 0,
3414                    "bps_wr_max": 0,
3415                    "iops_max": 0,
3416                    "iops_rd_max": 0,
3417                    "iops_wr_max": 0,
3418                    "iops_size": 0,
3419                    "write_threshold": 0,
3420                    "image":{
3421                       "filename":"disks/test.qcow2",
3422                       "format":"qcow2",
3423                       "virtual-size":2048000,
3424                       "backing_file":"base.qcow2",
3425                       "full-backing-filename":"disks/base.qcow2",
3426                       "backing-filename-format":"qcow2",
3427                       "snapshots":[
3428                          {
3429                             "id": "1",
3430                             "name": "snapshot1",
3431                             "vm-state-size": 0,
3432                             "date-sec": 10000200,
3433                             "date-nsec": 12,
3434                             "vm-clock-sec": 206,
3435                             "vm-clock-nsec": 30
3436                          }
3437                       ],
3438                       "backing-image":{
3439                           "filename":"disks/base.qcow2",
3440                           "format":"qcow2",
3441                           "virtual-size":2048000
3442                       }
3443                    } } ] }
3445 blockdev-change-medium
3446 ----------------------
3448 Changes the medium inserted into a block device by ejecting the current medium
3449 and loading a new image file which is inserted as the new medium.
3451 Arguments:
3453 - "device": block device name (deprecated, use @id instead)
3454             (json-string, optional)
3455 - "id": the name or QOM path of the guest device (json-string, optional)
3456 - "filename": filename of the new image (json-string)
3457 - "format": format of the new image (json-string, optional)
3458 - "read-only-mode": new read-only mode (json-string, optional)
3459           - Possible values: "retain" (default), "read-only", "read-write"
3461 Examples:
3463 1. Change a removable medium
3465 -> { "execute": "blockdev-change-medium",
3466              "arguments": { "id": "ide0-1-0",
3467                             "filename": "/srv/images/Fedora-12-x86_64-DVD.iso",
3468                             "format": "raw" } }
3469 <- { "return": {} }
3471 2. Load a read-only medium into a writable drive
3473 -> { "execute": "blockdev-change-medium",
3474              "arguments": { "id": "floppyA",
3475                             "filename": "/srv/images/ro.img",
3476                             "format": "raw",
3477                             "read-only-mode": "retain" } }
3479 <- { "error":
3480      { "class": "GenericError",
3481        "desc": "Could not open '/srv/images/ro.img': Permission denied" } }
3483 -> { "execute": "blockdev-change-medium",
3484              "arguments": { "id": "floppyA",
3485                             "filename": "/srv/images/ro.img",
3486                             "format": "raw",
3487                             "read-only-mode": "read-only" } }
3489 <- { "return": {} }
3491 query-memdev
3492 ------------
3494 Show memory devices information.
3497 Example (1):
3499 -> { "execute": "query-memdev" }
3500 <- { "return": [
3501        {
3502          "size": 536870912,
3503          "merge": false,
3504          "dump": true,
3505          "prealloc": false,
3506          "host-nodes": [0, 1],
3507          "policy": "bind"
3508        },
3509        {
3510          "size": 536870912,
3511          "merge": false,
3512          "dump": true,
3513          "prealloc": true,
3514          "host-nodes": [2, 3],
3515          "policy": "preferred"
3516        }
3517      ]
3518    }
3520 query-memory-devices
3521 --------------------
3523 Return a list of memory devices.
3525 Example:
3526 -> { "execute": "query-memory-devices" }
3527 <- { "return": [ { "data":
3528                       { "addr": 5368709120,
3529                         "hotpluggable": true,
3530                         "hotplugged": true,
3531                         "id": "d1",
3532                         "memdev": "/objects/memX",
3533                         "node": 0,
3534                         "size": 1073741824,
3535                         "slot": 0},
3536                    "type": "dimm"
3537                  } ] }
3539 query-acpi-ospm-status
3540 ----------------------
3542 Return list of ACPIOSTInfo for devices that support status reporting
3543 via ACPI _OST method.
3545 Example:
3546 -> { "execute": "query-acpi-ospm-status" }
3547 <- { "return": [ { "device": "d1", "slot": "0", "slot-type": "DIMM", "source": 1, "status": 0},
3548                  { "slot": "1", "slot-type": "DIMM", "source": 0, "status": 0},
3549                  { "slot": "2", "slot-type": "DIMM", "source": 0, "status": 0},
3550                  { "slot": "3", "slot-type": "DIMM", "source": 0, "status": 0}
3551    ]}
3553 rtc-reset-reinjection
3554 ---------------------
3556 Reset the RTC interrupt reinjection backlog.
3558 Arguments: None.
3560 Example:
3562 -> { "execute": "rtc-reset-reinjection" }
3563 <- { "return": {} }
3565 trace-event-get-state
3566 ---------------------
3568 Query the state of events.
3570 Arguments:
3572 - "name": Event name pattern (json-string).
3573 - "vcpu": The vCPU to query, any vCPU by default (json-int, optional).
3575 An event is returned if:
3576 - its name matches the "name" pattern, and
3577 - if "vcpu" is given, the event has the "vcpu" property.
3579 Therefore, if "vcpu" is given, the operation will only match per-vCPU events,
3580 returning their state on the specified vCPU. Special case: if "name" is an exact
3581 match, "vcpu" is given and the event does not have the "vcpu" property, an error
3582 is returned.
3584 Example:
3586 -> { "execute": "trace-event-get-state", "arguments": { "name": "qemu_memalign" } }
3587 <- { "return": [ { "name": "qemu_memalign", "state": "disabled" } ] }
3589 trace-event-set-state
3590 ---------------------
3592 Set the state of events.
3594 Arguments:
3596 - "name": Event name pattern (json-string).
3597 - "enable": Whether to enable or disable the event (json-bool).
3598 - "ignore-unavailable": Whether to ignore errors for events that cannot be
3599   changed (json-bool, optional).
3600 - "vcpu": The vCPU to act upon, all vCPUs by default (json-int, optional).
3602 An event's state is modified if:
3603 - its name matches the "name" pattern, and
3604 - if "vcpu" is given, the event has the "vcpu" property.
3606 Therefore, if "vcpu" is given, the operation will only match per-vCPU events,
3607 setting their state on the specified vCPU. Special case: if "name" is an exact
3608 match, "vcpu" is given and the event does not have the "vcpu" property, an error
3609 is returned.
3611 Example:
3613 -> { "execute": "trace-event-set-state", "arguments": { "name": "qemu_memalign", "enable": "true" } }
3614 <- { "return": {} }
3616 input-send-event
3617 ----------------
3619 Send input event to guest.
3621 Arguments:
3623 - "device": display device (json-string, optional)
3624 - "head": display head (json-int, optional)
3625 - "events": list of input events
3627 The consoles are visible in the qom tree, under
3628 /backend/console[$index]. They have a device link and head property, so
3629 it is possible to map which console belongs to which device and display.
3631 Example (1):
3633 Press left mouse button.
3635 -> { "execute": "input-send-event",
3636     "arguments": { "device": "video0",
3637                    "events": [ { "type": "btn",
3638                    "data" : { "down": true, "button": "left" } } ] } }
3639 <- { "return": {} }
3641 -> { "execute": "input-send-event",
3642     "arguments": { "device": "video0",
3643                    "events": [ { "type": "btn",
3644                    "data" : { "down": false, "button": "left" } } ] } }
3645 <- { "return": {} }
3647 Example (2):
3649 Press ctrl-alt-del.
3651 -> { "execute": "input-send-event",
3652      "arguments": { "events": [
3653         { "type": "key", "data" : { "down": true,
3654           "key": {"type": "qcode", "data": "ctrl" } } },
3655         { "type": "key", "data" : { "down": true,
3656           "key": {"type": "qcode", "data": "alt" } } },
3657         { "type": "key", "data" : { "down": true,
3658           "key": {"type": "qcode", "data": "delete" } } } ] } }
3659 <- { "return": {} }
3661 Example (3):
3663 Move mouse pointer to absolute coordinates (20000, 400).
3665 -> { "execute": "input-send-event" ,
3666   "arguments": { "events": [
3667                { "type": "abs", "data" : { "axis": "x", "value" : 20000 } },
3668                { "type": "abs", "data" : { "axis": "y", "value" : 400 } } ] } }
3669 <- { "return": {} }
3671 block-set-write-threshold
3672 ------------
3674 Change the write threshold for a block drive. The threshold is an offset,
3675 thus must be non-negative. Default is no write threshold.
3676 Setting the threshold to zero disables it.
3678 Arguments:
3680 - "node-name": the node name in the block driver state graph (json-string)
3681 - "write-threshold": the write threshold in bytes (json-int)
3683 Example:
3685 -> { "execute": "block-set-write-threshold",
3686   "arguments": { "node-name": "mydev",
3687                  "write-threshold": 17179869184 } }
3688 <- { "return": {} }
3690 Show rocker switch
3691 ------------------
3693 Arguments:
3695 - "name": switch name
3697 Example:
3699 -> { "execute": "query-rocker", "arguments": { "name": "sw1" } }
3700 <- { "return": {"name": "sw1", "ports": 2, "id": 1327446905938}}
3702 Show rocker switch ports
3703 ------------------------
3705 Arguments:
3707 - "name": switch name
3709 Example:
3711 -> { "execute": "query-rocker-ports", "arguments": { "name": "sw1" } }
3712 <- { "return": [ {"duplex": "full", "enabled": true, "name": "sw1.1",
3713                   "autoneg": "off", "link-up": true, "speed": 10000},
3714                  {"duplex": "full", "enabled": true, "name": "sw1.2",
3715                   "autoneg": "off", "link-up": true, "speed": 10000}
3716    ]}
3718 Show rocker switch OF-DPA flow tables
3719 -------------------------------------
3721 Arguments:
3723 - "name": switch name
3724 - "tbl-id": (optional) flow table ID
3726 Example:
3728 -> { "execute": "query-rocker-of-dpa-flows", "arguments": { "name": "sw1" } }
3729 <- { "return": [ {"key": {"in-pport": 0, "priority": 1, "tbl-id": 0},
3730                   "hits": 138,
3731                   "cookie": 0,
3732                   "action": {"goto-tbl": 10},
3733                   "mask": {"in-pport": 4294901760}
3734                  },
3735                  {...more...},
3736    ]}
3738 Show rocker OF-DPA group tables
3739 -------------------------------
3741 Arguments:
3743 - "name": switch name
3744 - "type": (optional) group type
3746 Example:
3748 -> { "execute": "query-rocker-of-dpa-groups", "arguments": { "name": "sw1" } }
3749 <- { "return": [ {"type": 0, "out-pport": 2, "pport": 2, "vlan-id": 3841,
3750                   "pop-vlan": 1, "id": 251723778},
3751                  {"type": 0, "out-pport": 0, "pport": 0, "vlan-id": 3841,
3752                   "pop-vlan": 1, "id": 251723776},
3753                  {"type": 0, "out-pport": 1, "pport": 1, "vlan-id": 3840,
3754                   "pop-vlan": 1, "id": 251658241},
3755                  {"type": 0, "out-pport": 0, "pport": 0, "vlan-id": 3840,
3756                   "pop-vlan": 1, "id": 251658240}
3757    ]}
3759 query-gic-capabilities
3760 ---------------
3762 Return a list of GICCapability objects, describing supported GIC
3763 (Generic Interrupt Controller) versions.
3765 Arguments: None
3767 Example:
3769 -> { "execute": "query-gic-capabilities" }
3770 <- { "return": [{ "version": 2, "emulated": true, "kernel": false },
3771                 { "version": 3, "emulated": false, "kernel": true } ] }
3773 Show existing/possible CPUs
3774 ---------------------------
3776 Arguments: None.
3778 Example for pseries machine type started with
3779 -smp 2,cores=2,maxcpus=4 -cpu POWER8:
3781 -> { "execute": "query-hotpluggable-cpus" }
3782 <- {"return": [
3783      { "props": { "core-id": 8 }, "type": "POWER8-spapr-cpu-core",
3784        "vcpus-count": 1 },
3785      { "props": { "core-id": 0 }, "type": "POWER8-spapr-cpu-core",
3786        "vcpus-count": 1, "qom-path": "/machine/unattached/device[0]"}
3787    ]}'
3789 Example for pc machine type started with
3790 -smp 1,maxcpus=2:
3791     -> { "execute": "query-hotpluggable-cpus" }
3792     <- {"return": [
3793          {
3794             "type": "qemu64-x86_64-cpu", "vcpus-count": 1,
3795             "props": {"core-id": 0, "socket-id": 1, "thread-id": 0}
3796          },
3797          {
3798             "qom-path": "/machine/unattached/device[0]",
3799             "type": "qemu64-x86_64-cpu", "vcpus-count": 1,
3800             "props": {"core-id": 0, "socket-id": 0, "thread-id": 0}
3801          }
3802        ]}