exec: remove ram_addr argument from qemu_ram_block_from_host
[qemu.git] / qmp-commands.hx
blob28801a28fb1b5bcdf2b151f787250f825cbbd2fc
1 HXCOMM QMP dispatch table and documentation
2 HXCOMM Text between SQMP and EQMP is copied to the QMP documentation file and
3 HXCOMM does not show up in the other formats.
5 SQMP
6 QMP Supported Commands
7 ----------------------
9 This document describes all commands currently supported by QMP.
11 Most of the time their usage is exactly the same as in the user Monitor, this
12 means that any other document which also describe commands (the manpage,
13 QEMU's manual, etc) can and should be consulted.
15 QMP has two types of commands: regular and query commands. Regular commands
16 usually change the Virtual Machine's state someway, while query commands just
17 return information. The sections below are divided accordingly.
19 It's important to observe that all communication examples are formatted in
20 a reader-friendly way, so that they're easier to understand. However, in real
21 protocol usage, they're emitted as a single line.
23 Also, the following notation is used to denote data flow:
25 -> data issued by the Client
26 <- Server data response
28 Please, refer to the QMP specification (QMP/qmp-spec.txt) for detailed
29 information on the Server command and response formats.
31 NOTE: This document is temporary and will be replaced soon.
33 1. Stability Considerations
34 ===========================
36 The current QMP command set (described in this file) may be useful for a
37 number of use cases, however it's limited and several commands have bad
38 defined semantics, specially with regard to command completion.
40 These problems are going to be solved incrementally in the next QEMU releases
41 and we're going to establish a deprecation policy for badly defined commands.
43 If you're planning to adopt QMP, please observe the following:
45 1. The deprecation policy will take effect and be documented soon, please
46 check the documentation of each used command as soon as a new release of
47 QEMU is available
49 2. DO NOT rely on anything which is not explicit documented
51 3. Errors, in special, are not documented. Applications should NOT check
52 for specific errors classes or data (it's strongly recommended to only
53 check for the "error" key)
55 2. Regular Commands
56 ===================
58 Server's responses in the examples below are always a success response, please
59 refer to the QMP specification for more details on error responses.
61 EQMP
64 .name = "quit",
65 .args_type = "",
66 .mhandler.cmd_new = qmp_marshal_quit,
69 SQMP
70 quit
71 ----
73 Quit the emulator.
75 Arguments: None.
77 Example:
79 -> { "execute": "quit" }
80 <- { "return": {} }
82 EQMP
85 .name = "eject",
86 .args_type = "force:-f,device:B",
87 .mhandler.cmd_new = qmp_marshal_eject,
90 SQMP
91 eject
92 -----
94 Eject a removable medium.
96 Arguments:
98 - force: force ejection (json-bool, optional)
99 - device: device name (json-string)
101 Example:
103 -> { "execute": "eject", "arguments": { "device": "ide1-cd0" } }
104 <- { "return": {} }
106 Note: The "force" argument defaults to false.
108 EQMP
111 .name = "change",
112 .args_type = "device:B,target:F,arg:s?",
113 .mhandler.cmd_new = qmp_marshal_change,
116 SQMP
117 change
118 ------
120 Change a removable medium or VNC configuration.
122 Arguments:
124 - "device": device name (json-string)
125 - "target": filename or item (json-string)
126 - "arg": additional argument (json-string, optional)
128 Examples:
130 1. Change a removable medium
132 -> { "execute": "change",
133 "arguments": { "device": "ide1-cd0",
134 "target": "/srv/images/Fedora-12-x86_64-DVD.iso" } }
135 <- { "return": {} }
137 2. Change VNC password
139 -> { "execute": "change",
140 "arguments": { "device": "vnc", "target": "password",
141 "arg": "foobar1" } }
142 <- { "return": {} }
144 EQMP
147 .name = "screendump",
148 .args_type = "filename:F",
149 .mhandler.cmd_new = qmp_marshal_screendump,
152 SQMP
153 screendump
154 ----------
156 Save screen into PPM image.
158 Arguments:
160 - "filename": file path (json-string)
162 Example:
164 -> { "execute": "screendump", "arguments": { "filename": "/tmp/image" } }
165 <- { "return": {} }
167 EQMP
170 .name = "stop",
171 .args_type = "",
172 .mhandler.cmd_new = qmp_marshal_stop,
175 SQMP
176 stop
177 ----
179 Stop the emulator.
181 Arguments: None.
183 Example:
185 -> { "execute": "stop" }
186 <- { "return": {} }
188 EQMP
191 .name = "cont",
192 .args_type = "",
193 .mhandler.cmd_new = qmp_marshal_cont,
196 SQMP
197 cont
198 ----
200 Resume emulation.
202 Arguments: None.
204 Example:
206 -> { "execute": "cont" }
207 <- { "return": {} }
209 EQMP
212 .name = "system_wakeup",
213 .args_type = "",
214 .mhandler.cmd_new = qmp_marshal_system_wakeup,
217 SQMP
218 system_wakeup
219 -------------
221 Wakeup guest from suspend.
223 Arguments: None.
225 Example:
227 -> { "execute": "system_wakeup" }
228 <- { "return": {} }
230 EQMP
233 .name = "system_reset",
234 .args_type = "",
235 .mhandler.cmd_new = qmp_marshal_system_reset,
238 SQMP
239 system_reset
240 ------------
242 Reset the system.
244 Arguments: None.
246 Example:
248 -> { "execute": "system_reset" }
249 <- { "return": {} }
251 EQMP
254 .name = "system_powerdown",
255 .args_type = "",
256 .mhandler.cmd_new = qmp_marshal_system_powerdown,
259 SQMP
260 system_powerdown
261 ----------------
263 Send system power down event.
265 Arguments: None.
267 Example:
269 -> { "execute": "system_powerdown" }
270 <- { "return": {} }
272 EQMP
275 .name = "device_add",
276 .args_type = "device:O",
277 .params = "driver[,prop=value][,...]",
278 .help = "add device, like -device on the command line",
279 .mhandler.cmd_new = qmp_device_add,
282 SQMP
283 device_add
284 ----------
286 Add a device.
288 Arguments:
290 - "driver": the name of the new device's driver (json-string)
291 - "bus": the device's parent bus (device tree path, json-string, optional)
292 - "id": the device's ID, must be unique (json-string)
293 - device properties
295 Example:
297 -> { "execute": "device_add", "arguments": { "driver": "e1000", "id": "net1" } }
298 <- { "return": {} }
300 Notes:
302 (1) For detailed information about this command, please refer to the
303 'docs/qdev-device-use.txt' file.
305 (2) It's possible to list device properties by running QEMU with the
306 "-device DEVICE,\?" command-line argument, where DEVICE is the device's name
308 EQMP
311 .name = "device_del",
312 .args_type = "id:s",
313 .mhandler.cmd_new = qmp_marshal_device_del,
316 SQMP
317 device_del
318 ----------
320 Remove a device.
322 Arguments:
324 - "id": the device's ID or QOM path (json-string)
326 Example:
328 -> { "execute": "device_del", "arguments": { "id": "net1" } }
329 <- { "return": {} }
331 Example:
333 -> { "execute": "device_del", "arguments": { "id": "/machine/peripheral-anon/device[0]" } }
334 <- { "return": {} }
336 EQMP
339 .name = "send-key",
340 .args_type = "keys:q,hold-time:i?",
341 .mhandler.cmd_new = qmp_marshal_send_key,
344 SQMP
345 send-key
346 ----------
348 Send keys to VM.
350 Arguments:
352 keys array:
353 - "key": key sequence (a json-array of key union values,
354 union can be number or qcode enum)
356 - hold-time: time to delay key up events, milliseconds. Defaults to 100
357 (json-int, optional)
359 Example:
361 -> { "execute": "send-key",
362 "arguments": { "keys": [ { "type": "qcode", "data": "ctrl" },
363 { "type": "qcode", "data": "alt" },
364 { "type": "qcode", "data": "delete" } ] } }
365 <- { "return": {} }
367 EQMP
370 .name = "cpu",
371 .args_type = "index:i",
372 .mhandler.cmd_new = qmp_marshal_cpu,
375 SQMP
379 Set the default CPU.
381 Arguments:
383 - "index": the CPU's index (json-int)
385 Example:
387 -> { "execute": "cpu", "arguments": { "index": 0 } }
388 <- { "return": {} }
390 Note: CPUs' indexes are obtained with the 'query-cpus' command.
392 EQMP
395 .name = "cpu-add",
396 .args_type = "id:i",
397 .mhandler.cmd_new = qmp_marshal_cpu_add,
400 SQMP
401 cpu-add
402 -------
404 Adds virtual cpu
406 Arguments:
408 - "id": cpu id (json-int)
410 Example:
412 -> { "execute": "cpu-add", "arguments": { "id": 2 } }
413 <- { "return": {} }
415 EQMP
418 .name = "memsave",
419 .args_type = "val:l,size:i,filename:s,cpu:i?",
420 .mhandler.cmd_new = qmp_marshal_memsave,
423 SQMP
424 memsave
425 -------
427 Save to disk virtual memory dump starting at 'val' of size 'size'.
429 Arguments:
431 - "val": the starting address (json-int)
432 - "size": the memory size, in bytes (json-int)
433 - "filename": file path (json-string)
434 - "cpu": virtual CPU index (json-int, optional)
436 Example:
438 -> { "execute": "memsave",
439 "arguments": { "val": 10,
440 "size": 100,
441 "filename": "/tmp/virtual-mem-dump" } }
442 <- { "return": {} }
444 EQMP
447 .name = "pmemsave",
448 .args_type = "val:l,size:i,filename:s",
449 .mhandler.cmd_new = qmp_marshal_pmemsave,
452 SQMP
453 pmemsave
454 --------
456 Save to disk physical memory dump starting at 'val' of size 'size'.
458 Arguments:
460 - "val": the starting address (json-int)
461 - "size": the memory size, in bytes (json-int)
462 - "filename": file path (json-string)
464 Example:
466 -> { "execute": "pmemsave",
467 "arguments": { "val": 10,
468 "size": 100,
469 "filename": "/tmp/physical-mem-dump" } }
470 <- { "return": {} }
472 EQMP
475 .name = "inject-nmi",
476 .args_type = "",
477 .mhandler.cmd_new = qmp_marshal_inject_nmi,
480 SQMP
481 inject-nmi
482 ----------
484 Inject an NMI on the default CPU (x86/s390) or all CPUs (ppc64).
486 Arguments: None.
488 Example:
490 -> { "execute": "inject-nmi" }
491 <- { "return": {} }
493 Note: inject-nmi fails when the guest doesn't support injecting.
495 EQMP
498 .name = "ringbuf-write",
499 .args_type = "device:s,data:s,format:s?",
500 .mhandler.cmd_new = qmp_marshal_ringbuf_write,
503 SQMP
504 ringbuf-write
505 -------------
507 Write to a ring buffer character device.
509 Arguments:
511 - "device": ring buffer character device name (json-string)
512 - "data": data to write (json-string)
513 - "format": data format (json-string, optional)
514 - Possible values: "utf8" (default), "base64"
516 Example:
518 -> { "execute": "ringbuf-write",
519 "arguments": { "device": "foo",
520 "data": "abcdefgh",
521 "format": "utf8" } }
522 <- { "return": {} }
524 EQMP
527 .name = "ringbuf-read",
528 .args_type = "device:s,size:i,format:s?",
529 .mhandler.cmd_new = qmp_marshal_ringbuf_read,
532 SQMP
533 ringbuf-read
534 -------------
536 Read from a ring buffer character device.
538 Arguments:
540 - "device": ring buffer character device name (json-string)
541 - "size": how many bytes to read at most (json-int)
542 - Number of data bytes, not number of characters in encoded data
543 - "format": data format (json-string, optional)
544 - Possible values: "utf8" (default), "base64"
545 - Naturally, format "utf8" works only when the ring buffer
546 contains valid UTF-8 text. Invalid UTF-8 sequences get
547 replaced. Bug: replacement doesn't work. Bug: can screw
548 up on encountering NUL characters, after the ring buffer
549 lost data, and when reading stops because the size limit
550 is reached.
552 Example:
554 -> { "execute": "ringbuf-read",
555 "arguments": { "device": "foo",
556 "size": 1000,
557 "format": "utf8" } }
558 <- {"return": "abcdefgh"}
560 EQMP
563 .name = "xen-save-devices-state",
564 .args_type = "filename:F",
565 .mhandler.cmd_new = qmp_marshal_xen_save_devices_state,
568 SQMP
569 xen-save-devices-state
570 -------
572 Save the state of all devices to file. The RAM and the block devices
573 of the VM are not saved by this command.
575 Arguments:
577 - "filename": the file to save the state of the devices to as binary
578 data. See xen-save-devices-state.txt for a description of the binary
579 format.
581 Example:
583 -> { "execute": "xen-save-devices-state",
584 "arguments": { "filename": "/tmp/save" } }
585 <- { "return": {} }
587 EQMP
590 .name = "xen-set-global-dirty-log",
591 .args_type = "enable:b",
592 .mhandler.cmd_new = qmp_marshal_xen_set_global_dirty_log,
595 SQMP
596 xen-set-global-dirty-log
597 -------
599 Enable or disable the global dirty log mode.
601 Arguments:
603 - "enable": Enable it or disable it.
605 Example:
607 -> { "execute": "xen-set-global-dirty-log",
608 "arguments": { "enable": true } }
609 <- { "return": {} }
611 EQMP
614 .name = "migrate",
615 .args_type = "detach:-d,blk:-b,inc:-i,uri:s",
616 .mhandler.cmd_new = qmp_marshal_migrate,
619 SQMP
620 migrate
621 -------
623 Migrate to URI.
625 Arguments:
627 - "blk": block migration, full disk copy (json-bool, optional)
628 - "inc": incremental disk copy (json-bool, optional)
629 - "uri": Destination URI (json-string)
631 Example:
633 -> { "execute": "migrate", "arguments": { "uri": "tcp:0:4446" } }
634 <- { "return": {} }
636 Notes:
638 (1) The 'query-migrate' command should be used to check migration's progress
639 and final result (this information is provided by the 'status' member)
640 (2) All boolean arguments default to false
641 (3) The user Monitor's "detach" argument is invalid in QMP and should not
642 be used
644 EQMP
647 .name = "migrate_cancel",
648 .args_type = "",
649 .mhandler.cmd_new = qmp_marshal_migrate_cancel,
652 SQMP
653 migrate_cancel
654 --------------
656 Cancel the current migration.
658 Arguments: None.
660 Example:
662 -> { "execute": "migrate_cancel" }
663 <- { "return": {} }
665 EQMP
668 .name = "migrate-incoming",
669 .args_type = "uri:s",
670 .mhandler.cmd_new = qmp_marshal_migrate_incoming,
673 SQMP
674 migrate-incoming
675 ----------------
677 Continue an incoming migration
679 Arguments:
681 - "uri": Source/listening URI (json-string)
683 Example:
685 -> { "execute": "migrate-incoming", "arguments": { "uri": "tcp::4446" } }
686 <- { "return": {} }
688 Notes:
690 (1) QEMU must be started with -incoming defer to allow migrate-incoming to
691 be used
692 (2) The uri format is the same as for -incoming
694 EQMP
696 .name = "migrate-set-cache-size",
697 .args_type = "value:o",
698 .mhandler.cmd_new = qmp_marshal_migrate_set_cache_size,
701 SQMP
702 migrate-set-cache-size
703 ----------------------
705 Set cache size to be used by XBZRLE migration, the cache size will be rounded
706 down to the nearest power of 2
708 Arguments:
710 - "value": cache size in bytes (json-int)
712 Example:
714 -> { "execute": "migrate-set-cache-size", "arguments": { "value": 536870912 } }
715 <- { "return": {} }
717 EQMP
719 .name = "migrate-start-postcopy",
720 .args_type = "",
721 .mhandler.cmd_new = qmp_marshal_migrate_start_postcopy,
724 SQMP
725 migrate-start-postcopy
726 ----------------------
728 Switch an in-progress migration to postcopy mode. Ignored after the end of
729 migration (or once already in postcopy).
731 Example:
732 -> { "execute": "migrate-start-postcopy" }
733 <- { "return": {} }
735 EQMP
738 .name = "query-migrate-cache-size",
739 .args_type = "",
740 .mhandler.cmd_new = qmp_marshal_query_migrate_cache_size,
743 SQMP
744 query-migrate-cache-size
745 ------------------------
747 Show cache size to be used by XBZRLE migration
749 returns a json-object with the following information:
750 - "size" : json-int
752 Example:
754 -> { "execute": "query-migrate-cache-size" }
755 <- { "return": 67108864 }
757 EQMP
760 .name = "migrate_set_speed",
761 .args_type = "value:o",
762 .mhandler.cmd_new = qmp_marshal_migrate_set_speed,
765 SQMP
766 migrate_set_speed
767 -----------------
769 Set maximum speed for migrations.
771 Arguments:
773 - "value": maximum speed, in bytes per second (json-int)
775 Example:
777 -> { "execute": "migrate_set_speed", "arguments": { "value": 1024 } }
778 <- { "return": {} }
780 EQMP
783 .name = "migrate_set_downtime",
784 .args_type = "value:T",
785 .mhandler.cmd_new = qmp_marshal_migrate_set_downtime,
788 SQMP
789 migrate_set_downtime
790 --------------------
792 Set maximum tolerated downtime (in seconds) for migrations.
794 Arguments:
796 - "value": maximum downtime (json-number)
798 Example:
800 -> { "execute": "migrate_set_downtime", "arguments": { "value": 0.1 } }
801 <- { "return": {} }
803 EQMP
806 .name = "client_migrate_info",
807 .args_type = "protocol:s,hostname:s,port:i?,tls-port:i?,cert-subject:s?",
808 .params = "protocol hostname port tls-port cert-subject",
809 .help = "set migration information for remote display",
810 .mhandler.cmd_new = qmp_marshal_client_migrate_info,
813 SQMP
814 client_migrate_info
815 -------------------
817 Set migration information for remote display. This makes the server
818 ask the client to automatically reconnect using the new parameters
819 once migration finished successfully. Only implemented for SPICE.
821 Arguments:
823 - "protocol": must be "spice" (json-string)
824 - "hostname": migration target hostname (json-string)
825 - "port": spice tcp port for plaintext channels (json-int, optional)
826 - "tls-port": spice tcp port for tls-secured channels (json-int, optional)
827 - "cert-subject": server certificate subject (json-string, optional)
829 Example:
831 -> { "execute": "client_migrate_info",
832 "arguments": { "protocol": "spice",
833 "hostname": "virt42.lab.kraxel.org",
834 "port": 1234 } }
835 <- { "return": {} }
837 EQMP
840 .name = "dump-guest-memory",
841 .args_type = "paging:b,protocol:s,detach:b?,begin:i?,end:i?,format:s?",
842 .params = "-p protocol [-d] [begin] [length] [format]",
843 .help = "dump guest memory to file",
844 .mhandler.cmd_new = qmp_marshal_dump_guest_memory,
847 SQMP
848 dump
851 Dump guest memory to file. The file can be processed with crash or gdb.
853 Arguments:
855 - "paging": do paging to get guest's memory mapping (json-bool)
856 - "protocol": destination file(started with "file:") or destination file
857 descriptor (started with "fd:") (json-string)
858 - "detach": if specified, command will return immediately, without waiting
859 for the dump to finish. The user can track progress using
860 "query-dump". (json-bool)
861 - "begin": the starting physical address. It's optional, and should be specified
862 with length together (json-int)
863 - "length": the memory size, in bytes. It's optional, and should be specified
864 with begin together (json-int)
865 - "format": the format of guest memory dump. It's optional, and can be
866 elf|kdump-zlib|kdump-lzo|kdump-snappy, but non-elf formats will
867 conflict with paging and filter, ie. begin and length (json-string)
869 Example:
871 -> { "execute": "dump-guest-memory", "arguments": { "protocol": "fd:dump" } }
872 <- { "return": {} }
874 Notes:
876 (1) All boolean arguments default to false
878 EQMP
881 .name = "query-dump-guest-memory-capability",
882 .args_type = "",
883 .mhandler.cmd_new = qmp_marshal_query_dump_guest_memory_capability,
886 SQMP
887 query-dump-guest-memory-capability
888 ----------
890 Show available formats for 'dump-guest-memory'
892 Example:
894 -> { "execute": "query-dump-guest-memory-capability" }
895 <- { "return": { "formats":
896 ["elf", "kdump-zlib", "kdump-lzo", "kdump-snappy"] }
898 EQMP
901 .name = "query-dump",
902 .args_type = "",
903 .params = "",
904 .help = "query background dump status",
905 .mhandler.cmd_new = qmp_marshal_query_dump,
908 SQMP
909 query-dump
910 ----------
912 Query background dump status.
914 Arguments: None.
916 Example:
918 -> { "execute": "query-dump" }
919 <- { "return": { "status": "active", "completed": 1024000,
920 "total": 2048000 } }
922 EQMP
924 #if defined TARGET_S390X
926 .name = "dump-skeys",
927 .args_type = "filename:F",
928 .mhandler.cmd_new = qmp_marshal_dump_skeys,
930 #endif
932 SQMP
933 dump-skeys
934 ----------
936 Save guest storage keys to file.
938 Arguments:
940 - "filename": file path (json-string)
942 Example:
944 -> { "execute": "dump-skeys", "arguments": { "filename": "/tmp/skeys" } }
945 <- { "return": {} }
947 EQMP
950 .name = "netdev_add",
951 .args_type = "netdev:O",
952 .mhandler.cmd_new = qmp_netdev_add,
955 SQMP
956 netdev_add
957 ----------
959 Add host network device.
961 Arguments:
963 - "type": the device type, "tap", "user", ... (json-string)
964 - "id": the device's ID, must be unique (json-string)
965 - device options
967 Example:
969 -> { "execute": "netdev_add",
970 "arguments": { "type": "user", "id": "netdev1",
971 "dnssearch": "example.org" } }
972 <- { "return": {} }
974 Note: The supported device options are the same ones supported by the '-netdev'
975 command-line argument, which are listed in the '-help' output or QEMU's
976 manual
978 EQMP
981 .name = "netdev_del",
982 .args_type = "id:s",
983 .mhandler.cmd_new = qmp_marshal_netdev_del,
986 SQMP
987 netdev_del
988 ----------
990 Remove host network device.
992 Arguments:
994 - "id": the device's ID, must be unique (json-string)
996 Example:
998 -> { "execute": "netdev_del", "arguments": { "id": "netdev1" } }
999 <- { "return": {} }
1002 EQMP
1005 .name = "object-add",
1006 .args_type = "qom-type:s,id:s,props:q?",
1007 .mhandler.cmd_new = qmp_marshal_object_add,
1010 SQMP
1011 object-add
1012 ----------
1014 Create QOM object.
1016 Arguments:
1018 - "qom-type": the object's QOM type, i.e. the class name (json-string)
1019 - "id": the object's ID, must be unique (json-string)
1020 - "props": a dictionary of object property values (optional, json-dict)
1022 Example:
1024 -> { "execute": "object-add", "arguments": { "qom-type": "rng-random", "id": "rng1",
1025 "props": { "filename": "/dev/hwrng" } } }
1026 <- { "return": {} }
1028 EQMP
1031 .name = "object-del",
1032 .args_type = "id:s",
1033 .mhandler.cmd_new = qmp_marshal_object_del,
1036 SQMP
1037 object-del
1038 ----------
1040 Remove QOM object.
1042 Arguments:
1044 - "id": the object's ID (json-string)
1046 Example:
1048 -> { "execute": "object-del", "arguments": { "id": "rng1" } }
1049 <- { "return": {} }
1052 EQMP
1056 .name = "block_resize",
1057 .args_type = "device:s?,node-name:s?,size:o",
1058 .mhandler.cmd_new = qmp_marshal_block_resize,
1061 SQMP
1062 block_resize
1063 ------------
1065 Resize a block image while a guest is running.
1067 Arguments:
1069 - "device": the device's ID, must be unique (json-string)
1070 - "node-name": the node name in the block driver state graph (json-string)
1071 - "size": new size
1073 Example:
1075 -> { "execute": "block_resize", "arguments": { "device": "scratch", "size": 1073741824 } }
1076 <- { "return": {} }
1078 EQMP
1081 .name = "block-stream",
1082 .args_type = "device:B,base:s?,speed:o?,backing-file:s?,on-error:s?",
1083 .mhandler.cmd_new = qmp_marshal_block_stream,
1086 SQMP
1087 block-stream
1088 ------------
1090 Copy data from a backing file into a block device.
1092 Arguments:
1094 - "device": The device's ID, must be unique (json-string)
1095 - "base": The file name of the backing image above which copying starts
1096 (json-string, optional)
1097 - "backing-file": The backing file string to write into the active layer. This
1098 filename is not validated.
1100 If a pathname string is such that it cannot be resolved by
1101 QEMU, that means that subsequent QMP or HMP commands must use
1102 node-names for the image in question, as filename lookup
1103 methods will fail.
1105 If not specified, QEMU will automatically determine the
1106 backing file string to use, or error out if there is no
1107 obvious choice. Care should be taken when specifying the
1108 string, to specify a valid filename or protocol.
1109 (json-string, optional) (Since 2.1)
1110 - "speed": the maximum speed, in bytes per second (json-int, optional)
1111 - "on-error": the action to take on an error (default 'report'). 'stop' and
1112 'enospc' can only be used if the block device supports io-status.
1113 (json-string, optional) (Since 2.1)
1115 Example:
1117 -> { "execute": "block-stream", "arguments": { "device": "virtio0",
1118 "base": "/tmp/master.qcow2" } }
1119 <- { "return": {} }
1121 EQMP
1124 .name = "block-commit",
1125 .args_type = "device:B,base:s?,top:s?,backing-file:s?,speed:o?",
1126 .mhandler.cmd_new = qmp_marshal_block_commit,
1129 SQMP
1130 block-commit
1131 ------------
1133 Live commit of data from overlay image nodes into backing nodes - i.e., writes
1134 data between 'top' and 'base' into 'base'.
1136 Arguments:
1138 - "device": The device's ID, must be unique (json-string)
1139 - "base": The file name of the backing image to write data into.
1140 If not specified, this is the deepest backing image
1141 (json-string, optional)
1142 - "top": The file name of the backing image within the image chain,
1143 which contains the topmost data to be committed down. If
1144 not specified, this is the active layer. (json-string, optional)
1146 - backing-file: The backing file string to write into the overlay
1147 image of 'top'. If 'top' is the active layer,
1148 specifying a backing file string is an error. This
1149 filename is not validated.
1151 If a pathname string is such that it cannot be
1152 resolved by QEMU, that means that subsequent QMP or
1153 HMP commands must use node-names for the image in
1154 question, as filename lookup methods will fail.
1156 If not specified, QEMU will automatically determine
1157 the backing file string to use, or error out if
1158 there is no obvious choice. Care should be taken
1159 when specifying the string, to specify a valid
1160 filename or protocol.
1161 (json-string, optional) (Since 2.1)
1163 If top == base, that is an error.
1164 If top == active, the job will not be completed by itself,
1165 user needs to complete the job with the block-job-complete
1166 command after getting the ready event. (Since 2.0)
1168 If the base image is smaller than top, then the base image
1169 will be resized to be the same size as top. If top is
1170 smaller than the base image, the base will not be
1171 truncated. If you want the base image size to match the
1172 size of the smaller top, you can safely truncate it
1173 yourself once the commit operation successfully completes.
1174 (json-string)
1175 - "speed": the maximum speed, in bytes per second (json-int, optional)
1178 Example:
1180 -> { "execute": "block-commit", "arguments": { "device": "virtio0",
1181 "top": "/tmp/snap1.qcow2" } }
1182 <- { "return": {} }
1184 EQMP
1187 .name = "drive-backup",
1188 .args_type = "sync:s,device:B,target:s,speed:i?,mode:s?,format:s?,"
1189 "bitmap:s?,on-source-error:s?,on-target-error:s?",
1190 .mhandler.cmd_new = qmp_marshal_drive_backup,
1193 SQMP
1194 drive-backup
1195 ------------
1197 Start a point-in-time copy of a block device to a new destination. The
1198 status of ongoing drive-backup operations can be checked with
1199 query-block-jobs where the BlockJobInfo.type field has the value 'backup'.
1200 The operation can be stopped before it has completed using the
1201 block-job-cancel command.
1203 Arguments:
1205 - "device": the name of the device which should be copied.
1206 (json-string)
1207 - "target": the target of the new image. If the file exists, or if it is a
1208 device, the existing file/device will be used as the new
1209 destination. If it does not exist, a new file will be created.
1210 (json-string)
1211 - "format": the format of the new destination, default is to probe if 'mode' is
1212 'existing', else the format of the source
1213 (json-string, optional)
1214 - "sync": what parts of the disk image should be copied to the destination;
1215 possibilities include "full" for all the disk, "top" for only the sectors
1216 allocated in the topmost image, "incremental" for only the dirty sectors in
1217 the bitmap, or "none" to only replicate new I/O (MirrorSyncMode).
1218 - "bitmap": dirty bitmap name for sync==incremental. Must be present if sync
1219 is "incremental", must NOT be present otherwise.
1220 - "mode": whether and how QEMU should create a new image
1221 (NewImageMode, optional, default 'absolute-paths')
1222 - "speed": the maximum speed, in bytes per second (json-int, optional)
1223 - "on-source-error": the action to take on an error on the source, default
1224 'report'. 'stop' and 'enospc' can only be used
1225 if the block device supports io-status.
1226 (BlockdevOnError, optional)
1227 - "on-target-error": the action to take on an error on the target, default
1228 'report' (no limitations, since this applies to
1229 a different block device than device).
1230 (BlockdevOnError, optional)
1232 Example:
1233 -> { "execute": "drive-backup", "arguments": { "device": "drive0",
1234 "sync": "full",
1235 "target": "backup.img" } }
1236 <- { "return": {} }
1238 EQMP
1241 .name = "blockdev-backup",
1242 .args_type = "sync:s,device:B,target:B,speed:i?,"
1243 "on-source-error:s?,on-target-error:s?",
1244 .mhandler.cmd_new = qmp_marshal_blockdev_backup,
1247 SQMP
1248 blockdev-backup
1249 ---------------
1251 The device version of drive-backup: this command takes an existing named device
1252 as backup target.
1254 Arguments:
1256 - "device": the name of the device which should be copied.
1257 (json-string)
1258 - "target": the name of the backup target device. (json-string)
1259 - "sync": what parts of the disk image should be copied to the destination;
1260 possibilities include "full" for all the disk, "top" for only the
1261 sectors allocated in the topmost image, or "none" to only replicate
1262 new I/O (MirrorSyncMode).
1263 - "speed": the maximum speed, in bytes per second (json-int, optional)
1264 - "on-source-error": the action to take on an error on the source, default
1265 'report'. 'stop' and 'enospc' can only be used
1266 if the block device supports io-status.
1267 (BlockdevOnError, optional)
1268 - "on-target-error": the action to take on an error on the target, default
1269 'report' (no limitations, since this applies to
1270 a different block device than device).
1271 (BlockdevOnError, optional)
1273 Example:
1274 -> { "execute": "blockdev-backup", "arguments": { "device": "src-id",
1275 "sync": "full",
1276 "target": "tgt-id" } }
1277 <- { "return": {} }
1279 EQMP
1282 .name = "block-job-set-speed",
1283 .args_type = "device:B,speed:o",
1284 .mhandler.cmd_new = qmp_marshal_block_job_set_speed,
1288 .name = "block-job-cancel",
1289 .args_type = "device:B,force:b?",
1290 .mhandler.cmd_new = qmp_marshal_block_job_cancel,
1293 .name = "block-job-pause",
1294 .args_type = "device:B",
1295 .mhandler.cmd_new = qmp_marshal_block_job_pause,
1298 .name = "block-job-resume",
1299 .args_type = "device:B",
1300 .mhandler.cmd_new = qmp_marshal_block_job_resume,
1303 .name = "block-job-complete",
1304 .args_type = "device:B",
1305 .mhandler.cmd_new = qmp_marshal_block_job_complete,
1308 .name = "transaction",
1309 .args_type = "actions:q,properties:q?",
1310 .mhandler.cmd_new = qmp_marshal_transaction,
1313 SQMP
1314 transaction
1315 -----------
1317 Atomically operate on one or more block devices. Operations that are
1318 currently supported:
1320 - drive-backup
1321 - blockdev-backup
1322 - blockdev-snapshot-sync
1323 - blockdev-snapshot-internal-sync
1324 - abort
1325 - block-dirty-bitmap-add
1326 - block-dirty-bitmap-clear
1328 Refer to the qemu/qapi-schema.json file for minimum required QEMU
1329 versions for these operations. A list of dictionaries is accepted,
1330 that contains the actions to be performed. If there is any failure
1331 performing any of the operations, all operations for the group are
1332 abandoned.
1334 For external snapshots, the dictionary contains the device, the file to use for
1335 the new snapshot, and the format. The default format, if not specified, is
1336 qcow2.
1338 Each new snapshot defaults to being created by QEMU (wiping any
1339 contents if the file already exists), but it is also possible to reuse
1340 an externally-created file. In the latter case, you should ensure that
1341 the new image file has the same contents as the current one; QEMU cannot
1342 perform any meaningful check. Typically this is achieved by using the
1343 current image file as the backing file for the new image.
1345 On failure, the original disks pre-snapshot attempt will be used.
1347 For internal snapshots, the dictionary contains the device and the snapshot's
1348 name. If an internal snapshot matching name already exists, the request will
1349 be rejected. Only some image formats support it, for example, qcow2, rbd,
1350 and sheepdog.
1352 On failure, qemu will try delete the newly created internal snapshot in the
1353 transaction. When an I/O error occurs during deletion, the user needs to fix
1354 it later with qemu-img or other command.
1356 Arguments:
1358 actions array:
1359 - "type": the operation to perform (json-string). Possible
1360 values: "drive-backup", "blockdev-backup",
1361 "blockdev-snapshot-sync",
1362 "blockdev-snapshot-internal-sync",
1363 "abort", "block-dirty-bitmap-add",
1364 "block-dirty-bitmap-clear"
1365 - "data": a dictionary. The contents depend on the value
1366 of "type". When "type" is "blockdev-snapshot-sync":
1367 - "device": device name to snapshot (json-string)
1368 - "node-name": graph node name to snapshot (json-string)
1369 - "snapshot-file": name of new image file (json-string)
1370 - "snapshot-node-name": graph node name of the new snapshot (json-string)
1371 - "format": format of new image (json-string, optional)
1372 - "mode": whether and how QEMU should create the snapshot file
1373 (NewImageMode, optional, default "absolute-paths")
1374 When "type" is "blockdev-snapshot-internal-sync":
1375 - "device": device name to snapshot (json-string)
1376 - "name": name of the new snapshot (json-string)
1378 Example:
1380 -> { "execute": "transaction",
1381 "arguments": { "actions": [
1382 { "type": "blockdev-snapshot-sync", "data" : { "device": "ide-hd0",
1383 "snapshot-file": "/some/place/my-image",
1384 "format": "qcow2" } },
1385 { "type": "blockdev-snapshot-sync", "data" : { "node-name": "myfile",
1386 "snapshot-file": "/some/place/my-image2",
1387 "snapshot-node-name": "node3432",
1388 "mode": "existing",
1389 "format": "qcow2" } },
1390 { "type": "blockdev-snapshot-sync", "data" : { "device": "ide-hd1",
1391 "snapshot-file": "/some/place/my-image2",
1392 "mode": "existing",
1393 "format": "qcow2" } },
1394 { "type": "blockdev-snapshot-internal-sync", "data" : {
1395 "device": "ide-hd2",
1396 "name": "snapshot0" } } ] } }
1397 <- { "return": {} }
1399 EQMP
1402 .name = "block-dirty-bitmap-add",
1403 .args_type = "node:B,name:s,granularity:i?",
1404 .mhandler.cmd_new = qmp_marshal_block_dirty_bitmap_add,
1407 SQMP
1409 block-dirty-bitmap-add
1410 ----------------------
1411 Since 2.4
1413 Create a dirty bitmap with a name on the device, and start tracking the writes.
1415 Arguments:
1417 - "node": device/node on which to create dirty bitmap (json-string)
1418 - "name": name of the new dirty bitmap (json-string)
1419 - "granularity": granularity to track writes with (int, optional)
1421 Example:
1423 -> { "execute": "block-dirty-bitmap-add", "arguments": { "node": "drive0",
1424 "name": "bitmap0" } }
1425 <- { "return": {} }
1427 EQMP
1430 .name = "block-dirty-bitmap-remove",
1431 .args_type = "node:B,name:s",
1432 .mhandler.cmd_new = qmp_marshal_block_dirty_bitmap_remove,
1435 SQMP
1437 block-dirty-bitmap-remove
1438 -------------------------
1439 Since 2.4
1441 Stop write tracking and remove the dirty bitmap that was created with
1442 block-dirty-bitmap-add.
1444 Arguments:
1446 - "node": device/node on which to remove dirty bitmap (json-string)
1447 - "name": name of the dirty bitmap to remove (json-string)
1449 Example:
1451 -> { "execute": "block-dirty-bitmap-remove", "arguments": { "node": "drive0",
1452 "name": "bitmap0" } }
1453 <- { "return": {} }
1455 EQMP
1458 .name = "block-dirty-bitmap-clear",
1459 .args_type = "node:B,name:s",
1460 .mhandler.cmd_new = qmp_marshal_block_dirty_bitmap_clear,
1463 SQMP
1465 block-dirty-bitmap-clear
1466 ------------------------
1467 Since 2.4
1469 Reset the dirty bitmap associated with a node so that an incremental backup
1470 from this point in time forward will only backup clusters modified after this
1471 clear operation.
1473 Arguments:
1475 - "node": device/node on which to remove dirty bitmap (json-string)
1476 - "name": name of the dirty bitmap to remove (json-string)
1478 Example:
1480 -> { "execute": "block-dirty-bitmap-clear", "arguments": { "node": "drive0",
1481 "name": "bitmap0" } }
1482 <- { "return": {} }
1484 EQMP
1487 .name = "blockdev-snapshot-sync",
1488 .args_type = "device:s?,node-name:s?,snapshot-file:s,snapshot-node-name:s?,format:s?,mode:s?",
1489 .mhandler.cmd_new = qmp_marshal_blockdev_snapshot_sync,
1492 SQMP
1493 blockdev-snapshot-sync
1494 ----------------------
1496 Synchronous snapshot of a block device. snapshot-file specifies the
1497 target of the new image. If the file exists, or if it is a device, the
1498 snapshot will be created in the existing file/device. If does not
1499 exist, a new file will be created. format specifies the format of the
1500 snapshot image, default is qcow2.
1502 Arguments:
1504 - "device": device name to snapshot (json-string)
1505 - "node-name": graph node name to snapshot (json-string)
1506 - "snapshot-file": name of new image file (json-string)
1507 - "snapshot-node-name": graph node name of the new snapshot (json-string)
1508 - "mode": whether and how QEMU should create the snapshot file
1509 (NewImageMode, optional, default "absolute-paths")
1510 - "format": format of new image (json-string, optional)
1512 Example:
1514 -> { "execute": "blockdev-snapshot-sync", "arguments": { "device": "ide-hd0",
1515 "snapshot-file":
1516 "/some/place/my-image",
1517 "format": "qcow2" } }
1518 <- { "return": {} }
1520 EQMP
1523 .name = "blockdev-snapshot",
1524 .args_type = "node:s,overlay:s",
1525 .mhandler.cmd_new = qmp_marshal_blockdev_snapshot,
1528 SQMP
1529 blockdev-snapshot
1530 -----------------
1531 Since 2.5
1533 Create a snapshot, by installing 'node' as the backing image of
1534 'overlay'. Additionally, if 'node' is associated with a block
1535 device, the block device changes to using 'overlay' as its new active
1536 image.
1538 Arguments:
1540 - "node": device that will have a snapshot created (json-string)
1541 - "overlay": device that will have 'node' as its backing image (json-string)
1543 Example:
1545 -> { "execute": "blockdev-add",
1546 "arguments": { "options": { "driver": "qcow2",
1547 "node-name": "node1534",
1548 "file": { "driver": "file",
1549 "filename": "hd1.qcow2" },
1550 "backing": "" } } }
1552 <- { "return": {} }
1554 -> { "execute": "blockdev-snapshot", "arguments": { "node": "ide-hd0",
1555 "overlay": "node1534" } }
1556 <- { "return": {} }
1558 EQMP
1561 .name = "blockdev-snapshot-internal-sync",
1562 .args_type = "device:B,name:s",
1563 .mhandler.cmd_new = qmp_marshal_blockdev_snapshot_internal_sync,
1566 SQMP
1567 blockdev-snapshot-internal-sync
1568 -------------------------------
1570 Synchronously take an internal snapshot of a block device when the format of
1571 image used supports it. If the name is an empty string, or a snapshot with
1572 name already exists, the operation will fail.
1574 Arguments:
1576 - "device": device name to snapshot (json-string)
1577 - "name": name of the new snapshot (json-string)
1579 Example:
1581 -> { "execute": "blockdev-snapshot-internal-sync",
1582 "arguments": { "device": "ide-hd0",
1583 "name": "snapshot0" }
1585 <- { "return": {} }
1587 EQMP
1590 .name = "blockdev-snapshot-delete-internal-sync",
1591 .args_type = "device:B,id:s?,name:s?",
1592 .mhandler.cmd_new =
1593 qmp_marshal_blockdev_snapshot_delete_internal_sync,
1596 SQMP
1597 blockdev-snapshot-delete-internal-sync
1598 --------------------------------------
1600 Synchronously delete an internal snapshot of a block device when the format of
1601 image used supports it. The snapshot is identified by name or id or both. One
1602 of name or id is required. If the snapshot is not found, the operation will
1603 fail.
1605 Arguments:
1607 - "device": device name (json-string)
1608 - "id": ID of the snapshot (json-string, optional)
1609 - "name": name of the snapshot (json-string, optional)
1611 Example:
1613 -> { "execute": "blockdev-snapshot-delete-internal-sync",
1614 "arguments": { "device": "ide-hd0",
1615 "name": "snapshot0" }
1617 <- { "return": {
1618 "id": "1",
1619 "name": "snapshot0",
1620 "vm-state-size": 0,
1621 "date-sec": 1000012,
1622 "date-nsec": 10,
1623 "vm-clock-sec": 100,
1624 "vm-clock-nsec": 20
1628 EQMP
1631 .name = "drive-mirror",
1632 .args_type = "sync:s,device:B,target:s,speed:i?,mode:s?,format:s?,"
1633 "node-name:s?,replaces:s?,"
1634 "on-source-error:s?,on-target-error:s?,"
1635 "unmap:b?,"
1636 "granularity:i?,buf-size:i?",
1637 .mhandler.cmd_new = qmp_marshal_drive_mirror,
1640 SQMP
1641 drive-mirror
1642 ------------
1644 Start mirroring a block device's writes to a new destination. target
1645 specifies the target of the new image. If the file exists, or if it is
1646 a device, it will be used as the new destination for writes. If it does not
1647 exist, a new file will be created. format specifies the format of the
1648 mirror image, default is to probe if mode='existing', else the format
1649 of the source.
1651 Arguments:
1653 - "device": device name to operate on (json-string)
1654 - "target": name of new image file (json-string)
1655 - "format": format of new image (json-string, optional)
1656 - "node-name": the name of the new block driver state in the node graph
1657 (json-string, optional)
1658 - "replaces": the block driver node name to replace when finished
1659 (json-string, optional)
1660 - "mode": how an image file should be created into the target
1661 file/device (NewImageMode, optional, default 'absolute-paths')
1662 - "speed": maximum speed of the streaming job, in bytes per second
1663 (json-int)
1664 - "granularity": granularity of the dirty bitmap, in bytes (json-int, optional)
1665 - "buf-size": maximum amount of data in flight from source to target, in bytes
1666 (json-int, default 10M)
1667 - "sync": what parts of the disk image should be copied to the destination;
1668 possibilities include "full" for all the disk, "top" for only the sectors
1669 allocated in the topmost image, or "none" to only replicate new I/O
1670 (MirrorSyncMode).
1671 - "on-source-error": the action to take on an error on the source
1672 (BlockdevOnError, default 'report')
1673 - "on-target-error": the action to take on an error on the target
1674 (BlockdevOnError, default 'report')
1675 - "unmap": whether the target sectors should be discarded where source has only
1676 zeroes. (json-bool, optional, default true)
1678 The default value of the granularity is the image cluster size clamped
1679 between 4096 and 65536, if the image format defines one. If the format
1680 does not define a cluster size, the default value of the granularity
1681 is 65536.
1684 Example:
1686 -> { "execute": "drive-mirror", "arguments": { "device": "ide-hd0",
1687 "target": "/some/place/my-image",
1688 "sync": "full",
1689 "format": "qcow2" } }
1690 <- { "return": {} }
1692 EQMP
1695 .name = "blockdev-mirror",
1696 .args_type = "sync:s,device:B,target:B,replaces:s?,speed:i?,"
1697 "on-source-error:s?,on-target-error:s?,"
1698 "granularity:i?,buf-size:i?",
1699 .mhandler.cmd_new = qmp_marshal_blockdev_mirror,
1702 SQMP
1703 blockdev-mirror
1704 ------------
1706 Start mirroring a block device's writes to another block device. target
1707 specifies the target of mirror operation.
1709 Arguments:
1711 - "device": device name to operate on (json-string)
1712 - "target": device name to mirror to (json-string)
1713 - "replaces": the block driver node name to replace when finished
1714 (json-string, optional)
1715 - "speed": maximum speed of the streaming job, in bytes per second
1716 (json-int)
1717 - "granularity": granularity of the dirty bitmap, in bytes (json-int, optional)
1718 - "buf_size": maximum amount of data in flight from source to target, in bytes
1719 (json-int, default 10M)
1720 - "sync": what parts of the disk image should be copied to the destination;
1721 possibilities include "full" for all the disk, "top" for only the sectors
1722 allocated in the topmost image, or "none" to only replicate new I/O
1723 (MirrorSyncMode).
1724 - "on-source-error": the action to take on an error on the source
1725 (BlockdevOnError, default 'report')
1726 - "on-target-error": the action to take on an error on the target
1727 (BlockdevOnError, default 'report')
1729 The default value of the granularity is the image cluster size clamped
1730 between 4096 and 65536, if the image format defines one. If the format
1731 does not define a cluster size, the default value of the granularity
1732 is 65536.
1734 Example:
1736 -> { "execute": "blockdev-mirror", "arguments": { "device": "ide-hd0",
1737 "target": "target0",
1738 "sync": "full" } }
1739 <- { "return": {} }
1741 EQMP
1743 .name = "change-backing-file",
1744 .args_type = "device:s,image-node-name:s,backing-file:s",
1745 .mhandler.cmd_new = qmp_marshal_change_backing_file,
1748 SQMP
1749 change-backing-file
1750 -------------------
1751 Since: 2.1
1753 Change the backing file in the image file metadata. This does not cause
1754 QEMU to reopen the image file to reparse the backing filename (it may,
1755 however, perform a reopen to change permissions from r/o -> r/w -> r/o,
1756 if needed). The new backing file string is written into the image file
1757 metadata, and the QEMU internal strings are updated.
1759 Arguments:
1761 - "image-node-name": The name of the block driver state node of the
1762 image to modify. The "device" is argument is used to
1763 verify "image-node-name" is in the chain described by
1764 "device".
1765 (json-string, optional)
1767 - "device": The name of the device.
1768 (json-string)
1770 - "backing-file": The string to write as the backing file. This string is
1771 not validated, so care should be taken when specifying
1772 the string or the image chain may not be able to be
1773 reopened again.
1774 (json-string)
1776 Returns: Nothing on success
1777 If "device" does not exist or cannot be determined, DeviceNotFound
1779 EQMP
1782 .name = "balloon",
1783 .args_type = "value:M",
1784 .mhandler.cmd_new = qmp_marshal_balloon,
1787 SQMP
1788 balloon
1789 -------
1791 Request VM to change its memory allocation (in bytes).
1793 Arguments:
1795 - "value": New memory allocation (json-int)
1797 Example:
1799 -> { "execute": "balloon", "arguments": { "value": 536870912 } }
1800 <- { "return": {} }
1802 EQMP
1805 .name = "set_link",
1806 .args_type = "name:s,up:b",
1807 .mhandler.cmd_new = qmp_marshal_set_link,
1810 SQMP
1811 set_link
1812 --------
1814 Change the link status of a network adapter.
1816 Arguments:
1818 - "name": network device name (json-string)
1819 - "up": status is up (json-bool)
1821 Example:
1823 -> { "execute": "set_link", "arguments": { "name": "e1000.0", "up": false } }
1824 <- { "return": {} }
1826 EQMP
1829 .name = "getfd",
1830 .args_type = "fdname:s",
1831 .params = "getfd name",
1832 .help = "receive a file descriptor via SCM rights and assign it a name",
1833 .mhandler.cmd_new = qmp_marshal_getfd,
1836 SQMP
1837 getfd
1838 -----
1840 Receive a file descriptor via SCM rights and assign it a name.
1842 Arguments:
1844 - "fdname": file descriptor name (json-string)
1846 Example:
1848 -> { "execute": "getfd", "arguments": { "fdname": "fd1" } }
1849 <- { "return": {} }
1851 Notes:
1853 (1) If the name specified by the "fdname" argument already exists,
1854 the file descriptor assigned to it will be closed and replaced
1855 by the received file descriptor.
1856 (2) The 'closefd' command can be used to explicitly close the file
1857 descriptor when it is no longer needed.
1859 EQMP
1862 .name = "closefd",
1863 .args_type = "fdname:s",
1864 .params = "closefd name",
1865 .help = "close a file descriptor previously passed via SCM rights",
1866 .mhandler.cmd_new = qmp_marshal_closefd,
1869 SQMP
1870 closefd
1871 -------
1873 Close a file descriptor previously passed via SCM rights.
1875 Arguments:
1877 - "fdname": file descriptor name (json-string)
1879 Example:
1881 -> { "execute": "closefd", "arguments": { "fdname": "fd1" } }
1882 <- { "return": {} }
1884 EQMP
1887 .name = "add-fd",
1888 .args_type = "fdset-id:i?,opaque:s?",
1889 .params = "add-fd fdset-id opaque",
1890 .help = "Add a file descriptor, that was passed via SCM rights, to an fd set",
1891 .mhandler.cmd_new = qmp_marshal_add_fd,
1894 SQMP
1895 add-fd
1896 -------
1898 Add a file descriptor, that was passed via SCM rights, to an fd set.
1900 Arguments:
1902 - "fdset-id": The ID of the fd set to add the file descriptor to.
1903 (json-int, optional)
1904 - "opaque": A free-form string that can be used to describe the fd.
1905 (json-string, optional)
1907 Return a json-object with the following information:
1909 - "fdset-id": The ID of the fd set that the fd was added to. (json-int)
1910 - "fd": The file descriptor that was received via SCM rights and added to the
1911 fd set. (json-int)
1913 Example:
1915 -> { "execute": "add-fd", "arguments": { "fdset-id": 1 } }
1916 <- { "return": { "fdset-id": 1, "fd": 3 } }
1918 Notes:
1920 (1) The list of fd sets is shared by all monitor connections.
1921 (2) If "fdset-id" is not specified, a new fd set will be created.
1923 EQMP
1926 .name = "remove-fd",
1927 .args_type = "fdset-id:i,fd:i?",
1928 .params = "remove-fd fdset-id fd",
1929 .help = "Remove a file descriptor from an fd set",
1930 .mhandler.cmd_new = qmp_marshal_remove_fd,
1933 SQMP
1934 remove-fd
1935 ---------
1937 Remove a file descriptor from an fd set.
1939 Arguments:
1941 - "fdset-id": The ID of the fd set that the file descriptor belongs to.
1942 (json-int)
1943 - "fd": The file descriptor that is to be removed. (json-int, optional)
1945 Example:
1947 -> { "execute": "remove-fd", "arguments": { "fdset-id": 1, "fd": 3 } }
1948 <- { "return": {} }
1950 Notes:
1952 (1) The list of fd sets is shared by all monitor connections.
1953 (2) If "fd" is not specified, all file descriptors in "fdset-id" will be
1954 removed.
1956 EQMP
1959 .name = "query-fdsets",
1960 .args_type = "",
1961 .help = "Return information describing all fd sets",
1962 .mhandler.cmd_new = qmp_marshal_query_fdsets,
1965 SQMP
1966 query-fdsets
1967 -------------
1969 Return information describing all fd sets.
1971 Arguments: None
1973 Example:
1975 -> { "execute": "query-fdsets" }
1976 <- { "return": [
1978 "fds": [
1980 "fd": 30,
1981 "opaque": "rdonly:/path/to/file"
1984 "fd": 24,
1985 "opaque": "rdwr:/path/to/file"
1988 "fdset-id": 1
1991 "fds": [
1993 "fd": 28
1996 "fd": 29
1999 "fdset-id": 0
2004 Note: The list of fd sets is shared by all monitor connections.
2006 EQMP
2009 .name = "block_passwd",
2010 .args_type = "device:s?,node-name:s?,password:s",
2011 .mhandler.cmd_new = qmp_marshal_block_passwd,
2014 SQMP
2015 block_passwd
2016 ------------
2018 Set the password of encrypted block devices.
2020 Arguments:
2022 - "device": device name (json-string)
2023 - "node-name": name in the block driver state graph (json-string)
2024 - "password": password (json-string)
2026 Example:
2028 -> { "execute": "block_passwd", "arguments": { "device": "ide0-hd0",
2029 "password": "12345" } }
2030 <- { "return": {} }
2032 EQMP
2035 .name = "block_set_io_throttle",
2036 .args_type = "device:B,bps:l,bps_rd:l,bps_wr:l,iops:l,iops_rd:l,iops_wr:l,bps_max:l?,bps_rd_max:l?,bps_wr_max:l?,iops_max:l?,iops_rd_max:l?,iops_wr_max:l?,bps_max_length:l?,bps_rd_max_length:l?,bps_wr_max_length:l?,iops_max_length:l?,iops_rd_max_length:l?,iops_wr_max_length:l?,iops_size:l?,group:s?",
2037 .mhandler.cmd_new = qmp_marshal_block_set_io_throttle,
2040 SQMP
2041 block_set_io_throttle
2042 ------------
2044 Change I/O throttle limits for a block drive.
2046 Arguments:
2048 - "device": device name (json-string)
2049 - "bps": total throughput limit in bytes per second (json-int)
2050 - "bps_rd": read throughput limit in bytes per second (json-int)
2051 - "bps_wr": write throughput limit in bytes per second (json-int)
2052 - "iops": total I/O operations per second (json-int)
2053 - "iops_rd": read I/O operations per second (json-int)
2054 - "iops_wr": write I/O operations per second (json-int)
2055 - "bps_max": total throughput limit during bursts, in bytes (json-int, optional)
2056 - "bps_rd_max": read throughput limit during bursts, in bytes (json-int, optional)
2057 - "bps_wr_max": write throughput limit during bursts, in bytes (json-int, optional)
2058 - "iops_max": total I/O operations per second during bursts (json-int, optional)
2059 - "iops_rd_max": read I/O operations per second during bursts (json-int, optional)
2060 - "iops_wr_max": write I/O operations per second during bursts (json-int, optional)
2061 - "bps_max_length": maximum length of the @bps_max burst period, in seconds (json-int, optional)
2062 - "bps_rd_max_length": maximum length of the @bps_rd_max burst period, in seconds (json-int, optional)
2063 - "bps_wr_max_length": maximum length of the @bps_wr_max burst period, in seconds (json-int, optional)
2064 - "iops_max_length": maximum length of the @iops_max burst period, in seconds (json-int, optional)
2065 - "iops_rd_max_length": maximum length of the @iops_rd_max burst period, in seconds (json-int, optional)
2066 - "iops_wr_max_length": maximum length of the @iops_wr_max burst period, in seconds (json-int, optional)
2067 - "iops_size": I/O size in bytes when limiting (json-int, optional)
2068 - "group": throttle group name (json-string, optional)
2070 Example:
2072 -> { "execute": "block_set_io_throttle", "arguments": { "device": "virtio0",
2073 "bps": 1000000,
2074 "bps_rd": 0,
2075 "bps_wr": 0,
2076 "iops": 0,
2077 "iops_rd": 0,
2078 "iops_wr": 0,
2079 "bps_max": 8000000,
2080 "bps_rd_max": 0,
2081 "bps_wr_max": 0,
2082 "iops_max": 0,
2083 "iops_rd_max": 0,
2084 "iops_wr_max": 0,
2085 "bps_max_length": 60,
2086 "iops_size": 0 } }
2087 <- { "return": {} }
2089 EQMP
2092 .name = "set_password",
2093 .args_type = "protocol:s,password:s,connected:s?",
2094 .mhandler.cmd_new = qmp_marshal_set_password,
2097 SQMP
2098 set_password
2099 ------------
2101 Set the password for vnc/spice protocols.
2103 Arguments:
2105 - "protocol": protocol name (json-string)
2106 - "password": password (json-string)
2107 - "connected": [ keep | disconnect | fail ] (json-string, optional)
2109 Example:
2111 -> { "execute": "set_password", "arguments": { "protocol": "vnc",
2112 "password": "secret" } }
2113 <- { "return": {} }
2115 EQMP
2118 .name = "expire_password",
2119 .args_type = "protocol:s,time:s",
2120 .mhandler.cmd_new = qmp_marshal_expire_password,
2123 SQMP
2124 expire_password
2125 ---------------
2127 Set the password expire time for vnc/spice protocols.
2129 Arguments:
2131 - "protocol": protocol name (json-string)
2132 - "time": [ now | never | +secs | secs ] (json-string)
2134 Example:
2136 -> { "execute": "expire_password", "arguments": { "protocol": "vnc",
2137 "time": "+60" } }
2138 <- { "return": {} }
2140 EQMP
2143 .name = "add_client",
2144 .args_type = "protocol:s,fdname:s,skipauth:b?,tls:b?",
2145 .mhandler.cmd_new = qmp_marshal_add_client,
2148 SQMP
2149 add_client
2150 ----------
2152 Add a graphics client
2154 Arguments:
2156 - "protocol": protocol name (json-string)
2157 - "fdname": file descriptor name (json-string)
2158 - "skipauth": whether to skip authentication (json-bool, optional)
2159 - "tls": whether to perform TLS (json-bool, optional)
2161 Example:
2163 -> { "execute": "add_client", "arguments": { "protocol": "vnc",
2164 "fdname": "myclient" } }
2165 <- { "return": {} }
2167 EQMP
2169 .name = "qmp_capabilities",
2170 .args_type = "",
2171 .params = "",
2172 .help = "enable QMP capabilities",
2173 .mhandler.cmd_new = qmp_capabilities,
2176 SQMP
2177 qmp_capabilities
2178 ----------------
2180 Enable QMP capabilities.
2182 Arguments: None.
2184 Example:
2186 -> { "execute": "qmp_capabilities" }
2187 <- { "return": {} }
2189 Note: This command must be issued before issuing any other command.
2191 EQMP
2194 .name = "human-monitor-command",
2195 .args_type = "command-line:s,cpu-index:i?",
2196 .mhandler.cmd_new = qmp_marshal_human_monitor_command,
2199 SQMP
2200 human-monitor-command
2201 ---------------------
2203 Execute a Human Monitor command.
2205 Arguments:
2207 - command-line: the command name and its arguments, just like the
2208 Human Monitor's shell (json-string)
2209 - cpu-index: select the CPU number to be used by commands which access CPU
2210 data, like 'info registers'. The Monitor selects CPU 0 if this
2211 argument is not provided (json-int, optional)
2213 Example:
2215 -> { "execute": "human-monitor-command", "arguments": { "command-line": "info kvm" } }
2216 <- { "return": "kvm support: enabled\r\n" }
2218 Notes:
2220 (1) The Human Monitor is NOT an stable interface, this means that command
2221 names, arguments and responses can change or be removed at ANY time.
2222 Applications that rely on long term stability guarantees should NOT
2223 use this command
2225 (2) Limitations:
2227 o This command is stateless, this means that commands that depend
2228 on state information (such as getfd) might not work
2230 o Commands that prompt the user for data (eg. 'cont' when the block
2231 device is encrypted) don't currently work
2233 3. Query Commands
2234 =================
2236 HXCOMM Each query command below is inside a SQMP/EQMP section, do NOT change
2237 HXCOMM this! We will possibly move query commands definitions inside those
2238 HXCOMM sections, just like regular commands.
2240 EQMP
2242 SQMP
2243 query-version
2244 -------------
2246 Show QEMU version.
2248 Return a json-object with the following information:
2250 - "qemu": A json-object containing three integer values:
2251 - "major": QEMU's major version (json-int)
2252 - "minor": QEMU's minor version (json-int)
2253 - "micro": QEMU's micro version (json-int)
2254 - "package": package's version (json-string)
2256 Example:
2258 -> { "execute": "query-version" }
2259 <- {
2260 "return":{
2261 "qemu":{
2262 "major":0,
2263 "minor":11,
2264 "micro":5
2266 "package":""
2270 EQMP
2273 .name = "query-version",
2274 .args_type = "",
2275 .mhandler.cmd_new = qmp_marshal_query_version,
2278 SQMP
2279 query-commands
2280 --------------
2282 List QMP available commands.
2284 Each command is represented by a json-object, the returned value is a json-array
2285 of all commands.
2287 Each json-object contain:
2289 - "name": command's name (json-string)
2291 Example:
2293 -> { "execute": "query-commands" }
2294 <- {
2295 "return":[
2297 "name":"query-balloon"
2300 "name":"system_powerdown"
2305 Note: This example has been shortened as the real response is too long.
2307 EQMP
2310 .name = "query-commands",
2311 .args_type = "",
2312 .mhandler.cmd_new = qmp_marshal_query_commands,
2315 SQMP
2316 query-events
2317 --------------
2319 List QMP available events.
2321 Each event is represented by a json-object, the returned value is a json-array
2322 of all events.
2324 Each json-object contains:
2326 - "name": event's name (json-string)
2328 Example:
2330 -> { "execute": "query-events" }
2331 <- {
2332 "return":[
2334 "name":"SHUTDOWN"
2337 "name":"RESET"
2342 Note: This example has been shortened as the real response is too long.
2344 EQMP
2347 .name = "query-events",
2348 .args_type = "",
2349 .mhandler.cmd_new = qmp_marshal_query_events,
2352 SQMP
2353 query-qmp-schema
2354 ----------------
2356 Return the QMP wire schema. The returned value is a json-array of
2357 named schema entities. Entities are commands, events and various
2358 types. See docs/qapi-code-gen.txt for information on their structure
2359 and intended use.
2361 EQMP
2364 .name = "query-qmp-schema",
2365 .args_type = "",
2366 .mhandler.cmd_new = qmp_query_qmp_schema,
2369 SQMP
2370 query-chardev
2371 -------------
2373 Each device is represented by a json-object. The returned value is a json-array
2374 of all devices.
2376 Each json-object contain the following:
2378 - "label": device's label (json-string)
2379 - "filename": device's file (json-string)
2380 - "frontend-open": open/closed state of the frontend device attached to this
2381 backend (json-bool)
2383 Example:
2385 -> { "execute": "query-chardev" }
2386 <- {
2387 "return": [
2389 "label": "charchannel0",
2390 "filename": "unix:/var/lib/libvirt/qemu/seabios.rhel6.agent,server",
2391 "frontend-open": false
2394 "label": "charmonitor",
2395 "filename": "unix:/var/lib/libvirt/qemu/seabios.rhel6.monitor,server",
2396 "frontend-open": true
2399 "label": "charserial0",
2400 "filename": "pty:/dev/pts/2",
2401 "frontend-open": true
2406 EQMP
2409 .name = "query-chardev",
2410 .args_type = "",
2411 .mhandler.cmd_new = qmp_marshal_query_chardev,
2414 SQMP
2415 query-chardev-backends
2416 -------------
2418 List available character device backends.
2420 Each backend is represented by a json-object, the returned value is a json-array
2421 of all backends.
2423 Each json-object contains:
2425 - "name": backend name (json-string)
2427 Example:
2429 -> { "execute": "query-chardev-backends" }
2430 <- {
2431 "return":[
2433 "name":"udp"
2436 "name":"tcp"
2439 "name":"unix"
2442 "name":"spiceport"
2447 EQMP
2450 .name = "query-chardev-backends",
2451 .args_type = "",
2452 .mhandler.cmd_new = qmp_marshal_query_chardev_backends,
2455 SQMP
2456 query-block
2457 -----------
2459 Show the block devices.
2461 Each block device information is stored in a json-object and the returned value
2462 is a json-array of all devices.
2464 Each json-object contain the following:
2466 - "device": device name (json-string)
2467 - "type": device type (json-string)
2468 - deprecated, retained for backward compatibility
2469 - Possible values: "unknown"
2470 - "removable": true if the device is removable, false otherwise (json-bool)
2471 - "locked": true if the device is locked, false otherwise (json-bool)
2472 - "tray_open": only present if removable, true if the device has a tray,
2473 and it is open (json-bool)
2474 - "inserted": only present if the device is inserted, it is a json-object
2475 containing the following:
2476 - "file": device file name (json-string)
2477 - "ro": true if read-only, false otherwise (json-bool)
2478 - "drv": driver format name (json-string)
2479 - Possible values: "blkdebug", "bochs", "cloop", "dmg",
2480 "file", "file", "ftp", "ftps", "host_cdrom",
2481 "host_device", "http", "https",
2482 "nbd", "parallels", "qcow", "qcow2", "raw",
2483 "tftp", "vdi", "vmdk", "vpc", "vvfat"
2484 - "backing_file": backing file name (json-string, optional)
2485 - "backing_file_depth": number of files in the backing file chain (json-int)
2486 - "encrypted": true if encrypted, false otherwise (json-bool)
2487 - "bps": limit total bytes per second (json-int)
2488 - "bps_rd": limit read bytes per second (json-int)
2489 - "bps_wr": limit write bytes per second (json-int)
2490 - "iops": limit total I/O operations per second (json-int)
2491 - "iops_rd": limit read operations per second (json-int)
2492 - "iops_wr": limit write operations per second (json-int)
2493 - "bps_max": total max in bytes (json-int)
2494 - "bps_rd_max": read max in bytes (json-int)
2495 - "bps_wr_max": write max in bytes (json-int)
2496 - "iops_max": total I/O operations max (json-int)
2497 - "iops_rd_max": read I/O operations max (json-int)
2498 - "iops_wr_max": write I/O operations max (json-int)
2499 - "iops_size": I/O size when limiting by iops (json-int)
2500 - "detect_zeroes": detect and optimize zero writing (json-string)
2501 - Possible values: "off", "on", "unmap"
2502 - "write_threshold": write offset threshold in bytes, a event will be
2503 emitted if crossed. Zero if disabled (json-int)
2504 - "image": the detail of the image, it is a json-object containing
2505 the following:
2506 - "filename": image file name (json-string)
2507 - "format": image format (json-string)
2508 - "virtual-size": image capacity in bytes (json-int)
2509 - "dirty-flag": true if image is not cleanly closed, not present
2510 means clean (json-bool, optional)
2511 - "actual-size": actual size on disk in bytes of the image, not
2512 present when image does not support thin
2513 provision (json-int, optional)
2514 - "cluster-size": size of a cluster in bytes, not present if image
2515 format does not support it (json-int, optional)
2516 - "encrypted": true if the image is encrypted, not present means
2517 false or the image format does not support
2518 encryption (json-bool, optional)
2519 - "backing_file": backing file name, not present means no backing
2520 file is used or the image format does not
2521 support backing file chain
2522 (json-string, optional)
2523 - "full-backing-filename": full path of the backing file, not
2524 present if it equals backing_file or no
2525 backing file is used
2526 (json-string, optional)
2527 - "backing-filename-format": the format of the backing file, not
2528 present means unknown or no backing
2529 file (json-string, optional)
2530 - "snapshots": the internal snapshot info, it is an optional list
2531 of json-object containing the following:
2532 - "id": unique snapshot id (json-string)
2533 - "name": snapshot name (json-string)
2534 - "vm-state-size": size of the VM state in bytes (json-int)
2535 - "date-sec": UTC date of the snapshot in seconds (json-int)
2536 - "date-nsec": fractional part in nanoseconds to be used with
2537 date-sec (json-int)
2538 - "vm-clock-sec": VM clock relative to boot in seconds
2539 (json-int)
2540 - "vm-clock-nsec": fractional part in nanoseconds to be used
2541 with vm-clock-sec (json-int)
2542 - "backing-image": the detail of the backing image, it is an
2543 optional json-object only present when a
2544 backing image present for this image
2546 - "io-status": I/O operation status, only present if the device supports it
2547 and the VM is configured to stop on errors. It's always reset
2548 to "ok" when the "cont" command is issued (json_string, optional)
2549 - Possible values: "ok", "failed", "nospace"
2551 Example:
2553 -> { "execute": "query-block" }
2554 <- {
2555 "return":[
2557 "io-status": "ok",
2558 "device":"ide0-hd0",
2559 "locked":false,
2560 "removable":false,
2561 "inserted":{
2562 "ro":false,
2563 "drv":"qcow2",
2564 "encrypted":false,
2565 "file":"disks/test.qcow2",
2566 "backing_file_depth":1,
2567 "bps":1000000,
2568 "bps_rd":0,
2569 "bps_wr":0,
2570 "iops":1000000,
2571 "iops_rd":0,
2572 "iops_wr":0,
2573 "bps_max": 8000000,
2574 "bps_rd_max": 0,
2575 "bps_wr_max": 0,
2576 "iops_max": 0,
2577 "iops_rd_max": 0,
2578 "iops_wr_max": 0,
2579 "iops_size": 0,
2580 "detect_zeroes": "on",
2581 "write_threshold": 0,
2582 "image":{
2583 "filename":"disks/test.qcow2",
2584 "format":"qcow2",
2585 "virtual-size":2048000,
2586 "backing_file":"base.qcow2",
2587 "full-backing-filename":"disks/base.qcow2",
2588 "backing-filename-format":"qcow2",
2589 "snapshots":[
2591 "id": "1",
2592 "name": "snapshot1",
2593 "vm-state-size": 0,
2594 "date-sec": 10000200,
2595 "date-nsec": 12,
2596 "vm-clock-sec": 206,
2597 "vm-clock-nsec": 30
2600 "backing-image":{
2601 "filename":"disks/base.qcow2",
2602 "format":"qcow2",
2603 "virtual-size":2048000
2607 "type":"unknown"
2610 "io-status": "ok",
2611 "device":"ide1-cd0",
2612 "locked":false,
2613 "removable":true,
2614 "type":"unknown"
2617 "device":"floppy0",
2618 "locked":false,
2619 "removable":true,
2620 "type":"unknown"
2623 "device":"sd0",
2624 "locked":false,
2625 "removable":true,
2626 "type":"unknown"
2631 EQMP
2634 .name = "query-block",
2635 .args_type = "",
2636 .mhandler.cmd_new = qmp_marshal_query_block,
2639 SQMP
2640 query-blockstats
2641 ----------------
2643 Show block device statistics.
2645 Each device statistic information is stored in a json-object and the returned
2646 value is a json-array of all devices.
2648 Each json-object contain the following:
2650 - "device": device name (json-string)
2651 - "stats": A json-object with the statistics information, it contains:
2652 - "rd_bytes": bytes read (json-int)
2653 - "wr_bytes": bytes written (json-int)
2654 - "rd_operations": read operations (json-int)
2655 - "wr_operations": write operations (json-int)
2656 - "flush_operations": cache flush operations (json-int)
2657 - "wr_total_time_ns": total time spend on writes in nano-seconds (json-int)
2658 - "rd_total_time_ns": total time spend on reads in nano-seconds (json-int)
2659 - "flush_total_time_ns": total time spend on cache flushes in nano-seconds (json-int)
2660 - "wr_highest_offset": The offset after the greatest byte written to the
2661 BlockDriverState since it has been opened (json-int)
2662 - "rd_merged": number of read requests that have been merged into
2663 another request (json-int)
2664 - "wr_merged": number of write requests that have been merged into
2665 another request (json-int)
2666 - "idle_time_ns": time since the last I/O operation, in
2667 nanoseconds. If the field is absent it means
2668 that there haven't been any operations yet
2669 (json-int, optional)
2670 - "failed_rd_operations": number of failed read operations
2671 (json-int)
2672 - "failed_wr_operations": number of failed write operations
2673 (json-int)
2674 - "failed_flush_operations": number of failed flush operations
2675 (json-int)
2676 - "invalid_rd_operations": number of invalid read operations
2677 (json-int)
2678 - "invalid_wr_operations": number of invalid write operations
2679 (json-int)
2680 - "invalid_flush_operations": number of invalid flush operations
2681 (json-int)
2682 - "account_invalid": whether invalid operations are included in
2683 the last access statistics (json-bool)
2684 - "account_failed": whether failed operations are included in the
2685 latency and last access statistics
2686 (json-bool)
2687 - "timed_stats": A json-array containing statistics collected in
2688 specific intervals, with the following members:
2689 - "interval_length": interval used for calculating the
2690 statistics, in seconds (json-int)
2691 - "min_rd_latency_ns": minimum latency of read operations in
2692 the defined interval, in nanoseconds
2693 (json-int)
2694 - "min_wr_latency_ns": minimum latency of write operations in
2695 the defined interval, in nanoseconds
2696 (json-int)
2697 - "min_flush_latency_ns": minimum latency of flush operations
2698 in the defined interval, in
2699 nanoseconds (json-int)
2700 - "max_rd_latency_ns": maximum latency of read operations in
2701 the defined interval, in nanoseconds
2702 (json-int)
2703 - "max_wr_latency_ns": maximum latency of write operations in
2704 the defined interval, in nanoseconds
2705 (json-int)
2706 - "max_flush_latency_ns": maximum latency of flush operations
2707 in the defined interval, in
2708 nanoseconds (json-int)
2709 - "avg_rd_latency_ns": average latency of read operations in
2710 the defined interval, in nanoseconds
2711 (json-int)
2712 - "avg_wr_latency_ns": average latency of write operations in
2713 the defined interval, in nanoseconds
2714 (json-int)
2715 - "avg_flush_latency_ns": average latency of flush operations
2716 in the defined interval, in
2717 nanoseconds (json-int)
2718 - "avg_rd_queue_depth": average number of pending read
2719 operations in the defined interval
2720 (json-number)
2721 - "avg_wr_queue_depth": average number of pending write
2722 operations in the defined interval
2723 (json-number).
2724 - "parent": Contains recursively the statistics of the underlying
2725 protocol (e.g. the host file for a qcow2 image). If there is
2726 no underlying protocol, this field is omitted
2727 (json-object, optional)
2729 Example:
2731 -> { "execute": "query-blockstats" }
2732 <- {
2733 "return":[
2735 "device":"ide0-hd0",
2736 "parent":{
2737 "stats":{
2738 "wr_highest_offset":3686448128,
2739 "wr_bytes":9786368,
2740 "wr_operations":751,
2741 "rd_bytes":122567168,
2742 "rd_operations":36772
2743 "wr_total_times_ns":313253456
2744 "rd_total_times_ns":3465673657
2745 "flush_total_times_ns":49653
2746 "flush_operations":61,
2747 "rd_merged":0,
2748 "wr_merged":0,
2749 "idle_time_ns":2953431879,
2750 "account_invalid":true,
2751 "account_failed":false
2754 "stats":{
2755 "wr_highest_offset":2821110784,
2756 "wr_bytes":9786368,
2757 "wr_operations":692,
2758 "rd_bytes":122739200,
2759 "rd_operations":36604
2760 "flush_operations":51,
2761 "wr_total_times_ns":313253456
2762 "rd_total_times_ns":3465673657
2763 "flush_total_times_ns":49653,
2764 "rd_merged":0,
2765 "wr_merged":0,
2766 "idle_time_ns":2953431879,
2767 "account_invalid":true,
2768 "account_failed":false
2772 "device":"ide1-cd0",
2773 "stats":{
2774 "wr_highest_offset":0,
2775 "wr_bytes":0,
2776 "wr_operations":0,
2777 "rd_bytes":0,
2778 "rd_operations":0
2779 "flush_operations":0,
2780 "wr_total_times_ns":0
2781 "rd_total_times_ns":0
2782 "flush_total_times_ns":0,
2783 "rd_merged":0,
2784 "wr_merged":0,
2785 "account_invalid":false,
2786 "account_failed":false
2790 "device":"floppy0",
2791 "stats":{
2792 "wr_highest_offset":0,
2793 "wr_bytes":0,
2794 "wr_operations":0,
2795 "rd_bytes":0,
2796 "rd_operations":0
2797 "flush_operations":0,
2798 "wr_total_times_ns":0
2799 "rd_total_times_ns":0
2800 "flush_total_times_ns":0,
2801 "rd_merged":0,
2802 "wr_merged":0,
2803 "account_invalid":false,
2804 "account_failed":false
2808 "device":"sd0",
2809 "stats":{
2810 "wr_highest_offset":0,
2811 "wr_bytes":0,
2812 "wr_operations":0,
2813 "rd_bytes":0,
2814 "rd_operations":0
2815 "flush_operations":0,
2816 "wr_total_times_ns":0
2817 "rd_total_times_ns":0
2818 "flush_total_times_ns":0,
2819 "rd_merged":0,
2820 "wr_merged":0,
2821 "account_invalid":false,
2822 "account_failed":false
2828 EQMP
2831 .name = "query-blockstats",
2832 .args_type = "query-nodes:b?",
2833 .mhandler.cmd_new = qmp_marshal_query_blockstats,
2836 SQMP
2837 query-cpus
2838 ----------
2840 Show CPU information.
2842 Return a json-array. Each CPU is represented by a json-object, which contains:
2844 - "CPU": CPU index (json-int)
2845 - "current": true if this is the current CPU, false otherwise (json-bool)
2846 - "halted": true if the cpu is halted, false otherwise (json-bool)
2847 - "qom_path": path to the CPU object in the QOM tree (json-str)
2848 - "arch": architecture of the cpu, which determines what additional
2849 keys will be present (json-str)
2850 - Current program counter. The key's name depends on the architecture:
2851 "pc": i386/x86_64 (json-int)
2852 "nip": PPC (json-int)
2853 "pc" and "npc": sparc (json-int)
2854 "PC": mips (json-int)
2855 - "thread_id": ID of the underlying host thread (json-int)
2857 Example:
2859 -> { "execute": "query-cpus" }
2860 <- {
2861 "return":[
2863 "CPU":0,
2864 "current":true,
2865 "halted":false,
2866 "qom_path":"/machine/unattached/device[0]",
2867 "arch":"x86",
2868 "pc":3227107138,
2869 "thread_id":3134
2872 "CPU":1,
2873 "current":false,
2874 "halted":true,
2875 "qom_path":"/machine/unattached/device[2]",
2876 "arch":"x86",
2877 "pc":7108165,
2878 "thread_id":3135
2883 EQMP
2886 .name = "query-cpus",
2887 .args_type = "",
2888 .mhandler.cmd_new = qmp_marshal_query_cpus,
2891 SQMP
2892 query-iothreads
2893 ---------------
2895 Returns a list of information about each iothread.
2897 Note this list excludes the QEMU main loop thread, which is not declared
2898 using the -object iothread command-line option. It is always the main thread
2899 of the process.
2901 Return a json-array. Each iothread is represented by a json-object, which contains:
2903 - "id": name of iothread (json-str)
2904 - "thread-id": ID of the underlying host thread (json-int)
2906 Example:
2908 -> { "execute": "query-iothreads" }
2909 <- {
2910 "return":[
2912 "id":"iothread0",
2913 "thread-id":3134
2916 "id":"iothread1",
2917 "thread-id":3135
2922 EQMP
2925 .name = "query-iothreads",
2926 .args_type = "",
2927 .mhandler.cmd_new = qmp_marshal_query_iothreads,
2930 SQMP
2931 query-pci
2932 ---------
2934 PCI buses and devices information.
2936 The returned value is a json-array of all buses. Each bus is represented by
2937 a json-object, which has a key with a json-array of all PCI devices attached
2938 to it. Each device is represented by a json-object.
2940 The bus json-object contains the following:
2942 - "bus": bus number (json-int)
2943 - "devices": a json-array of json-objects, each json-object represents a
2944 PCI device
2946 The PCI device json-object contains the following:
2948 - "bus": identical to the parent's bus number (json-int)
2949 - "slot": slot number (json-int)
2950 - "function": function number (json-int)
2951 - "class_info": a json-object containing:
2952 - "desc": device class description (json-string, optional)
2953 - "class": device class number (json-int)
2954 - "id": a json-object containing:
2955 - "device": device ID (json-int)
2956 - "vendor": vendor ID (json-int)
2957 - "irq": device's IRQ if assigned (json-int, optional)
2958 - "qdev_id": qdev id string (json-string)
2959 - "pci_bridge": It's a json-object, only present if this device is a
2960 PCI bridge, contains:
2961 - "bus": bus number (json-int)
2962 - "secondary": secondary bus number (json-int)
2963 - "subordinate": subordinate bus number (json-int)
2964 - "io_range": I/O memory range information, a json-object with the
2965 following members:
2966 - "base": base address, in bytes (json-int)
2967 - "limit": limit address, in bytes (json-int)
2968 - "memory_range": memory range information, a json-object with the
2969 following members:
2970 - "base": base address, in bytes (json-int)
2971 - "limit": limit address, in bytes (json-int)
2972 - "prefetchable_range": Prefetchable memory range information, a
2973 json-object with the following members:
2974 - "base": base address, in bytes (json-int)
2975 - "limit": limit address, in bytes (json-int)
2976 - "devices": a json-array of PCI devices if there's any attached, each
2977 each element is represented by a json-object, which contains
2978 the same members of the 'PCI device json-object' described
2979 above (optional)
2980 - "regions": a json-array of json-objects, each json-object represents a
2981 memory region of this device
2983 The memory range json-object contains the following:
2985 - "base": base memory address (json-int)
2986 - "limit": limit value (json-int)
2988 The region json-object can be an I/O region or a memory region, an I/O region
2989 json-object contains the following:
2991 - "type": "io" (json-string, fixed)
2992 - "bar": BAR number (json-int)
2993 - "address": memory address (json-int)
2994 - "size": memory size (json-int)
2996 A memory region json-object contains the following:
2998 - "type": "memory" (json-string, fixed)
2999 - "bar": BAR number (json-int)
3000 - "address": memory address (json-int)
3001 - "size": memory size (json-int)
3002 - "mem_type_64": true or false (json-bool)
3003 - "prefetch": true or false (json-bool)
3005 Example:
3007 -> { "execute": "query-pci" }
3008 <- {
3009 "return":[
3011 "bus":0,
3012 "devices":[
3014 "bus":0,
3015 "qdev_id":"",
3016 "slot":0,
3017 "class_info":{
3018 "class":1536,
3019 "desc":"Host bridge"
3021 "id":{
3022 "device":32902,
3023 "vendor":4663
3025 "function":0,
3026 "regions":[
3031 "bus":0,
3032 "qdev_id":"",
3033 "slot":1,
3034 "class_info":{
3035 "class":1537,
3036 "desc":"ISA bridge"
3038 "id":{
3039 "device":32902,
3040 "vendor":28672
3042 "function":0,
3043 "regions":[
3048 "bus":0,
3049 "qdev_id":"",
3050 "slot":1,
3051 "class_info":{
3052 "class":257,
3053 "desc":"IDE controller"
3055 "id":{
3056 "device":32902,
3057 "vendor":28688
3059 "function":1,
3060 "regions":[
3062 "bar":4,
3063 "size":16,
3064 "address":49152,
3065 "type":"io"
3070 "bus":0,
3071 "qdev_id":"",
3072 "slot":2,
3073 "class_info":{
3074 "class":768,
3075 "desc":"VGA controller"
3077 "id":{
3078 "device":4115,
3079 "vendor":184
3081 "function":0,
3082 "regions":[
3084 "prefetch":true,
3085 "mem_type_64":false,
3086 "bar":0,
3087 "size":33554432,
3088 "address":4026531840,
3089 "type":"memory"
3092 "prefetch":false,
3093 "mem_type_64":false,
3094 "bar":1,
3095 "size":4096,
3096 "address":4060086272,
3097 "type":"memory"
3100 "prefetch":false,
3101 "mem_type_64":false,
3102 "bar":6,
3103 "size":65536,
3104 "address":-1,
3105 "type":"memory"
3110 "bus":0,
3111 "qdev_id":"",
3112 "irq":11,
3113 "slot":4,
3114 "class_info":{
3115 "class":1280,
3116 "desc":"RAM controller"
3118 "id":{
3119 "device":6900,
3120 "vendor":4098
3122 "function":0,
3123 "regions":[
3125 "bar":0,
3126 "size":32,
3127 "address":49280,
3128 "type":"io"
3137 Note: This example has been shortened as the real response is too long.
3139 EQMP
3142 .name = "query-pci",
3143 .args_type = "",
3144 .mhandler.cmd_new = qmp_marshal_query_pci,
3147 SQMP
3148 query-kvm
3149 ---------
3151 Show KVM information.
3153 Return a json-object with the following information:
3155 - "enabled": true if KVM support is enabled, false otherwise (json-bool)
3156 - "present": true if QEMU has KVM support, false otherwise (json-bool)
3158 Example:
3160 -> { "execute": "query-kvm" }
3161 <- { "return": { "enabled": true, "present": true } }
3163 EQMP
3166 .name = "query-kvm",
3167 .args_type = "",
3168 .mhandler.cmd_new = qmp_marshal_query_kvm,
3171 SQMP
3172 query-status
3173 ------------
3175 Return a json-object with the following information:
3177 - "running": true if the VM is running, or false if it is paused (json-bool)
3178 - "singlestep": true if the VM is in single step mode,
3179 false otherwise (json-bool)
3180 - "status": one of the following values (json-string)
3181 "debug" - QEMU is running on a debugger
3182 "inmigrate" - guest is paused waiting for an incoming migration
3183 "internal-error" - An internal error that prevents further guest
3184 execution has occurred
3185 "io-error" - the last IOP has failed and the device is configured
3186 to pause on I/O errors
3187 "paused" - guest has been paused via the 'stop' command
3188 "postmigrate" - guest is paused following a successful 'migrate'
3189 "prelaunch" - QEMU was started with -S and guest has not started
3190 "finish-migrate" - guest is paused to finish the migration process
3191 "restore-vm" - guest is paused to restore VM state
3192 "running" - guest is actively running
3193 "save-vm" - guest is paused to save the VM state
3194 "shutdown" - guest is shut down (and -no-shutdown is in use)
3195 "watchdog" - the watchdog action is configured to pause and
3196 has been triggered
3198 Example:
3200 -> { "execute": "query-status" }
3201 <- { "return": { "running": true, "singlestep": false, "status": "running" } }
3203 EQMP
3206 .name = "query-status",
3207 .args_type = "",
3208 .mhandler.cmd_new = qmp_marshal_query_status,
3211 SQMP
3212 query-mice
3213 ----------
3215 Show VM mice information.
3217 Each mouse is represented by a json-object, the returned value is a json-array
3218 of all mice.
3220 The mouse json-object contains the following:
3222 - "name": mouse's name (json-string)
3223 - "index": mouse's index (json-int)
3224 - "current": true if this mouse is receiving events, false otherwise (json-bool)
3225 - "absolute": true if the mouse generates absolute input events (json-bool)
3227 Example:
3229 -> { "execute": "query-mice" }
3230 <- {
3231 "return":[
3233 "name":"QEMU Microsoft Mouse",
3234 "index":0,
3235 "current":false,
3236 "absolute":false
3239 "name":"QEMU PS/2 Mouse",
3240 "index":1,
3241 "current":true,
3242 "absolute":true
3247 EQMP
3250 .name = "query-mice",
3251 .args_type = "",
3252 .mhandler.cmd_new = qmp_marshal_query_mice,
3255 SQMP
3256 query-vnc
3257 ---------
3259 Show VNC server information.
3261 Return a json-object with server information. Connected clients are returned
3262 as a json-array of json-objects.
3264 The main json-object contains the following:
3266 - "enabled": true or false (json-bool)
3267 - "host": server's IP address (json-string)
3268 - "family": address family (json-string)
3269 - Possible values: "ipv4", "ipv6", "unix", "unknown"
3270 - "service": server's port number (json-string)
3271 - "auth": authentication method (json-string)
3272 - Possible values: "invalid", "none", "ra2", "ra2ne", "sasl", "tight",
3273 "tls", "ultra", "unknown", "vencrypt", "vencrypt",
3274 "vencrypt+plain", "vencrypt+tls+none",
3275 "vencrypt+tls+plain", "vencrypt+tls+sasl",
3276 "vencrypt+tls+vnc", "vencrypt+x509+none",
3277 "vencrypt+x509+plain", "vencrypt+x509+sasl",
3278 "vencrypt+x509+vnc", "vnc"
3279 - "clients": a json-array of all connected clients
3281 Clients are described by a json-object, each one contain the following:
3283 - "host": client's IP address (json-string)
3284 - "family": address family (json-string)
3285 - Possible values: "ipv4", "ipv6", "unix", "unknown"
3286 - "service": client's port number (json-string)
3287 - "x509_dname": TLS dname (json-string, optional)
3288 - "sasl_username": SASL username (json-string, optional)
3290 Example:
3292 -> { "execute": "query-vnc" }
3293 <- {
3294 "return":{
3295 "enabled":true,
3296 "host":"0.0.0.0",
3297 "service":"50402",
3298 "auth":"vnc",
3299 "family":"ipv4",
3300 "clients":[
3302 "host":"127.0.0.1",
3303 "service":"50401",
3304 "family":"ipv4"
3310 EQMP
3313 .name = "query-vnc",
3314 .args_type = "",
3315 .mhandler.cmd_new = qmp_marshal_query_vnc,
3318 .name = "query-vnc-servers",
3319 .args_type = "",
3320 .mhandler.cmd_new = qmp_marshal_query_vnc_servers,
3323 SQMP
3324 query-spice
3325 -----------
3327 Show SPICE server information.
3329 Return a json-object with server information. Connected clients are returned
3330 as a json-array of json-objects.
3332 The main json-object contains the following:
3334 - "enabled": true or false (json-bool)
3335 - "host": server's IP address (json-string)
3336 - "port": server's port number (json-int, optional)
3337 - "tls-port": server's port number (json-int, optional)
3338 - "auth": authentication method (json-string)
3339 - Possible values: "none", "spice"
3340 - "channels": a json-array of all active channels clients
3342 Channels are described by a json-object, each one contain the following:
3344 - "host": client's IP address (json-string)
3345 - "family": address family (json-string)
3346 - Possible values: "ipv4", "ipv6", "unix", "unknown"
3347 - "port": client's port number (json-string)
3348 - "connection-id": spice connection id. All channels with the same id
3349 belong to the same spice session (json-int)
3350 - "channel-type": channel type. "1" is the main control channel, filter for
3351 this one if you want track spice sessions only (json-int)
3352 - "channel-id": channel id. Usually "0", might be different needed when
3353 multiple channels of the same type exist, such as multiple
3354 display channels in a multihead setup (json-int)
3355 - "tls": whether the channel is encrypted (json-bool)
3357 Example:
3359 -> { "execute": "query-spice" }
3360 <- {
3361 "return": {
3362 "enabled": true,
3363 "auth": "spice",
3364 "port": 5920,
3365 "tls-port": 5921,
3366 "host": "0.0.0.0",
3367 "channels": [
3369 "port": "54924",
3370 "family": "ipv4",
3371 "channel-type": 1,
3372 "connection-id": 1804289383,
3373 "host": "127.0.0.1",
3374 "channel-id": 0,
3375 "tls": true
3378 "port": "36710",
3379 "family": "ipv4",
3380 "channel-type": 4,
3381 "connection-id": 1804289383,
3382 "host": "127.0.0.1",
3383 "channel-id": 0,
3384 "tls": false
3386 [ ... more channels follow ... ]
3391 EQMP
3393 #if defined(CONFIG_SPICE)
3395 .name = "query-spice",
3396 .args_type = "",
3397 .mhandler.cmd_new = qmp_marshal_query_spice,
3399 #endif
3401 SQMP
3402 query-name
3403 ----------
3405 Show VM name.
3407 Return a json-object with the following information:
3409 - "name": VM's name (json-string, optional)
3411 Example:
3413 -> { "execute": "query-name" }
3414 <- { "return": { "name": "qemu-name" } }
3416 EQMP
3419 .name = "query-name",
3420 .args_type = "",
3421 .mhandler.cmd_new = qmp_marshal_query_name,
3424 SQMP
3425 query-uuid
3426 ----------
3428 Show VM UUID.
3430 Return a json-object with the following information:
3432 - "UUID": Universally Unique Identifier (json-string)
3434 Example:
3436 -> { "execute": "query-uuid" }
3437 <- { "return": { "UUID": "550e8400-e29b-41d4-a716-446655440000" } }
3439 EQMP
3442 .name = "query-uuid",
3443 .args_type = "",
3444 .mhandler.cmd_new = qmp_marshal_query_uuid,
3447 SQMP
3448 query-command-line-options
3449 --------------------------
3451 Show command line option schema.
3453 Return a json-array of command line option schema for all options (or for
3454 the given option), returning an error if the given option doesn't exist.
3456 Each array entry contains the following:
3458 - "option": option name (json-string)
3459 - "parameters": a json-array describes all parameters of the option:
3460 - "name": parameter name (json-string)
3461 - "type": parameter type (one of 'string', 'boolean', 'number',
3462 or 'size')
3463 - "help": human readable description of the parameter
3464 (json-string, optional)
3465 - "default": default value string for the parameter
3466 (json-string, optional)
3468 Example:
3470 -> { "execute": "query-command-line-options", "arguments": { "option": "option-rom" } }
3471 <- { "return": [
3473 "parameters": [
3475 "name": "romfile",
3476 "type": "string"
3479 "name": "bootindex",
3480 "type": "number"
3483 "option": "option-rom"
3488 EQMP
3491 .name = "query-command-line-options",
3492 .args_type = "option:s?",
3493 .mhandler.cmd_new = qmp_marshal_query_command_line_options,
3496 SQMP
3497 query-migrate
3498 -------------
3500 Migration status.
3502 Return a json-object. If migration is active there will be another json-object
3503 with RAM migration status and if block migration is active another one with
3504 block migration status.
3506 The main json-object contains the following:
3508 - "status": migration status (json-string)
3509 - Possible values: "setup", "active", "completed", "failed", "cancelled"
3510 - "total-time": total amount of ms since migration started. If
3511 migration has ended, it returns the total migration
3512 time (json-int)
3513 - "setup-time" amount of setup time in milliseconds _before_ the
3514 iterations begin but _after_ the QMP command is issued.
3515 This is designed to provide an accounting of any activities
3516 (such as RDMA pinning) which may be expensive, but do not
3517 actually occur during the iterative migration rounds
3518 themselves. (json-int)
3519 - "downtime": only present when migration has finished correctly
3520 total amount in ms for downtime that happened (json-int)
3521 - "expected-downtime": only present while migration is active
3522 total amount in ms for downtime that was calculated on
3523 the last bitmap round (json-int)
3524 - "ram": only present if "status" is "active", it is a json-object with the
3525 following RAM information:
3526 - "transferred": amount transferred in bytes (json-int)
3527 - "remaining": amount remaining to transfer in bytes (json-int)
3528 - "total": total amount of memory in bytes (json-int)
3529 - "duplicate": number of pages filled entirely with the same
3530 byte (json-int)
3531 These are sent over the wire much more efficiently.
3532 - "skipped": number of skipped zero pages (json-int)
3533 - "normal" : number of whole pages transferred. I.e. they
3534 were not sent as duplicate or xbzrle pages (json-int)
3535 - "normal-bytes" : number of bytes transferred in whole
3536 pages. This is just normal pages times size of one page,
3537 but this way upper levels don't need to care about page
3538 size (json-int)
3539 - "dirty-sync-count": times that dirty ram was synchronized (json-int)
3540 - "disk": only present if "status" is "active" and it is a block migration,
3541 it is a json-object with the following disk information:
3542 - "transferred": amount transferred in bytes (json-int)
3543 - "remaining": amount remaining to transfer in bytes json-int)
3544 - "total": total disk size in bytes (json-int)
3545 - "xbzrle-cache": only present if XBZRLE is active.
3546 It is a json-object with the following XBZRLE information:
3547 - "cache-size": XBZRLE cache size in bytes
3548 - "bytes": number of bytes transferred for XBZRLE compressed pages
3549 - "pages": number of XBZRLE compressed pages
3550 - "cache-miss": number of XBRZRLE page cache misses
3551 - "cache-miss-rate": rate of XBRZRLE page cache misses
3552 - "overflow": number of times XBZRLE overflows. This means
3553 that the XBZRLE encoding was bigger than just sent the
3554 whole page, and then we sent the whole page instead (as as
3555 normal page).
3557 Examples:
3559 1. Before the first migration
3561 -> { "execute": "query-migrate" }
3562 <- { "return": {} }
3564 2. Migration is done and has succeeded
3566 -> { "execute": "query-migrate" }
3567 <- { "return": {
3568 "status": "completed",
3569 "ram":{
3570 "transferred":123,
3571 "remaining":123,
3572 "total":246,
3573 "total-time":12345,
3574 "setup-time":12345,
3575 "downtime":12345,
3576 "duplicate":123,
3577 "normal":123,
3578 "normal-bytes":123456,
3579 "dirty-sync-count":15
3584 3. Migration is done and has failed
3586 -> { "execute": "query-migrate" }
3587 <- { "return": { "status": "failed" } }
3589 4. Migration is being performed and is not a block migration:
3591 -> { "execute": "query-migrate" }
3592 <- {
3593 "return":{
3594 "status":"active",
3595 "ram":{
3596 "transferred":123,
3597 "remaining":123,
3598 "total":246,
3599 "total-time":12345,
3600 "setup-time":12345,
3601 "expected-downtime":12345,
3602 "duplicate":123,
3603 "normal":123,
3604 "normal-bytes":123456,
3605 "dirty-sync-count":15
3610 5. Migration is being performed and is a block migration:
3612 -> { "execute": "query-migrate" }
3613 <- {
3614 "return":{
3615 "status":"active",
3616 "ram":{
3617 "total":1057024,
3618 "remaining":1053304,
3619 "transferred":3720,
3620 "total-time":12345,
3621 "setup-time":12345,
3622 "expected-downtime":12345,
3623 "duplicate":123,
3624 "normal":123,
3625 "normal-bytes":123456,
3626 "dirty-sync-count":15
3628 "disk":{
3629 "total":20971520,
3630 "remaining":20880384,
3631 "transferred":91136
3636 6. Migration is being performed and XBZRLE is active:
3638 -> { "execute": "query-migrate" }
3639 <- {
3640 "return":{
3641 "status":"active",
3642 "capabilities" : [ { "capability": "xbzrle", "state" : true } ],
3643 "ram":{
3644 "total":1057024,
3645 "remaining":1053304,
3646 "transferred":3720,
3647 "total-time":12345,
3648 "setup-time":12345,
3649 "expected-downtime":12345,
3650 "duplicate":10,
3651 "normal":3333,
3652 "normal-bytes":3412992,
3653 "dirty-sync-count":15
3655 "xbzrle-cache":{
3656 "cache-size":67108864,
3657 "bytes":20971520,
3658 "pages":2444343,
3659 "cache-miss":2244,
3660 "cache-miss-rate":0.123,
3661 "overflow":34434
3666 EQMP
3669 .name = "query-migrate",
3670 .args_type = "",
3671 .mhandler.cmd_new = qmp_marshal_query_migrate,
3674 SQMP
3675 migrate-set-capabilities
3676 ------------------------
3678 Enable/Disable migration capabilities
3680 - "xbzrle": XBZRLE support
3681 - "rdma-pin-all": pin all pages when using RDMA during migration
3682 - "auto-converge": throttle down guest to help convergence of migration
3683 - "zero-blocks": compress zero blocks during block migration
3684 - "compress": use multiple compression threads to accelerate live migration
3685 - "events": generate events for each migration state change
3686 - "postcopy-ram": postcopy mode for live migration
3688 Arguments:
3690 Example:
3692 -> { "execute": "migrate-set-capabilities" , "arguments":
3693 { "capabilities": [ { "capability": "xbzrle", "state": true } ] } }
3695 EQMP
3698 .name = "migrate-set-capabilities",
3699 .args_type = "capabilities:q",
3700 .params = "capability:s,state:b",
3701 .mhandler.cmd_new = qmp_marshal_migrate_set_capabilities,
3703 SQMP
3704 query-migrate-capabilities
3705 --------------------------
3707 Query current migration capabilities
3709 - "capabilities": migration capabilities state
3710 - "xbzrle" : XBZRLE state (json-bool)
3711 - "rdma-pin-all" : RDMA Pin Page state (json-bool)
3712 - "auto-converge" : Auto Converge state (json-bool)
3713 - "zero-blocks" : Zero Blocks state (json-bool)
3714 - "compress": Multiple compression threads state (json-bool)
3715 - "events": Migration state change event state (json-bool)
3716 - "postcopy-ram": postcopy ram state (json-bool)
3718 Arguments:
3720 Example:
3722 -> { "execute": "query-migrate-capabilities" }
3723 <- {"return": [
3724 {"state": false, "capability": "xbzrle"},
3725 {"state": false, "capability": "rdma-pin-all"},
3726 {"state": false, "capability": "auto-converge"},
3727 {"state": false, "capability": "zero-blocks"},
3728 {"state": false, "capability": "compress"},
3729 {"state": true, "capability": "events"},
3730 {"state": false, "capability": "postcopy-ram"}
3733 EQMP
3736 .name = "query-migrate-capabilities",
3737 .args_type = "",
3738 .mhandler.cmd_new = qmp_marshal_query_migrate_capabilities,
3741 SQMP
3742 migrate-set-parameters
3743 ----------------------
3745 Set migration parameters
3747 - "compress-level": set compression level during migration (json-int)
3748 - "compress-threads": set compression thread count for migration (json-int)
3749 - "decompress-threads": set decompression thread count for migration (json-int)
3750 - "cpu-throttle-initial": set initial percentage of time guest cpus are
3751 throttled for auto-converge (json-int)
3752 - "cpu-throttle-increment": set throttle increasing percentage for
3753 auto-converge (json-int)
3755 Arguments:
3757 Example:
3759 -> { "execute": "migrate-set-parameters" , "arguments":
3760 { "compress-level": 1 } }
3762 EQMP
3765 .name = "migrate-set-parameters",
3766 .args_type =
3767 "compress-level:i?,compress-threads:i?,decompress-threads:i?,cpu-throttle-initial:i?,cpu-throttle-increment:i?",
3768 .mhandler.cmd_new = qmp_marshal_migrate_set_parameters,
3770 SQMP
3771 query-migrate-parameters
3772 ------------------------
3774 Query current migration parameters
3776 - "parameters": migration parameters value
3777 - "compress-level" : compression level value (json-int)
3778 - "compress-threads" : compression thread count value (json-int)
3779 - "decompress-threads" : decompression thread count value (json-int)
3780 - "cpu-throttle-initial" : initial percentage of time guest cpus are
3781 throttled (json-int)
3782 - "cpu-throttle-increment" : throttle increasing percentage for
3783 auto-converge (json-int)
3785 Arguments:
3787 Example:
3789 -> { "execute": "query-migrate-parameters" }
3790 <- {
3791 "return": {
3792 "decompress-threads": 2,
3793 "cpu-throttle-increment": 10,
3794 "compress-threads": 8,
3795 "compress-level": 1,
3796 "cpu-throttle-initial": 20
3800 EQMP
3803 .name = "query-migrate-parameters",
3804 .args_type = "",
3805 .mhandler.cmd_new = qmp_marshal_query_migrate_parameters,
3808 SQMP
3809 query-balloon
3810 -------------
3812 Show balloon information.
3814 Make an asynchronous request for balloon info. When the request completes a
3815 json-object will be returned containing the following data:
3817 - "actual": current balloon value in bytes (json-int)
3819 Example:
3821 -> { "execute": "query-balloon" }
3822 <- {
3823 "return":{
3824 "actual":1073741824,
3828 EQMP
3831 .name = "query-balloon",
3832 .args_type = "",
3833 .mhandler.cmd_new = qmp_marshal_query_balloon,
3837 .name = "query-block-jobs",
3838 .args_type = "",
3839 .mhandler.cmd_new = qmp_marshal_query_block_jobs,
3843 .name = "qom-list",
3844 .args_type = "path:s",
3845 .mhandler.cmd_new = qmp_marshal_qom_list,
3849 .name = "qom-set",
3850 .args_type = "path:s,property:s,value:q",
3851 .mhandler.cmd_new = qmp_marshal_qom_set,
3855 .name = "qom-get",
3856 .args_type = "path:s,property:s",
3857 .mhandler.cmd_new = qmp_marshal_qom_get,
3861 .name = "nbd-server-start",
3862 .args_type = "addr:q,tls-creds:s?",
3863 .mhandler.cmd_new = qmp_marshal_nbd_server_start,
3866 .name = "nbd-server-add",
3867 .args_type = "device:B,writable:b?",
3868 .mhandler.cmd_new = qmp_marshal_nbd_server_add,
3871 .name = "nbd-server-stop",
3872 .args_type = "",
3873 .mhandler.cmd_new = qmp_marshal_nbd_server_stop,
3877 .name = "change-vnc-password",
3878 .args_type = "password:s",
3879 .mhandler.cmd_new = qmp_marshal_change_vnc_password,
3882 .name = "qom-list-types",
3883 .args_type = "implements:s?,abstract:b?",
3884 .mhandler.cmd_new = qmp_marshal_qom_list_types,
3888 .name = "device-list-properties",
3889 .args_type = "typename:s",
3890 .mhandler.cmd_new = qmp_marshal_device_list_properties,
3894 .name = "query-machines",
3895 .args_type = "",
3896 .mhandler.cmd_new = qmp_marshal_query_machines,
3900 .name = "query-cpu-definitions",
3901 .args_type = "",
3902 .mhandler.cmd_new = qmp_marshal_query_cpu_definitions,
3906 .name = "query-target",
3907 .args_type = "",
3908 .mhandler.cmd_new = qmp_marshal_query_target,
3912 .name = "query-tpm",
3913 .args_type = "",
3914 .mhandler.cmd_new = qmp_marshal_query_tpm,
3917 SQMP
3918 query-tpm
3919 ---------
3921 Return information about the TPM device.
3923 Arguments: None
3925 Example:
3927 -> { "execute": "query-tpm" }
3928 <- { "return":
3930 { "model": "tpm-tis",
3931 "options":
3932 { "type": "passthrough",
3933 "data":
3934 { "cancel-path": "/sys/class/misc/tpm0/device/cancel",
3935 "path": "/dev/tpm0"
3938 "id": "tpm0"
3943 EQMP
3946 .name = "query-tpm-models",
3947 .args_type = "",
3948 .mhandler.cmd_new = qmp_marshal_query_tpm_models,
3951 SQMP
3952 query-tpm-models
3953 ----------------
3955 Return a list of supported TPM models.
3957 Arguments: None
3959 Example:
3961 -> { "execute": "query-tpm-models" }
3962 <- { "return": [ "tpm-tis" ] }
3964 EQMP
3967 .name = "query-tpm-types",
3968 .args_type = "",
3969 .mhandler.cmd_new = qmp_marshal_query_tpm_types,
3972 SQMP
3973 query-tpm-types
3974 ---------------
3976 Return a list of supported TPM types.
3978 Arguments: None
3980 Example:
3982 -> { "execute": "query-tpm-types" }
3983 <- { "return": [ "passthrough" ] }
3985 EQMP
3988 .name = "chardev-add",
3989 .args_type = "id:s,backend:q",
3990 .mhandler.cmd_new = qmp_marshal_chardev_add,
3993 SQMP
3994 chardev-add
3995 ----------------
3997 Add a chardev.
3999 Arguments:
4001 - "id": the chardev's ID, must be unique (json-string)
4002 - "backend": chardev backend type + parameters
4004 Examples:
4006 -> { "execute" : "chardev-add",
4007 "arguments" : { "id" : "foo",
4008 "backend" : { "type" : "null", "data" : {} } } }
4009 <- { "return": {} }
4011 -> { "execute" : "chardev-add",
4012 "arguments" : { "id" : "bar",
4013 "backend" : { "type" : "file",
4014 "data" : { "out" : "/tmp/bar.log" } } } }
4015 <- { "return": {} }
4017 -> { "execute" : "chardev-add",
4018 "arguments" : { "id" : "baz",
4019 "backend" : { "type" : "pty", "data" : {} } } }
4020 <- { "return": { "pty" : "/dev/pty/42" } }
4022 EQMP
4025 .name = "chardev-remove",
4026 .args_type = "id:s",
4027 .mhandler.cmd_new = qmp_marshal_chardev_remove,
4031 SQMP
4032 chardev-remove
4033 --------------
4035 Remove a chardev.
4037 Arguments:
4039 - "id": the chardev's ID, must exist and not be in use (json-string)
4041 Example:
4043 -> { "execute": "chardev-remove", "arguments": { "id" : "foo" } }
4044 <- { "return": {} }
4046 EQMP
4048 .name = "query-rx-filter",
4049 .args_type = "name:s?",
4050 .mhandler.cmd_new = qmp_marshal_query_rx_filter,
4053 SQMP
4054 query-rx-filter
4055 ---------------
4057 Show rx-filter information.
4059 Returns a json-array of rx-filter information for all NICs (or for the
4060 given NIC), returning an error if the given NIC doesn't exist, or
4061 given NIC doesn't support rx-filter querying, or given net client
4062 isn't a NIC.
4064 The query will clear the event notification flag of each NIC, then qemu
4065 will start to emit event to QMP monitor.
4067 Each array entry contains the following:
4069 - "name": net client name (json-string)
4070 - "promiscuous": promiscuous mode is enabled (json-bool)
4071 - "multicast": multicast receive state (one of 'normal', 'none', 'all')
4072 - "unicast": unicast receive state (one of 'normal', 'none', 'all')
4073 - "vlan": vlan receive state (one of 'normal', 'none', 'all') (Since 2.0)
4074 - "broadcast-allowed": allow to receive broadcast (json-bool)
4075 - "multicast-overflow": multicast table is overflowed (json-bool)
4076 - "unicast-overflow": unicast table is overflowed (json-bool)
4077 - "main-mac": main macaddr string (json-string)
4078 - "vlan-table": a json-array of active vlan id
4079 - "unicast-table": a json-array of unicast macaddr string
4080 - "multicast-table": a json-array of multicast macaddr string
4082 Example:
4084 -> { "execute": "query-rx-filter", "arguments": { "name": "vnet0" } }
4085 <- { "return": [
4087 "promiscuous": true,
4088 "name": "vnet0",
4089 "main-mac": "52:54:00:12:34:56",
4090 "unicast": "normal",
4091 "vlan": "normal",
4092 "vlan-table": [
4096 "unicast-table": [
4098 "multicast": "normal",
4099 "multicast-overflow": false,
4100 "unicast-overflow": false,
4101 "multicast-table": [
4102 "01:00:5e:00:00:01",
4103 "33:33:00:00:00:01",
4104 "33:33:ff:12:34:56"
4106 "broadcast-allowed": false
4111 EQMP
4114 .name = "blockdev-add",
4115 .args_type = "options:q",
4116 .mhandler.cmd_new = qmp_marshal_blockdev_add,
4119 SQMP
4120 blockdev-add
4121 ------------
4123 Add a block device.
4125 This command is still a work in progress. It doesn't support all
4126 block drivers among other things. Stay away from it unless you want
4127 to help with its development.
4129 Arguments:
4131 - "options": block driver options
4133 Example (1):
4135 -> { "execute": "blockdev-add",
4136 "arguments": { "options" : { "driver": "qcow2",
4137 "file": { "driver": "file",
4138 "filename": "test.qcow2" } } } }
4139 <- { "return": {} }
4141 Example (2):
4143 -> { "execute": "blockdev-add",
4144 "arguments": {
4145 "options": {
4146 "driver": "qcow2",
4147 "id": "my_disk",
4148 "discard": "unmap",
4149 "cache": {
4150 "direct": true,
4151 "writeback": true
4153 "file": {
4154 "driver": "file",
4155 "filename": "/tmp/test.qcow2"
4157 "backing": {
4158 "driver": "raw",
4159 "file": {
4160 "driver": "file",
4161 "filename": "/dev/fdset/4"
4168 <- { "return": {} }
4170 EQMP
4173 .name = "x-blockdev-del",
4174 .args_type = "id:s?,node-name:s?",
4175 .mhandler.cmd_new = qmp_marshal_x_blockdev_del,
4178 SQMP
4179 x-blockdev-del
4180 ------------
4181 Since 2.5
4183 Deletes a block device thas has been added using blockdev-add.
4184 The selected device can be either a block backend or a graph node.
4186 In the former case the backend will be destroyed, along with its
4187 inserted medium if there's any. The command will fail if the backend
4188 or its medium are in use.
4190 In the latter case the node will be destroyed. The command will fail
4191 if the node is attached to a block backend or is otherwise being
4192 used.
4194 One of "id" or "node-name" must be specified, but not both.
4196 This command is still a work in progress and is considered
4197 experimental. Stay away from it unless you want to help with its
4198 development.
4200 Arguments:
4202 - "id": Name of the block backend device to delete (json-string, optional)
4203 - "node-name": Name of the graph node to delete (json-string, optional)
4205 Example:
4207 -> { "execute": "blockdev-add",
4208 "arguments": {
4209 "options": {
4210 "driver": "qcow2",
4211 "id": "drive0",
4212 "file": {
4213 "driver": "file",
4214 "filename": "test.qcow2"
4220 <- { "return": {} }
4222 -> { "execute": "x-blockdev-del",
4223 "arguments": { "id": "drive0" }
4225 <- { "return": {} }
4227 EQMP
4230 .name = "blockdev-open-tray",
4231 .args_type = "device:s,force:b?",
4232 .mhandler.cmd_new = qmp_marshal_blockdev_open_tray,
4235 SQMP
4236 blockdev-open-tray
4237 ------------------
4239 Opens a block device's tray. If there is a block driver state tree inserted as a
4240 medium, it will become inaccessible to the guest (but it will remain associated
4241 to the block device, so closing the tray will make it accessible again).
4243 If the tray was already open before, this will be a no-op.
4245 Once the tray opens, a DEVICE_TRAY_MOVED event is emitted. There are cases in
4246 which no such event will be generated, these include:
4247 - if the guest has locked the tray, @force is false and the guest does not
4248 respond to the eject request
4249 - if the BlockBackend denoted by @device does not have a guest device attached
4250 to it
4251 - if the guest device does not have an actual tray and is empty, for instance
4252 for floppy disk drives
4254 Arguments:
4256 - "device": block device name (json-string)
4257 - "force": if false (the default), an eject request will be sent to the guest if
4258 it has locked the tray (and the tray will not be opened immediately);
4259 if true, the tray will be opened regardless of whether it is locked
4260 (json-bool, optional)
4262 Example:
4264 -> { "execute": "blockdev-open-tray",
4265 "arguments": { "device": "ide1-cd0" } }
4267 <- { "timestamp": { "seconds": 1418751016,
4268 "microseconds": 716996 },
4269 "event": "DEVICE_TRAY_MOVED",
4270 "data": { "device": "ide1-cd0",
4271 "tray-open": true } }
4273 <- { "return": {} }
4275 EQMP
4278 .name = "blockdev-close-tray",
4279 .args_type = "device:s",
4280 .mhandler.cmd_new = qmp_marshal_blockdev_close_tray,
4283 SQMP
4284 blockdev-close-tray
4285 -------------------
4287 Closes a block device's tray. If there is a block driver state tree associated
4288 with the block device (which is currently ejected), that tree will be loaded as
4289 the medium.
4291 If the tray was already closed before, this will be a no-op.
4293 Arguments:
4295 - "device": block device name (json-string)
4297 Example:
4299 -> { "execute": "blockdev-close-tray",
4300 "arguments": { "device": "ide1-cd0" } }
4302 <- { "timestamp": { "seconds": 1418751345,
4303 "microseconds": 272147 },
4304 "event": "DEVICE_TRAY_MOVED",
4305 "data": { "device": "ide1-cd0",
4306 "tray-open": false } }
4308 <- { "return": {} }
4310 EQMP
4313 .name = "x-blockdev-remove-medium",
4314 .args_type = "device:s",
4315 .mhandler.cmd_new = qmp_marshal_x_blockdev_remove_medium,
4318 SQMP
4319 x-blockdev-remove-medium
4320 ------------------------
4322 Removes a medium (a block driver state tree) from a block device. That block
4323 device's tray must currently be open (unless there is no attached guest device).
4325 If the tray is open and there is no medium inserted, this will be a no-op.
4327 This command is still a work in progress and is considered experimental.
4328 Stay away from it unless you want to help with its development.
4330 Arguments:
4332 - "device": block device name (json-string)
4334 Example:
4336 -> { "execute": "x-blockdev-remove-medium",
4337 "arguments": { "device": "ide1-cd0" } }
4339 <- { "error": { "class": "GenericError",
4340 "desc": "Tray of device 'ide1-cd0' is not open" } }
4342 -> { "execute": "blockdev-open-tray",
4343 "arguments": { "device": "ide1-cd0" } }
4345 <- { "timestamp": { "seconds": 1418751627,
4346 "microseconds": 549958 },
4347 "event": "DEVICE_TRAY_MOVED",
4348 "data": { "device": "ide1-cd0",
4349 "tray-open": true } }
4351 <- { "return": {} }
4353 -> { "execute": "x-blockdev-remove-medium",
4354 "arguments": { "device": "ide1-cd0" } }
4356 <- { "return": {} }
4358 EQMP
4361 .name = "x-blockdev-insert-medium",
4362 .args_type = "device:s,node-name:s",
4363 .mhandler.cmd_new = qmp_marshal_x_blockdev_insert_medium,
4366 SQMP
4367 x-blockdev-insert-medium
4368 ------------------------
4370 Inserts a medium (a block driver state tree) into a block device. That block
4371 device's tray must currently be open (unless there is no attached guest device)
4372 and there must be no medium inserted already.
4374 This command is still a work in progress and is considered experimental.
4375 Stay away from it unless you want to help with its development.
4377 Arguments:
4379 - "device": block device name (json-string)
4380 - "node-name": root node of the BDS tree to insert into the block device
4382 Example:
4384 -> { "execute": "blockdev-add",
4385 "arguments": { "options": { "node-name": "node0",
4386 "driver": "raw",
4387 "file": { "driver": "file",
4388 "filename": "fedora.iso" } } } }
4390 <- { "return": {} }
4392 -> { "execute": "x-blockdev-insert-medium",
4393 "arguments": { "device": "ide1-cd0",
4394 "node-name": "node0" } }
4396 <- { "return": {} }
4398 EQMP
4401 .name = "x-blockdev-change",
4402 .args_type = "parent:B,child:B?,node:B?",
4403 .mhandler.cmd_new = qmp_marshal_x_blockdev_change,
4406 SQMP
4407 x-blockdev-change
4408 -----------------
4410 Dynamically reconfigure the block driver state graph. It can be used
4411 to add, remove, insert or replace a graph node. Currently only the
4412 Quorum driver implements this feature to add or remove its child. This
4413 is useful to fix a broken quorum child.
4415 If @node is specified, it will be inserted under @parent. @child
4416 may not be specified in this case. If both @parent and @child are
4417 specified but @node is not, @child will be detached from @parent.
4419 Arguments:
4420 - "parent": the id or name of the parent node (json-string)
4421 - "child": the name of a child under the given parent node (json-string, optional)
4422 - "node": the name of the node that will be added (json-string, optional)
4424 Note: this command is experimental, and not a stable API. It doesn't
4425 support all kinds of operations, all kinds of children, nor all block
4426 drivers.
4428 Warning: The data in a new quorum child MUST be consistent with that of
4429 the rest of the array.
4431 Example:
4433 Add a new node to a quorum
4434 -> { "execute": "blockdev-add",
4435 "arguments": { "options": { "driver": "raw",
4436 "node-name": "new_node",
4437 "file": { "driver": "file",
4438 "filename": "test.raw" } } } }
4439 <- { "return": {} }
4440 -> { "execute": "x-blockdev-change",
4441 "arguments": { "parent": "disk1",
4442 "node": "new_node" } }
4443 <- { "return": {} }
4445 Delete a quorum's node
4446 -> { "execute": "x-blockdev-change",
4447 "arguments": { "parent": "disk1",
4448 "child": "children.1" } }
4449 <- { "return": {} }
4451 EQMP
4454 .name = "query-named-block-nodes",
4455 .args_type = "",
4456 .mhandler.cmd_new = qmp_marshal_query_named_block_nodes,
4459 SQMP
4460 @query-named-block-nodes
4461 ------------------------
4463 Return a list of BlockDeviceInfo for all the named block driver nodes
4465 Example:
4467 -> { "execute": "query-named-block-nodes" }
4468 <- { "return": [ { "ro":false,
4469 "drv":"qcow2",
4470 "encrypted":false,
4471 "file":"disks/test.qcow2",
4472 "node-name": "my-node",
4473 "backing_file_depth":1,
4474 "bps":1000000,
4475 "bps_rd":0,
4476 "bps_wr":0,
4477 "iops":1000000,
4478 "iops_rd":0,
4479 "iops_wr":0,
4480 "bps_max": 8000000,
4481 "bps_rd_max": 0,
4482 "bps_wr_max": 0,
4483 "iops_max": 0,
4484 "iops_rd_max": 0,
4485 "iops_wr_max": 0,
4486 "iops_size": 0,
4487 "write_threshold": 0,
4488 "image":{
4489 "filename":"disks/test.qcow2",
4490 "format":"qcow2",
4491 "virtual-size":2048000,
4492 "backing_file":"base.qcow2",
4493 "full-backing-filename":"disks/base.qcow2",
4494 "backing-filename-format":"qcow2",
4495 "snapshots":[
4497 "id": "1",
4498 "name": "snapshot1",
4499 "vm-state-size": 0,
4500 "date-sec": 10000200,
4501 "date-nsec": 12,
4502 "vm-clock-sec": 206,
4503 "vm-clock-nsec": 30
4506 "backing-image":{
4507 "filename":"disks/base.qcow2",
4508 "format":"qcow2",
4509 "virtual-size":2048000
4511 } } ] }
4513 EQMP
4516 .name = "blockdev-change-medium",
4517 .args_type = "device:B,filename:F,format:s?,read-only-mode:s?",
4518 .mhandler.cmd_new = qmp_marshal_blockdev_change_medium,
4521 SQMP
4522 blockdev-change-medium
4523 ----------------------
4525 Changes the medium inserted into a block device by ejecting the current medium
4526 and loading a new image file which is inserted as the new medium.
4528 Arguments:
4530 - "device": device name (json-string)
4531 - "filename": filename of the new image (json-string)
4532 - "format": format of the new image (json-string, optional)
4533 - "read-only-mode": new read-only mode (json-string, optional)
4534 - Possible values: "retain" (default), "read-only", "read-write"
4536 Examples:
4538 1. Change a removable medium
4540 -> { "execute": "blockdev-change-medium",
4541 "arguments": { "device": "ide1-cd0",
4542 "filename": "/srv/images/Fedora-12-x86_64-DVD.iso",
4543 "format": "raw" } }
4544 <- { "return": {} }
4546 2. Load a read-only medium into a writable drive
4548 -> { "execute": "blockdev-change-medium",
4549 "arguments": { "device": "isa-fd0",
4550 "filename": "/srv/images/ro.img",
4551 "format": "raw",
4552 "read-only-mode": "retain" } }
4554 <- { "error":
4555 { "class": "GenericError",
4556 "desc": "Could not open '/srv/images/ro.img': Permission denied" } }
4558 -> { "execute": "blockdev-change-medium",
4559 "arguments": { "device": "isa-fd0",
4560 "filename": "/srv/images/ro.img",
4561 "format": "raw",
4562 "read-only-mode": "read-only" } }
4564 <- { "return": {} }
4566 EQMP
4569 .name = "query-memdev",
4570 .args_type = "",
4571 .mhandler.cmd_new = qmp_marshal_query_memdev,
4574 SQMP
4575 query-memdev
4576 ------------
4578 Show memory devices information.
4581 Example (1):
4583 -> { "execute": "query-memdev" }
4584 <- { "return": [
4586 "size": 536870912,
4587 "merge": false,
4588 "dump": true,
4589 "prealloc": false,
4590 "host-nodes": [0, 1],
4591 "policy": "bind"
4594 "size": 536870912,
4595 "merge": false,
4596 "dump": true,
4597 "prealloc": true,
4598 "host-nodes": [2, 3],
4599 "policy": "preferred"
4604 EQMP
4607 .name = "query-memory-devices",
4608 .args_type = "",
4609 .mhandler.cmd_new = qmp_marshal_query_memory_devices,
4612 SQMP
4613 @query-memory-devices
4614 --------------------
4616 Return a list of memory devices.
4618 Example:
4619 -> { "execute": "query-memory-devices" }
4620 <- { "return": [ { "data":
4621 { "addr": 5368709120,
4622 "hotpluggable": true,
4623 "hotplugged": true,
4624 "id": "d1",
4625 "memdev": "/objects/memX",
4626 "node": 0,
4627 "size": 1073741824,
4628 "slot": 0},
4629 "type": "dimm"
4630 } ] }
4631 EQMP
4634 .name = "query-acpi-ospm-status",
4635 .args_type = "",
4636 .mhandler.cmd_new = qmp_marshal_query_acpi_ospm_status,
4639 SQMP
4640 @query-acpi-ospm-status
4641 --------------------
4643 Return list of ACPIOSTInfo for devices that support status reporting
4644 via ACPI _OST method.
4646 Example:
4647 -> { "execute": "query-acpi-ospm-status" }
4648 <- { "return": [ { "device": "d1", "slot": "0", "slot-type": "DIMM", "source": 1, "status": 0},
4649 { "slot": "1", "slot-type": "DIMM", "source": 0, "status": 0},
4650 { "slot": "2", "slot-type": "DIMM", "source": 0, "status": 0},
4651 { "slot": "3", "slot-type": "DIMM", "source": 0, "status": 0}
4653 EQMP
4655 #if defined TARGET_I386
4657 .name = "rtc-reset-reinjection",
4658 .args_type = "",
4659 .mhandler.cmd_new = qmp_marshal_rtc_reset_reinjection,
4661 #endif
4663 SQMP
4664 rtc-reset-reinjection
4665 ---------------------
4667 Reset the RTC interrupt reinjection backlog.
4669 Arguments: None.
4671 Example:
4673 -> { "execute": "rtc-reset-reinjection" }
4674 <- { "return": {} }
4675 EQMP
4678 .name = "trace-event-get-state",
4679 .args_type = "name:s",
4680 .mhandler.cmd_new = qmp_marshal_trace_event_get_state,
4683 SQMP
4684 trace-event-get-state
4685 ---------------------
4687 Query the state of events.
4689 Example:
4691 -> { "execute": "trace-event-get-state", "arguments": { "name": "qemu_memalign" } }
4692 <- { "return": [ { "name": "qemu_memalign", "state": "disabled" } ] }
4693 EQMP
4696 .name = "trace-event-set-state",
4697 .args_type = "name:s,enable:b,ignore-unavailable:b?",
4698 .mhandler.cmd_new = qmp_marshal_trace_event_set_state,
4701 SQMP
4702 trace-event-set-state
4703 ---------------------
4705 Set the state of events.
4707 Example:
4709 -> { "execute": "trace-event-set-state", "arguments": { "name": "qemu_memalign", "enable": "true" } }
4710 <- { "return": {} }
4711 EQMP
4714 .name = "input-send-event",
4715 .args_type = "console:i?,events:q",
4716 .mhandler.cmd_new = qmp_marshal_input_send_event,
4719 SQMP
4720 @input-send-event
4721 -----------------
4723 Send input event to guest.
4725 Arguments:
4727 - "device": display device (json-string, optional)
4728 - "head": display head (json-int, optional)
4729 - "events": list of input events
4731 The consoles are visible in the qom tree, under
4732 /backend/console[$index]. They have a device link and head property, so
4733 it is possible to map which console belongs to which device and display.
4735 Note: this command is experimental, and not a stable API.
4737 Example (1):
4739 Press left mouse button.
4741 -> { "execute": "input-send-event",
4742 "arguments": { "device": "video0",
4743 "events": [ { "type": "btn",
4744 "data" : { "down": true, "button": "left" } } ] } }
4745 <- { "return": {} }
4747 -> { "execute": "input-send-event",
4748 "arguments": { "device": "video0",
4749 "events": [ { "type": "btn",
4750 "data" : { "down": false, "button": "left" } } ] } }
4751 <- { "return": {} }
4753 Example (2):
4755 Press ctrl-alt-del.
4757 -> { "execute": "input-send-event",
4758 "arguments": { "events": [
4759 { "type": "key", "data" : { "down": true,
4760 "key": {"type": "qcode", "data": "ctrl" } } },
4761 { "type": "key", "data" : { "down": true,
4762 "key": {"type": "qcode", "data": "alt" } } },
4763 { "type": "key", "data" : { "down": true,
4764 "key": {"type": "qcode", "data": "delete" } } } ] } }
4765 <- { "return": {} }
4767 Example (3):
4769 Move mouse pointer to absolute coordinates (20000, 400).
4771 -> { "execute": "input-send-event" ,
4772 "arguments": { "events": [
4773 { "type": "abs", "data" : { "axis": "x", "value" : 20000 } },
4774 { "type": "abs", "data" : { "axis": "y", "value" : 400 } } ] } }
4775 <- { "return": {} }
4777 EQMP
4780 .name = "block-set-write-threshold",
4781 .args_type = "node-name:s,write-threshold:l",
4782 .mhandler.cmd_new = qmp_marshal_block_set_write_threshold,
4785 SQMP
4786 block-set-write-threshold
4787 ------------
4789 Change the write threshold for a block drive. The threshold is an offset,
4790 thus must be non-negative. Default is no write threshold.
4791 Setting the threshold to zero disables it.
4793 Arguments:
4795 - "node-name": the node name in the block driver state graph (json-string)
4796 - "write-threshold": the write threshold in bytes (json-int)
4798 Example:
4800 -> { "execute": "block-set-write-threshold",
4801 "arguments": { "node-name": "mydev",
4802 "write-threshold": 17179869184 } }
4803 <- { "return": {} }
4805 EQMP
4808 .name = "query-rocker",
4809 .args_type = "name:s",
4810 .mhandler.cmd_new = qmp_marshal_query_rocker,
4813 SQMP
4814 Show rocker switch
4815 ------------------
4817 Arguments:
4819 - "name": switch name
4821 Example:
4823 -> { "execute": "query-rocker", "arguments": { "name": "sw1" } }
4824 <- { "return": {"name": "sw1", "ports": 2, "id": 1327446905938}}
4826 EQMP
4829 .name = "query-rocker-ports",
4830 .args_type = "name:s",
4831 .mhandler.cmd_new = qmp_marshal_query_rocker_ports,
4834 SQMP
4835 Show rocker switch ports
4836 ------------------------
4838 Arguments:
4840 - "name": switch name
4842 Example:
4844 -> { "execute": "query-rocker-ports", "arguments": { "name": "sw1" } }
4845 <- { "return": [ {"duplex": "full", "enabled": true, "name": "sw1.1",
4846 "autoneg": "off", "link-up": true, "speed": 10000},
4847 {"duplex": "full", "enabled": true, "name": "sw1.2",
4848 "autoneg": "off", "link-up": true, "speed": 10000}
4851 EQMP
4854 .name = "query-rocker-of-dpa-flows",
4855 .args_type = "name:s,tbl-id:i?",
4856 .mhandler.cmd_new = qmp_marshal_query_rocker_of_dpa_flows,
4859 SQMP
4860 Show rocker switch OF-DPA flow tables
4861 -------------------------------------
4863 Arguments:
4865 - "name": switch name
4866 - "tbl-id": (optional) flow table ID
4868 Example:
4870 -> { "execute": "query-rocker-of-dpa-flows", "arguments": { "name": "sw1" } }
4871 <- { "return": [ {"key": {"in-pport": 0, "priority": 1, "tbl-id": 0},
4872 "hits": 138,
4873 "cookie": 0,
4874 "action": {"goto-tbl": 10},
4875 "mask": {"in-pport": 4294901760}
4877 {...more...},
4880 EQMP
4883 .name = "query-rocker-of-dpa-groups",
4884 .args_type = "name:s,type:i?",
4885 .mhandler.cmd_new = qmp_marshal_query_rocker_of_dpa_groups,
4888 SQMP
4889 Show rocker OF-DPA group tables
4890 -------------------------------
4892 Arguments:
4894 - "name": switch name
4895 - "type": (optional) group type
4897 Example:
4899 -> { "execute": "query-rocker-of-dpa-groups", "arguments": { "name": "sw1" } }
4900 <- { "return": [ {"type": 0, "out-pport": 2, "pport": 2, "vlan-id": 3841,
4901 "pop-vlan": 1, "id": 251723778},
4902 {"type": 0, "out-pport": 0, "pport": 0, "vlan-id": 3841,
4903 "pop-vlan": 1, "id": 251723776},
4904 {"type": 0, "out-pport": 1, "pport": 1, "vlan-id": 3840,
4905 "pop-vlan": 1, "id": 251658241},
4906 {"type": 0, "out-pport": 0, "pport": 0, "vlan-id": 3840,
4907 "pop-vlan": 1, "id": 251658240}
4910 EQMP
4912 #if defined TARGET_ARM
4914 .name = "query-gic-capabilities",
4915 .args_type = "",
4916 .mhandler.cmd_new = qmp_marshal_query_gic_capabilities,
4918 #endif
4920 SQMP
4921 query-gic-capabilities
4922 ---------------
4924 Return a list of GICCapability objects, describing supported GIC
4925 (Generic Interrupt Controller) versions.
4927 Arguments: None
4929 Example:
4931 -> { "execute": "query-gic-capabilities" }
4932 <- { "return": [{ "version": 2, "emulated": true, "kernel": false },
4933 { "version": 3, "emulated": false, "kernel": true } ] }
4935 EQMP