ui/cocoa.m: Make a better about dialog
[qemu/ar7.git] / qmp-commands.hx
blobe6c91936003da81c089a52f8fc4faaf014a0bccd
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-load-devices-state",
591 .args_type = "filename:F",
592 .mhandler.cmd_new = qmp_marshal_xen_load_devices_state,
595 SQMP
596 xen-load-devices-state
597 ----------------------
599 Load the state of all devices from file. The RAM and the block devices
600 of the VM are not loaded by this command.
602 Arguments:
604 - "filename": the file to load the state of the devices from as binary
605 data. See xen-save-devices-state.txt for a description of the binary
606 format.
608 Example:
610 -> { "execute": "xen-load-devices-state",
611 "arguments": { "filename": "/tmp/resume" } }
612 <- { "return": {} }
614 EQMP
617 .name = "xen-set-global-dirty-log",
618 .args_type = "enable:b",
619 .mhandler.cmd_new = qmp_marshal_xen_set_global_dirty_log,
622 SQMP
623 xen-set-global-dirty-log
624 -------
626 Enable or disable the global dirty log mode.
628 Arguments:
630 - "enable": Enable it or disable it.
632 Example:
634 -> { "execute": "xen-set-global-dirty-log",
635 "arguments": { "enable": true } }
636 <- { "return": {} }
638 EQMP
641 .name = "migrate",
642 .args_type = "detach:-d,blk:-b,inc:-i,uri:s",
643 .mhandler.cmd_new = qmp_marshal_migrate,
646 SQMP
647 migrate
648 -------
650 Migrate to URI.
652 Arguments:
654 - "blk": block migration, full disk copy (json-bool, optional)
655 - "inc": incremental disk copy (json-bool, optional)
656 - "uri": Destination URI (json-string)
658 Example:
660 -> { "execute": "migrate", "arguments": { "uri": "tcp:0:4446" } }
661 <- { "return": {} }
663 Notes:
665 (1) The 'query-migrate' command should be used to check migration's progress
666 and final result (this information is provided by the 'status' member)
667 (2) All boolean arguments default to false
668 (3) The user Monitor's "detach" argument is invalid in QMP and should not
669 be used
671 EQMP
674 .name = "migrate_cancel",
675 .args_type = "",
676 .mhandler.cmd_new = qmp_marshal_migrate_cancel,
679 SQMP
680 migrate_cancel
681 --------------
683 Cancel the current migration.
685 Arguments: None.
687 Example:
689 -> { "execute": "migrate_cancel" }
690 <- { "return": {} }
692 EQMP
695 .name = "migrate-incoming",
696 .args_type = "uri:s",
697 .mhandler.cmd_new = qmp_marshal_migrate_incoming,
700 SQMP
701 migrate-incoming
702 ----------------
704 Continue an incoming migration
706 Arguments:
708 - "uri": Source/listening URI (json-string)
710 Example:
712 -> { "execute": "migrate-incoming", "arguments": { "uri": "tcp::4446" } }
713 <- { "return": {} }
715 Notes:
717 (1) QEMU must be started with -incoming defer to allow migrate-incoming to
718 be used
719 (2) The uri format is the same as for -incoming
721 EQMP
723 .name = "migrate-set-cache-size",
724 .args_type = "value:o",
725 .mhandler.cmd_new = qmp_marshal_migrate_set_cache_size,
728 SQMP
729 migrate-set-cache-size
730 ----------------------
732 Set cache size to be used by XBZRLE migration, the cache size will be rounded
733 down to the nearest power of 2
735 Arguments:
737 - "value": cache size in bytes (json-int)
739 Example:
741 -> { "execute": "migrate-set-cache-size", "arguments": { "value": 536870912 } }
742 <- { "return": {} }
744 EQMP
746 .name = "migrate-start-postcopy",
747 .args_type = "",
748 .mhandler.cmd_new = qmp_marshal_migrate_start_postcopy,
751 SQMP
752 migrate-start-postcopy
753 ----------------------
755 Switch an in-progress migration to postcopy mode. Ignored after the end of
756 migration (or once already in postcopy).
758 Example:
759 -> { "execute": "migrate-start-postcopy" }
760 <- { "return": {} }
762 EQMP
765 .name = "query-migrate-cache-size",
766 .args_type = "",
767 .mhandler.cmd_new = qmp_marshal_query_migrate_cache_size,
770 SQMP
771 query-migrate-cache-size
772 ------------------------
774 Show cache size to be used by XBZRLE migration
776 returns a json-object with the following information:
777 - "size" : json-int
779 Example:
781 -> { "execute": "query-migrate-cache-size" }
782 <- { "return": 67108864 }
784 EQMP
787 .name = "migrate_set_speed",
788 .args_type = "value:o",
789 .mhandler.cmd_new = qmp_marshal_migrate_set_speed,
792 SQMP
793 migrate_set_speed
794 -----------------
796 Set maximum speed for migrations.
798 Arguments:
800 - "value": maximum speed, in bytes per second (json-int)
802 Example:
804 -> { "execute": "migrate_set_speed", "arguments": { "value": 1024 } }
805 <- { "return": {} }
807 EQMP
810 .name = "migrate_set_downtime",
811 .args_type = "value:T",
812 .mhandler.cmd_new = qmp_marshal_migrate_set_downtime,
815 SQMP
816 migrate_set_downtime
817 --------------------
819 Set maximum tolerated downtime (in seconds) for migrations.
821 Arguments:
823 - "value": maximum downtime (json-number)
825 Example:
827 -> { "execute": "migrate_set_downtime", "arguments": { "value": 0.1 } }
828 <- { "return": {} }
830 EQMP
833 .name = "client_migrate_info",
834 .args_type = "protocol:s,hostname:s,port:i?,tls-port:i?,cert-subject:s?",
835 .params = "protocol hostname port tls-port cert-subject",
836 .help = "set migration information for remote display",
837 .mhandler.cmd_new = qmp_marshal_client_migrate_info,
840 SQMP
841 client_migrate_info
842 -------------------
844 Set migration information for remote display. This makes the server
845 ask the client to automatically reconnect using the new parameters
846 once migration finished successfully. Only implemented for SPICE.
848 Arguments:
850 - "protocol": must be "spice" (json-string)
851 - "hostname": migration target hostname (json-string)
852 - "port": spice tcp port for plaintext channels (json-int, optional)
853 - "tls-port": spice tcp port for tls-secured channels (json-int, optional)
854 - "cert-subject": server certificate subject (json-string, optional)
856 Example:
858 -> { "execute": "client_migrate_info",
859 "arguments": { "protocol": "spice",
860 "hostname": "virt42.lab.kraxel.org",
861 "port": 1234 } }
862 <- { "return": {} }
864 EQMP
867 .name = "dump-guest-memory",
868 .args_type = "paging:b,protocol:s,detach:b?,begin:i?,end:i?,format:s?",
869 .params = "-p protocol [-d] [begin] [length] [format]",
870 .help = "dump guest memory to file",
871 .mhandler.cmd_new = qmp_marshal_dump_guest_memory,
874 SQMP
875 dump
878 Dump guest memory to file. The file can be processed with crash or gdb.
880 Arguments:
882 - "paging": do paging to get guest's memory mapping (json-bool)
883 - "protocol": destination file(started with "file:") or destination file
884 descriptor (started with "fd:") (json-string)
885 - "detach": if specified, command will return immediately, without waiting
886 for the dump to finish. The user can track progress using
887 "query-dump". (json-bool)
888 - "begin": the starting physical address. It's optional, and should be specified
889 with length together (json-int)
890 - "length": the memory size, in bytes. It's optional, and should be specified
891 with begin together (json-int)
892 - "format": the format of guest memory dump. It's optional, and can be
893 elf|kdump-zlib|kdump-lzo|kdump-snappy, but non-elf formats will
894 conflict with paging and filter, ie. begin and length (json-string)
896 Example:
898 -> { "execute": "dump-guest-memory", "arguments": { "protocol": "fd:dump" } }
899 <- { "return": {} }
901 Notes:
903 (1) All boolean arguments default to false
905 EQMP
908 .name = "query-dump-guest-memory-capability",
909 .args_type = "",
910 .mhandler.cmd_new = qmp_marshal_query_dump_guest_memory_capability,
913 SQMP
914 query-dump-guest-memory-capability
915 ----------
917 Show available formats for 'dump-guest-memory'
919 Example:
921 -> { "execute": "query-dump-guest-memory-capability" }
922 <- { "return": { "formats":
923 ["elf", "kdump-zlib", "kdump-lzo", "kdump-snappy"] }
925 EQMP
928 .name = "query-dump",
929 .args_type = "",
930 .params = "",
931 .help = "query background dump status",
932 .mhandler.cmd_new = qmp_marshal_query_dump,
935 SQMP
936 query-dump
937 ----------
939 Query background dump status.
941 Arguments: None.
943 Example:
945 -> { "execute": "query-dump" }
946 <- { "return": { "status": "active", "completed": 1024000,
947 "total": 2048000 } }
949 EQMP
951 #if defined TARGET_S390X
953 .name = "dump-skeys",
954 .args_type = "filename:F",
955 .mhandler.cmd_new = qmp_marshal_dump_skeys,
957 #endif
959 SQMP
960 dump-skeys
961 ----------
963 Save guest storage keys to file.
965 Arguments:
967 - "filename": file path (json-string)
969 Example:
971 -> { "execute": "dump-skeys", "arguments": { "filename": "/tmp/skeys" } }
972 <- { "return": {} }
974 EQMP
977 .name = "netdev_add",
978 .args_type = "netdev:O",
979 .mhandler.cmd_new = qmp_netdev_add,
982 SQMP
983 netdev_add
984 ----------
986 Add host network device.
988 Arguments:
990 - "type": the device type, "tap", "user", ... (json-string)
991 - "id": the device's ID, must be unique (json-string)
992 - device options
994 Example:
996 -> { "execute": "netdev_add",
997 "arguments": { "type": "user", "id": "netdev1",
998 "dnssearch": "example.org" } }
999 <- { "return": {} }
1001 Note: The supported device options are the same ones supported by the '-netdev'
1002 command-line argument, which are listed in the '-help' output or QEMU's
1003 manual
1005 EQMP
1008 .name = "netdev_del",
1009 .args_type = "id:s",
1010 .mhandler.cmd_new = qmp_marshal_netdev_del,
1013 SQMP
1014 netdev_del
1015 ----------
1017 Remove host network device.
1019 Arguments:
1021 - "id": the device's ID, must be unique (json-string)
1023 Example:
1025 -> { "execute": "netdev_del", "arguments": { "id": "netdev1" } }
1026 <- { "return": {} }
1029 EQMP
1032 .name = "object-add",
1033 .args_type = "qom-type:s,id:s,props:q?",
1034 .mhandler.cmd_new = qmp_marshal_object_add,
1037 SQMP
1038 object-add
1039 ----------
1041 Create QOM object.
1043 Arguments:
1045 - "qom-type": the object's QOM type, i.e. the class name (json-string)
1046 - "id": the object's ID, must be unique (json-string)
1047 - "props": a dictionary of object property values (optional, json-dict)
1049 Example:
1051 -> { "execute": "object-add", "arguments": { "qom-type": "rng-random", "id": "rng1",
1052 "props": { "filename": "/dev/hwrng" } } }
1053 <- { "return": {} }
1055 EQMP
1058 .name = "object-del",
1059 .args_type = "id:s",
1060 .mhandler.cmd_new = qmp_marshal_object_del,
1063 SQMP
1064 object-del
1065 ----------
1067 Remove QOM object.
1069 Arguments:
1071 - "id": the object's ID (json-string)
1073 Example:
1075 -> { "execute": "object-del", "arguments": { "id": "rng1" } }
1076 <- { "return": {} }
1079 EQMP
1083 .name = "block_resize",
1084 .args_type = "device:s?,node-name:s?,size:o",
1085 .mhandler.cmd_new = qmp_marshal_block_resize,
1088 SQMP
1089 block_resize
1090 ------------
1092 Resize a block image while a guest is running.
1094 Arguments:
1096 - "device": the device's ID, must be unique (json-string)
1097 - "node-name": the node name in the block driver state graph (json-string)
1098 - "size": new size
1100 Example:
1102 -> { "execute": "block_resize", "arguments": { "device": "scratch", "size": 1073741824 } }
1103 <- { "return": {} }
1105 EQMP
1108 .name = "block-stream",
1109 .args_type = "job-id:s?,device:B,base:s?,speed:o?,backing-file:s?,on-error:s?",
1110 .mhandler.cmd_new = qmp_marshal_block_stream,
1113 SQMP
1114 block-stream
1115 ------------
1117 Copy data from a backing file into a block device.
1119 Arguments:
1121 - "job-id": Identifier for the newly-created block job. If omitted,
1122 the device name will be used. (json-string, optional)
1123 - "device": The device name or node-name of a root node (json-string)
1124 - "base": The file name of the backing image above which copying starts
1125 (json-string, optional)
1126 - "backing-file": The backing file string to write into the active layer. This
1127 filename is not validated.
1129 If a pathname string is such that it cannot be resolved by
1130 QEMU, that means that subsequent QMP or HMP commands must use
1131 node-names for the image in question, as filename lookup
1132 methods will fail.
1134 If not specified, QEMU will automatically determine the
1135 backing file string to use, or error out if there is no
1136 obvious choice. Care should be taken when specifying the
1137 string, to specify a valid filename or protocol.
1138 (json-string, optional) (Since 2.1)
1139 - "speed": the maximum speed, in bytes per second (json-int, optional)
1140 - "on-error": the action to take on an error (default 'report'). 'stop' and
1141 'enospc' can only be used if the block device supports io-status.
1142 (json-string, optional) (Since 2.1)
1144 Example:
1146 -> { "execute": "block-stream", "arguments": { "device": "virtio0",
1147 "base": "/tmp/master.qcow2" } }
1148 <- { "return": {} }
1150 EQMP
1153 .name = "block-commit",
1154 .args_type = "job-id:s?,device:B,base:s?,top:s?,backing-file:s?,speed:o?",
1155 .mhandler.cmd_new = qmp_marshal_block_commit,
1158 SQMP
1159 block-commit
1160 ------------
1162 Live commit of data from overlay image nodes into backing nodes - i.e., writes
1163 data between 'top' and 'base' into 'base'.
1165 Arguments:
1167 - "job-id": Identifier for the newly-created block job. If omitted,
1168 the device name will be used. (json-string, optional)
1169 - "device": The device name or node-name of a root node (json-string)
1170 - "base": The file name of the backing image to write data into.
1171 If not specified, this is the deepest backing image
1172 (json-string, optional)
1173 - "top": The file name of the backing image within the image chain,
1174 which contains the topmost data to be committed down. If
1175 not specified, this is the active layer. (json-string, optional)
1177 - backing-file: The backing file string to write into the overlay
1178 image of 'top'. If 'top' is the active layer,
1179 specifying a backing file string is an error. This
1180 filename is not validated.
1182 If a pathname string is such that it cannot be
1183 resolved by QEMU, that means that subsequent QMP or
1184 HMP commands must use node-names for the image in
1185 question, as filename lookup methods will fail.
1187 If not specified, QEMU will automatically determine
1188 the backing file string to use, or error out if
1189 there is no obvious choice. Care should be taken
1190 when specifying the string, to specify a valid
1191 filename or protocol.
1192 (json-string, optional) (Since 2.1)
1194 If top == base, that is an error.
1195 If top == active, the job will not be completed by itself,
1196 user needs to complete the job with the block-job-complete
1197 command after getting the ready event. (Since 2.0)
1199 If the base image is smaller than top, then the base image
1200 will be resized to be the same size as top. If top is
1201 smaller than the base image, the base will not be
1202 truncated. If you want the base image size to match the
1203 size of the smaller top, you can safely truncate it
1204 yourself once the commit operation successfully completes.
1205 (json-string)
1206 - "speed": the maximum speed, in bytes per second (json-int, optional)
1209 Example:
1211 -> { "execute": "block-commit", "arguments": { "device": "virtio0",
1212 "top": "/tmp/snap1.qcow2" } }
1213 <- { "return": {} }
1215 EQMP
1218 .name = "drive-backup",
1219 .args_type = "job-id:s?,sync:s,device:B,target:s,speed:i?,mode:s?,"
1220 "format:s?,bitmap:s?,compress:b?,"
1221 "on-source-error:s?,on-target-error:s?",
1222 .mhandler.cmd_new = qmp_marshal_drive_backup,
1225 SQMP
1226 drive-backup
1227 ------------
1229 Start a point-in-time copy of a block device to a new destination. The
1230 status of ongoing drive-backup operations can be checked with
1231 query-block-jobs where the BlockJobInfo.type field has the value 'backup'.
1232 The operation can be stopped before it has completed using the
1233 block-job-cancel command.
1235 Arguments:
1237 - "job-id": Identifier for the newly-created block job. If omitted,
1238 the device name will be used. (json-string, optional)
1239 - "device": the device name or node-name of a root node which should be copied.
1240 (json-string)
1241 - "target": the target of the new image. If the file exists, or if it is a
1242 device, the existing file/device will be used as the new
1243 destination. If it does not exist, a new file will be created.
1244 (json-string)
1245 - "format": the format of the new destination, default is to probe if 'mode' is
1246 'existing', else the format of the source
1247 (json-string, optional)
1248 - "sync": what parts of the disk image should be copied to the destination;
1249 possibilities include "full" for all the disk, "top" for only the sectors
1250 allocated in the topmost image, "incremental" for only the dirty sectors in
1251 the bitmap, or "none" to only replicate new I/O (MirrorSyncMode).
1252 - "bitmap": dirty bitmap name for sync==incremental. Must be present if sync
1253 is "incremental", must NOT be present otherwise.
1254 - "mode": whether and how QEMU should create a new image
1255 (NewImageMode, optional, default 'absolute-paths')
1256 - "speed": the maximum speed, in bytes per second (json-int, optional)
1257 - "compress": true to compress data, if the target format supports it.
1258 (json-bool, optional, default false)
1259 - "on-source-error": the action to take on an error on the source, default
1260 'report'. 'stop' and 'enospc' can only be used
1261 if the block device supports io-status.
1262 (BlockdevOnError, optional)
1263 - "on-target-error": the action to take on an error on the target, default
1264 'report' (no limitations, since this applies to
1265 a different block device than device).
1266 (BlockdevOnError, optional)
1268 Example:
1269 -> { "execute": "drive-backup", "arguments": { "device": "drive0",
1270 "sync": "full",
1271 "target": "backup.img" } }
1272 <- { "return": {} }
1274 EQMP
1277 .name = "blockdev-backup",
1278 .args_type = "job-id:s?,sync:s,device:B,target:B,speed:i?,compress:b?,"
1279 "on-source-error:s?,on-target-error:s?",
1280 .mhandler.cmd_new = qmp_marshal_blockdev_backup,
1283 SQMP
1284 blockdev-backup
1285 ---------------
1287 The device version of drive-backup: this command takes an existing named device
1288 as backup target.
1290 Arguments:
1292 - "job-id": Identifier for the newly-created block job. If omitted,
1293 the device name will be used. (json-string, optional)
1294 - "device": the device name or node-name of a root node which should be copied.
1295 (json-string)
1296 - "target": the name of the backup target device. (json-string)
1297 - "sync": what parts of the disk image should be copied to the destination;
1298 possibilities include "full" for all the disk, "top" for only the
1299 sectors allocated in the topmost image, or "none" to only replicate
1300 new I/O (MirrorSyncMode).
1301 - "speed": the maximum speed, in bytes per second (json-int, optional)
1302 - "compress": true to compress data, if the target format supports it.
1303 (json-bool, optional, default false)
1304 - "on-source-error": the action to take on an error on the source, default
1305 'report'. 'stop' and 'enospc' can only be used
1306 if the block device supports io-status.
1307 (BlockdevOnError, optional)
1308 - "on-target-error": the action to take on an error on the target, default
1309 'report' (no limitations, since this applies to
1310 a different block device than device).
1311 (BlockdevOnError, optional)
1313 Example:
1314 -> { "execute": "blockdev-backup", "arguments": { "device": "src-id",
1315 "sync": "full",
1316 "target": "tgt-id" } }
1317 <- { "return": {} }
1319 EQMP
1322 .name = "block-job-set-speed",
1323 .args_type = "device:B,speed:o",
1324 .mhandler.cmd_new = qmp_marshal_block_job_set_speed,
1328 .name = "block-job-cancel",
1329 .args_type = "device:B,force:b?",
1330 .mhandler.cmd_new = qmp_marshal_block_job_cancel,
1333 .name = "block-job-pause",
1334 .args_type = "device:B",
1335 .mhandler.cmd_new = qmp_marshal_block_job_pause,
1338 .name = "block-job-resume",
1339 .args_type = "device:B",
1340 .mhandler.cmd_new = qmp_marshal_block_job_resume,
1343 .name = "block-job-complete",
1344 .args_type = "device:B",
1345 .mhandler.cmd_new = qmp_marshal_block_job_complete,
1348 .name = "transaction",
1349 .args_type = "actions:q,properties:q?",
1350 .mhandler.cmd_new = qmp_marshal_transaction,
1353 SQMP
1354 transaction
1355 -----------
1357 Atomically operate on one or more block devices. Operations that are
1358 currently supported:
1360 - drive-backup
1361 - blockdev-backup
1362 - blockdev-snapshot-sync
1363 - blockdev-snapshot-internal-sync
1364 - abort
1365 - block-dirty-bitmap-add
1366 - block-dirty-bitmap-clear
1368 Refer to the qemu/qapi-schema.json file for minimum required QEMU
1369 versions for these operations. A list of dictionaries is accepted,
1370 that contains the actions to be performed. If there is any failure
1371 performing any of the operations, all operations for the group are
1372 abandoned.
1374 For external snapshots, the dictionary contains the device, the file to use for
1375 the new snapshot, and the format. The default format, if not specified, is
1376 qcow2.
1378 Each new snapshot defaults to being created by QEMU (wiping any
1379 contents if the file already exists), but it is also possible to reuse
1380 an externally-created file. In the latter case, you should ensure that
1381 the new image file has the same contents as the current one; QEMU cannot
1382 perform any meaningful check. Typically this is achieved by using the
1383 current image file as the backing file for the new image.
1385 On failure, the original disks pre-snapshot attempt will be used.
1387 For internal snapshots, the dictionary contains the device and the snapshot's
1388 name. If an internal snapshot matching name already exists, the request will
1389 be rejected. Only some image formats support it, for example, qcow2, rbd,
1390 and sheepdog.
1392 On failure, qemu will try delete the newly created internal snapshot in the
1393 transaction. When an I/O error occurs during deletion, the user needs to fix
1394 it later with qemu-img or other command.
1396 Arguments:
1398 actions array:
1399 - "type": the operation to perform (json-string). Possible
1400 values: "drive-backup", "blockdev-backup",
1401 "blockdev-snapshot-sync",
1402 "blockdev-snapshot-internal-sync",
1403 "abort", "block-dirty-bitmap-add",
1404 "block-dirty-bitmap-clear"
1405 - "data": a dictionary. The contents depend on the value
1406 of "type". When "type" is "blockdev-snapshot-sync":
1407 - "device": device name to snapshot (json-string)
1408 - "node-name": graph node name to snapshot (json-string)
1409 - "snapshot-file": name of new image file (json-string)
1410 - "snapshot-node-name": graph node name of the new snapshot (json-string)
1411 - "format": format of new image (json-string, optional)
1412 - "mode": whether and how QEMU should create the snapshot file
1413 (NewImageMode, optional, default "absolute-paths")
1414 When "type" is "blockdev-snapshot-internal-sync":
1415 - "device": the device name or node-name of a root node to snapshot
1416 (json-string)
1417 - "name": name of the new snapshot (json-string)
1419 Example:
1421 -> { "execute": "transaction",
1422 "arguments": { "actions": [
1423 { "type": "blockdev-snapshot-sync", "data" : { "device": "ide-hd0",
1424 "snapshot-file": "/some/place/my-image",
1425 "format": "qcow2" } },
1426 { "type": "blockdev-snapshot-sync", "data" : { "node-name": "myfile",
1427 "snapshot-file": "/some/place/my-image2",
1428 "snapshot-node-name": "node3432",
1429 "mode": "existing",
1430 "format": "qcow2" } },
1431 { "type": "blockdev-snapshot-sync", "data" : { "device": "ide-hd1",
1432 "snapshot-file": "/some/place/my-image2",
1433 "mode": "existing",
1434 "format": "qcow2" } },
1435 { "type": "blockdev-snapshot-internal-sync", "data" : {
1436 "device": "ide-hd2",
1437 "name": "snapshot0" } } ] } }
1438 <- { "return": {} }
1440 EQMP
1443 .name = "block-dirty-bitmap-add",
1444 .args_type = "node:B,name:s,granularity:i?",
1445 .mhandler.cmd_new = qmp_marshal_block_dirty_bitmap_add,
1448 SQMP
1450 block-dirty-bitmap-add
1451 ----------------------
1452 Since 2.4
1454 Create a dirty bitmap with a name on the device, and start tracking the writes.
1456 Arguments:
1458 - "node": device/node on which to create dirty bitmap (json-string)
1459 - "name": name of the new dirty bitmap (json-string)
1460 - "granularity": granularity to track writes with (int, optional)
1462 Example:
1464 -> { "execute": "block-dirty-bitmap-add", "arguments": { "node": "drive0",
1465 "name": "bitmap0" } }
1466 <- { "return": {} }
1468 EQMP
1471 .name = "block-dirty-bitmap-remove",
1472 .args_type = "node:B,name:s",
1473 .mhandler.cmd_new = qmp_marshal_block_dirty_bitmap_remove,
1476 SQMP
1478 block-dirty-bitmap-remove
1479 -------------------------
1480 Since 2.4
1482 Stop write tracking and remove the dirty bitmap that was created with
1483 block-dirty-bitmap-add.
1485 Arguments:
1487 - "node": device/node on which to remove dirty bitmap (json-string)
1488 - "name": name of the dirty bitmap to remove (json-string)
1490 Example:
1492 -> { "execute": "block-dirty-bitmap-remove", "arguments": { "node": "drive0",
1493 "name": "bitmap0" } }
1494 <- { "return": {} }
1496 EQMP
1499 .name = "block-dirty-bitmap-clear",
1500 .args_type = "node:B,name:s",
1501 .mhandler.cmd_new = qmp_marshal_block_dirty_bitmap_clear,
1504 SQMP
1506 block-dirty-bitmap-clear
1507 ------------------------
1508 Since 2.4
1510 Reset the dirty bitmap associated with a node so that an incremental backup
1511 from this point in time forward will only backup clusters modified after this
1512 clear operation.
1514 Arguments:
1516 - "node": device/node on which to remove dirty bitmap (json-string)
1517 - "name": name of the dirty bitmap to remove (json-string)
1519 Example:
1521 -> { "execute": "block-dirty-bitmap-clear", "arguments": { "node": "drive0",
1522 "name": "bitmap0" } }
1523 <- { "return": {} }
1525 EQMP
1528 .name = "blockdev-snapshot-sync",
1529 .args_type = "device:s?,node-name:s?,snapshot-file:s,snapshot-node-name:s?,format:s?,mode:s?",
1530 .mhandler.cmd_new = qmp_marshal_blockdev_snapshot_sync,
1533 SQMP
1534 blockdev-snapshot-sync
1535 ----------------------
1537 Synchronous snapshot of a block device. snapshot-file specifies the
1538 target of the new image. If the file exists, or if it is a device, the
1539 snapshot will be created in the existing file/device. If does not
1540 exist, a new file will be created. format specifies the format of the
1541 snapshot image, default is qcow2.
1543 Arguments:
1545 - "device": device name to snapshot (json-string)
1546 - "node-name": graph node name to snapshot (json-string)
1547 - "snapshot-file": name of new image file (json-string)
1548 - "snapshot-node-name": graph node name of the new snapshot (json-string)
1549 - "mode": whether and how QEMU should create the snapshot file
1550 (NewImageMode, optional, default "absolute-paths")
1551 - "format": format of new image (json-string, optional)
1553 Example:
1555 -> { "execute": "blockdev-snapshot-sync", "arguments": { "device": "ide-hd0",
1556 "snapshot-file":
1557 "/some/place/my-image",
1558 "format": "qcow2" } }
1559 <- { "return": {} }
1561 EQMP
1564 .name = "blockdev-snapshot",
1565 .args_type = "node:s,overlay:s",
1566 .mhandler.cmd_new = qmp_marshal_blockdev_snapshot,
1569 SQMP
1570 blockdev-snapshot
1571 -----------------
1572 Since 2.5
1574 Create a snapshot, by installing 'node' as the backing image of
1575 'overlay'. Additionally, if 'node' is associated with a block
1576 device, the block device changes to using 'overlay' as its new active
1577 image.
1579 Arguments:
1581 - "node": device that will have a snapshot created (json-string)
1582 - "overlay": device that will have 'node' as its backing image (json-string)
1584 Example:
1586 -> { "execute": "blockdev-add",
1587 "arguments": { "options": { "driver": "qcow2",
1588 "node-name": "node1534",
1589 "file": { "driver": "file",
1590 "filename": "hd1.qcow2" },
1591 "backing": "" } } }
1593 <- { "return": {} }
1595 -> { "execute": "blockdev-snapshot", "arguments": { "node": "ide-hd0",
1596 "overlay": "node1534" } }
1597 <- { "return": {} }
1599 EQMP
1602 .name = "blockdev-snapshot-internal-sync",
1603 .args_type = "device:B,name:s",
1604 .mhandler.cmd_new = qmp_marshal_blockdev_snapshot_internal_sync,
1607 SQMP
1608 blockdev-snapshot-internal-sync
1609 -------------------------------
1611 Synchronously take an internal snapshot of a block device when the format of
1612 image used supports it. If the name is an empty string, or a snapshot with
1613 name already exists, the operation will fail.
1615 Arguments:
1617 - "device": the device name or node-name of a root node to snapshot
1618 (json-string)
1619 - "name": name of the new snapshot (json-string)
1621 Example:
1623 -> { "execute": "blockdev-snapshot-internal-sync",
1624 "arguments": { "device": "ide-hd0",
1625 "name": "snapshot0" }
1627 <- { "return": {} }
1629 EQMP
1632 .name = "blockdev-snapshot-delete-internal-sync",
1633 .args_type = "device:B,id:s?,name:s?",
1634 .mhandler.cmd_new =
1635 qmp_marshal_blockdev_snapshot_delete_internal_sync,
1638 SQMP
1639 blockdev-snapshot-delete-internal-sync
1640 --------------------------------------
1642 Synchronously delete an internal snapshot of a block device when the format of
1643 image used supports it. The snapshot is identified by name or id or both. One
1644 of name or id is required. If the snapshot is not found, the operation will
1645 fail.
1647 Arguments:
1649 - "device": the device name or node-name of a root node (json-string)
1650 - "id": ID of the snapshot (json-string, optional)
1651 - "name": name of the snapshot (json-string, optional)
1653 Example:
1655 -> { "execute": "blockdev-snapshot-delete-internal-sync",
1656 "arguments": { "device": "ide-hd0",
1657 "name": "snapshot0" }
1659 <- { "return": {
1660 "id": "1",
1661 "name": "snapshot0",
1662 "vm-state-size": 0,
1663 "date-sec": 1000012,
1664 "date-nsec": 10,
1665 "vm-clock-sec": 100,
1666 "vm-clock-nsec": 20
1670 EQMP
1673 .name = "drive-mirror",
1674 .args_type = "job-id:s?,sync:s,device:B,target:s,speed:i?,mode:s?,"
1675 "format:s?,node-name:s?,replaces:s?,"
1676 "on-source-error:s?,on-target-error:s?,"
1677 "unmap:b?,"
1678 "granularity:i?,buf-size:i?",
1679 .mhandler.cmd_new = qmp_marshal_drive_mirror,
1682 SQMP
1683 drive-mirror
1684 ------------
1686 Start mirroring a block device's writes to a new destination. target
1687 specifies the target of the new image. If the file exists, or if it is
1688 a device, it will be used as the new destination for writes. If it does not
1689 exist, a new file will be created. format specifies the format of the
1690 mirror image, default is to probe if mode='existing', else the format
1691 of the source.
1693 Arguments:
1695 - "job-id": Identifier for the newly-created block job. If omitted,
1696 the device name will be used. (json-string, optional)
1697 - "device": the device name or node-name of a root node whose writes should be
1698 mirrored. (json-string)
1699 - "target": name of new image file (json-string)
1700 - "format": format of new image (json-string, optional)
1701 - "node-name": the name of the new block driver state in the node graph
1702 (json-string, optional)
1703 - "replaces": the block driver node name to replace when finished
1704 (json-string, optional)
1705 - "mode": how an image file should be created into the target
1706 file/device (NewImageMode, optional, default 'absolute-paths')
1707 - "speed": maximum speed of the streaming job, in bytes per second
1708 (json-int)
1709 - "granularity": granularity of the dirty bitmap, in bytes (json-int, optional)
1710 - "buf-size": maximum amount of data in flight from source to target, in bytes
1711 (json-int, default 10M)
1712 - "sync": what parts of the disk image should be copied to the destination;
1713 possibilities include "full" for all the disk, "top" for only the sectors
1714 allocated in the topmost image, or "none" to only replicate new I/O
1715 (MirrorSyncMode).
1716 - "on-source-error": the action to take on an error on the source
1717 (BlockdevOnError, default 'report')
1718 - "on-target-error": the action to take on an error on the target
1719 (BlockdevOnError, default 'report')
1720 - "unmap": whether the target sectors should be discarded where source has only
1721 zeroes. (json-bool, optional, default true)
1723 The default value of the granularity is the image cluster size clamped
1724 between 4096 and 65536, if the image format defines one. If the format
1725 does not define a cluster size, the default value of the granularity
1726 is 65536.
1729 Example:
1731 -> { "execute": "drive-mirror", "arguments": { "device": "ide-hd0",
1732 "target": "/some/place/my-image",
1733 "sync": "full",
1734 "format": "qcow2" } }
1735 <- { "return": {} }
1737 EQMP
1740 .name = "blockdev-mirror",
1741 .args_type = "job-id:s?,sync:s,device:B,target:B,replaces:s?,speed:i?,"
1742 "on-source-error:s?,on-target-error:s?,"
1743 "granularity:i?,buf-size:i?",
1744 .mhandler.cmd_new = qmp_marshal_blockdev_mirror,
1747 SQMP
1748 blockdev-mirror
1749 ------------
1751 Start mirroring a block device's writes to another block device. target
1752 specifies the target of mirror operation.
1754 Arguments:
1756 - "job-id": Identifier for the newly-created block job. If omitted,
1757 the device name will be used. (json-string, optional)
1758 - "device": The device name or node-name of a root node whose writes should be
1759 mirrored (json-string)
1760 - "target": device name to mirror to (json-string)
1761 - "replaces": the block driver node name to replace when finished
1762 (json-string, optional)
1763 - "speed": maximum speed of the streaming job, in bytes per second
1764 (json-int)
1765 - "granularity": granularity of the dirty bitmap, in bytes (json-int, optional)
1766 - "buf_size": maximum amount of data in flight from source to target, in bytes
1767 (json-int, default 10M)
1768 - "sync": what parts of the disk image should be copied to the destination;
1769 possibilities include "full" for all the disk, "top" for only the sectors
1770 allocated in the topmost image, or "none" to only replicate new I/O
1771 (MirrorSyncMode).
1772 - "on-source-error": the action to take on an error on the source
1773 (BlockdevOnError, default 'report')
1774 - "on-target-error": the action to take on an error on the target
1775 (BlockdevOnError, default 'report')
1777 The default value of the granularity is the image cluster size clamped
1778 between 4096 and 65536, if the image format defines one. If the format
1779 does not define a cluster size, the default value of the granularity
1780 is 65536.
1782 Example:
1784 -> { "execute": "blockdev-mirror", "arguments": { "device": "ide-hd0",
1785 "target": "target0",
1786 "sync": "full" } }
1787 <- { "return": {} }
1789 EQMP
1791 .name = "change-backing-file",
1792 .args_type = "device:s,image-node-name:s,backing-file:s",
1793 .mhandler.cmd_new = qmp_marshal_change_backing_file,
1796 SQMP
1797 change-backing-file
1798 -------------------
1799 Since: 2.1
1801 Change the backing file in the image file metadata. This does not cause
1802 QEMU to reopen the image file to reparse the backing filename (it may,
1803 however, perform a reopen to change permissions from r/o -> r/w -> r/o,
1804 if needed). The new backing file string is written into the image file
1805 metadata, and the QEMU internal strings are updated.
1807 Arguments:
1809 - "image-node-name": The name of the block driver state node of the
1810 image to modify. The "device" is argument is used to
1811 verify "image-node-name" is in the chain described by
1812 "device".
1813 (json-string, optional)
1815 - "device": The device name or node-name of the root node that owns
1816 image-node-name.
1817 (json-string)
1819 - "backing-file": The string to write as the backing file. This string is
1820 not validated, so care should be taken when specifying
1821 the string or the image chain may not be able to be
1822 reopened again.
1823 (json-string)
1825 Returns: Nothing on success
1826 If "device" does not exist or cannot be determined, DeviceNotFound
1828 EQMP
1831 .name = "balloon",
1832 .args_type = "value:M",
1833 .mhandler.cmd_new = qmp_marshal_balloon,
1836 SQMP
1837 balloon
1838 -------
1840 Request VM to change its memory allocation (in bytes).
1842 Arguments:
1844 - "value": New memory allocation (json-int)
1846 Example:
1848 -> { "execute": "balloon", "arguments": { "value": 536870912 } }
1849 <- { "return": {} }
1851 EQMP
1854 .name = "set_link",
1855 .args_type = "name:s,up:b",
1856 .mhandler.cmd_new = qmp_marshal_set_link,
1859 SQMP
1860 set_link
1861 --------
1863 Change the link status of a network adapter.
1865 Arguments:
1867 - "name": network device name (json-string)
1868 - "up": status is up (json-bool)
1870 Example:
1872 -> { "execute": "set_link", "arguments": { "name": "e1000.0", "up": false } }
1873 <- { "return": {} }
1875 EQMP
1878 .name = "getfd",
1879 .args_type = "fdname:s",
1880 .params = "getfd name",
1881 .help = "receive a file descriptor via SCM rights and assign it a name",
1882 .mhandler.cmd_new = qmp_marshal_getfd,
1885 SQMP
1886 getfd
1887 -----
1889 Receive a file descriptor via SCM rights and assign it a name.
1891 Arguments:
1893 - "fdname": file descriptor name (json-string)
1895 Example:
1897 -> { "execute": "getfd", "arguments": { "fdname": "fd1" } }
1898 <- { "return": {} }
1900 Notes:
1902 (1) If the name specified by the "fdname" argument already exists,
1903 the file descriptor assigned to it will be closed and replaced
1904 by the received file descriptor.
1905 (2) The 'closefd' command can be used to explicitly close the file
1906 descriptor when it is no longer needed.
1908 EQMP
1911 .name = "closefd",
1912 .args_type = "fdname:s",
1913 .params = "closefd name",
1914 .help = "close a file descriptor previously passed via SCM rights",
1915 .mhandler.cmd_new = qmp_marshal_closefd,
1918 SQMP
1919 closefd
1920 -------
1922 Close a file descriptor previously passed via SCM rights.
1924 Arguments:
1926 - "fdname": file descriptor name (json-string)
1928 Example:
1930 -> { "execute": "closefd", "arguments": { "fdname": "fd1" } }
1931 <- { "return": {} }
1933 EQMP
1936 .name = "add-fd",
1937 .args_type = "fdset-id:i?,opaque:s?",
1938 .params = "add-fd fdset-id opaque",
1939 .help = "Add a file descriptor, that was passed via SCM rights, to an fd set",
1940 .mhandler.cmd_new = qmp_marshal_add_fd,
1943 SQMP
1944 add-fd
1945 -------
1947 Add a file descriptor, that was passed via SCM rights, to an fd set.
1949 Arguments:
1951 - "fdset-id": The ID of the fd set to add the file descriptor to.
1952 (json-int, optional)
1953 - "opaque": A free-form string that can be used to describe the fd.
1954 (json-string, optional)
1956 Return a json-object with the following information:
1958 - "fdset-id": The ID of the fd set that the fd was added to. (json-int)
1959 - "fd": The file descriptor that was received via SCM rights and added to the
1960 fd set. (json-int)
1962 Example:
1964 -> { "execute": "add-fd", "arguments": { "fdset-id": 1 } }
1965 <- { "return": { "fdset-id": 1, "fd": 3 } }
1967 Notes:
1969 (1) The list of fd sets is shared by all monitor connections.
1970 (2) If "fdset-id" is not specified, a new fd set will be created.
1972 EQMP
1975 .name = "remove-fd",
1976 .args_type = "fdset-id:i,fd:i?",
1977 .params = "remove-fd fdset-id fd",
1978 .help = "Remove a file descriptor from an fd set",
1979 .mhandler.cmd_new = qmp_marshal_remove_fd,
1982 SQMP
1983 remove-fd
1984 ---------
1986 Remove a file descriptor from an fd set.
1988 Arguments:
1990 - "fdset-id": The ID of the fd set that the file descriptor belongs to.
1991 (json-int)
1992 - "fd": The file descriptor that is to be removed. (json-int, optional)
1994 Example:
1996 -> { "execute": "remove-fd", "arguments": { "fdset-id": 1, "fd": 3 } }
1997 <- { "return": {} }
1999 Notes:
2001 (1) The list of fd sets is shared by all monitor connections.
2002 (2) If "fd" is not specified, all file descriptors in "fdset-id" will be
2003 removed.
2005 EQMP
2008 .name = "query-fdsets",
2009 .args_type = "",
2010 .help = "Return information describing all fd sets",
2011 .mhandler.cmd_new = qmp_marshal_query_fdsets,
2014 SQMP
2015 query-fdsets
2016 -------------
2018 Return information describing all fd sets.
2020 Arguments: None
2022 Example:
2024 -> { "execute": "query-fdsets" }
2025 <- { "return": [
2027 "fds": [
2029 "fd": 30,
2030 "opaque": "rdonly:/path/to/file"
2033 "fd": 24,
2034 "opaque": "rdwr:/path/to/file"
2037 "fdset-id": 1
2040 "fds": [
2042 "fd": 28
2045 "fd": 29
2048 "fdset-id": 0
2053 Note: The list of fd sets is shared by all monitor connections.
2055 EQMP
2058 .name = "block_passwd",
2059 .args_type = "device:s?,node-name:s?,password:s",
2060 .mhandler.cmd_new = qmp_marshal_block_passwd,
2063 SQMP
2064 block_passwd
2065 ------------
2067 Set the password of encrypted block devices.
2069 Arguments:
2071 - "device": device name (json-string)
2072 - "node-name": name in the block driver state graph (json-string)
2073 - "password": password (json-string)
2075 Example:
2077 -> { "execute": "block_passwd", "arguments": { "device": "ide0-hd0",
2078 "password": "12345" } }
2079 <- { "return": {} }
2081 EQMP
2084 .name = "block_set_io_throttle",
2085 .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?",
2086 .mhandler.cmd_new = qmp_marshal_block_set_io_throttle,
2089 SQMP
2090 block_set_io_throttle
2091 ------------
2093 Change I/O throttle limits for a block drive.
2095 Arguments:
2097 - "device": device name (json-string)
2098 - "bps": total throughput limit in bytes per second (json-int)
2099 - "bps_rd": read throughput limit in bytes per second (json-int)
2100 - "bps_wr": write throughput limit in bytes per second (json-int)
2101 - "iops": total I/O operations per second (json-int)
2102 - "iops_rd": read I/O operations per second (json-int)
2103 - "iops_wr": write I/O operations per second (json-int)
2104 - "bps_max": total throughput limit during bursts, in bytes (json-int, optional)
2105 - "bps_rd_max": read throughput limit during bursts, in bytes (json-int, optional)
2106 - "bps_wr_max": write throughput limit during bursts, in bytes (json-int, optional)
2107 - "iops_max": total I/O operations per second during bursts (json-int, optional)
2108 - "iops_rd_max": read I/O operations per second during bursts (json-int, optional)
2109 - "iops_wr_max": write I/O operations per second during bursts (json-int, optional)
2110 - "bps_max_length": maximum length of the @bps_max burst period, in seconds (json-int, optional)
2111 - "bps_rd_max_length": maximum length of the @bps_rd_max burst period, in seconds (json-int, optional)
2112 - "bps_wr_max_length": maximum length of the @bps_wr_max burst period, in seconds (json-int, optional)
2113 - "iops_max_length": maximum length of the @iops_max burst period, in seconds (json-int, optional)
2114 - "iops_rd_max_length": maximum length of the @iops_rd_max burst period, in seconds (json-int, optional)
2115 - "iops_wr_max_length": maximum length of the @iops_wr_max burst period, in seconds (json-int, optional)
2116 - "iops_size": I/O size in bytes when limiting (json-int, optional)
2117 - "group": throttle group name (json-string, optional)
2119 Example:
2121 -> { "execute": "block_set_io_throttle", "arguments": { "device": "virtio0",
2122 "bps": 1000000,
2123 "bps_rd": 0,
2124 "bps_wr": 0,
2125 "iops": 0,
2126 "iops_rd": 0,
2127 "iops_wr": 0,
2128 "bps_max": 8000000,
2129 "bps_rd_max": 0,
2130 "bps_wr_max": 0,
2131 "iops_max": 0,
2132 "iops_rd_max": 0,
2133 "iops_wr_max": 0,
2134 "bps_max_length": 60,
2135 "iops_size": 0 } }
2136 <- { "return": {} }
2138 EQMP
2141 .name = "set_password",
2142 .args_type = "protocol:s,password:s,connected:s?",
2143 .mhandler.cmd_new = qmp_marshal_set_password,
2146 SQMP
2147 set_password
2148 ------------
2150 Set the password for vnc/spice protocols.
2152 Arguments:
2154 - "protocol": protocol name (json-string)
2155 - "password": password (json-string)
2156 - "connected": [ keep | disconnect | fail ] (json-string, optional)
2158 Example:
2160 -> { "execute": "set_password", "arguments": { "protocol": "vnc",
2161 "password": "secret" } }
2162 <- { "return": {} }
2164 EQMP
2167 .name = "expire_password",
2168 .args_type = "protocol:s,time:s",
2169 .mhandler.cmd_new = qmp_marshal_expire_password,
2172 SQMP
2173 expire_password
2174 ---------------
2176 Set the password expire time for vnc/spice protocols.
2178 Arguments:
2180 - "protocol": protocol name (json-string)
2181 - "time": [ now | never | +secs | secs ] (json-string)
2183 Example:
2185 -> { "execute": "expire_password", "arguments": { "protocol": "vnc",
2186 "time": "+60" } }
2187 <- { "return": {} }
2189 EQMP
2192 .name = "add_client",
2193 .args_type = "protocol:s,fdname:s,skipauth:b?,tls:b?",
2194 .mhandler.cmd_new = qmp_marshal_add_client,
2197 SQMP
2198 add_client
2199 ----------
2201 Add a graphics client
2203 Arguments:
2205 - "protocol": protocol name (json-string)
2206 - "fdname": file descriptor name (json-string)
2207 - "skipauth": whether to skip authentication (json-bool, optional)
2208 - "tls": whether to perform TLS (json-bool, optional)
2210 Example:
2212 -> { "execute": "add_client", "arguments": { "protocol": "vnc",
2213 "fdname": "myclient" } }
2214 <- { "return": {} }
2216 EQMP
2218 .name = "qmp_capabilities",
2219 .args_type = "",
2220 .params = "",
2221 .help = "enable QMP capabilities",
2222 .mhandler.cmd_new = qmp_capabilities,
2225 SQMP
2226 qmp_capabilities
2227 ----------------
2229 Enable QMP capabilities.
2231 Arguments: None.
2233 Example:
2235 -> { "execute": "qmp_capabilities" }
2236 <- { "return": {} }
2238 Note: This command must be issued before issuing any other command.
2240 EQMP
2243 .name = "human-monitor-command",
2244 .args_type = "command-line:s,cpu-index:i?",
2245 .mhandler.cmd_new = qmp_marshal_human_monitor_command,
2248 SQMP
2249 human-monitor-command
2250 ---------------------
2252 Execute a Human Monitor command.
2254 Arguments:
2256 - command-line: the command name and its arguments, just like the
2257 Human Monitor's shell (json-string)
2258 - cpu-index: select the CPU number to be used by commands which access CPU
2259 data, like 'info registers'. The Monitor selects CPU 0 if this
2260 argument is not provided (json-int, optional)
2262 Example:
2264 -> { "execute": "human-monitor-command", "arguments": { "command-line": "info kvm" } }
2265 <- { "return": "kvm support: enabled\r\n" }
2267 Notes:
2269 (1) The Human Monitor is NOT an stable interface, this means that command
2270 names, arguments and responses can change or be removed at ANY time.
2271 Applications that rely on long term stability guarantees should NOT
2272 use this command
2274 (2) Limitations:
2276 o This command is stateless, this means that commands that depend
2277 on state information (such as getfd) might not work
2279 o Commands that prompt the user for data (eg. 'cont' when the block
2280 device is encrypted) don't currently work
2282 3. Query Commands
2283 =================
2285 HXCOMM Each query command below is inside a SQMP/EQMP section, do NOT change
2286 HXCOMM this! We will possibly move query commands definitions inside those
2287 HXCOMM sections, just like regular commands.
2289 EQMP
2291 SQMP
2292 query-version
2293 -------------
2295 Show QEMU version.
2297 Return a json-object with the following information:
2299 - "qemu": A json-object containing three integer values:
2300 - "major": QEMU's major version (json-int)
2301 - "minor": QEMU's minor version (json-int)
2302 - "micro": QEMU's micro version (json-int)
2303 - "package": package's version (json-string)
2305 Example:
2307 -> { "execute": "query-version" }
2308 <- {
2309 "return":{
2310 "qemu":{
2311 "major":0,
2312 "minor":11,
2313 "micro":5
2315 "package":""
2319 EQMP
2322 .name = "query-version",
2323 .args_type = "",
2324 .mhandler.cmd_new = qmp_marshal_query_version,
2327 SQMP
2328 query-commands
2329 --------------
2331 List QMP available commands.
2333 Each command is represented by a json-object, the returned value is a json-array
2334 of all commands.
2336 Each json-object contain:
2338 - "name": command's name (json-string)
2340 Example:
2342 -> { "execute": "query-commands" }
2343 <- {
2344 "return":[
2346 "name":"query-balloon"
2349 "name":"system_powerdown"
2354 Note: This example has been shortened as the real response is too long.
2356 EQMP
2359 .name = "query-commands",
2360 .args_type = "",
2361 .mhandler.cmd_new = qmp_marshal_query_commands,
2364 SQMP
2365 query-events
2366 --------------
2368 List QMP available events.
2370 Each event is represented by a json-object, the returned value is a json-array
2371 of all events.
2373 Each json-object contains:
2375 - "name": event's name (json-string)
2377 Example:
2379 -> { "execute": "query-events" }
2380 <- {
2381 "return":[
2383 "name":"SHUTDOWN"
2386 "name":"RESET"
2391 Note: This example has been shortened as the real response is too long.
2393 EQMP
2396 .name = "query-events",
2397 .args_type = "",
2398 .mhandler.cmd_new = qmp_marshal_query_events,
2401 SQMP
2402 query-qmp-schema
2403 ----------------
2405 Return the QMP wire schema. The returned value is a json-array of
2406 named schema entities. Entities are commands, events and various
2407 types. See docs/qapi-code-gen.txt for information on their structure
2408 and intended use.
2410 EQMP
2413 .name = "query-qmp-schema",
2414 .args_type = "",
2415 .mhandler.cmd_new = qmp_query_qmp_schema,
2418 SQMP
2419 query-chardev
2420 -------------
2422 Each device is represented by a json-object. The returned value is a json-array
2423 of all devices.
2425 Each json-object contain the following:
2427 - "label": device's label (json-string)
2428 - "filename": device's file (json-string)
2429 - "frontend-open": open/closed state of the frontend device attached to this
2430 backend (json-bool)
2432 Example:
2434 -> { "execute": "query-chardev" }
2435 <- {
2436 "return": [
2438 "label": "charchannel0",
2439 "filename": "unix:/var/lib/libvirt/qemu/seabios.rhel6.agent,server",
2440 "frontend-open": false
2443 "label": "charmonitor",
2444 "filename": "unix:/var/lib/libvirt/qemu/seabios.rhel6.monitor,server",
2445 "frontend-open": true
2448 "label": "charserial0",
2449 "filename": "pty:/dev/pts/2",
2450 "frontend-open": true
2455 EQMP
2458 .name = "query-chardev",
2459 .args_type = "",
2460 .mhandler.cmd_new = qmp_marshal_query_chardev,
2463 SQMP
2464 query-chardev-backends
2465 -------------
2467 List available character device backends.
2469 Each backend is represented by a json-object, the returned value is a json-array
2470 of all backends.
2472 Each json-object contains:
2474 - "name": backend name (json-string)
2476 Example:
2478 -> { "execute": "query-chardev-backends" }
2479 <- {
2480 "return":[
2482 "name":"udp"
2485 "name":"tcp"
2488 "name":"unix"
2491 "name":"spiceport"
2496 EQMP
2499 .name = "query-chardev-backends",
2500 .args_type = "",
2501 .mhandler.cmd_new = qmp_marshal_query_chardev_backends,
2504 SQMP
2505 query-block
2506 -----------
2508 Show the block devices.
2510 Each block device information is stored in a json-object and the returned value
2511 is a json-array of all devices.
2513 Each json-object contain the following:
2515 - "device": device name (json-string)
2516 - "type": device type (json-string)
2517 - deprecated, retained for backward compatibility
2518 - Possible values: "unknown"
2519 - "removable": true if the device is removable, false otherwise (json-bool)
2520 - "locked": true if the device is locked, false otherwise (json-bool)
2521 - "tray_open": only present if removable, true if the device has a tray,
2522 and it is open (json-bool)
2523 - "inserted": only present if the device is inserted, it is a json-object
2524 containing the following:
2525 - "file": device file name (json-string)
2526 - "ro": true if read-only, false otherwise (json-bool)
2527 - "drv": driver format name (json-string)
2528 - Possible values: "blkdebug", "bochs", "cloop", "dmg",
2529 "file", "file", "ftp", "ftps", "host_cdrom",
2530 "host_device", "http", "https",
2531 "nbd", "parallels", "qcow", "qcow2", "raw",
2532 "tftp", "vdi", "vmdk", "vpc", "vvfat"
2533 - "backing_file": backing file name (json-string, optional)
2534 - "backing_file_depth": number of files in the backing file chain (json-int)
2535 - "encrypted": true if encrypted, false otherwise (json-bool)
2536 - "bps": limit total bytes per second (json-int)
2537 - "bps_rd": limit read bytes per second (json-int)
2538 - "bps_wr": limit write bytes per second (json-int)
2539 - "iops": limit total I/O operations per second (json-int)
2540 - "iops_rd": limit read operations per second (json-int)
2541 - "iops_wr": limit write operations per second (json-int)
2542 - "bps_max": total max in bytes (json-int)
2543 - "bps_rd_max": read max in bytes (json-int)
2544 - "bps_wr_max": write max in bytes (json-int)
2545 - "iops_max": total I/O operations max (json-int)
2546 - "iops_rd_max": read I/O operations max (json-int)
2547 - "iops_wr_max": write I/O operations max (json-int)
2548 - "iops_size": I/O size when limiting by iops (json-int)
2549 - "detect_zeroes": detect and optimize zero writing (json-string)
2550 - Possible values: "off", "on", "unmap"
2551 - "write_threshold": write offset threshold in bytes, a event will be
2552 emitted if crossed. Zero if disabled (json-int)
2553 - "image": the detail of the image, it is a json-object containing
2554 the following:
2555 - "filename": image file name (json-string)
2556 - "format": image format (json-string)
2557 - "virtual-size": image capacity in bytes (json-int)
2558 - "dirty-flag": true if image is not cleanly closed, not present
2559 means clean (json-bool, optional)
2560 - "actual-size": actual size on disk in bytes of the image, not
2561 present when image does not support thin
2562 provision (json-int, optional)
2563 - "cluster-size": size of a cluster in bytes, not present if image
2564 format does not support it (json-int, optional)
2565 - "encrypted": true if the image is encrypted, not present means
2566 false or the image format does not support
2567 encryption (json-bool, optional)
2568 - "backing_file": backing file name, not present means no backing
2569 file is used or the image format does not
2570 support backing file chain
2571 (json-string, optional)
2572 - "full-backing-filename": full path of the backing file, not
2573 present if it equals backing_file or no
2574 backing file is used
2575 (json-string, optional)
2576 - "backing-filename-format": the format of the backing file, not
2577 present means unknown or no backing
2578 file (json-string, optional)
2579 - "snapshots": the internal snapshot info, it is an optional list
2580 of json-object containing the following:
2581 - "id": unique snapshot id (json-string)
2582 - "name": snapshot name (json-string)
2583 - "vm-state-size": size of the VM state in bytes (json-int)
2584 - "date-sec": UTC date of the snapshot in seconds (json-int)
2585 - "date-nsec": fractional part in nanoseconds to be used with
2586 date-sec (json-int)
2587 - "vm-clock-sec": VM clock relative to boot in seconds
2588 (json-int)
2589 - "vm-clock-nsec": fractional part in nanoseconds to be used
2590 with vm-clock-sec (json-int)
2591 - "backing-image": the detail of the backing image, it is an
2592 optional json-object only present when a
2593 backing image present for this image
2595 - "io-status": I/O operation status, only present if the device supports it
2596 and the VM is configured to stop on errors. It's always reset
2597 to "ok" when the "cont" command is issued (json_string, optional)
2598 - Possible values: "ok", "failed", "nospace"
2600 Example:
2602 -> { "execute": "query-block" }
2603 <- {
2604 "return":[
2606 "io-status": "ok",
2607 "device":"ide0-hd0",
2608 "locked":false,
2609 "removable":false,
2610 "inserted":{
2611 "ro":false,
2612 "drv":"qcow2",
2613 "encrypted":false,
2614 "file":"disks/test.qcow2",
2615 "backing_file_depth":1,
2616 "bps":1000000,
2617 "bps_rd":0,
2618 "bps_wr":0,
2619 "iops":1000000,
2620 "iops_rd":0,
2621 "iops_wr":0,
2622 "bps_max": 8000000,
2623 "bps_rd_max": 0,
2624 "bps_wr_max": 0,
2625 "iops_max": 0,
2626 "iops_rd_max": 0,
2627 "iops_wr_max": 0,
2628 "iops_size": 0,
2629 "detect_zeroes": "on",
2630 "write_threshold": 0,
2631 "image":{
2632 "filename":"disks/test.qcow2",
2633 "format":"qcow2",
2634 "virtual-size":2048000,
2635 "backing_file":"base.qcow2",
2636 "full-backing-filename":"disks/base.qcow2",
2637 "backing-filename-format":"qcow2",
2638 "snapshots":[
2640 "id": "1",
2641 "name": "snapshot1",
2642 "vm-state-size": 0,
2643 "date-sec": 10000200,
2644 "date-nsec": 12,
2645 "vm-clock-sec": 206,
2646 "vm-clock-nsec": 30
2649 "backing-image":{
2650 "filename":"disks/base.qcow2",
2651 "format":"qcow2",
2652 "virtual-size":2048000
2656 "type":"unknown"
2659 "io-status": "ok",
2660 "device":"ide1-cd0",
2661 "locked":false,
2662 "removable":true,
2663 "type":"unknown"
2666 "device":"floppy0",
2667 "locked":false,
2668 "removable":true,
2669 "type":"unknown"
2672 "device":"sd0",
2673 "locked":false,
2674 "removable":true,
2675 "type":"unknown"
2680 EQMP
2683 .name = "query-block",
2684 .args_type = "",
2685 .mhandler.cmd_new = qmp_marshal_query_block,
2688 SQMP
2689 query-blockstats
2690 ----------------
2692 Show block device statistics.
2694 Each device statistic information is stored in a json-object and the returned
2695 value is a json-array of all devices.
2697 Each json-object contain the following:
2699 - "device": device name (json-string)
2700 - "stats": A json-object with the statistics information, it contains:
2701 - "rd_bytes": bytes read (json-int)
2702 - "wr_bytes": bytes written (json-int)
2703 - "rd_operations": read operations (json-int)
2704 - "wr_operations": write operations (json-int)
2705 - "flush_operations": cache flush operations (json-int)
2706 - "wr_total_time_ns": total time spend on writes in nano-seconds (json-int)
2707 - "rd_total_time_ns": total time spend on reads in nano-seconds (json-int)
2708 - "flush_total_time_ns": total time spend on cache flushes in nano-seconds (json-int)
2709 - "wr_highest_offset": The offset after the greatest byte written to the
2710 BlockDriverState since it has been opened (json-int)
2711 - "rd_merged": number of read requests that have been merged into
2712 another request (json-int)
2713 - "wr_merged": number of write requests that have been merged into
2714 another request (json-int)
2715 - "idle_time_ns": time since the last I/O operation, in
2716 nanoseconds. If the field is absent it means
2717 that there haven't been any operations yet
2718 (json-int, optional)
2719 - "failed_rd_operations": number of failed read operations
2720 (json-int)
2721 - "failed_wr_operations": number of failed write operations
2722 (json-int)
2723 - "failed_flush_operations": number of failed flush operations
2724 (json-int)
2725 - "invalid_rd_operations": number of invalid read operations
2726 (json-int)
2727 - "invalid_wr_operations": number of invalid write operations
2728 (json-int)
2729 - "invalid_flush_operations": number of invalid flush operations
2730 (json-int)
2731 - "account_invalid": whether invalid operations are included in
2732 the last access statistics (json-bool)
2733 - "account_failed": whether failed operations are included in the
2734 latency and last access statistics
2735 (json-bool)
2736 - "timed_stats": A json-array containing statistics collected in
2737 specific intervals, with the following members:
2738 - "interval_length": interval used for calculating the
2739 statistics, in seconds (json-int)
2740 - "min_rd_latency_ns": minimum latency of read operations in
2741 the defined interval, in nanoseconds
2742 (json-int)
2743 - "min_wr_latency_ns": minimum latency of write operations in
2744 the defined interval, in nanoseconds
2745 (json-int)
2746 - "min_flush_latency_ns": minimum latency of flush operations
2747 in the defined interval, in
2748 nanoseconds (json-int)
2749 - "max_rd_latency_ns": maximum latency of read operations in
2750 the defined interval, in nanoseconds
2751 (json-int)
2752 - "max_wr_latency_ns": maximum latency of write operations in
2753 the defined interval, in nanoseconds
2754 (json-int)
2755 - "max_flush_latency_ns": maximum latency of flush operations
2756 in the defined interval, in
2757 nanoseconds (json-int)
2758 - "avg_rd_latency_ns": average latency of read operations in
2759 the defined interval, in nanoseconds
2760 (json-int)
2761 - "avg_wr_latency_ns": average latency of write operations in
2762 the defined interval, in nanoseconds
2763 (json-int)
2764 - "avg_flush_latency_ns": average latency of flush operations
2765 in the defined interval, in
2766 nanoseconds (json-int)
2767 - "avg_rd_queue_depth": average number of pending read
2768 operations in the defined interval
2769 (json-number)
2770 - "avg_wr_queue_depth": average number of pending write
2771 operations in the defined interval
2772 (json-number).
2773 - "parent": Contains recursively the statistics of the underlying
2774 protocol (e.g. the host file for a qcow2 image). If there is
2775 no underlying protocol, this field is omitted
2776 (json-object, optional)
2778 Example:
2780 -> { "execute": "query-blockstats" }
2781 <- {
2782 "return":[
2784 "device":"ide0-hd0",
2785 "parent":{
2786 "stats":{
2787 "wr_highest_offset":3686448128,
2788 "wr_bytes":9786368,
2789 "wr_operations":751,
2790 "rd_bytes":122567168,
2791 "rd_operations":36772
2792 "wr_total_times_ns":313253456
2793 "rd_total_times_ns":3465673657
2794 "flush_total_times_ns":49653
2795 "flush_operations":61,
2796 "rd_merged":0,
2797 "wr_merged":0,
2798 "idle_time_ns":2953431879,
2799 "account_invalid":true,
2800 "account_failed":false
2803 "stats":{
2804 "wr_highest_offset":2821110784,
2805 "wr_bytes":9786368,
2806 "wr_operations":692,
2807 "rd_bytes":122739200,
2808 "rd_operations":36604
2809 "flush_operations":51,
2810 "wr_total_times_ns":313253456
2811 "rd_total_times_ns":3465673657
2812 "flush_total_times_ns":49653,
2813 "rd_merged":0,
2814 "wr_merged":0,
2815 "idle_time_ns":2953431879,
2816 "account_invalid":true,
2817 "account_failed":false
2821 "device":"ide1-cd0",
2822 "stats":{
2823 "wr_highest_offset":0,
2824 "wr_bytes":0,
2825 "wr_operations":0,
2826 "rd_bytes":0,
2827 "rd_operations":0
2828 "flush_operations":0,
2829 "wr_total_times_ns":0
2830 "rd_total_times_ns":0
2831 "flush_total_times_ns":0,
2832 "rd_merged":0,
2833 "wr_merged":0,
2834 "account_invalid":false,
2835 "account_failed":false
2839 "device":"floppy0",
2840 "stats":{
2841 "wr_highest_offset":0,
2842 "wr_bytes":0,
2843 "wr_operations":0,
2844 "rd_bytes":0,
2845 "rd_operations":0
2846 "flush_operations":0,
2847 "wr_total_times_ns":0
2848 "rd_total_times_ns":0
2849 "flush_total_times_ns":0,
2850 "rd_merged":0,
2851 "wr_merged":0,
2852 "account_invalid":false,
2853 "account_failed":false
2857 "device":"sd0",
2858 "stats":{
2859 "wr_highest_offset":0,
2860 "wr_bytes":0,
2861 "wr_operations":0,
2862 "rd_bytes":0,
2863 "rd_operations":0
2864 "flush_operations":0,
2865 "wr_total_times_ns":0
2866 "rd_total_times_ns":0
2867 "flush_total_times_ns":0,
2868 "rd_merged":0,
2869 "wr_merged":0,
2870 "account_invalid":false,
2871 "account_failed":false
2877 EQMP
2880 .name = "query-blockstats",
2881 .args_type = "query-nodes:b?",
2882 .mhandler.cmd_new = qmp_marshal_query_blockstats,
2885 SQMP
2886 query-cpus
2887 ----------
2889 Show CPU information.
2891 Return a json-array. Each CPU is represented by a json-object, which contains:
2893 - "CPU": CPU index (json-int)
2894 - "current": true if this is the current CPU, false otherwise (json-bool)
2895 - "halted": true if the cpu is halted, false otherwise (json-bool)
2896 - "qom_path": path to the CPU object in the QOM tree (json-str)
2897 - "arch": architecture of the cpu, which determines what additional
2898 keys will be present (json-str)
2899 - Current program counter. The key's name depends on the architecture:
2900 "pc": i386/x86_64 (json-int)
2901 "nip": PPC (json-int)
2902 "pc" and "npc": sparc (json-int)
2903 "PC": mips (json-int)
2904 - "thread_id": ID of the underlying host thread (json-int)
2906 Example:
2908 -> { "execute": "query-cpus" }
2909 <- {
2910 "return":[
2912 "CPU":0,
2913 "current":true,
2914 "halted":false,
2915 "qom_path":"/machine/unattached/device[0]",
2916 "arch":"x86",
2917 "pc":3227107138,
2918 "thread_id":3134
2921 "CPU":1,
2922 "current":false,
2923 "halted":true,
2924 "qom_path":"/machine/unattached/device[2]",
2925 "arch":"x86",
2926 "pc":7108165,
2927 "thread_id":3135
2932 EQMP
2935 .name = "query-cpus",
2936 .args_type = "",
2937 .mhandler.cmd_new = qmp_marshal_query_cpus,
2940 SQMP
2941 query-iothreads
2942 ---------------
2944 Returns a list of information about each iothread.
2946 Note this list excludes the QEMU main loop thread, which is not declared
2947 using the -object iothread command-line option. It is always the main thread
2948 of the process.
2950 Return a json-array. Each iothread is represented by a json-object, which contains:
2952 - "id": name of iothread (json-str)
2953 - "thread-id": ID of the underlying host thread (json-int)
2955 Example:
2957 -> { "execute": "query-iothreads" }
2958 <- {
2959 "return":[
2961 "id":"iothread0",
2962 "thread-id":3134
2965 "id":"iothread1",
2966 "thread-id":3135
2971 EQMP
2974 .name = "query-iothreads",
2975 .args_type = "",
2976 .mhandler.cmd_new = qmp_marshal_query_iothreads,
2979 SQMP
2980 query-pci
2981 ---------
2983 PCI buses and devices information.
2985 The returned value is a json-array of all buses. Each bus is represented by
2986 a json-object, which has a key with a json-array of all PCI devices attached
2987 to it. Each device is represented by a json-object.
2989 The bus json-object contains the following:
2991 - "bus": bus number (json-int)
2992 - "devices": a json-array of json-objects, each json-object represents a
2993 PCI device
2995 The PCI device json-object contains the following:
2997 - "bus": identical to the parent's bus number (json-int)
2998 - "slot": slot number (json-int)
2999 - "function": function number (json-int)
3000 - "class_info": a json-object containing:
3001 - "desc": device class description (json-string, optional)
3002 - "class": device class number (json-int)
3003 - "id": a json-object containing:
3004 - "device": device ID (json-int)
3005 - "vendor": vendor ID (json-int)
3006 - "irq": device's IRQ if assigned (json-int, optional)
3007 - "qdev_id": qdev id string (json-string)
3008 - "pci_bridge": It's a json-object, only present if this device is a
3009 PCI bridge, contains:
3010 - "bus": bus number (json-int)
3011 - "secondary": secondary bus number (json-int)
3012 - "subordinate": subordinate bus number (json-int)
3013 - "io_range": I/O memory range information, a json-object with the
3014 following members:
3015 - "base": base address, in bytes (json-int)
3016 - "limit": limit address, in bytes (json-int)
3017 - "memory_range": memory range information, a json-object with the
3018 following members:
3019 - "base": base address, in bytes (json-int)
3020 - "limit": limit address, in bytes (json-int)
3021 - "prefetchable_range": Prefetchable memory range information, a
3022 json-object with the following members:
3023 - "base": base address, in bytes (json-int)
3024 - "limit": limit address, in bytes (json-int)
3025 - "devices": a json-array of PCI devices if there's any attached, each
3026 each element is represented by a json-object, which contains
3027 the same members of the 'PCI device json-object' described
3028 above (optional)
3029 - "regions": a json-array of json-objects, each json-object represents a
3030 memory region of this device
3032 The memory range json-object contains the following:
3034 - "base": base memory address (json-int)
3035 - "limit": limit value (json-int)
3037 The region json-object can be an I/O region or a memory region, an I/O region
3038 json-object contains the following:
3040 - "type": "io" (json-string, fixed)
3041 - "bar": BAR number (json-int)
3042 - "address": memory address (json-int)
3043 - "size": memory size (json-int)
3045 A memory region json-object contains the following:
3047 - "type": "memory" (json-string, fixed)
3048 - "bar": BAR number (json-int)
3049 - "address": memory address (json-int)
3050 - "size": memory size (json-int)
3051 - "mem_type_64": true or false (json-bool)
3052 - "prefetch": true or false (json-bool)
3054 Example:
3056 -> { "execute": "query-pci" }
3057 <- {
3058 "return":[
3060 "bus":0,
3061 "devices":[
3063 "bus":0,
3064 "qdev_id":"",
3065 "slot":0,
3066 "class_info":{
3067 "class":1536,
3068 "desc":"Host bridge"
3070 "id":{
3071 "device":32902,
3072 "vendor":4663
3074 "function":0,
3075 "regions":[
3080 "bus":0,
3081 "qdev_id":"",
3082 "slot":1,
3083 "class_info":{
3084 "class":1537,
3085 "desc":"ISA bridge"
3087 "id":{
3088 "device":32902,
3089 "vendor":28672
3091 "function":0,
3092 "regions":[
3097 "bus":0,
3098 "qdev_id":"",
3099 "slot":1,
3100 "class_info":{
3101 "class":257,
3102 "desc":"IDE controller"
3104 "id":{
3105 "device":32902,
3106 "vendor":28688
3108 "function":1,
3109 "regions":[
3111 "bar":4,
3112 "size":16,
3113 "address":49152,
3114 "type":"io"
3119 "bus":0,
3120 "qdev_id":"",
3121 "slot":2,
3122 "class_info":{
3123 "class":768,
3124 "desc":"VGA controller"
3126 "id":{
3127 "device":4115,
3128 "vendor":184
3130 "function":0,
3131 "regions":[
3133 "prefetch":true,
3134 "mem_type_64":false,
3135 "bar":0,
3136 "size":33554432,
3137 "address":4026531840,
3138 "type":"memory"
3141 "prefetch":false,
3142 "mem_type_64":false,
3143 "bar":1,
3144 "size":4096,
3145 "address":4060086272,
3146 "type":"memory"
3149 "prefetch":false,
3150 "mem_type_64":false,
3151 "bar":6,
3152 "size":65536,
3153 "address":-1,
3154 "type":"memory"
3159 "bus":0,
3160 "qdev_id":"",
3161 "irq":11,
3162 "slot":4,
3163 "class_info":{
3164 "class":1280,
3165 "desc":"RAM controller"
3167 "id":{
3168 "device":6900,
3169 "vendor":4098
3171 "function":0,
3172 "regions":[
3174 "bar":0,
3175 "size":32,
3176 "address":49280,
3177 "type":"io"
3186 Note: This example has been shortened as the real response is too long.
3188 EQMP
3191 .name = "query-pci",
3192 .args_type = "",
3193 .mhandler.cmd_new = qmp_marshal_query_pci,
3196 SQMP
3197 query-kvm
3198 ---------
3200 Show KVM information.
3202 Return a json-object with the following information:
3204 - "enabled": true if KVM support is enabled, false otherwise (json-bool)
3205 - "present": true if QEMU has KVM support, false otherwise (json-bool)
3207 Example:
3209 -> { "execute": "query-kvm" }
3210 <- { "return": { "enabled": true, "present": true } }
3212 EQMP
3215 .name = "query-kvm",
3216 .args_type = "",
3217 .mhandler.cmd_new = qmp_marshal_query_kvm,
3220 SQMP
3221 query-status
3222 ------------
3224 Return a json-object with the following information:
3226 - "running": true if the VM is running, or false if it is paused (json-bool)
3227 - "singlestep": true if the VM is in single step mode,
3228 false otherwise (json-bool)
3229 - "status": one of the following values (json-string)
3230 "debug" - QEMU is running on a debugger
3231 "inmigrate" - guest is paused waiting for an incoming migration
3232 "internal-error" - An internal error that prevents further guest
3233 execution has occurred
3234 "io-error" - the last IOP has failed and the device is configured
3235 to pause on I/O errors
3236 "paused" - guest has been paused via the 'stop' command
3237 "postmigrate" - guest is paused following a successful 'migrate'
3238 "prelaunch" - QEMU was started with -S and guest has not started
3239 "finish-migrate" - guest is paused to finish the migration process
3240 "restore-vm" - guest is paused to restore VM state
3241 "running" - guest is actively running
3242 "save-vm" - guest is paused to save the VM state
3243 "shutdown" - guest is shut down (and -no-shutdown is in use)
3244 "watchdog" - the watchdog action is configured to pause and
3245 has been triggered
3247 Example:
3249 -> { "execute": "query-status" }
3250 <- { "return": { "running": true, "singlestep": false, "status": "running" } }
3252 EQMP
3255 .name = "query-status",
3256 .args_type = "",
3257 .mhandler.cmd_new = qmp_marshal_query_status,
3260 SQMP
3261 query-mice
3262 ----------
3264 Show VM mice information.
3266 Each mouse is represented by a json-object, the returned value is a json-array
3267 of all mice.
3269 The mouse json-object contains the following:
3271 - "name": mouse's name (json-string)
3272 - "index": mouse's index (json-int)
3273 - "current": true if this mouse is receiving events, false otherwise (json-bool)
3274 - "absolute": true if the mouse generates absolute input events (json-bool)
3276 Example:
3278 -> { "execute": "query-mice" }
3279 <- {
3280 "return":[
3282 "name":"QEMU Microsoft Mouse",
3283 "index":0,
3284 "current":false,
3285 "absolute":false
3288 "name":"QEMU PS/2 Mouse",
3289 "index":1,
3290 "current":true,
3291 "absolute":true
3296 EQMP
3299 .name = "query-mice",
3300 .args_type = "",
3301 .mhandler.cmd_new = qmp_marshal_query_mice,
3304 SQMP
3305 query-vnc
3306 ---------
3308 Show VNC server information.
3310 Return a json-object with server information. Connected clients are returned
3311 as a json-array of json-objects.
3313 The main json-object contains the following:
3315 - "enabled": true or false (json-bool)
3316 - "host": server's IP address (json-string)
3317 - "family": address family (json-string)
3318 - Possible values: "ipv4", "ipv6", "unix", "unknown"
3319 - "service": server's port number (json-string)
3320 - "auth": authentication method (json-string)
3321 - Possible values: "invalid", "none", "ra2", "ra2ne", "sasl", "tight",
3322 "tls", "ultra", "unknown", "vencrypt", "vencrypt",
3323 "vencrypt+plain", "vencrypt+tls+none",
3324 "vencrypt+tls+plain", "vencrypt+tls+sasl",
3325 "vencrypt+tls+vnc", "vencrypt+x509+none",
3326 "vencrypt+x509+plain", "vencrypt+x509+sasl",
3327 "vencrypt+x509+vnc", "vnc"
3328 - "clients": a json-array of all connected clients
3330 Clients are described by a json-object, each one contain the following:
3332 - "host": client's IP address (json-string)
3333 - "family": address family (json-string)
3334 - Possible values: "ipv4", "ipv6", "unix", "unknown"
3335 - "service": client's port number (json-string)
3336 - "x509_dname": TLS dname (json-string, optional)
3337 - "sasl_username": SASL username (json-string, optional)
3339 Example:
3341 -> { "execute": "query-vnc" }
3342 <- {
3343 "return":{
3344 "enabled":true,
3345 "host":"0.0.0.0",
3346 "service":"50402",
3347 "auth":"vnc",
3348 "family":"ipv4",
3349 "clients":[
3351 "host":"127.0.0.1",
3352 "service":"50401",
3353 "family":"ipv4"
3359 EQMP
3362 .name = "query-vnc",
3363 .args_type = "",
3364 .mhandler.cmd_new = qmp_marshal_query_vnc,
3367 .name = "query-vnc-servers",
3368 .args_type = "",
3369 .mhandler.cmd_new = qmp_marshal_query_vnc_servers,
3372 SQMP
3373 query-spice
3374 -----------
3376 Show SPICE server information.
3378 Return a json-object with server information. Connected clients are returned
3379 as a json-array of json-objects.
3381 The main json-object contains the following:
3383 - "enabled": true or false (json-bool)
3384 - "host": server's IP address (json-string)
3385 - "port": server's port number (json-int, optional)
3386 - "tls-port": server's port number (json-int, optional)
3387 - "auth": authentication method (json-string)
3388 - Possible values: "none", "spice"
3389 - "channels": a json-array of all active channels clients
3391 Channels are described by a json-object, each one contain the following:
3393 - "host": client's IP address (json-string)
3394 - "family": address family (json-string)
3395 - Possible values: "ipv4", "ipv6", "unix", "unknown"
3396 - "port": client's port number (json-string)
3397 - "connection-id": spice connection id. All channels with the same id
3398 belong to the same spice session (json-int)
3399 - "channel-type": channel type. "1" is the main control channel, filter for
3400 this one if you want track spice sessions only (json-int)
3401 - "channel-id": channel id. Usually "0", might be different needed when
3402 multiple channels of the same type exist, such as multiple
3403 display channels in a multihead setup (json-int)
3404 - "tls": whether the channel is encrypted (json-bool)
3406 Example:
3408 -> { "execute": "query-spice" }
3409 <- {
3410 "return": {
3411 "enabled": true,
3412 "auth": "spice",
3413 "port": 5920,
3414 "tls-port": 5921,
3415 "host": "0.0.0.0",
3416 "channels": [
3418 "port": "54924",
3419 "family": "ipv4",
3420 "channel-type": 1,
3421 "connection-id": 1804289383,
3422 "host": "127.0.0.1",
3423 "channel-id": 0,
3424 "tls": true
3427 "port": "36710",
3428 "family": "ipv4",
3429 "channel-type": 4,
3430 "connection-id": 1804289383,
3431 "host": "127.0.0.1",
3432 "channel-id": 0,
3433 "tls": false
3435 [ ... more channels follow ... ]
3440 EQMP
3442 #if defined(CONFIG_SPICE)
3444 .name = "query-spice",
3445 .args_type = "",
3446 .mhandler.cmd_new = qmp_marshal_query_spice,
3448 #endif
3450 SQMP
3451 query-name
3452 ----------
3454 Show VM name.
3456 Return a json-object with the following information:
3458 - "name": VM's name (json-string, optional)
3460 Example:
3462 -> { "execute": "query-name" }
3463 <- { "return": { "name": "qemu-name" } }
3465 EQMP
3468 .name = "query-name",
3469 .args_type = "",
3470 .mhandler.cmd_new = qmp_marshal_query_name,
3473 SQMP
3474 query-uuid
3475 ----------
3477 Show VM UUID.
3479 Return a json-object with the following information:
3481 - "UUID": Universally Unique Identifier (json-string)
3483 Example:
3485 -> { "execute": "query-uuid" }
3486 <- { "return": { "UUID": "550e8400-e29b-41d4-a716-446655440000" } }
3488 EQMP
3491 .name = "query-uuid",
3492 .args_type = "",
3493 .mhandler.cmd_new = qmp_marshal_query_uuid,
3496 SQMP
3497 query-command-line-options
3498 --------------------------
3500 Show command line option schema.
3502 Return a json-array of command line option schema for all options (or for
3503 the given option), returning an error if the given option doesn't exist.
3505 Each array entry contains the following:
3507 - "option": option name (json-string)
3508 - "parameters": a json-array describes all parameters of the option:
3509 - "name": parameter name (json-string)
3510 - "type": parameter type (one of 'string', 'boolean', 'number',
3511 or 'size')
3512 - "help": human readable description of the parameter
3513 (json-string, optional)
3514 - "default": default value string for the parameter
3515 (json-string, optional)
3517 Example:
3519 -> { "execute": "query-command-line-options", "arguments": { "option": "option-rom" } }
3520 <- { "return": [
3522 "parameters": [
3524 "name": "romfile",
3525 "type": "string"
3528 "name": "bootindex",
3529 "type": "number"
3532 "option": "option-rom"
3537 EQMP
3540 .name = "query-command-line-options",
3541 .args_type = "option:s?",
3542 .mhandler.cmd_new = qmp_marshal_query_command_line_options,
3545 SQMP
3546 query-migrate
3547 -------------
3549 Migration status.
3551 Return a json-object. If migration is active there will be another json-object
3552 with RAM migration status and if block migration is active another one with
3553 block migration status.
3555 The main json-object contains the following:
3557 - "status": migration status (json-string)
3558 - Possible values: "setup", "active", "completed", "failed", "cancelled"
3559 - "total-time": total amount of ms since migration started. If
3560 migration has ended, it returns the total migration
3561 time (json-int)
3562 - "setup-time" amount of setup time in milliseconds _before_ the
3563 iterations begin but _after_ the QMP command is issued.
3564 This is designed to provide an accounting of any activities
3565 (such as RDMA pinning) which may be expensive, but do not
3566 actually occur during the iterative migration rounds
3567 themselves. (json-int)
3568 - "downtime": only present when migration has finished correctly
3569 total amount in ms for downtime that happened (json-int)
3570 - "expected-downtime": only present while migration is active
3571 total amount in ms for downtime that was calculated on
3572 the last bitmap round (json-int)
3573 - "ram": only present if "status" is "active", it is a json-object with the
3574 following RAM information:
3575 - "transferred": amount transferred in bytes (json-int)
3576 - "remaining": amount remaining to transfer in bytes (json-int)
3577 - "total": total amount of memory in bytes (json-int)
3578 - "duplicate": number of pages filled entirely with the same
3579 byte (json-int)
3580 These are sent over the wire much more efficiently.
3581 - "skipped": number of skipped zero pages (json-int)
3582 - "normal" : number of whole pages transferred. I.e. they
3583 were not sent as duplicate or xbzrle pages (json-int)
3584 - "normal-bytes" : number of bytes transferred in whole
3585 pages. This is just normal pages times size of one page,
3586 but this way upper levels don't need to care about page
3587 size (json-int)
3588 - "dirty-sync-count": times that dirty ram was synchronized (json-int)
3589 - "disk": only present if "status" is "active" and it is a block migration,
3590 it is a json-object with the following disk information:
3591 - "transferred": amount transferred in bytes (json-int)
3592 - "remaining": amount remaining to transfer in bytes json-int)
3593 - "total": total disk size in bytes (json-int)
3594 - "xbzrle-cache": only present if XBZRLE is active.
3595 It is a json-object with the following XBZRLE information:
3596 - "cache-size": XBZRLE cache size in bytes
3597 - "bytes": number of bytes transferred for XBZRLE compressed pages
3598 - "pages": number of XBZRLE compressed pages
3599 - "cache-miss": number of XBRZRLE page cache misses
3600 - "cache-miss-rate": rate of XBRZRLE page cache misses
3601 - "overflow": number of times XBZRLE overflows. This means
3602 that the XBZRLE encoding was bigger than just sent the
3603 whole page, and then we sent the whole page instead (as as
3604 normal page).
3606 Examples:
3608 1. Before the first migration
3610 -> { "execute": "query-migrate" }
3611 <- { "return": {} }
3613 2. Migration is done and has succeeded
3615 -> { "execute": "query-migrate" }
3616 <- { "return": {
3617 "status": "completed",
3618 "ram":{
3619 "transferred":123,
3620 "remaining":123,
3621 "total":246,
3622 "total-time":12345,
3623 "setup-time":12345,
3624 "downtime":12345,
3625 "duplicate":123,
3626 "normal":123,
3627 "normal-bytes":123456,
3628 "dirty-sync-count":15
3633 3. Migration is done and has failed
3635 -> { "execute": "query-migrate" }
3636 <- { "return": { "status": "failed" } }
3638 4. Migration is being performed and is not a block migration:
3640 -> { "execute": "query-migrate" }
3641 <- {
3642 "return":{
3643 "status":"active",
3644 "ram":{
3645 "transferred":123,
3646 "remaining":123,
3647 "total":246,
3648 "total-time":12345,
3649 "setup-time":12345,
3650 "expected-downtime":12345,
3651 "duplicate":123,
3652 "normal":123,
3653 "normal-bytes":123456,
3654 "dirty-sync-count":15
3659 5. Migration is being performed and is a block migration:
3661 -> { "execute": "query-migrate" }
3662 <- {
3663 "return":{
3664 "status":"active",
3665 "ram":{
3666 "total":1057024,
3667 "remaining":1053304,
3668 "transferred":3720,
3669 "total-time":12345,
3670 "setup-time":12345,
3671 "expected-downtime":12345,
3672 "duplicate":123,
3673 "normal":123,
3674 "normal-bytes":123456,
3675 "dirty-sync-count":15
3677 "disk":{
3678 "total":20971520,
3679 "remaining":20880384,
3680 "transferred":91136
3685 6. Migration is being performed and XBZRLE is active:
3687 -> { "execute": "query-migrate" }
3688 <- {
3689 "return":{
3690 "status":"active",
3691 "capabilities" : [ { "capability": "xbzrle", "state" : true } ],
3692 "ram":{
3693 "total":1057024,
3694 "remaining":1053304,
3695 "transferred":3720,
3696 "total-time":12345,
3697 "setup-time":12345,
3698 "expected-downtime":12345,
3699 "duplicate":10,
3700 "normal":3333,
3701 "normal-bytes":3412992,
3702 "dirty-sync-count":15
3704 "xbzrle-cache":{
3705 "cache-size":67108864,
3706 "bytes":20971520,
3707 "pages":2444343,
3708 "cache-miss":2244,
3709 "cache-miss-rate":0.123,
3710 "overflow":34434
3715 EQMP
3718 .name = "query-migrate",
3719 .args_type = "",
3720 .mhandler.cmd_new = qmp_marshal_query_migrate,
3723 SQMP
3724 migrate-set-capabilities
3725 ------------------------
3727 Enable/Disable migration capabilities
3729 - "xbzrle": XBZRLE support
3730 - "rdma-pin-all": pin all pages when using RDMA during migration
3731 - "auto-converge": throttle down guest to help convergence of migration
3732 - "zero-blocks": compress zero blocks during block migration
3733 - "compress": use multiple compression threads to accelerate live migration
3734 - "events": generate events for each migration state change
3735 - "postcopy-ram": postcopy mode for live migration
3737 Arguments:
3739 Example:
3741 -> { "execute": "migrate-set-capabilities" , "arguments":
3742 { "capabilities": [ { "capability": "xbzrle", "state": true } ] } }
3744 EQMP
3747 .name = "migrate-set-capabilities",
3748 .args_type = "capabilities:q",
3749 .params = "capability:s,state:b",
3750 .mhandler.cmd_new = qmp_marshal_migrate_set_capabilities,
3752 SQMP
3753 query-migrate-capabilities
3754 --------------------------
3756 Query current migration capabilities
3758 - "capabilities": migration capabilities state
3759 - "xbzrle" : XBZRLE state (json-bool)
3760 - "rdma-pin-all" : RDMA Pin Page state (json-bool)
3761 - "auto-converge" : Auto Converge state (json-bool)
3762 - "zero-blocks" : Zero Blocks state (json-bool)
3763 - "compress": Multiple compression threads state (json-bool)
3764 - "events": Migration state change event state (json-bool)
3765 - "postcopy-ram": postcopy ram state (json-bool)
3767 Arguments:
3769 Example:
3771 -> { "execute": "query-migrate-capabilities" }
3772 <- {"return": [
3773 {"state": false, "capability": "xbzrle"},
3774 {"state": false, "capability": "rdma-pin-all"},
3775 {"state": false, "capability": "auto-converge"},
3776 {"state": false, "capability": "zero-blocks"},
3777 {"state": false, "capability": "compress"},
3778 {"state": true, "capability": "events"},
3779 {"state": false, "capability": "postcopy-ram"}
3782 EQMP
3785 .name = "query-migrate-capabilities",
3786 .args_type = "",
3787 .mhandler.cmd_new = qmp_marshal_query_migrate_capabilities,
3790 SQMP
3791 migrate-set-parameters
3792 ----------------------
3794 Set migration parameters
3796 - "compress-level": set compression level during migration (json-int)
3797 - "compress-threads": set compression thread count for migration (json-int)
3798 - "decompress-threads": set decompression thread count for migration (json-int)
3799 - "cpu-throttle-initial": set initial percentage of time guest cpus are
3800 throttled for auto-converge (json-int)
3801 - "cpu-throttle-increment": set throttle increasing percentage for
3802 auto-converge (json-int)
3804 Arguments:
3806 Example:
3808 -> { "execute": "migrate-set-parameters" , "arguments":
3809 { "compress-level": 1 } }
3811 EQMP
3814 .name = "migrate-set-parameters",
3815 .args_type =
3816 "compress-level:i?,compress-threads:i?,decompress-threads:i?,cpu-throttle-initial:i?,cpu-throttle-increment:i?",
3817 .mhandler.cmd_new = qmp_marshal_migrate_set_parameters,
3819 SQMP
3820 query-migrate-parameters
3821 ------------------------
3823 Query current migration parameters
3825 - "parameters": migration parameters value
3826 - "compress-level" : compression level value (json-int)
3827 - "compress-threads" : compression thread count value (json-int)
3828 - "decompress-threads" : decompression thread count value (json-int)
3829 - "cpu-throttle-initial" : initial percentage of time guest cpus are
3830 throttled (json-int)
3831 - "cpu-throttle-increment" : throttle increasing percentage for
3832 auto-converge (json-int)
3834 Arguments:
3836 Example:
3838 -> { "execute": "query-migrate-parameters" }
3839 <- {
3840 "return": {
3841 "decompress-threads": 2,
3842 "cpu-throttle-increment": 10,
3843 "compress-threads": 8,
3844 "compress-level": 1,
3845 "cpu-throttle-initial": 20
3849 EQMP
3852 .name = "query-migrate-parameters",
3853 .args_type = "",
3854 .mhandler.cmd_new = qmp_marshal_query_migrate_parameters,
3857 SQMP
3858 query-balloon
3859 -------------
3861 Show balloon information.
3863 Make an asynchronous request for balloon info. When the request completes a
3864 json-object will be returned containing the following data:
3866 - "actual": current balloon value in bytes (json-int)
3868 Example:
3870 -> { "execute": "query-balloon" }
3871 <- {
3872 "return":{
3873 "actual":1073741824,
3877 EQMP
3880 .name = "query-balloon",
3881 .args_type = "",
3882 .mhandler.cmd_new = qmp_marshal_query_balloon,
3886 .name = "query-block-jobs",
3887 .args_type = "",
3888 .mhandler.cmd_new = qmp_marshal_query_block_jobs,
3892 .name = "qom-list",
3893 .args_type = "path:s",
3894 .mhandler.cmd_new = qmp_marshal_qom_list,
3898 .name = "qom-set",
3899 .args_type = "path:s,property:s,value:q",
3900 .mhandler.cmd_new = qmp_marshal_qom_set,
3904 .name = "qom-get",
3905 .args_type = "path:s,property:s",
3906 .mhandler.cmd_new = qmp_marshal_qom_get,
3910 .name = "nbd-server-start",
3911 .args_type = "addr:q,tls-creds:s?",
3912 .mhandler.cmd_new = qmp_marshal_nbd_server_start,
3915 .name = "nbd-server-add",
3916 .args_type = "device:B,writable:b?",
3917 .mhandler.cmd_new = qmp_marshal_nbd_server_add,
3920 .name = "nbd-server-stop",
3921 .args_type = "",
3922 .mhandler.cmd_new = qmp_marshal_nbd_server_stop,
3926 .name = "change-vnc-password",
3927 .args_type = "password:s",
3928 .mhandler.cmd_new = qmp_marshal_change_vnc_password,
3931 .name = "qom-list-types",
3932 .args_type = "implements:s?,abstract:b?",
3933 .mhandler.cmd_new = qmp_marshal_qom_list_types,
3937 .name = "device-list-properties",
3938 .args_type = "typename:s",
3939 .mhandler.cmd_new = qmp_marshal_device_list_properties,
3943 .name = "query-machines",
3944 .args_type = "",
3945 .mhandler.cmd_new = qmp_marshal_query_machines,
3949 .name = "query-cpu-definitions",
3950 .args_type = "",
3951 .mhandler.cmd_new = qmp_marshal_query_cpu_definitions,
3955 .name = "query-cpu-model-expansion",
3956 .args_type = "type:s,model:q",
3957 .mhandler.cmd_new = qmp_marshal_query_cpu_model_expansion,
3961 .name = "query-cpu-model-comparison",
3962 .args_type = "modela:q,modelb:q",
3963 .mhandler.cmd_new = qmp_marshal_query_cpu_model_comparison,
3967 .name = "query-cpu-model-baseline",
3968 .args_type = "modela:q,modelb:q",
3969 .mhandler.cmd_new = qmp_marshal_query_cpu_model_baseline,
3973 .name = "query-target",
3974 .args_type = "",
3975 .mhandler.cmd_new = qmp_marshal_query_target,
3979 .name = "query-tpm",
3980 .args_type = "",
3981 .mhandler.cmd_new = qmp_marshal_query_tpm,
3984 SQMP
3985 query-tpm
3986 ---------
3988 Return information about the TPM device.
3990 Arguments: None
3992 Example:
3994 -> { "execute": "query-tpm" }
3995 <- { "return":
3997 { "model": "tpm-tis",
3998 "options":
3999 { "type": "passthrough",
4000 "data":
4001 { "cancel-path": "/sys/class/misc/tpm0/device/cancel",
4002 "path": "/dev/tpm0"
4005 "id": "tpm0"
4010 EQMP
4013 .name = "query-tpm-models",
4014 .args_type = "",
4015 .mhandler.cmd_new = qmp_marshal_query_tpm_models,
4018 SQMP
4019 query-tpm-models
4020 ----------------
4022 Return a list of supported TPM models.
4024 Arguments: None
4026 Example:
4028 -> { "execute": "query-tpm-models" }
4029 <- { "return": [ "tpm-tis" ] }
4031 EQMP
4034 .name = "query-tpm-types",
4035 .args_type = "",
4036 .mhandler.cmd_new = qmp_marshal_query_tpm_types,
4039 SQMP
4040 query-tpm-types
4041 ---------------
4043 Return a list of supported TPM types.
4045 Arguments: None
4047 Example:
4049 -> { "execute": "query-tpm-types" }
4050 <- { "return": [ "passthrough" ] }
4052 EQMP
4055 .name = "chardev-add",
4056 .args_type = "id:s,backend:q",
4057 .mhandler.cmd_new = qmp_marshal_chardev_add,
4060 SQMP
4061 chardev-add
4062 ----------------
4064 Add a chardev.
4066 Arguments:
4068 - "id": the chardev's ID, must be unique (json-string)
4069 - "backend": chardev backend type + parameters
4071 Examples:
4073 -> { "execute" : "chardev-add",
4074 "arguments" : { "id" : "foo",
4075 "backend" : { "type" : "null", "data" : {} } } }
4076 <- { "return": {} }
4078 -> { "execute" : "chardev-add",
4079 "arguments" : { "id" : "bar",
4080 "backend" : { "type" : "file",
4081 "data" : { "out" : "/tmp/bar.log" } } } }
4082 <- { "return": {} }
4084 -> { "execute" : "chardev-add",
4085 "arguments" : { "id" : "baz",
4086 "backend" : { "type" : "pty", "data" : {} } } }
4087 <- { "return": { "pty" : "/dev/pty/42" } }
4089 EQMP
4092 .name = "chardev-remove",
4093 .args_type = "id:s",
4094 .mhandler.cmd_new = qmp_marshal_chardev_remove,
4098 SQMP
4099 chardev-remove
4100 --------------
4102 Remove a chardev.
4104 Arguments:
4106 - "id": the chardev's ID, must exist and not be in use (json-string)
4108 Example:
4110 -> { "execute": "chardev-remove", "arguments": { "id" : "foo" } }
4111 <- { "return": {} }
4113 EQMP
4115 .name = "query-rx-filter",
4116 .args_type = "name:s?",
4117 .mhandler.cmd_new = qmp_marshal_query_rx_filter,
4120 SQMP
4121 query-rx-filter
4122 ---------------
4124 Show rx-filter information.
4126 Returns a json-array of rx-filter information for all NICs (or for the
4127 given NIC), returning an error if the given NIC doesn't exist, or
4128 given NIC doesn't support rx-filter querying, or given net client
4129 isn't a NIC.
4131 The query will clear the event notification flag of each NIC, then qemu
4132 will start to emit event to QMP monitor.
4134 Each array entry contains the following:
4136 - "name": net client name (json-string)
4137 - "promiscuous": promiscuous mode is enabled (json-bool)
4138 - "multicast": multicast receive state (one of 'normal', 'none', 'all')
4139 - "unicast": unicast receive state (one of 'normal', 'none', 'all')
4140 - "vlan": vlan receive state (one of 'normal', 'none', 'all') (Since 2.0)
4141 - "broadcast-allowed": allow to receive broadcast (json-bool)
4142 - "multicast-overflow": multicast table is overflowed (json-bool)
4143 - "unicast-overflow": unicast table is overflowed (json-bool)
4144 - "main-mac": main macaddr string (json-string)
4145 - "vlan-table": a json-array of active vlan id
4146 - "unicast-table": a json-array of unicast macaddr string
4147 - "multicast-table": a json-array of multicast macaddr string
4149 Example:
4151 -> { "execute": "query-rx-filter", "arguments": { "name": "vnet0" } }
4152 <- { "return": [
4154 "promiscuous": true,
4155 "name": "vnet0",
4156 "main-mac": "52:54:00:12:34:56",
4157 "unicast": "normal",
4158 "vlan": "normal",
4159 "vlan-table": [
4163 "unicast-table": [
4165 "multicast": "normal",
4166 "multicast-overflow": false,
4167 "unicast-overflow": false,
4168 "multicast-table": [
4169 "01:00:5e:00:00:01",
4170 "33:33:00:00:00:01",
4171 "33:33:ff:12:34:56"
4173 "broadcast-allowed": false
4178 EQMP
4181 .name = "blockdev-add",
4182 .args_type = "options:q",
4183 .mhandler.cmd_new = qmp_marshal_blockdev_add,
4186 SQMP
4187 blockdev-add
4188 ------------
4190 Add a block device.
4192 This command is still a work in progress. It doesn't support all
4193 block drivers among other things. Stay away from it unless you want
4194 to help with its development.
4196 Arguments:
4198 - "options": block driver options
4200 Example (1):
4202 -> { "execute": "blockdev-add",
4203 "arguments": { "options" : { "driver": "qcow2",
4204 "file": { "driver": "file",
4205 "filename": "test.qcow2" } } } }
4206 <- { "return": {} }
4208 Example (2):
4210 -> { "execute": "blockdev-add",
4211 "arguments": {
4212 "options": {
4213 "driver": "qcow2",
4214 "id": "my_disk",
4215 "discard": "unmap",
4216 "cache": {
4217 "direct": true,
4218 "writeback": true
4220 "file": {
4221 "driver": "file",
4222 "filename": "/tmp/test.qcow2"
4224 "backing": {
4225 "driver": "raw",
4226 "file": {
4227 "driver": "file",
4228 "filename": "/dev/fdset/4"
4235 <- { "return": {} }
4237 EQMP
4240 .name = "x-blockdev-del",
4241 .args_type = "id:s?,node-name:s?",
4242 .mhandler.cmd_new = qmp_marshal_x_blockdev_del,
4245 SQMP
4246 x-blockdev-del
4247 ------------
4248 Since 2.5
4250 Deletes a block device thas has been added using blockdev-add.
4251 The selected device can be either a block backend or a graph node.
4253 In the former case the backend will be destroyed, along with its
4254 inserted medium if there's any. The command will fail if the backend
4255 or its medium are in use.
4257 In the latter case the node will be destroyed. The command will fail
4258 if the node is attached to a block backend or is otherwise being
4259 used.
4261 One of "id" or "node-name" must be specified, but not both.
4263 This command is still a work in progress and is considered
4264 experimental. Stay away from it unless you want to help with its
4265 development.
4267 Arguments:
4269 - "id": Name of the block backend device to delete (json-string, optional)
4270 - "node-name": Name of the graph node to delete (json-string, optional)
4272 Example:
4274 -> { "execute": "blockdev-add",
4275 "arguments": {
4276 "options": {
4277 "driver": "qcow2",
4278 "id": "drive0",
4279 "file": {
4280 "driver": "file",
4281 "filename": "test.qcow2"
4287 <- { "return": {} }
4289 -> { "execute": "x-blockdev-del",
4290 "arguments": { "id": "drive0" }
4292 <- { "return": {} }
4294 EQMP
4297 .name = "blockdev-open-tray",
4298 .args_type = "device:s,force:b?",
4299 .mhandler.cmd_new = qmp_marshal_blockdev_open_tray,
4302 SQMP
4303 blockdev-open-tray
4304 ------------------
4306 Opens a block device's tray. If there is a block driver state tree inserted as a
4307 medium, it will become inaccessible to the guest (but it will remain associated
4308 to the block device, so closing the tray will make it accessible again).
4310 If the tray was already open before, this will be a no-op.
4312 Once the tray opens, a DEVICE_TRAY_MOVED event is emitted. There are cases in
4313 which no such event will be generated, these include:
4314 - if the guest has locked the tray, @force is false and the guest does not
4315 respond to the eject request
4316 - if the BlockBackend denoted by @device does not have a guest device attached
4317 to it
4318 - if the guest device does not have an actual tray and is empty, for instance
4319 for floppy disk drives
4321 Arguments:
4323 - "device": block device name (json-string)
4324 - "force": if false (the default), an eject request will be sent to the guest if
4325 it has locked the tray (and the tray will not be opened immediately);
4326 if true, the tray will be opened regardless of whether it is locked
4327 (json-bool, optional)
4329 Example:
4331 -> { "execute": "blockdev-open-tray",
4332 "arguments": { "device": "ide1-cd0" } }
4334 <- { "timestamp": { "seconds": 1418751016,
4335 "microseconds": 716996 },
4336 "event": "DEVICE_TRAY_MOVED",
4337 "data": { "device": "ide1-cd0",
4338 "tray-open": true } }
4340 <- { "return": {} }
4342 EQMP
4345 .name = "blockdev-close-tray",
4346 .args_type = "device:s",
4347 .mhandler.cmd_new = qmp_marshal_blockdev_close_tray,
4350 SQMP
4351 blockdev-close-tray
4352 -------------------
4354 Closes a block device's tray. If there is a block driver state tree associated
4355 with the block device (which is currently ejected), that tree will be loaded as
4356 the medium.
4358 If the tray was already closed before, this will be a no-op.
4360 Arguments:
4362 - "device": block device name (json-string)
4364 Example:
4366 -> { "execute": "blockdev-close-tray",
4367 "arguments": { "device": "ide1-cd0" } }
4369 <- { "timestamp": { "seconds": 1418751345,
4370 "microseconds": 272147 },
4371 "event": "DEVICE_TRAY_MOVED",
4372 "data": { "device": "ide1-cd0",
4373 "tray-open": false } }
4375 <- { "return": {} }
4377 EQMP
4380 .name = "x-blockdev-remove-medium",
4381 .args_type = "device:s",
4382 .mhandler.cmd_new = qmp_marshal_x_blockdev_remove_medium,
4385 SQMP
4386 x-blockdev-remove-medium
4387 ------------------------
4389 Removes a medium (a block driver state tree) from a block device. That block
4390 device's tray must currently be open (unless there is no attached guest device).
4392 If the tray is open and there is no medium inserted, this will be a no-op.
4394 This command is still a work in progress and is considered experimental.
4395 Stay away from it unless you want to help with its development.
4397 Arguments:
4399 - "device": block device name (json-string)
4401 Example:
4403 -> { "execute": "x-blockdev-remove-medium",
4404 "arguments": { "device": "ide1-cd0" } }
4406 <- { "error": { "class": "GenericError",
4407 "desc": "Tray of device 'ide1-cd0' is not open" } }
4409 -> { "execute": "blockdev-open-tray",
4410 "arguments": { "device": "ide1-cd0" } }
4412 <- { "timestamp": { "seconds": 1418751627,
4413 "microseconds": 549958 },
4414 "event": "DEVICE_TRAY_MOVED",
4415 "data": { "device": "ide1-cd0",
4416 "tray-open": true } }
4418 <- { "return": {} }
4420 -> { "execute": "x-blockdev-remove-medium",
4421 "arguments": { "device": "ide1-cd0" } }
4423 <- { "return": {} }
4425 EQMP
4428 .name = "x-blockdev-insert-medium",
4429 .args_type = "device:s,node-name:s",
4430 .mhandler.cmd_new = qmp_marshal_x_blockdev_insert_medium,
4433 SQMP
4434 x-blockdev-insert-medium
4435 ------------------------
4437 Inserts a medium (a block driver state tree) into a block device. That block
4438 device's tray must currently be open (unless there is no attached guest device)
4439 and there must be no medium inserted already.
4441 This command is still a work in progress and is considered experimental.
4442 Stay away from it unless you want to help with its development.
4444 Arguments:
4446 - "device": block device name (json-string)
4447 - "node-name": root node of the BDS tree to insert into the block device
4449 Example:
4451 -> { "execute": "blockdev-add",
4452 "arguments": { "options": { "node-name": "node0",
4453 "driver": "raw",
4454 "file": { "driver": "file",
4455 "filename": "fedora.iso" } } } }
4457 <- { "return": {} }
4459 -> { "execute": "x-blockdev-insert-medium",
4460 "arguments": { "device": "ide1-cd0",
4461 "node-name": "node0" } }
4463 <- { "return": {} }
4465 EQMP
4468 .name = "x-blockdev-change",
4469 .args_type = "parent:B,child:B?,node:B?",
4470 .mhandler.cmd_new = qmp_marshal_x_blockdev_change,
4473 SQMP
4474 x-blockdev-change
4475 -----------------
4477 Dynamically reconfigure the block driver state graph. It can be used
4478 to add, remove, insert or replace a graph node. Currently only the
4479 Quorum driver implements this feature to add or remove its child. This
4480 is useful to fix a broken quorum child.
4482 If @node is specified, it will be inserted under @parent. @child
4483 may not be specified in this case. If both @parent and @child are
4484 specified but @node is not, @child will be detached from @parent.
4486 Arguments:
4487 - "parent": the id or name of the parent node (json-string)
4488 - "child": the name of a child under the given parent node (json-string, optional)
4489 - "node": the name of the node that will be added (json-string, optional)
4491 Note: this command is experimental, and not a stable API. It doesn't
4492 support all kinds of operations, all kinds of children, nor all block
4493 drivers.
4495 Warning: The data in a new quorum child MUST be consistent with that of
4496 the rest of the array.
4498 Example:
4500 Add a new node to a quorum
4501 -> { "execute": "blockdev-add",
4502 "arguments": { "options": { "driver": "raw",
4503 "node-name": "new_node",
4504 "file": { "driver": "file",
4505 "filename": "test.raw" } } } }
4506 <- { "return": {} }
4507 -> { "execute": "x-blockdev-change",
4508 "arguments": { "parent": "disk1",
4509 "node": "new_node" } }
4510 <- { "return": {} }
4512 Delete a quorum's node
4513 -> { "execute": "x-blockdev-change",
4514 "arguments": { "parent": "disk1",
4515 "child": "children.1" } }
4516 <- { "return": {} }
4518 EQMP
4521 .name = "query-named-block-nodes",
4522 .args_type = "",
4523 .mhandler.cmd_new = qmp_marshal_query_named_block_nodes,
4526 SQMP
4527 @query-named-block-nodes
4528 ------------------------
4530 Return a list of BlockDeviceInfo for all the named block driver nodes
4532 Example:
4534 -> { "execute": "query-named-block-nodes" }
4535 <- { "return": [ { "ro":false,
4536 "drv":"qcow2",
4537 "encrypted":false,
4538 "file":"disks/test.qcow2",
4539 "node-name": "my-node",
4540 "backing_file_depth":1,
4541 "bps":1000000,
4542 "bps_rd":0,
4543 "bps_wr":0,
4544 "iops":1000000,
4545 "iops_rd":0,
4546 "iops_wr":0,
4547 "bps_max": 8000000,
4548 "bps_rd_max": 0,
4549 "bps_wr_max": 0,
4550 "iops_max": 0,
4551 "iops_rd_max": 0,
4552 "iops_wr_max": 0,
4553 "iops_size": 0,
4554 "write_threshold": 0,
4555 "image":{
4556 "filename":"disks/test.qcow2",
4557 "format":"qcow2",
4558 "virtual-size":2048000,
4559 "backing_file":"base.qcow2",
4560 "full-backing-filename":"disks/base.qcow2",
4561 "backing-filename-format":"qcow2",
4562 "snapshots":[
4564 "id": "1",
4565 "name": "snapshot1",
4566 "vm-state-size": 0,
4567 "date-sec": 10000200,
4568 "date-nsec": 12,
4569 "vm-clock-sec": 206,
4570 "vm-clock-nsec": 30
4573 "backing-image":{
4574 "filename":"disks/base.qcow2",
4575 "format":"qcow2",
4576 "virtual-size":2048000
4578 } } ] }
4580 EQMP
4583 .name = "blockdev-change-medium",
4584 .args_type = "device:B,filename:F,format:s?,read-only-mode:s?",
4585 .mhandler.cmd_new = qmp_marshal_blockdev_change_medium,
4588 SQMP
4589 blockdev-change-medium
4590 ----------------------
4592 Changes the medium inserted into a block device by ejecting the current medium
4593 and loading a new image file which is inserted as the new medium.
4595 Arguments:
4597 - "device": device name (json-string)
4598 - "filename": filename of the new image (json-string)
4599 - "format": format of the new image (json-string, optional)
4600 - "read-only-mode": new read-only mode (json-string, optional)
4601 - Possible values: "retain" (default), "read-only", "read-write"
4603 Examples:
4605 1. Change a removable medium
4607 -> { "execute": "blockdev-change-medium",
4608 "arguments": { "device": "ide1-cd0",
4609 "filename": "/srv/images/Fedora-12-x86_64-DVD.iso",
4610 "format": "raw" } }
4611 <- { "return": {} }
4613 2. Load a read-only medium into a writable drive
4615 -> { "execute": "blockdev-change-medium",
4616 "arguments": { "device": "isa-fd0",
4617 "filename": "/srv/images/ro.img",
4618 "format": "raw",
4619 "read-only-mode": "retain" } }
4621 <- { "error":
4622 { "class": "GenericError",
4623 "desc": "Could not open '/srv/images/ro.img': Permission denied" } }
4625 -> { "execute": "blockdev-change-medium",
4626 "arguments": { "device": "isa-fd0",
4627 "filename": "/srv/images/ro.img",
4628 "format": "raw",
4629 "read-only-mode": "read-only" } }
4631 <- { "return": {} }
4633 EQMP
4636 .name = "query-memdev",
4637 .args_type = "",
4638 .mhandler.cmd_new = qmp_marshal_query_memdev,
4641 SQMP
4642 query-memdev
4643 ------------
4645 Show memory devices information.
4648 Example (1):
4650 -> { "execute": "query-memdev" }
4651 <- { "return": [
4653 "size": 536870912,
4654 "merge": false,
4655 "dump": true,
4656 "prealloc": false,
4657 "host-nodes": [0, 1],
4658 "policy": "bind"
4661 "size": 536870912,
4662 "merge": false,
4663 "dump": true,
4664 "prealloc": true,
4665 "host-nodes": [2, 3],
4666 "policy": "preferred"
4671 EQMP
4674 .name = "query-memory-devices",
4675 .args_type = "",
4676 .mhandler.cmd_new = qmp_marshal_query_memory_devices,
4679 SQMP
4680 @query-memory-devices
4681 --------------------
4683 Return a list of memory devices.
4685 Example:
4686 -> { "execute": "query-memory-devices" }
4687 <- { "return": [ { "data":
4688 { "addr": 5368709120,
4689 "hotpluggable": true,
4690 "hotplugged": true,
4691 "id": "d1",
4692 "memdev": "/objects/memX",
4693 "node": 0,
4694 "size": 1073741824,
4695 "slot": 0},
4696 "type": "dimm"
4697 } ] }
4698 EQMP
4701 .name = "query-acpi-ospm-status",
4702 .args_type = "",
4703 .mhandler.cmd_new = qmp_marshal_query_acpi_ospm_status,
4706 SQMP
4707 @query-acpi-ospm-status
4708 --------------------
4710 Return list of ACPIOSTInfo for devices that support status reporting
4711 via ACPI _OST method.
4713 Example:
4714 -> { "execute": "query-acpi-ospm-status" }
4715 <- { "return": [ { "device": "d1", "slot": "0", "slot-type": "DIMM", "source": 1, "status": 0},
4716 { "slot": "1", "slot-type": "DIMM", "source": 0, "status": 0},
4717 { "slot": "2", "slot-type": "DIMM", "source": 0, "status": 0},
4718 { "slot": "3", "slot-type": "DIMM", "source": 0, "status": 0}
4720 EQMP
4722 #if defined TARGET_I386
4724 .name = "rtc-reset-reinjection",
4725 .args_type = "",
4726 .mhandler.cmd_new = qmp_marshal_rtc_reset_reinjection,
4728 #endif
4730 SQMP
4731 rtc-reset-reinjection
4732 ---------------------
4734 Reset the RTC interrupt reinjection backlog.
4736 Arguments: None.
4738 Example:
4740 -> { "execute": "rtc-reset-reinjection" }
4741 <- { "return": {} }
4742 EQMP
4745 .name = "trace-event-get-state",
4746 .args_type = "name:s,vcpu:i?",
4747 .mhandler.cmd_new = qmp_marshal_trace_event_get_state,
4750 SQMP
4751 trace-event-get-state
4752 ---------------------
4754 Query the state of events.
4756 Arguments:
4758 - "name": Event name pattern (json-string).
4759 - "vcpu": The vCPU to query, any vCPU by default (json-int, optional).
4761 An event is returned if:
4762 - its name matches the "name" pattern, and
4763 - if "vcpu" is given, the event has the "vcpu" property.
4765 Therefore, if "vcpu" is given, the operation will only match per-vCPU events,
4766 returning their state on the specified vCPU. Special case: if "name" is an exact
4767 match, "vcpu" is given and the event does not have the "vcpu" property, an error
4768 is returned.
4770 Example:
4772 -> { "execute": "trace-event-get-state", "arguments": { "name": "qemu_memalign" } }
4773 <- { "return": [ { "name": "qemu_memalign", "state": "disabled" } ] }
4774 EQMP
4777 .name = "trace-event-set-state",
4778 .args_type = "name:s,enable:b,ignore-unavailable:b?,vcpu:i?",
4779 .mhandler.cmd_new = qmp_marshal_trace_event_set_state,
4782 SQMP
4783 trace-event-set-state
4784 ---------------------
4786 Set the state of events.
4788 Arguments:
4790 - "name": Event name pattern (json-string).
4791 - "enable": Whether to enable or disable the event (json-bool).
4792 - "ignore-unavailable": Whether to ignore errors for events that cannot be
4793 changed (json-bool, optional).
4794 - "vcpu": The vCPU to act upon, all vCPUs by default (json-int, optional).
4796 An event's state is modified if:
4797 - its name matches the "name" pattern, and
4798 - if "vcpu" is given, the event has the "vcpu" property.
4800 Therefore, if "vcpu" is given, the operation will only match per-vCPU events,
4801 setting their state on the specified vCPU. Special case: if "name" is an exact
4802 match, "vcpu" is given and the event does not have the "vcpu" property, an error
4803 is returned.
4805 Example:
4807 -> { "execute": "trace-event-set-state", "arguments": { "name": "qemu_memalign", "enable": "true" } }
4808 <- { "return": {} }
4809 EQMP
4812 .name = "input-send-event",
4813 .args_type = "console:i?,events:q",
4814 .mhandler.cmd_new = qmp_marshal_input_send_event,
4817 SQMP
4818 @input-send-event
4819 -----------------
4821 Send input event to guest.
4823 Arguments:
4825 - "device": display device (json-string, optional)
4826 - "head": display head (json-int, optional)
4827 - "events": list of input events
4829 The consoles are visible in the qom tree, under
4830 /backend/console[$index]. They have a device link and head property, so
4831 it is possible to map which console belongs to which device and display.
4833 Example (1):
4835 Press left mouse button.
4837 -> { "execute": "input-send-event",
4838 "arguments": { "device": "video0",
4839 "events": [ { "type": "btn",
4840 "data" : { "down": true, "button": "left" } } ] } }
4841 <- { "return": {} }
4843 -> { "execute": "input-send-event",
4844 "arguments": { "device": "video0",
4845 "events": [ { "type": "btn",
4846 "data" : { "down": false, "button": "left" } } ] } }
4847 <- { "return": {} }
4849 Example (2):
4851 Press ctrl-alt-del.
4853 -> { "execute": "input-send-event",
4854 "arguments": { "events": [
4855 { "type": "key", "data" : { "down": true,
4856 "key": {"type": "qcode", "data": "ctrl" } } },
4857 { "type": "key", "data" : { "down": true,
4858 "key": {"type": "qcode", "data": "alt" } } },
4859 { "type": "key", "data" : { "down": true,
4860 "key": {"type": "qcode", "data": "delete" } } } ] } }
4861 <- { "return": {} }
4863 Example (3):
4865 Move mouse pointer to absolute coordinates (20000, 400).
4867 -> { "execute": "input-send-event" ,
4868 "arguments": { "events": [
4869 { "type": "abs", "data" : { "axis": "x", "value" : 20000 } },
4870 { "type": "abs", "data" : { "axis": "y", "value" : 400 } } ] } }
4871 <- { "return": {} }
4873 EQMP
4876 .name = "block-set-write-threshold",
4877 .args_type = "node-name:s,write-threshold:l",
4878 .mhandler.cmd_new = qmp_marshal_block_set_write_threshold,
4881 SQMP
4882 block-set-write-threshold
4883 ------------
4885 Change the write threshold for a block drive. The threshold is an offset,
4886 thus must be non-negative. Default is no write threshold.
4887 Setting the threshold to zero disables it.
4889 Arguments:
4891 - "node-name": the node name in the block driver state graph (json-string)
4892 - "write-threshold": the write threshold in bytes (json-int)
4894 Example:
4896 -> { "execute": "block-set-write-threshold",
4897 "arguments": { "node-name": "mydev",
4898 "write-threshold": 17179869184 } }
4899 <- { "return": {} }
4901 EQMP
4904 .name = "query-rocker",
4905 .args_type = "name:s",
4906 .mhandler.cmd_new = qmp_marshal_query_rocker,
4909 SQMP
4910 Show rocker switch
4911 ------------------
4913 Arguments:
4915 - "name": switch name
4917 Example:
4919 -> { "execute": "query-rocker", "arguments": { "name": "sw1" } }
4920 <- { "return": {"name": "sw1", "ports": 2, "id": 1327446905938}}
4922 EQMP
4925 .name = "query-rocker-ports",
4926 .args_type = "name:s",
4927 .mhandler.cmd_new = qmp_marshal_query_rocker_ports,
4930 SQMP
4931 Show rocker switch ports
4932 ------------------------
4934 Arguments:
4936 - "name": switch name
4938 Example:
4940 -> { "execute": "query-rocker-ports", "arguments": { "name": "sw1" } }
4941 <- { "return": [ {"duplex": "full", "enabled": true, "name": "sw1.1",
4942 "autoneg": "off", "link-up": true, "speed": 10000},
4943 {"duplex": "full", "enabled": true, "name": "sw1.2",
4944 "autoneg": "off", "link-up": true, "speed": 10000}
4947 EQMP
4950 .name = "query-rocker-of-dpa-flows",
4951 .args_type = "name:s,tbl-id:i?",
4952 .mhandler.cmd_new = qmp_marshal_query_rocker_of_dpa_flows,
4955 SQMP
4956 Show rocker switch OF-DPA flow tables
4957 -------------------------------------
4959 Arguments:
4961 - "name": switch name
4962 - "tbl-id": (optional) flow table ID
4964 Example:
4966 -> { "execute": "query-rocker-of-dpa-flows", "arguments": { "name": "sw1" } }
4967 <- { "return": [ {"key": {"in-pport": 0, "priority": 1, "tbl-id": 0},
4968 "hits": 138,
4969 "cookie": 0,
4970 "action": {"goto-tbl": 10},
4971 "mask": {"in-pport": 4294901760}
4973 {...more...},
4976 EQMP
4979 .name = "query-rocker-of-dpa-groups",
4980 .args_type = "name:s,type:i?",
4981 .mhandler.cmd_new = qmp_marshal_query_rocker_of_dpa_groups,
4984 SQMP
4985 Show rocker OF-DPA group tables
4986 -------------------------------
4988 Arguments:
4990 - "name": switch name
4991 - "type": (optional) group type
4993 Example:
4995 -> { "execute": "query-rocker-of-dpa-groups", "arguments": { "name": "sw1" } }
4996 <- { "return": [ {"type": 0, "out-pport": 2, "pport": 2, "vlan-id": 3841,
4997 "pop-vlan": 1, "id": 251723778},
4998 {"type": 0, "out-pport": 0, "pport": 0, "vlan-id": 3841,
4999 "pop-vlan": 1, "id": 251723776},
5000 {"type": 0, "out-pport": 1, "pport": 1, "vlan-id": 3840,
5001 "pop-vlan": 1, "id": 251658241},
5002 {"type": 0, "out-pport": 0, "pport": 0, "vlan-id": 3840,
5003 "pop-vlan": 1, "id": 251658240}
5006 EQMP
5008 #if defined TARGET_ARM
5010 .name = "query-gic-capabilities",
5011 .args_type = "",
5012 .mhandler.cmd_new = qmp_marshal_query_gic_capabilities,
5014 #endif
5016 SQMP
5017 query-gic-capabilities
5018 ---------------
5020 Return a list of GICCapability objects, describing supported GIC
5021 (Generic Interrupt Controller) versions.
5023 Arguments: None
5025 Example:
5027 -> { "execute": "query-gic-capabilities" }
5028 <- { "return": [{ "version": 2, "emulated": true, "kernel": false },
5029 { "version": 3, "emulated": false, "kernel": true } ] }
5031 EQMP
5034 .name = "query-hotpluggable-cpus",
5035 .args_type = "",
5036 .mhandler.cmd_new = qmp_marshal_query_hotpluggable_cpus,
5039 SQMP
5040 Show existing/possible CPUs
5041 ---------------------------
5043 Arguments: None.
5045 Example for pseries machine type started with
5046 -smp 2,cores=2,maxcpus=4 -cpu POWER8:
5048 -> { "execute": "query-hotpluggable-cpus" }
5049 <- {"return": [
5050 { "props": { "core-id": 8 }, "type": "POWER8-spapr-cpu-core",
5051 "vcpus-count": 1 },
5052 { "props": { "core-id": 0 }, "type": "POWER8-spapr-cpu-core",
5053 "vcpus-count": 1, "qom-path": "/machine/unattached/device[0]"}
5056 Example for pc machine type started with
5057 -smp 1,maxcpus=2:
5058 -> { "execute": "query-hotpluggable-cpus" }
5059 <- {"return": [
5061 "type": "qemu64-x86_64-cpu", "vcpus-count": 1,
5062 "props": {"core-id": 0, "socket-id": 1, "thread-id": 0}
5065 "qom-path": "/machine/unattached/device[0]",
5066 "type": "qemu64-x86_64-cpu", "vcpus-count": 1,
5067 "props": {"core-id": 0, "socket-id": 0, "thread-id": 0}