block: simplify blockdev-backup
[qemu.git] / qmp-commands.hx
blob956f1b0f477b2b09be437fac79969ecd957f7407
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?,on-source-error:s?,on-target-error:s?",
1221 .mhandler.cmd_new = qmp_marshal_drive_backup,
1224 SQMP
1225 drive-backup
1226 ------------
1228 Start a point-in-time copy of a block device to a new destination. The
1229 status of ongoing drive-backup operations can be checked with
1230 query-block-jobs where the BlockJobInfo.type field has the value 'backup'.
1231 The operation can be stopped before it has completed using the
1232 block-job-cancel command.
1234 Arguments:
1236 - "job-id": Identifier for the newly-created block job. If omitted,
1237 the device name will be used. (json-string, optional)
1238 - "device": the device name or node-name of a root node which should be copied.
1239 (json-string)
1240 - "target": the target of the new image. If the file exists, or if it is a
1241 device, the existing file/device will be used as the new
1242 destination. If it does not exist, a new file will be created.
1243 (json-string)
1244 - "format": the format of the new destination, default is to probe if 'mode' is
1245 'existing', else the format of the source
1246 (json-string, optional)
1247 - "sync": what parts of the disk image should be copied to the destination;
1248 possibilities include "full" for all the disk, "top" for only the sectors
1249 allocated in the topmost image, "incremental" for only the dirty sectors in
1250 the bitmap, or "none" to only replicate new I/O (MirrorSyncMode).
1251 - "bitmap": dirty bitmap name for sync==incremental. Must be present if sync
1252 is "incremental", must NOT be present otherwise.
1253 - "mode": whether and how QEMU should create a new image
1254 (NewImageMode, optional, default 'absolute-paths')
1255 - "speed": the maximum speed, in bytes per second (json-int, optional)
1256 - "on-source-error": the action to take on an error on the source, default
1257 'report'. 'stop' and 'enospc' can only be used
1258 if the block device supports io-status.
1259 (BlockdevOnError, optional)
1260 - "on-target-error": the action to take on an error on the target, default
1261 'report' (no limitations, since this applies to
1262 a different block device than device).
1263 (BlockdevOnError, optional)
1265 Example:
1266 -> { "execute": "drive-backup", "arguments": { "device": "drive0",
1267 "sync": "full",
1268 "target": "backup.img" } }
1269 <- { "return": {} }
1271 EQMP
1274 .name = "blockdev-backup",
1275 .args_type = "job-id:s?,sync:s,device:B,target:B,speed:i?,"
1276 "on-source-error:s?,on-target-error:s?",
1277 .mhandler.cmd_new = qmp_marshal_blockdev_backup,
1280 SQMP
1281 blockdev-backup
1282 ---------------
1284 The device version of drive-backup: this command takes an existing named device
1285 as backup target.
1287 Arguments:
1289 - "job-id": Identifier for the newly-created block job. If omitted,
1290 the device name will be used. (json-string, optional)
1291 - "device": the device name or node-name of a root node which should be copied.
1292 (json-string)
1293 - "target": the name of the backup target device. (json-string)
1294 - "sync": what parts of the disk image should be copied to the destination;
1295 possibilities include "full" for all the disk, "top" for only the
1296 sectors allocated in the topmost image, or "none" to only replicate
1297 new I/O (MirrorSyncMode).
1298 - "speed": the maximum speed, in bytes per second (json-int, optional)
1299 - "on-source-error": the action to take on an error on the source, default
1300 'report'. 'stop' and 'enospc' can only be used
1301 if the block device supports io-status.
1302 (BlockdevOnError, optional)
1303 - "on-target-error": the action to take on an error on the target, default
1304 'report' (no limitations, since this applies to
1305 a different block device than device).
1306 (BlockdevOnError, optional)
1308 Example:
1309 -> { "execute": "blockdev-backup", "arguments": { "device": "src-id",
1310 "sync": "full",
1311 "target": "tgt-id" } }
1312 <- { "return": {} }
1314 EQMP
1317 .name = "block-job-set-speed",
1318 .args_type = "device:B,speed:o",
1319 .mhandler.cmd_new = qmp_marshal_block_job_set_speed,
1323 .name = "block-job-cancel",
1324 .args_type = "device:B,force:b?",
1325 .mhandler.cmd_new = qmp_marshal_block_job_cancel,
1328 .name = "block-job-pause",
1329 .args_type = "device:B",
1330 .mhandler.cmd_new = qmp_marshal_block_job_pause,
1333 .name = "block-job-resume",
1334 .args_type = "device:B",
1335 .mhandler.cmd_new = qmp_marshal_block_job_resume,
1338 .name = "block-job-complete",
1339 .args_type = "device:B",
1340 .mhandler.cmd_new = qmp_marshal_block_job_complete,
1343 .name = "transaction",
1344 .args_type = "actions:q,properties:q?",
1345 .mhandler.cmd_new = qmp_marshal_transaction,
1348 SQMP
1349 transaction
1350 -----------
1352 Atomically operate on one or more block devices. Operations that are
1353 currently supported:
1355 - drive-backup
1356 - blockdev-backup
1357 - blockdev-snapshot-sync
1358 - blockdev-snapshot-internal-sync
1359 - abort
1360 - block-dirty-bitmap-add
1361 - block-dirty-bitmap-clear
1363 Refer to the qemu/qapi-schema.json file for minimum required QEMU
1364 versions for these operations. A list of dictionaries is accepted,
1365 that contains the actions to be performed. If there is any failure
1366 performing any of the operations, all operations for the group are
1367 abandoned.
1369 For external snapshots, the dictionary contains the device, the file to use for
1370 the new snapshot, and the format. The default format, if not specified, is
1371 qcow2.
1373 Each new snapshot defaults to being created by QEMU (wiping any
1374 contents if the file already exists), but it is also possible to reuse
1375 an externally-created file. In the latter case, you should ensure that
1376 the new image file has the same contents as the current one; QEMU cannot
1377 perform any meaningful check. Typically this is achieved by using the
1378 current image file as the backing file for the new image.
1380 On failure, the original disks pre-snapshot attempt will be used.
1382 For internal snapshots, the dictionary contains the device and the snapshot's
1383 name. If an internal snapshot matching name already exists, the request will
1384 be rejected. Only some image formats support it, for example, qcow2, rbd,
1385 and sheepdog.
1387 On failure, qemu will try delete the newly created internal snapshot in the
1388 transaction. When an I/O error occurs during deletion, the user needs to fix
1389 it later with qemu-img or other command.
1391 Arguments:
1393 actions array:
1394 - "type": the operation to perform (json-string). Possible
1395 values: "drive-backup", "blockdev-backup",
1396 "blockdev-snapshot-sync",
1397 "blockdev-snapshot-internal-sync",
1398 "abort", "block-dirty-bitmap-add",
1399 "block-dirty-bitmap-clear"
1400 - "data": a dictionary. The contents depend on the value
1401 of "type". When "type" is "blockdev-snapshot-sync":
1402 - "device": device name to snapshot (json-string)
1403 - "node-name": graph node name to snapshot (json-string)
1404 - "snapshot-file": name of new image file (json-string)
1405 - "snapshot-node-name": graph node name of the new snapshot (json-string)
1406 - "format": format of new image (json-string, optional)
1407 - "mode": whether and how QEMU should create the snapshot file
1408 (NewImageMode, optional, default "absolute-paths")
1409 When "type" is "blockdev-snapshot-internal-sync":
1410 - "device": the device name or node-name of a root node to snapshot
1411 (json-string)
1412 - "name": name of the new snapshot (json-string)
1414 Example:
1416 -> { "execute": "transaction",
1417 "arguments": { "actions": [
1418 { "type": "blockdev-snapshot-sync", "data" : { "device": "ide-hd0",
1419 "snapshot-file": "/some/place/my-image",
1420 "format": "qcow2" } },
1421 { "type": "blockdev-snapshot-sync", "data" : { "node-name": "myfile",
1422 "snapshot-file": "/some/place/my-image2",
1423 "snapshot-node-name": "node3432",
1424 "mode": "existing",
1425 "format": "qcow2" } },
1426 { "type": "blockdev-snapshot-sync", "data" : { "device": "ide-hd1",
1427 "snapshot-file": "/some/place/my-image2",
1428 "mode": "existing",
1429 "format": "qcow2" } },
1430 { "type": "blockdev-snapshot-internal-sync", "data" : {
1431 "device": "ide-hd2",
1432 "name": "snapshot0" } } ] } }
1433 <- { "return": {} }
1435 EQMP
1438 .name = "block-dirty-bitmap-add",
1439 .args_type = "node:B,name:s,granularity:i?",
1440 .mhandler.cmd_new = qmp_marshal_block_dirty_bitmap_add,
1443 SQMP
1445 block-dirty-bitmap-add
1446 ----------------------
1447 Since 2.4
1449 Create a dirty bitmap with a name on the device, and start tracking the writes.
1451 Arguments:
1453 - "node": device/node on which to create dirty bitmap (json-string)
1454 - "name": name of the new dirty bitmap (json-string)
1455 - "granularity": granularity to track writes with (int, optional)
1457 Example:
1459 -> { "execute": "block-dirty-bitmap-add", "arguments": { "node": "drive0",
1460 "name": "bitmap0" } }
1461 <- { "return": {} }
1463 EQMP
1466 .name = "block-dirty-bitmap-remove",
1467 .args_type = "node:B,name:s",
1468 .mhandler.cmd_new = qmp_marshal_block_dirty_bitmap_remove,
1471 SQMP
1473 block-dirty-bitmap-remove
1474 -------------------------
1475 Since 2.4
1477 Stop write tracking and remove the dirty bitmap that was created with
1478 block-dirty-bitmap-add.
1480 Arguments:
1482 - "node": device/node on which to remove dirty bitmap (json-string)
1483 - "name": name of the dirty bitmap to remove (json-string)
1485 Example:
1487 -> { "execute": "block-dirty-bitmap-remove", "arguments": { "node": "drive0",
1488 "name": "bitmap0" } }
1489 <- { "return": {} }
1491 EQMP
1494 .name = "block-dirty-bitmap-clear",
1495 .args_type = "node:B,name:s",
1496 .mhandler.cmd_new = qmp_marshal_block_dirty_bitmap_clear,
1499 SQMP
1501 block-dirty-bitmap-clear
1502 ------------------------
1503 Since 2.4
1505 Reset the dirty bitmap associated with a node so that an incremental backup
1506 from this point in time forward will only backup clusters modified after this
1507 clear operation.
1509 Arguments:
1511 - "node": device/node on which to remove dirty bitmap (json-string)
1512 - "name": name of the dirty bitmap to remove (json-string)
1514 Example:
1516 -> { "execute": "block-dirty-bitmap-clear", "arguments": { "node": "drive0",
1517 "name": "bitmap0" } }
1518 <- { "return": {} }
1520 EQMP
1523 .name = "blockdev-snapshot-sync",
1524 .args_type = "device:s?,node-name:s?,snapshot-file:s,snapshot-node-name:s?,format:s?,mode:s?",
1525 .mhandler.cmd_new = qmp_marshal_blockdev_snapshot_sync,
1528 SQMP
1529 blockdev-snapshot-sync
1530 ----------------------
1532 Synchronous snapshot of a block device. snapshot-file specifies the
1533 target of the new image. If the file exists, or if it is a device, the
1534 snapshot will be created in the existing file/device. If does not
1535 exist, a new file will be created. format specifies the format of the
1536 snapshot image, default is qcow2.
1538 Arguments:
1540 - "device": device name to snapshot (json-string)
1541 - "node-name": graph node name to snapshot (json-string)
1542 - "snapshot-file": name of new image file (json-string)
1543 - "snapshot-node-name": graph node name of the new snapshot (json-string)
1544 - "mode": whether and how QEMU should create the snapshot file
1545 (NewImageMode, optional, default "absolute-paths")
1546 - "format": format of new image (json-string, optional)
1548 Example:
1550 -> { "execute": "blockdev-snapshot-sync", "arguments": { "device": "ide-hd0",
1551 "snapshot-file":
1552 "/some/place/my-image",
1553 "format": "qcow2" } }
1554 <- { "return": {} }
1556 EQMP
1559 .name = "blockdev-snapshot",
1560 .args_type = "node:s,overlay:s",
1561 .mhandler.cmd_new = qmp_marshal_blockdev_snapshot,
1564 SQMP
1565 blockdev-snapshot
1566 -----------------
1567 Since 2.5
1569 Create a snapshot, by installing 'node' as the backing image of
1570 'overlay'. Additionally, if 'node' is associated with a block
1571 device, the block device changes to using 'overlay' as its new active
1572 image.
1574 Arguments:
1576 - "node": device that will have a snapshot created (json-string)
1577 - "overlay": device that will have 'node' as its backing image (json-string)
1579 Example:
1581 -> { "execute": "blockdev-add",
1582 "arguments": { "options": { "driver": "qcow2",
1583 "node-name": "node1534",
1584 "file": { "driver": "file",
1585 "filename": "hd1.qcow2" },
1586 "backing": "" } } }
1588 <- { "return": {} }
1590 -> { "execute": "blockdev-snapshot", "arguments": { "node": "ide-hd0",
1591 "overlay": "node1534" } }
1592 <- { "return": {} }
1594 EQMP
1597 .name = "blockdev-snapshot-internal-sync",
1598 .args_type = "device:B,name:s",
1599 .mhandler.cmd_new = qmp_marshal_blockdev_snapshot_internal_sync,
1602 SQMP
1603 blockdev-snapshot-internal-sync
1604 -------------------------------
1606 Synchronously take an internal snapshot of a block device when the format of
1607 image used supports it. If the name is an empty string, or a snapshot with
1608 name already exists, the operation will fail.
1610 Arguments:
1612 - "device": the device name or node-name of a root node to snapshot
1613 (json-string)
1614 - "name": name of the new snapshot (json-string)
1616 Example:
1618 -> { "execute": "blockdev-snapshot-internal-sync",
1619 "arguments": { "device": "ide-hd0",
1620 "name": "snapshot0" }
1622 <- { "return": {} }
1624 EQMP
1627 .name = "blockdev-snapshot-delete-internal-sync",
1628 .args_type = "device:B,id:s?,name:s?",
1629 .mhandler.cmd_new =
1630 qmp_marshal_blockdev_snapshot_delete_internal_sync,
1633 SQMP
1634 blockdev-snapshot-delete-internal-sync
1635 --------------------------------------
1637 Synchronously delete an internal snapshot of a block device when the format of
1638 image used supports it. The snapshot is identified by name or id or both. One
1639 of name or id is required. If the snapshot is not found, the operation will
1640 fail.
1642 Arguments:
1644 - "device": the device name or node-name of a root node (json-string)
1645 - "id": ID of the snapshot (json-string, optional)
1646 - "name": name of the snapshot (json-string, optional)
1648 Example:
1650 -> { "execute": "blockdev-snapshot-delete-internal-sync",
1651 "arguments": { "device": "ide-hd0",
1652 "name": "snapshot0" }
1654 <- { "return": {
1655 "id": "1",
1656 "name": "snapshot0",
1657 "vm-state-size": 0,
1658 "date-sec": 1000012,
1659 "date-nsec": 10,
1660 "vm-clock-sec": 100,
1661 "vm-clock-nsec": 20
1665 EQMP
1668 .name = "drive-mirror",
1669 .args_type = "job-id:s?,sync:s,device:B,target:s,speed:i?,mode:s?,"
1670 "format:s?,node-name:s?,replaces:s?,"
1671 "on-source-error:s?,on-target-error:s?,"
1672 "unmap:b?,"
1673 "granularity:i?,buf-size:i?",
1674 .mhandler.cmd_new = qmp_marshal_drive_mirror,
1677 SQMP
1678 drive-mirror
1679 ------------
1681 Start mirroring a block device's writes to a new destination. target
1682 specifies the target of the new image. If the file exists, or if it is
1683 a device, it will be used as the new destination for writes. If it does not
1684 exist, a new file will be created. format specifies the format of the
1685 mirror image, default is to probe if mode='existing', else the format
1686 of the source.
1688 Arguments:
1690 - "job-id": Identifier for the newly-created block job. If omitted,
1691 the device name will be used. (json-string, optional)
1692 - "device": the device name or node-name of a root node whose writes should be
1693 mirrored. (json-string)
1694 - "target": name of new image file (json-string)
1695 - "format": format of new image (json-string, optional)
1696 - "node-name": the name of the new block driver state in the node graph
1697 (json-string, optional)
1698 - "replaces": the block driver node name to replace when finished
1699 (json-string, optional)
1700 - "mode": how an image file should be created into the target
1701 file/device (NewImageMode, optional, default 'absolute-paths')
1702 - "speed": maximum speed of the streaming job, in bytes per second
1703 (json-int)
1704 - "granularity": granularity of the dirty bitmap, in bytes (json-int, optional)
1705 - "buf-size": maximum amount of data in flight from source to target, in bytes
1706 (json-int, default 10M)
1707 - "sync": what parts of the disk image should be copied to the destination;
1708 possibilities include "full" for all the disk, "top" for only the sectors
1709 allocated in the topmost image, or "none" to only replicate new I/O
1710 (MirrorSyncMode).
1711 - "on-source-error": the action to take on an error on the source
1712 (BlockdevOnError, default 'report')
1713 - "on-target-error": the action to take on an error on the target
1714 (BlockdevOnError, default 'report')
1715 - "unmap": whether the target sectors should be discarded where source has only
1716 zeroes. (json-bool, optional, default true)
1718 The default value of the granularity is the image cluster size clamped
1719 between 4096 and 65536, if the image format defines one. If the format
1720 does not define a cluster size, the default value of the granularity
1721 is 65536.
1724 Example:
1726 -> { "execute": "drive-mirror", "arguments": { "device": "ide-hd0",
1727 "target": "/some/place/my-image",
1728 "sync": "full",
1729 "format": "qcow2" } }
1730 <- { "return": {} }
1732 EQMP
1735 .name = "blockdev-mirror",
1736 .args_type = "job-id:s?,sync:s,device:B,target:B,replaces:s?,speed:i?,"
1737 "on-source-error:s?,on-target-error:s?,"
1738 "granularity:i?,buf-size:i?",
1739 .mhandler.cmd_new = qmp_marshal_blockdev_mirror,
1742 SQMP
1743 blockdev-mirror
1744 ------------
1746 Start mirroring a block device's writes to another block device. target
1747 specifies the target of mirror operation.
1749 Arguments:
1751 - "job-id": Identifier for the newly-created block job. If omitted,
1752 the device name will be used. (json-string, optional)
1753 - "device": The device name or node-name of a root node whose writes should be
1754 mirrored (json-string)
1755 - "target": device name to mirror to (json-string)
1756 - "replaces": the block driver node name to replace when finished
1757 (json-string, optional)
1758 - "speed": maximum speed of the streaming job, in bytes per second
1759 (json-int)
1760 - "granularity": granularity of the dirty bitmap, in bytes (json-int, optional)
1761 - "buf_size": maximum amount of data in flight from source to target, in bytes
1762 (json-int, default 10M)
1763 - "sync": what parts of the disk image should be copied to the destination;
1764 possibilities include "full" for all the disk, "top" for only the sectors
1765 allocated in the topmost image, or "none" to only replicate new I/O
1766 (MirrorSyncMode).
1767 - "on-source-error": the action to take on an error on the source
1768 (BlockdevOnError, default 'report')
1769 - "on-target-error": the action to take on an error on the target
1770 (BlockdevOnError, default 'report')
1772 The default value of the granularity is the image cluster size clamped
1773 between 4096 and 65536, if the image format defines one. If the format
1774 does not define a cluster size, the default value of the granularity
1775 is 65536.
1777 Example:
1779 -> { "execute": "blockdev-mirror", "arguments": { "device": "ide-hd0",
1780 "target": "target0",
1781 "sync": "full" } }
1782 <- { "return": {} }
1784 EQMP
1786 .name = "change-backing-file",
1787 .args_type = "device:s,image-node-name:s,backing-file:s",
1788 .mhandler.cmd_new = qmp_marshal_change_backing_file,
1791 SQMP
1792 change-backing-file
1793 -------------------
1794 Since: 2.1
1796 Change the backing file in the image file metadata. This does not cause
1797 QEMU to reopen the image file to reparse the backing filename (it may,
1798 however, perform a reopen to change permissions from r/o -> r/w -> r/o,
1799 if needed). The new backing file string is written into the image file
1800 metadata, and the QEMU internal strings are updated.
1802 Arguments:
1804 - "image-node-name": The name of the block driver state node of the
1805 image to modify. The "device" is argument is used to
1806 verify "image-node-name" is in the chain described by
1807 "device".
1808 (json-string, optional)
1810 - "device": The device name or node-name of the root node that owns
1811 image-node-name.
1812 (json-string)
1814 - "backing-file": The string to write as the backing file. This string is
1815 not validated, so care should be taken when specifying
1816 the string or the image chain may not be able to be
1817 reopened again.
1818 (json-string)
1820 Returns: Nothing on success
1821 If "device" does not exist or cannot be determined, DeviceNotFound
1823 EQMP
1826 .name = "balloon",
1827 .args_type = "value:M",
1828 .mhandler.cmd_new = qmp_marshal_balloon,
1831 SQMP
1832 balloon
1833 -------
1835 Request VM to change its memory allocation (in bytes).
1837 Arguments:
1839 - "value": New memory allocation (json-int)
1841 Example:
1843 -> { "execute": "balloon", "arguments": { "value": 536870912 } }
1844 <- { "return": {} }
1846 EQMP
1849 .name = "set_link",
1850 .args_type = "name:s,up:b",
1851 .mhandler.cmd_new = qmp_marshal_set_link,
1854 SQMP
1855 set_link
1856 --------
1858 Change the link status of a network adapter.
1860 Arguments:
1862 - "name": network device name (json-string)
1863 - "up": status is up (json-bool)
1865 Example:
1867 -> { "execute": "set_link", "arguments": { "name": "e1000.0", "up": false } }
1868 <- { "return": {} }
1870 EQMP
1873 .name = "getfd",
1874 .args_type = "fdname:s",
1875 .params = "getfd name",
1876 .help = "receive a file descriptor via SCM rights and assign it a name",
1877 .mhandler.cmd_new = qmp_marshal_getfd,
1880 SQMP
1881 getfd
1882 -----
1884 Receive a file descriptor via SCM rights and assign it a name.
1886 Arguments:
1888 - "fdname": file descriptor name (json-string)
1890 Example:
1892 -> { "execute": "getfd", "arguments": { "fdname": "fd1" } }
1893 <- { "return": {} }
1895 Notes:
1897 (1) If the name specified by the "fdname" argument already exists,
1898 the file descriptor assigned to it will be closed and replaced
1899 by the received file descriptor.
1900 (2) The 'closefd' command can be used to explicitly close the file
1901 descriptor when it is no longer needed.
1903 EQMP
1906 .name = "closefd",
1907 .args_type = "fdname:s",
1908 .params = "closefd name",
1909 .help = "close a file descriptor previously passed via SCM rights",
1910 .mhandler.cmd_new = qmp_marshal_closefd,
1913 SQMP
1914 closefd
1915 -------
1917 Close a file descriptor previously passed via SCM rights.
1919 Arguments:
1921 - "fdname": file descriptor name (json-string)
1923 Example:
1925 -> { "execute": "closefd", "arguments": { "fdname": "fd1" } }
1926 <- { "return": {} }
1928 EQMP
1931 .name = "add-fd",
1932 .args_type = "fdset-id:i?,opaque:s?",
1933 .params = "add-fd fdset-id opaque",
1934 .help = "Add a file descriptor, that was passed via SCM rights, to an fd set",
1935 .mhandler.cmd_new = qmp_marshal_add_fd,
1938 SQMP
1939 add-fd
1940 -------
1942 Add a file descriptor, that was passed via SCM rights, to an fd set.
1944 Arguments:
1946 - "fdset-id": The ID of the fd set to add the file descriptor to.
1947 (json-int, optional)
1948 - "opaque": A free-form string that can be used to describe the fd.
1949 (json-string, optional)
1951 Return a json-object with the following information:
1953 - "fdset-id": The ID of the fd set that the fd was added to. (json-int)
1954 - "fd": The file descriptor that was received via SCM rights and added to the
1955 fd set. (json-int)
1957 Example:
1959 -> { "execute": "add-fd", "arguments": { "fdset-id": 1 } }
1960 <- { "return": { "fdset-id": 1, "fd": 3 } }
1962 Notes:
1964 (1) The list of fd sets is shared by all monitor connections.
1965 (2) If "fdset-id" is not specified, a new fd set will be created.
1967 EQMP
1970 .name = "remove-fd",
1971 .args_type = "fdset-id:i,fd:i?",
1972 .params = "remove-fd fdset-id fd",
1973 .help = "Remove a file descriptor from an fd set",
1974 .mhandler.cmd_new = qmp_marshal_remove_fd,
1977 SQMP
1978 remove-fd
1979 ---------
1981 Remove a file descriptor from an fd set.
1983 Arguments:
1985 - "fdset-id": The ID of the fd set that the file descriptor belongs to.
1986 (json-int)
1987 - "fd": The file descriptor that is to be removed. (json-int, optional)
1989 Example:
1991 -> { "execute": "remove-fd", "arguments": { "fdset-id": 1, "fd": 3 } }
1992 <- { "return": {} }
1994 Notes:
1996 (1) The list of fd sets is shared by all monitor connections.
1997 (2) If "fd" is not specified, all file descriptors in "fdset-id" will be
1998 removed.
2000 EQMP
2003 .name = "query-fdsets",
2004 .args_type = "",
2005 .help = "Return information describing all fd sets",
2006 .mhandler.cmd_new = qmp_marshal_query_fdsets,
2009 SQMP
2010 query-fdsets
2011 -------------
2013 Return information describing all fd sets.
2015 Arguments: None
2017 Example:
2019 -> { "execute": "query-fdsets" }
2020 <- { "return": [
2022 "fds": [
2024 "fd": 30,
2025 "opaque": "rdonly:/path/to/file"
2028 "fd": 24,
2029 "opaque": "rdwr:/path/to/file"
2032 "fdset-id": 1
2035 "fds": [
2037 "fd": 28
2040 "fd": 29
2043 "fdset-id": 0
2048 Note: The list of fd sets is shared by all monitor connections.
2050 EQMP
2053 .name = "block_passwd",
2054 .args_type = "device:s?,node-name:s?,password:s",
2055 .mhandler.cmd_new = qmp_marshal_block_passwd,
2058 SQMP
2059 block_passwd
2060 ------------
2062 Set the password of encrypted block devices.
2064 Arguments:
2066 - "device": device name (json-string)
2067 - "node-name": name in the block driver state graph (json-string)
2068 - "password": password (json-string)
2070 Example:
2072 -> { "execute": "block_passwd", "arguments": { "device": "ide0-hd0",
2073 "password": "12345" } }
2074 <- { "return": {} }
2076 EQMP
2079 .name = "block_set_io_throttle",
2080 .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?",
2081 .mhandler.cmd_new = qmp_marshal_block_set_io_throttle,
2084 SQMP
2085 block_set_io_throttle
2086 ------------
2088 Change I/O throttle limits for a block drive.
2090 Arguments:
2092 - "device": device name (json-string)
2093 - "bps": total throughput limit in bytes per second (json-int)
2094 - "bps_rd": read throughput limit in bytes per second (json-int)
2095 - "bps_wr": write throughput limit in bytes per second (json-int)
2096 - "iops": total I/O operations per second (json-int)
2097 - "iops_rd": read I/O operations per second (json-int)
2098 - "iops_wr": write I/O operations per second (json-int)
2099 - "bps_max": total throughput limit during bursts, in bytes (json-int, optional)
2100 - "bps_rd_max": read throughput limit during bursts, in bytes (json-int, optional)
2101 - "bps_wr_max": write throughput limit during bursts, in bytes (json-int, optional)
2102 - "iops_max": total I/O operations per second during bursts (json-int, optional)
2103 - "iops_rd_max": read I/O operations per second during bursts (json-int, optional)
2104 - "iops_wr_max": write I/O operations per second during bursts (json-int, optional)
2105 - "bps_max_length": maximum length of the @bps_max burst period, in seconds (json-int, optional)
2106 - "bps_rd_max_length": maximum length of the @bps_rd_max burst period, in seconds (json-int, optional)
2107 - "bps_wr_max_length": maximum length of the @bps_wr_max burst period, in seconds (json-int, optional)
2108 - "iops_max_length": maximum length of the @iops_max burst period, in seconds (json-int, optional)
2109 - "iops_rd_max_length": maximum length of the @iops_rd_max burst period, in seconds (json-int, optional)
2110 - "iops_wr_max_length": maximum length of the @iops_wr_max burst period, in seconds (json-int, optional)
2111 - "iops_size": I/O size in bytes when limiting (json-int, optional)
2112 - "group": throttle group name (json-string, optional)
2114 Example:
2116 -> { "execute": "block_set_io_throttle", "arguments": { "device": "virtio0",
2117 "bps": 1000000,
2118 "bps_rd": 0,
2119 "bps_wr": 0,
2120 "iops": 0,
2121 "iops_rd": 0,
2122 "iops_wr": 0,
2123 "bps_max": 8000000,
2124 "bps_rd_max": 0,
2125 "bps_wr_max": 0,
2126 "iops_max": 0,
2127 "iops_rd_max": 0,
2128 "iops_wr_max": 0,
2129 "bps_max_length": 60,
2130 "iops_size": 0 } }
2131 <- { "return": {} }
2133 EQMP
2136 .name = "set_password",
2137 .args_type = "protocol:s,password:s,connected:s?",
2138 .mhandler.cmd_new = qmp_marshal_set_password,
2141 SQMP
2142 set_password
2143 ------------
2145 Set the password for vnc/spice protocols.
2147 Arguments:
2149 - "protocol": protocol name (json-string)
2150 - "password": password (json-string)
2151 - "connected": [ keep | disconnect | fail ] (json-string, optional)
2153 Example:
2155 -> { "execute": "set_password", "arguments": { "protocol": "vnc",
2156 "password": "secret" } }
2157 <- { "return": {} }
2159 EQMP
2162 .name = "expire_password",
2163 .args_type = "protocol:s,time:s",
2164 .mhandler.cmd_new = qmp_marshal_expire_password,
2167 SQMP
2168 expire_password
2169 ---------------
2171 Set the password expire time for vnc/spice protocols.
2173 Arguments:
2175 - "protocol": protocol name (json-string)
2176 - "time": [ now | never | +secs | secs ] (json-string)
2178 Example:
2180 -> { "execute": "expire_password", "arguments": { "protocol": "vnc",
2181 "time": "+60" } }
2182 <- { "return": {} }
2184 EQMP
2187 .name = "add_client",
2188 .args_type = "protocol:s,fdname:s,skipauth:b?,tls:b?",
2189 .mhandler.cmd_new = qmp_marshal_add_client,
2192 SQMP
2193 add_client
2194 ----------
2196 Add a graphics client
2198 Arguments:
2200 - "protocol": protocol name (json-string)
2201 - "fdname": file descriptor name (json-string)
2202 - "skipauth": whether to skip authentication (json-bool, optional)
2203 - "tls": whether to perform TLS (json-bool, optional)
2205 Example:
2207 -> { "execute": "add_client", "arguments": { "protocol": "vnc",
2208 "fdname": "myclient" } }
2209 <- { "return": {} }
2211 EQMP
2213 .name = "qmp_capabilities",
2214 .args_type = "",
2215 .params = "",
2216 .help = "enable QMP capabilities",
2217 .mhandler.cmd_new = qmp_capabilities,
2220 SQMP
2221 qmp_capabilities
2222 ----------------
2224 Enable QMP capabilities.
2226 Arguments: None.
2228 Example:
2230 -> { "execute": "qmp_capabilities" }
2231 <- { "return": {} }
2233 Note: This command must be issued before issuing any other command.
2235 EQMP
2238 .name = "human-monitor-command",
2239 .args_type = "command-line:s,cpu-index:i?",
2240 .mhandler.cmd_new = qmp_marshal_human_monitor_command,
2243 SQMP
2244 human-monitor-command
2245 ---------------------
2247 Execute a Human Monitor command.
2249 Arguments:
2251 - command-line: the command name and its arguments, just like the
2252 Human Monitor's shell (json-string)
2253 - cpu-index: select the CPU number to be used by commands which access CPU
2254 data, like 'info registers'. The Monitor selects CPU 0 if this
2255 argument is not provided (json-int, optional)
2257 Example:
2259 -> { "execute": "human-monitor-command", "arguments": { "command-line": "info kvm" } }
2260 <- { "return": "kvm support: enabled\r\n" }
2262 Notes:
2264 (1) The Human Monitor is NOT an stable interface, this means that command
2265 names, arguments and responses can change or be removed at ANY time.
2266 Applications that rely on long term stability guarantees should NOT
2267 use this command
2269 (2) Limitations:
2271 o This command is stateless, this means that commands that depend
2272 on state information (such as getfd) might not work
2274 o Commands that prompt the user for data (eg. 'cont' when the block
2275 device is encrypted) don't currently work
2277 3. Query Commands
2278 =================
2280 HXCOMM Each query command below is inside a SQMP/EQMP section, do NOT change
2281 HXCOMM this! We will possibly move query commands definitions inside those
2282 HXCOMM sections, just like regular commands.
2284 EQMP
2286 SQMP
2287 query-version
2288 -------------
2290 Show QEMU version.
2292 Return a json-object with the following information:
2294 - "qemu": A json-object containing three integer values:
2295 - "major": QEMU's major version (json-int)
2296 - "minor": QEMU's minor version (json-int)
2297 - "micro": QEMU's micro version (json-int)
2298 - "package": package's version (json-string)
2300 Example:
2302 -> { "execute": "query-version" }
2303 <- {
2304 "return":{
2305 "qemu":{
2306 "major":0,
2307 "minor":11,
2308 "micro":5
2310 "package":""
2314 EQMP
2317 .name = "query-version",
2318 .args_type = "",
2319 .mhandler.cmd_new = qmp_marshal_query_version,
2322 SQMP
2323 query-commands
2324 --------------
2326 List QMP available commands.
2328 Each command is represented by a json-object, the returned value is a json-array
2329 of all commands.
2331 Each json-object contain:
2333 - "name": command's name (json-string)
2335 Example:
2337 -> { "execute": "query-commands" }
2338 <- {
2339 "return":[
2341 "name":"query-balloon"
2344 "name":"system_powerdown"
2349 Note: This example has been shortened as the real response is too long.
2351 EQMP
2354 .name = "query-commands",
2355 .args_type = "",
2356 .mhandler.cmd_new = qmp_marshal_query_commands,
2359 SQMP
2360 query-events
2361 --------------
2363 List QMP available events.
2365 Each event is represented by a json-object, the returned value is a json-array
2366 of all events.
2368 Each json-object contains:
2370 - "name": event's name (json-string)
2372 Example:
2374 -> { "execute": "query-events" }
2375 <- {
2376 "return":[
2378 "name":"SHUTDOWN"
2381 "name":"RESET"
2386 Note: This example has been shortened as the real response is too long.
2388 EQMP
2391 .name = "query-events",
2392 .args_type = "",
2393 .mhandler.cmd_new = qmp_marshal_query_events,
2396 SQMP
2397 query-qmp-schema
2398 ----------------
2400 Return the QMP wire schema. The returned value is a json-array of
2401 named schema entities. Entities are commands, events and various
2402 types. See docs/qapi-code-gen.txt for information on their structure
2403 and intended use.
2405 EQMP
2408 .name = "query-qmp-schema",
2409 .args_type = "",
2410 .mhandler.cmd_new = qmp_query_qmp_schema,
2413 SQMP
2414 query-chardev
2415 -------------
2417 Each device is represented by a json-object. The returned value is a json-array
2418 of all devices.
2420 Each json-object contain the following:
2422 - "label": device's label (json-string)
2423 - "filename": device's file (json-string)
2424 - "frontend-open": open/closed state of the frontend device attached to this
2425 backend (json-bool)
2427 Example:
2429 -> { "execute": "query-chardev" }
2430 <- {
2431 "return": [
2433 "label": "charchannel0",
2434 "filename": "unix:/var/lib/libvirt/qemu/seabios.rhel6.agent,server",
2435 "frontend-open": false
2438 "label": "charmonitor",
2439 "filename": "unix:/var/lib/libvirt/qemu/seabios.rhel6.monitor,server",
2440 "frontend-open": true
2443 "label": "charserial0",
2444 "filename": "pty:/dev/pts/2",
2445 "frontend-open": true
2450 EQMP
2453 .name = "query-chardev",
2454 .args_type = "",
2455 .mhandler.cmd_new = qmp_marshal_query_chardev,
2458 SQMP
2459 query-chardev-backends
2460 -------------
2462 List available character device backends.
2464 Each backend is represented by a json-object, the returned value is a json-array
2465 of all backends.
2467 Each json-object contains:
2469 - "name": backend name (json-string)
2471 Example:
2473 -> { "execute": "query-chardev-backends" }
2474 <- {
2475 "return":[
2477 "name":"udp"
2480 "name":"tcp"
2483 "name":"unix"
2486 "name":"spiceport"
2491 EQMP
2494 .name = "query-chardev-backends",
2495 .args_type = "",
2496 .mhandler.cmd_new = qmp_marshal_query_chardev_backends,
2499 SQMP
2500 query-block
2501 -----------
2503 Show the block devices.
2505 Each block device information is stored in a json-object and the returned value
2506 is a json-array of all devices.
2508 Each json-object contain the following:
2510 - "device": device name (json-string)
2511 - "type": device type (json-string)
2512 - deprecated, retained for backward compatibility
2513 - Possible values: "unknown"
2514 - "removable": true if the device is removable, false otherwise (json-bool)
2515 - "locked": true if the device is locked, false otherwise (json-bool)
2516 - "tray_open": only present if removable, true if the device has a tray,
2517 and it is open (json-bool)
2518 - "inserted": only present if the device is inserted, it is a json-object
2519 containing the following:
2520 - "file": device file name (json-string)
2521 - "ro": true if read-only, false otherwise (json-bool)
2522 - "drv": driver format name (json-string)
2523 - Possible values: "blkdebug", "bochs", "cloop", "dmg",
2524 "file", "file", "ftp", "ftps", "host_cdrom",
2525 "host_device", "http", "https",
2526 "nbd", "parallels", "qcow", "qcow2", "raw",
2527 "tftp", "vdi", "vmdk", "vpc", "vvfat"
2528 - "backing_file": backing file name (json-string, optional)
2529 - "backing_file_depth": number of files in the backing file chain (json-int)
2530 - "encrypted": true if encrypted, false otherwise (json-bool)
2531 - "bps": limit total bytes per second (json-int)
2532 - "bps_rd": limit read bytes per second (json-int)
2533 - "bps_wr": limit write bytes per second (json-int)
2534 - "iops": limit total I/O operations per second (json-int)
2535 - "iops_rd": limit read operations per second (json-int)
2536 - "iops_wr": limit write operations per second (json-int)
2537 - "bps_max": total max in bytes (json-int)
2538 - "bps_rd_max": read max in bytes (json-int)
2539 - "bps_wr_max": write max in bytes (json-int)
2540 - "iops_max": total I/O operations max (json-int)
2541 - "iops_rd_max": read I/O operations max (json-int)
2542 - "iops_wr_max": write I/O operations max (json-int)
2543 - "iops_size": I/O size when limiting by iops (json-int)
2544 - "detect_zeroes": detect and optimize zero writing (json-string)
2545 - Possible values: "off", "on", "unmap"
2546 - "write_threshold": write offset threshold in bytes, a event will be
2547 emitted if crossed. Zero if disabled (json-int)
2548 - "image": the detail of the image, it is a json-object containing
2549 the following:
2550 - "filename": image file name (json-string)
2551 - "format": image format (json-string)
2552 - "virtual-size": image capacity in bytes (json-int)
2553 - "dirty-flag": true if image is not cleanly closed, not present
2554 means clean (json-bool, optional)
2555 - "actual-size": actual size on disk in bytes of the image, not
2556 present when image does not support thin
2557 provision (json-int, optional)
2558 - "cluster-size": size of a cluster in bytes, not present if image
2559 format does not support it (json-int, optional)
2560 - "encrypted": true if the image is encrypted, not present means
2561 false or the image format does not support
2562 encryption (json-bool, optional)
2563 - "backing_file": backing file name, not present means no backing
2564 file is used or the image format does not
2565 support backing file chain
2566 (json-string, optional)
2567 - "full-backing-filename": full path of the backing file, not
2568 present if it equals backing_file or no
2569 backing file is used
2570 (json-string, optional)
2571 - "backing-filename-format": the format of the backing file, not
2572 present means unknown or no backing
2573 file (json-string, optional)
2574 - "snapshots": the internal snapshot info, it is an optional list
2575 of json-object containing the following:
2576 - "id": unique snapshot id (json-string)
2577 - "name": snapshot name (json-string)
2578 - "vm-state-size": size of the VM state in bytes (json-int)
2579 - "date-sec": UTC date of the snapshot in seconds (json-int)
2580 - "date-nsec": fractional part in nanoseconds to be used with
2581 date-sec (json-int)
2582 - "vm-clock-sec": VM clock relative to boot in seconds
2583 (json-int)
2584 - "vm-clock-nsec": fractional part in nanoseconds to be used
2585 with vm-clock-sec (json-int)
2586 - "backing-image": the detail of the backing image, it is an
2587 optional json-object only present when a
2588 backing image present for this image
2590 - "io-status": I/O operation status, only present if the device supports it
2591 and the VM is configured to stop on errors. It's always reset
2592 to "ok" when the "cont" command is issued (json_string, optional)
2593 - Possible values: "ok", "failed", "nospace"
2595 Example:
2597 -> { "execute": "query-block" }
2598 <- {
2599 "return":[
2601 "io-status": "ok",
2602 "device":"ide0-hd0",
2603 "locked":false,
2604 "removable":false,
2605 "inserted":{
2606 "ro":false,
2607 "drv":"qcow2",
2608 "encrypted":false,
2609 "file":"disks/test.qcow2",
2610 "backing_file_depth":1,
2611 "bps":1000000,
2612 "bps_rd":0,
2613 "bps_wr":0,
2614 "iops":1000000,
2615 "iops_rd":0,
2616 "iops_wr":0,
2617 "bps_max": 8000000,
2618 "bps_rd_max": 0,
2619 "bps_wr_max": 0,
2620 "iops_max": 0,
2621 "iops_rd_max": 0,
2622 "iops_wr_max": 0,
2623 "iops_size": 0,
2624 "detect_zeroes": "on",
2625 "write_threshold": 0,
2626 "image":{
2627 "filename":"disks/test.qcow2",
2628 "format":"qcow2",
2629 "virtual-size":2048000,
2630 "backing_file":"base.qcow2",
2631 "full-backing-filename":"disks/base.qcow2",
2632 "backing-filename-format":"qcow2",
2633 "snapshots":[
2635 "id": "1",
2636 "name": "snapshot1",
2637 "vm-state-size": 0,
2638 "date-sec": 10000200,
2639 "date-nsec": 12,
2640 "vm-clock-sec": 206,
2641 "vm-clock-nsec": 30
2644 "backing-image":{
2645 "filename":"disks/base.qcow2",
2646 "format":"qcow2",
2647 "virtual-size":2048000
2651 "type":"unknown"
2654 "io-status": "ok",
2655 "device":"ide1-cd0",
2656 "locked":false,
2657 "removable":true,
2658 "type":"unknown"
2661 "device":"floppy0",
2662 "locked":false,
2663 "removable":true,
2664 "type":"unknown"
2667 "device":"sd0",
2668 "locked":false,
2669 "removable":true,
2670 "type":"unknown"
2675 EQMP
2678 .name = "query-block",
2679 .args_type = "",
2680 .mhandler.cmd_new = qmp_marshal_query_block,
2683 SQMP
2684 query-blockstats
2685 ----------------
2687 Show block device statistics.
2689 Each device statistic information is stored in a json-object and the returned
2690 value is a json-array of all devices.
2692 Each json-object contain the following:
2694 - "device": device name (json-string)
2695 - "stats": A json-object with the statistics information, it contains:
2696 - "rd_bytes": bytes read (json-int)
2697 - "wr_bytes": bytes written (json-int)
2698 - "rd_operations": read operations (json-int)
2699 - "wr_operations": write operations (json-int)
2700 - "flush_operations": cache flush operations (json-int)
2701 - "wr_total_time_ns": total time spend on writes in nano-seconds (json-int)
2702 - "rd_total_time_ns": total time spend on reads in nano-seconds (json-int)
2703 - "flush_total_time_ns": total time spend on cache flushes in nano-seconds (json-int)
2704 - "wr_highest_offset": The offset after the greatest byte written to the
2705 BlockDriverState since it has been opened (json-int)
2706 - "rd_merged": number of read requests that have been merged into
2707 another request (json-int)
2708 - "wr_merged": number of write requests that have been merged into
2709 another request (json-int)
2710 - "idle_time_ns": time since the last I/O operation, in
2711 nanoseconds. If the field is absent it means
2712 that there haven't been any operations yet
2713 (json-int, optional)
2714 - "failed_rd_operations": number of failed read operations
2715 (json-int)
2716 - "failed_wr_operations": number of failed write operations
2717 (json-int)
2718 - "failed_flush_operations": number of failed flush operations
2719 (json-int)
2720 - "invalid_rd_operations": number of invalid read operations
2721 (json-int)
2722 - "invalid_wr_operations": number of invalid write operations
2723 (json-int)
2724 - "invalid_flush_operations": number of invalid flush operations
2725 (json-int)
2726 - "account_invalid": whether invalid operations are included in
2727 the last access statistics (json-bool)
2728 - "account_failed": whether failed operations are included in the
2729 latency and last access statistics
2730 (json-bool)
2731 - "timed_stats": A json-array containing statistics collected in
2732 specific intervals, with the following members:
2733 - "interval_length": interval used for calculating the
2734 statistics, in seconds (json-int)
2735 - "min_rd_latency_ns": minimum latency of read operations in
2736 the defined interval, in nanoseconds
2737 (json-int)
2738 - "min_wr_latency_ns": minimum latency of write operations in
2739 the defined interval, in nanoseconds
2740 (json-int)
2741 - "min_flush_latency_ns": minimum latency of flush operations
2742 in the defined interval, in
2743 nanoseconds (json-int)
2744 - "max_rd_latency_ns": maximum latency of read operations in
2745 the defined interval, in nanoseconds
2746 (json-int)
2747 - "max_wr_latency_ns": maximum latency of write operations in
2748 the defined interval, in nanoseconds
2749 (json-int)
2750 - "max_flush_latency_ns": maximum latency of flush operations
2751 in the defined interval, in
2752 nanoseconds (json-int)
2753 - "avg_rd_latency_ns": average latency of read operations in
2754 the defined interval, in nanoseconds
2755 (json-int)
2756 - "avg_wr_latency_ns": average latency of write operations in
2757 the defined interval, in nanoseconds
2758 (json-int)
2759 - "avg_flush_latency_ns": average latency of flush operations
2760 in the defined interval, in
2761 nanoseconds (json-int)
2762 - "avg_rd_queue_depth": average number of pending read
2763 operations in the defined interval
2764 (json-number)
2765 - "avg_wr_queue_depth": average number of pending write
2766 operations in the defined interval
2767 (json-number).
2768 - "parent": Contains recursively the statistics of the underlying
2769 protocol (e.g. the host file for a qcow2 image). If there is
2770 no underlying protocol, this field is omitted
2771 (json-object, optional)
2773 Example:
2775 -> { "execute": "query-blockstats" }
2776 <- {
2777 "return":[
2779 "device":"ide0-hd0",
2780 "parent":{
2781 "stats":{
2782 "wr_highest_offset":3686448128,
2783 "wr_bytes":9786368,
2784 "wr_operations":751,
2785 "rd_bytes":122567168,
2786 "rd_operations":36772
2787 "wr_total_times_ns":313253456
2788 "rd_total_times_ns":3465673657
2789 "flush_total_times_ns":49653
2790 "flush_operations":61,
2791 "rd_merged":0,
2792 "wr_merged":0,
2793 "idle_time_ns":2953431879,
2794 "account_invalid":true,
2795 "account_failed":false
2798 "stats":{
2799 "wr_highest_offset":2821110784,
2800 "wr_bytes":9786368,
2801 "wr_operations":692,
2802 "rd_bytes":122739200,
2803 "rd_operations":36604
2804 "flush_operations":51,
2805 "wr_total_times_ns":313253456
2806 "rd_total_times_ns":3465673657
2807 "flush_total_times_ns":49653,
2808 "rd_merged":0,
2809 "wr_merged":0,
2810 "idle_time_ns":2953431879,
2811 "account_invalid":true,
2812 "account_failed":false
2816 "device":"ide1-cd0",
2817 "stats":{
2818 "wr_highest_offset":0,
2819 "wr_bytes":0,
2820 "wr_operations":0,
2821 "rd_bytes":0,
2822 "rd_operations":0
2823 "flush_operations":0,
2824 "wr_total_times_ns":0
2825 "rd_total_times_ns":0
2826 "flush_total_times_ns":0,
2827 "rd_merged":0,
2828 "wr_merged":0,
2829 "account_invalid":false,
2830 "account_failed":false
2834 "device":"floppy0",
2835 "stats":{
2836 "wr_highest_offset":0,
2837 "wr_bytes":0,
2838 "wr_operations":0,
2839 "rd_bytes":0,
2840 "rd_operations":0
2841 "flush_operations":0,
2842 "wr_total_times_ns":0
2843 "rd_total_times_ns":0
2844 "flush_total_times_ns":0,
2845 "rd_merged":0,
2846 "wr_merged":0,
2847 "account_invalid":false,
2848 "account_failed":false
2852 "device":"sd0",
2853 "stats":{
2854 "wr_highest_offset":0,
2855 "wr_bytes":0,
2856 "wr_operations":0,
2857 "rd_bytes":0,
2858 "rd_operations":0
2859 "flush_operations":0,
2860 "wr_total_times_ns":0
2861 "rd_total_times_ns":0
2862 "flush_total_times_ns":0,
2863 "rd_merged":0,
2864 "wr_merged":0,
2865 "account_invalid":false,
2866 "account_failed":false
2872 EQMP
2875 .name = "query-blockstats",
2876 .args_type = "query-nodes:b?",
2877 .mhandler.cmd_new = qmp_marshal_query_blockstats,
2880 SQMP
2881 query-cpus
2882 ----------
2884 Show CPU information.
2886 Return a json-array. Each CPU is represented by a json-object, which contains:
2888 - "CPU": CPU index (json-int)
2889 - "current": true if this is the current CPU, false otherwise (json-bool)
2890 - "halted": true if the cpu is halted, false otherwise (json-bool)
2891 - "qom_path": path to the CPU object in the QOM tree (json-str)
2892 - "arch": architecture of the cpu, which determines what additional
2893 keys will be present (json-str)
2894 - Current program counter. The key's name depends on the architecture:
2895 "pc": i386/x86_64 (json-int)
2896 "nip": PPC (json-int)
2897 "pc" and "npc": sparc (json-int)
2898 "PC": mips (json-int)
2899 - "thread_id": ID of the underlying host thread (json-int)
2901 Example:
2903 -> { "execute": "query-cpus" }
2904 <- {
2905 "return":[
2907 "CPU":0,
2908 "current":true,
2909 "halted":false,
2910 "qom_path":"/machine/unattached/device[0]",
2911 "arch":"x86",
2912 "pc":3227107138,
2913 "thread_id":3134
2916 "CPU":1,
2917 "current":false,
2918 "halted":true,
2919 "qom_path":"/machine/unattached/device[2]",
2920 "arch":"x86",
2921 "pc":7108165,
2922 "thread_id":3135
2927 EQMP
2930 .name = "query-cpus",
2931 .args_type = "",
2932 .mhandler.cmd_new = qmp_marshal_query_cpus,
2935 SQMP
2936 query-iothreads
2937 ---------------
2939 Returns a list of information about each iothread.
2941 Note this list excludes the QEMU main loop thread, which is not declared
2942 using the -object iothread command-line option. It is always the main thread
2943 of the process.
2945 Return a json-array. Each iothread is represented by a json-object, which contains:
2947 - "id": name of iothread (json-str)
2948 - "thread-id": ID of the underlying host thread (json-int)
2950 Example:
2952 -> { "execute": "query-iothreads" }
2953 <- {
2954 "return":[
2956 "id":"iothread0",
2957 "thread-id":3134
2960 "id":"iothread1",
2961 "thread-id":3135
2966 EQMP
2969 .name = "query-iothreads",
2970 .args_type = "",
2971 .mhandler.cmd_new = qmp_marshal_query_iothreads,
2974 SQMP
2975 query-pci
2976 ---------
2978 PCI buses and devices information.
2980 The returned value is a json-array of all buses. Each bus is represented by
2981 a json-object, which has a key with a json-array of all PCI devices attached
2982 to it. Each device is represented by a json-object.
2984 The bus json-object contains the following:
2986 - "bus": bus number (json-int)
2987 - "devices": a json-array of json-objects, each json-object represents a
2988 PCI device
2990 The PCI device json-object contains the following:
2992 - "bus": identical to the parent's bus number (json-int)
2993 - "slot": slot number (json-int)
2994 - "function": function number (json-int)
2995 - "class_info": a json-object containing:
2996 - "desc": device class description (json-string, optional)
2997 - "class": device class number (json-int)
2998 - "id": a json-object containing:
2999 - "device": device ID (json-int)
3000 - "vendor": vendor ID (json-int)
3001 - "irq": device's IRQ if assigned (json-int, optional)
3002 - "qdev_id": qdev id string (json-string)
3003 - "pci_bridge": It's a json-object, only present if this device is a
3004 PCI bridge, contains:
3005 - "bus": bus number (json-int)
3006 - "secondary": secondary bus number (json-int)
3007 - "subordinate": subordinate bus number (json-int)
3008 - "io_range": I/O memory range information, a json-object with the
3009 following members:
3010 - "base": base address, in bytes (json-int)
3011 - "limit": limit address, in bytes (json-int)
3012 - "memory_range": memory range information, a json-object with the
3013 following members:
3014 - "base": base address, in bytes (json-int)
3015 - "limit": limit address, in bytes (json-int)
3016 - "prefetchable_range": Prefetchable memory range information, a
3017 json-object with the following members:
3018 - "base": base address, in bytes (json-int)
3019 - "limit": limit address, in bytes (json-int)
3020 - "devices": a json-array of PCI devices if there's any attached, each
3021 each element is represented by a json-object, which contains
3022 the same members of the 'PCI device json-object' described
3023 above (optional)
3024 - "regions": a json-array of json-objects, each json-object represents a
3025 memory region of this device
3027 The memory range json-object contains the following:
3029 - "base": base memory address (json-int)
3030 - "limit": limit value (json-int)
3032 The region json-object can be an I/O region or a memory region, an I/O region
3033 json-object contains the following:
3035 - "type": "io" (json-string, fixed)
3036 - "bar": BAR number (json-int)
3037 - "address": memory address (json-int)
3038 - "size": memory size (json-int)
3040 A memory region json-object contains the following:
3042 - "type": "memory" (json-string, fixed)
3043 - "bar": BAR number (json-int)
3044 - "address": memory address (json-int)
3045 - "size": memory size (json-int)
3046 - "mem_type_64": true or false (json-bool)
3047 - "prefetch": true or false (json-bool)
3049 Example:
3051 -> { "execute": "query-pci" }
3052 <- {
3053 "return":[
3055 "bus":0,
3056 "devices":[
3058 "bus":0,
3059 "qdev_id":"",
3060 "slot":0,
3061 "class_info":{
3062 "class":1536,
3063 "desc":"Host bridge"
3065 "id":{
3066 "device":32902,
3067 "vendor":4663
3069 "function":0,
3070 "regions":[
3075 "bus":0,
3076 "qdev_id":"",
3077 "slot":1,
3078 "class_info":{
3079 "class":1537,
3080 "desc":"ISA bridge"
3082 "id":{
3083 "device":32902,
3084 "vendor":28672
3086 "function":0,
3087 "regions":[
3092 "bus":0,
3093 "qdev_id":"",
3094 "slot":1,
3095 "class_info":{
3096 "class":257,
3097 "desc":"IDE controller"
3099 "id":{
3100 "device":32902,
3101 "vendor":28688
3103 "function":1,
3104 "regions":[
3106 "bar":4,
3107 "size":16,
3108 "address":49152,
3109 "type":"io"
3114 "bus":0,
3115 "qdev_id":"",
3116 "slot":2,
3117 "class_info":{
3118 "class":768,
3119 "desc":"VGA controller"
3121 "id":{
3122 "device":4115,
3123 "vendor":184
3125 "function":0,
3126 "regions":[
3128 "prefetch":true,
3129 "mem_type_64":false,
3130 "bar":0,
3131 "size":33554432,
3132 "address":4026531840,
3133 "type":"memory"
3136 "prefetch":false,
3137 "mem_type_64":false,
3138 "bar":1,
3139 "size":4096,
3140 "address":4060086272,
3141 "type":"memory"
3144 "prefetch":false,
3145 "mem_type_64":false,
3146 "bar":6,
3147 "size":65536,
3148 "address":-1,
3149 "type":"memory"
3154 "bus":0,
3155 "qdev_id":"",
3156 "irq":11,
3157 "slot":4,
3158 "class_info":{
3159 "class":1280,
3160 "desc":"RAM controller"
3162 "id":{
3163 "device":6900,
3164 "vendor":4098
3166 "function":0,
3167 "regions":[
3169 "bar":0,
3170 "size":32,
3171 "address":49280,
3172 "type":"io"
3181 Note: This example has been shortened as the real response is too long.
3183 EQMP
3186 .name = "query-pci",
3187 .args_type = "",
3188 .mhandler.cmd_new = qmp_marshal_query_pci,
3191 SQMP
3192 query-kvm
3193 ---------
3195 Show KVM information.
3197 Return a json-object with the following information:
3199 - "enabled": true if KVM support is enabled, false otherwise (json-bool)
3200 - "present": true if QEMU has KVM support, false otherwise (json-bool)
3202 Example:
3204 -> { "execute": "query-kvm" }
3205 <- { "return": { "enabled": true, "present": true } }
3207 EQMP
3210 .name = "query-kvm",
3211 .args_type = "",
3212 .mhandler.cmd_new = qmp_marshal_query_kvm,
3215 SQMP
3216 query-status
3217 ------------
3219 Return a json-object with the following information:
3221 - "running": true if the VM is running, or false if it is paused (json-bool)
3222 - "singlestep": true if the VM is in single step mode,
3223 false otherwise (json-bool)
3224 - "status": one of the following values (json-string)
3225 "debug" - QEMU is running on a debugger
3226 "inmigrate" - guest is paused waiting for an incoming migration
3227 "internal-error" - An internal error that prevents further guest
3228 execution has occurred
3229 "io-error" - the last IOP has failed and the device is configured
3230 to pause on I/O errors
3231 "paused" - guest has been paused via the 'stop' command
3232 "postmigrate" - guest is paused following a successful 'migrate'
3233 "prelaunch" - QEMU was started with -S and guest has not started
3234 "finish-migrate" - guest is paused to finish the migration process
3235 "restore-vm" - guest is paused to restore VM state
3236 "running" - guest is actively running
3237 "save-vm" - guest is paused to save the VM state
3238 "shutdown" - guest is shut down (and -no-shutdown is in use)
3239 "watchdog" - the watchdog action is configured to pause and
3240 has been triggered
3242 Example:
3244 -> { "execute": "query-status" }
3245 <- { "return": { "running": true, "singlestep": false, "status": "running" } }
3247 EQMP
3250 .name = "query-status",
3251 .args_type = "",
3252 .mhandler.cmd_new = qmp_marshal_query_status,
3255 SQMP
3256 query-mice
3257 ----------
3259 Show VM mice information.
3261 Each mouse is represented by a json-object, the returned value is a json-array
3262 of all mice.
3264 The mouse json-object contains the following:
3266 - "name": mouse's name (json-string)
3267 - "index": mouse's index (json-int)
3268 - "current": true if this mouse is receiving events, false otherwise (json-bool)
3269 - "absolute": true if the mouse generates absolute input events (json-bool)
3271 Example:
3273 -> { "execute": "query-mice" }
3274 <- {
3275 "return":[
3277 "name":"QEMU Microsoft Mouse",
3278 "index":0,
3279 "current":false,
3280 "absolute":false
3283 "name":"QEMU PS/2 Mouse",
3284 "index":1,
3285 "current":true,
3286 "absolute":true
3291 EQMP
3294 .name = "query-mice",
3295 .args_type = "",
3296 .mhandler.cmd_new = qmp_marshal_query_mice,
3299 SQMP
3300 query-vnc
3301 ---------
3303 Show VNC server information.
3305 Return a json-object with server information. Connected clients are returned
3306 as a json-array of json-objects.
3308 The main json-object contains the following:
3310 - "enabled": true or false (json-bool)
3311 - "host": server's IP address (json-string)
3312 - "family": address family (json-string)
3313 - Possible values: "ipv4", "ipv6", "unix", "unknown"
3314 - "service": server's port number (json-string)
3315 - "auth": authentication method (json-string)
3316 - Possible values: "invalid", "none", "ra2", "ra2ne", "sasl", "tight",
3317 "tls", "ultra", "unknown", "vencrypt", "vencrypt",
3318 "vencrypt+plain", "vencrypt+tls+none",
3319 "vencrypt+tls+plain", "vencrypt+tls+sasl",
3320 "vencrypt+tls+vnc", "vencrypt+x509+none",
3321 "vencrypt+x509+plain", "vencrypt+x509+sasl",
3322 "vencrypt+x509+vnc", "vnc"
3323 - "clients": a json-array of all connected clients
3325 Clients are described by a json-object, each one contain the following:
3327 - "host": client's IP address (json-string)
3328 - "family": address family (json-string)
3329 - Possible values: "ipv4", "ipv6", "unix", "unknown"
3330 - "service": client's port number (json-string)
3331 - "x509_dname": TLS dname (json-string, optional)
3332 - "sasl_username": SASL username (json-string, optional)
3334 Example:
3336 -> { "execute": "query-vnc" }
3337 <- {
3338 "return":{
3339 "enabled":true,
3340 "host":"0.0.0.0",
3341 "service":"50402",
3342 "auth":"vnc",
3343 "family":"ipv4",
3344 "clients":[
3346 "host":"127.0.0.1",
3347 "service":"50401",
3348 "family":"ipv4"
3354 EQMP
3357 .name = "query-vnc",
3358 .args_type = "",
3359 .mhandler.cmd_new = qmp_marshal_query_vnc,
3362 .name = "query-vnc-servers",
3363 .args_type = "",
3364 .mhandler.cmd_new = qmp_marshal_query_vnc_servers,
3367 SQMP
3368 query-spice
3369 -----------
3371 Show SPICE server information.
3373 Return a json-object with server information. Connected clients are returned
3374 as a json-array of json-objects.
3376 The main json-object contains the following:
3378 - "enabled": true or false (json-bool)
3379 - "host": server's IP address (json-string)
3380 - "port": server's port number (json-int, optional)
3381 - "tls-port": server's port number (json-int, optional)
3382 - "auth": authentication method (json-string)
3383 - Possible values: "none", "spice"
3384 - "channels": a json-array of all active channels clients
3386 Channels are described by a json-object, each one contain the following:
3388 - "host": client's IP address (json-string)
3389 - "family": address family (json-string)
3390 - Possible values: "ipv4", "ipv6", "unix", "unknown"
3391 - "port": client's port number (json-string)
3392 - "connection-id": spice connection id. All channels with the same id
3393 belong to the same spice session (json-int)
3394 - "channel-type": channel type. "1" is the main control channel, filter for
3395 this one if you want track spice sessions only (json-int)
3396 - "channel-id": channel id. Usually "0", might be different needed when
3397 multiple channels of the same type exist, such as multiple
3398 display channels in a multihead setup (json-int)
3399 - "tls": whether the channel is encrypted (json-bool)
3401 Example:
3403 -> { "execute": "query-spice" }
3404 <- {
3405 "return": {
3406 "enabled": true,
3407 "auth": "spice",
3408 "port": 5920,
3409 "tls-port": 5921,
3410 "host": "0.0.0.0",
3411 "channels": [
3413 "port": "54924",
3414 "family": "ipv4",
3415 "channel-type": 1,
3416 "connection-id": 1804289383,
3417 "host": "127.0.0.1",
3418 "channel-id": 0,
3419 "tls": true
3422 "port": "36710",
3423 "family": "ipv4",
3424 "channel-type": 4,
3425 "connection-id": 1804289383,
3426 "host": "127.0.0.1",
3427 "channel-id": 0,
3428 "tls": false
3430 [ ... more channels follow ... ]
3435 EQMP
3437 #if defined(CONFIG_SPICE)
3439 .name = "query-spice",
3440 .args_type = "",
3441 .mhandler.cmd_new = qmp_marshal_query_spice,
3443 #endif
3445 SQMP
3446 query-name
3447 ----------
3449 Show VM name.
3451 Return a json-object with the following information:
3453 - "name": VM's name (json-string, optional)
3455 Example:
3457 -> { "execute": "query-name" }
3458 <- { "return": { "name": "qemu-name" } }
3460 EQMP
3463 .name = "query-name",
3464 .args_type = "",
3465 .mhandler.cmd_new = qmp_marshal_query_name,
3468 SQMP
3469 query-uuid
3470 ----------
3472 Show VM UUID.
3474 Return a json-object with the following information:
3476 - "UUID": Universally Unique Identifier (json-string)
3478 Example:
3480 -> { "execute": "query-uuid" }
3481 <- { "return": { "UUID": "550e8400-e29b-41d4-a716-446655440000" } }
3483 EQMP
3486 .name = "query-uuid",
3487 .args_type = "",
3488 .mhandler.cmd_new = qmp_marshal_query_uuid,
3491 SQMP
3492 query-command-line-options
3493 --------------------------
3495 Show command line option schema.
3497 Return a json-array of command line option schema for all options (or for
3498 the given option), returning an error if the given option doesn't exist.
3500 Each array entry contains the following:
3502 - "option": option name (json-string)
3503 - "parameters": a json-array describes all parameters of the option:
3504 - "name": parameter name (json-string)
3505 - "type": parameter type (one of 'string', 'boolean', 'number',
3506 or 'size')
3507 - "help": human readable description of the parameter
3508 (json-string, optional)
3509 - "default": default value string for the parameter
3510 (json-string, optional)
3512 Example:
3514 -> { "execute": "query-command-line-options", "arguments": { "option": "option-rom" } }
3515 <- { "return": [
3517 "parameters": [
3519 "name": "romfile",
3520 "type": "string"
3523 "name": "bootindex",
3524 "type": "number"
3527 "option": "option-rom"
3532 EQMP
3535 .name = "query-command-line-options",
3536 .args_type = "option:s?",
3537 .mhandler.cmd_new = qmp_marshal_query_command_line_options,
3540 SQMP
3541 query-migrate
3542 -------------
3544 Migration status.
3546 Return a json-object. If migration is active there will be another json-object
3547 with RAM migration status and if block migration is active another one with
3548 block migration status.
3550 The main json-object contains the following:
3552 - "status": migration status (json-string)
3553 - Possible values: "setup", "active", "completed", "failed", "cancelled"
3554 - "total-time": total amount of ms since migration started. If
3555 migration has ended, it returns the total migration
3556 time (json-int)
3557 - "setup-time" amount of setup time in milliseconds _before_ the
3558 iterations begin but _after_ the QMP command is issued.
3559 This is designed to provide an accounting of any activities
3560 (such as RDMA pinning) which may be expensive, but do not
3561 actually occur during the iterative migration rounds
3562 themselves. (json-int)
3563 - "downtime": only present when migration has finished correctly
3564 total amount in ms for downtime that happened (json-int)
3565 - "expected-downtime": only present while migration is active
3566 total amount in ms for downtime that was calculated on
3567 the last bitmap round (json-int)
3568 - "ram": only present if "status" is "active", it is a json-object with the
3569 following RAM information:
3570 - "transferred": amount transferred in bytes (json-int)
3571 - "remaining": amount remaining to transfer in bytes (json-int)
3572 - "total": total amount of memory in bytes (json-int)
3573 - "duplicate": number of pages filled entirely with the same
3574 byte (json-int)
3575 These are sent over the wire much more efficiently.
3576 - "skipped": number of skipped zero pages (json-int)
3577 - "normal" : number of whole pages transferred. I.e. they
3578 were not sent as duplicate or xbzrle pages (json-int)
3579 - "normal-bytes" : number of bytes transferred in whole
3580 pages. This is just normal pages times size of one page,
3581 but this way upper levels don't need to care about page
3582 size (json-int)
3583 - "dirty-sync-count": times that dirty ram was synchronized (json-int)
3584 - "disk": only present if "status" is "active" and it is a block migration,
3585 it is a json-object with the following disk information:
3586 - "transferred": amount transferred in bytes (json-int)
3587 - "remaining": amount remaining to transfer in bytes json-int)
3588 - "total": total disk size in bytes (json-int)
3589 - "xbzrle-cache": only present if XBZRLE is active.
3590 It is a json-object with the following XBZRLE information:
3591 - "cache-size": XBZRLE cache size in bytes
3592 - "bytes": number of bytes transferred for XBZRLE compressed pages
3593 - "pages": number of XBZRLE compressed pages
3594 - "cache-miss": number of XBRZRLE page cache misses
3595 - "cache-miss-rate": rate of XBRZRLE page cache misses
3596 - "overflow": number of times XBZRLE overflows. This means
3597 that the XBZRLE encoding was bigger than just sent the
3598 whole page, and then we sent the whole page instead (as as
3599 normal page).
3601 Examples:
3603 1. Before the first migration
3605 -> { "execute": "query-migrate" }
3606 <- { "return": {} }
3608 2. Migration is done and has succeeded
3610 -> { "execute": "query-migrate" }
3611 <- { "return": {
3612 "status": "completed",
3613 "ram":{
3614 "transferred":123,
3615 "remaining":123,
3616 "total":246,
3617 "total-time":12345,
3618 "setup-time":12345,
3619 "downtime":12345,
3620 "duplicate":123,
3621 "normal":123,
3622 "normal-bytes":123456,
3623 "dirty-sync-count":15
3628 3. Migration is done and has failed
3630 -> { "execute": "query-migrate" }
3631 <- { "return": { "status": "failed" } }
3633 4. Migration is being performed and is not a block migration:
3635 -> { "execute": "query-migrate" }
3636 <- {
3637 "return":{
3638 "status":"active",
3639 "ram":{
3640 "transferred":123,
3641 "remaining":123,
3642 "total":246,
3643 "total-time":12345,
3644 "setup-time":12345,
3645 "expected-downtime":12345,
3646 "duplicate":123,
3647 "normal":123,
3648 "normal-bytes":123456,
3649 "dirty-sync-count":15
3654 5. Migration is being performed and is a block migration:
3656 -> { "execute": "query-migrate" }
3657 <- {
3658 "return":{
3659 "status":"active",
3660 "ram":{
3661 "total":1057024,
3662 "remaining":1053304,
3663 "transferred":3720,
3664 "total-time":12345,
3665 "setup-time":12345,
3666 "expected-downtime":12345,
3667 "duplicate":123,
3668 "normal":123,
3669 "normal-bytes":123456,
3670 "dirty-sync-count":15
3672 "disk":{
3673 "total":20971520,
3674 "remaining":20880384,
3675 "transferred":91136
3680 6. Migration is being performed and XBZRLE is active:
3682 -> { "execute": "query-migrate" }
3683 <- {
3684 "return":{
3685 "status":"active",
3686 "capabilities" : [ { "capability": "xbzrle", "state" : true } ],
3687 "ram":{
3688 "total":1057024,
3689 "remaining":1053304,
3690 "transferred":3720,
3691 "total-time":12345,
3692 "setup-time":12345,
3693 "expected-downtime":12345,
3694 "duplicate":10,
3695 "normal":3333,
3696 "normal-bytes":3412992,
3697 "dirty-sync-count":15
3699 "xbzrle-cache":{
3700 "cache-size":67108864,
3701 "bytes":20971520,
3702 "pages":2444343,
3703 "cache-miss":2244,
3704 "cache-miss-rate":0.123,
3705 "overflow":34434
3710 EQMP
3713 .name = "query-migrate",
3714 .args_type = "",
3715 .mhandler.cmd_new = qmp_marshal_query_migrate,
3718 SQMP
3719 migrate-set-capabilities
3720 ------------------------
3722 Enable/Disable migration capabilities
3724 - "xbzrle": XBZRLE support
3725 - "rdma-pin-all": pin all pages when using RDMA during migration
3726 - "auto-converge": throttle down guest to help convergence of migration
3727 - "zero-blocks": compress zero blocks during block migration
3728 - "compress": use multiple compression threads to accelerate live migration
3729 - "events": generate events for each migration state change
3730 - "postcopy-ram": postcopy mode for live migration
3732 Arguments:
3734 Example:
3736 -> { "execute": "migrate-set-capabilities" , "arguments":
3737 { "capabilities": [ { "capability": "xbzrle", "state": true } ] } }
3739 EQMP
3742 .name = "migrate-set-capabilities",
3743 .args_type = "capabilities:q",
3744 .params = "capability:s,state:b",
3745 .mhandler.cmd_new = qmp_marshal_migrate_set_capabilities,
3747 SQMP
3748 query-migrate-capabilities
3749 --------------------------
3751 Query current migration capabilities
3753 - "capabilities": migration capabilities state
3754 - "xbzrle" : XBZRLE state (json-bool)
3755 - "rdma-pin-all" : RDMA Pin Page state (json-bool)
3756 - "auto-converge" : Auto Converge state (json-bool)
3757 - "zero-blocks" : Zero Blocks state (json-bool)
3758 - "compress": Multiple compression threads state (json-bool)
3759 - "events": Migration state change event state (json-bool)
3760 - "postcopy-ram": postcopy ram state (json-bool)
3762 Arguments:
3764 Example:
3766 -> { "execute": "query-migrate-capabilities" }
3767 <- {"return": [
3768 {"state": false, "capability": "xbzrle"},
3769 {"state": false, "capability": "rdma-pin-all"},
3770 {"state": false, "capability": "auto-converge"},
3771 {"state": false, "capability": "zero-blocks"},
3772 {"state": false, "capability": "compress"},
3773 {"state": true, "capability": "events"},
3774 {"state": false, "capability": "postcopy-ram"}
3777 EQMP
3780 .name = "query-migrate-capabilities",
3781 .args_type = "",
3782 .mhandler.cmd_new = qmp_marshal_query_migrate_capabilities,
3785 SQMP
3786 migrate-set-parameters
3787 ----------------------
3789 Set migration parameters
3791 - "compress-level": set compression level during migration (json-int)
3792 - "compress-threads": set compression thread count for migration (json-int)
3793 - "decompress-threads": set decompression thread count for migration (json-int)
3794 - "cpu-throttle-initial": set initial percentage of time guest cpus are
3795 throttled for auto-converge (json-int)
3796 - "cpu-throttle-increment": set throttle increasing percentage for
3797 auto-converge (json-int)
3799 Arguments:
3801 Example:
3803 -> { "execute": "migrate-set-parameters" , "arguments":
3804 { "compress-level": 1 } }
3806 EQMP
3809 .name = "migrate-set-parameters",
3810 .args_type =
3811 "compress-level:i?,compress-threads:i?,decompress-threads:i?,cpu-throttle-initial:i?,cpu-throttle-increment:i?",
3812 .mhandler.cmd_new = qmp_marshal_migrate_set_parameters,
3814 SQMP
3815 query-migrate-parameters
3816 ------------------------
3818 Query current migration parameters
3820 - "parameters": migration parameters value
3821 - "compress-level" : compression level value (json-int)
3822 - "compress-threads" : compression thread count value (json-int)
3823 - "decompress-threads" : decompression thread count value (json-int)
3824 - "cpu-throttle-initial" : initial percentage of time guest cpus are
3825 throttled (json-int)
3826 - "cpu-throttle-increment" : throttle increasing percentage for
3827 auto-converge (json-int)
3829 Arguments:
3831 Example:
3833 -> { "execute": "query-migrate-parameters" }
3834 <- {
3835 "return": {
3836 "decompress-threads": 2,
3837 "cpu-throttle-increment": 10,
3838 "compress-threads": 8,
3839 "compress-level": 1,
3840 "cpu-throttle-initial": 20
3844 EQMP
3847 .name = "query-migrate-parameters",
3848 .args_type = "",
3849 .mhandler.cmd_new = qmp_marshal_query_migrate_parameters,
3852 SQMP
3853 query-balloon
3854 -------------
3856 Show balloon information.
3858 Make an asynchronous request for balloon info. When the request completes a
3859 json-object will be returned containing the following data:
3861 - "actual": current balloon value in bytes (json-int)
3863 Example:
3865 -> { "execute": "query-balloon" }
3866 <- {
3867 "return":{
3868 "actual":1073741824,
3872 EQMP
3875 .name = "query-balloon",
3876 .args_type = "",
3877 .mhandler.cmd_new = qmp_marshal_query_balloon,
3881 .name = "query-block-jobs",
3882 .args_type = "",
3883 .mhandler.cmd_new = qmp_marshal_query_block_jobs,
3887 .name = "qom-list",
3888 .args_type = "path:s",
3889 .mhandler.cmd_new = qmp_marshal_qom_list,
3893 .name = "qom-set",
3894 .args_type = "path:s,property:s,value:q",
3895 .mhandler.cmd_new = qmp_marshal_qom_set,
3899 .name = "qom-get",
3900 .args_type = "path:s,property:s",
3901 .mhandler.cmd_new = qmp_marshal_qom_get,
3905 .name = "nbd-server-start",
3906 .args_type = "addr:q,tls-creds:s?",
3907 .mhandler.cmd_new = qmp_marshal_nbd_server_start,
3910 .name = "nbd-server-add",
3911 .args_type = "device:B,writable:b?",
3912 .mhandler.cmd_new = qmp_marshal_nbd_server_add,
3915 .name = "nbd-server-stop",
3916 .args_type = "",
3917 .mhandler.cmd_new = qmp_marshal_nbd_server_stop,
3921 .name = "change-vnc-password",
3922 .args_type = "password:s",
3923 .mhandler.cmd_new = qmp_marshal_change_vnc_password,
3926 .name = "qom-list-types",
3927 .args_type = "implements:s?,abstract:b?",
3928 .mhandler.cmd_new = qmp_marshal_qom_list_types,
3932 .name = "device-list-properties",
3933 .args_type = "typename:s",
3934 .mhandler.cmd_new = qmp_marshal_device_list_properties,
3938 .name = "query-machines",
3939 .args_type = "",
3940 .mhandler.cmd_new = qmp_marshal_query_machines,
3944 .name = "query-cpu-definitions",
3945 .args_type = "",
3946 .mhandler.cmd_new = qmp_marshal_query_cpu_definitions,
3950 .name = "query-target",
3951 .args_type = "",
3952 .mhandler.cmd_new = qmp_marshal_query_target,
3956 .name = "query-tpm",
3957 .args_type = "",
3958 .mhandler.cmd_new = qmp_marshal_query_tpm,
3961 SQMP
3962 query-tpm
3963 ---------
3965 Return information about the TPM device.
3967 Arguments: None
3969 Example:
3971 -> { "execute": "query-tpm" }
3972 <- { "return":
3974 { "model": "tpm-tis",
3975 "options":
3976 { "type": "passthrough",
3977 "data":
3978 { "cancel-path": "/sys/class/misc/tpm0/device/cancel",
3979 "path": "/dev/tpm0"
3982 "id": "tpm0"
3987 EQMP
3990 .name = "query-tpm-models",
3991 .args_type = "",
3992 .mhandler.cmd_new = qmp_marshal_query_tpm_models,
3995 SQMP
3996 query-tpm-models
3997 ----------------
3999 Return a list of supported TPM models.
4001 Arguments: None
4003 Example:
4005 -> { "execute": "query-tpm-models" }
4006 <- { "return": [ "tpm-tis" ] }
4008 EQMP
4011 .name = "query-tpm-types",
4012 .args_type = "",
4013 .mhandler.cmd_new = qmp_marshal_query_tpm_types,
4016 SQMP
4017 query-tpm-types
4018 ---------------
4020 Return a list of supported TPM types.
4022 Arguments: None
4024 Example:
4026 -> { "execute": "query-tpm-types" }
4027 <- { "return": [ "passthrough" ] }
4029 EQMP
4032 .name = "chardev-add",
4033 .args_type = "id:s,backend:q",
4034 .mhandler.cmd_new = qmp_marshal_chardev_add,
4037 SQMP
4038 chardev-add
4039 ----------------
4041 Add a chardev.
4043 Arguments:
4045 - "id": the chardev's ID, must be unique (json-string)
4046 - "backend": chardev backend type + parameters
4048 Examples:
4050 -> { "execute" : "chardev-add",
4051 "arguments" : { "id" : "foo",
4052 "backend" : { "type" : "null", "data" : {} } } }
4053 <- { "return": {} }
4055 -> { "execute" : "chardev-add",
4056 "arguments" : { "id" : "bar",
4057 "backend" : { "type" : "file",
4058 "data" : { "out" : "/tmp/bar.log" } } } }
4059 <- { "return": {} }
4061 -> { "execute" : "chardev-add",
4062 "arguments" : { "id" : "baz",
4063 "backend" : { "type" : "pty", "data" : {} } } }
4064 <- { "return": { "pty" : "/dev/pty/42" } }
4066 EQMP
4069 .name = "chardev-remove",
4070 .args_type = "id:s",
4071 .mhandler.cmd_new = qmp_marshal_chardev_remove,
4075 SQMP
4076 chardev-remove
4077 --------------
4079 Remove a chardev.
4081 Arguments:
4083 - "id": the chardev's ID, must exist and not be in use (json-string)
4085 Example:
4087 -> { "execute": "chardev-remove", "arguments": { "id" : "foo" } }
4088 <- { "return": {} }
4090 EQMP
4092 .name = "query-rx-filter",
4093 .args_type = "name:s?",
4094 .mhandler.cmd_new = qmp_marshal_query_rx_filter,
4097 SQMP
4098 query-rx-filter
4099 ---------------
4101 Show rx-filter information.
4103 Returns a json-array of rx-filter information for all NICs (or for the
4104 given NIC), returning an error if the given NIC doesn't exist, or
4105 given NIC doesn't support rx-filter querying, or given net client
4106 isn't a NIC.
4108 The query will clear the event notification flag of each NIC, then qemu
4109 will start to emit event to QMP monitor.
4111 Each array entry contains the following:
4113 - "name": net client name (json-string)
4114 - "promiscuous": promiscuous mode is enabled (json-bool)
4115 - "multicast": multicast receive state (one of 'normal', 'none', 'all')
4116 - "unicast": unicast receive state (one of 'normal', 'none', 'all')
4117 - "vlan": vlan receive state (one of 'normal', 'none', 'all') (Since 2.0)
4118 - "broadcast-allowed": allow to receive broadcast (json-bool)
4119 - "multicast-overflow": multicast table is overflowed (json-bool)
4120 - "unicast-overflow": unicast table is overflowed (json-bool)
4121 - "main-mac": main macaddr string (json-string)
4122 - "vlan-table": a json-array of active vlan id
4123 - "unicast-table": a json-array of unicast macaddr string
4124 - "multicast-table": a json-array of multicast macaddr string
4126 Example:
4128 -> { "execute": "query-rx-filter", "arguments": { "name": "vnet0" } }
4129 <- { "return": [
4131 "promiscuous": true,
4132 "name": "vnet0",
4133 "main-mac": "52:54:00:12:34:56",
4134 "unicast": "normal",
4135 "vlan": "normal",
4136 "vlan-table": [
4140 "unicast-table": [
4142 "multicast": "normal",
4143 "multicast-overflow": false,
4144 "unicast-overflow": false,
4145 "multicast-table": [
4146 "01:00:5e:00:00:01",
4147 "33:33:00:00:00:01",
4148 "33:33:ff:12:34:56"
4150 "broadcast-allowed": false
4155 EQMP
4158 .name = "blockdev-add",
4159 .args_type = "options:q",
4160 .mhandler.cmd_new = qmp_marshal_blockdev_add,
4163 SQMP
4164 blockdev-add
4165 ------------
4167 Add a block device.
4169 This command is still a work in progress. It doesn't support all
4170 block drivers among other things. Stay away from it unless you want
4171 to help with its development.
4173 Arguments:
4175 - "options": block driver options
4177 Example (1):
4179 -> { "execute": "blockdev-add",
4180 "arguments": { "options" : { "driver": "qcow2",
4181 "file": { "driver": "file",
4182 "filename": "test.qcow2" } } } }
4183 <- { "return": {} }
4185 Example (2):
4187 -> { "execute": "blockdev-add",
4188 "arguments": {
4189 "options": {
4190 "driver": "qcow2",
4191 "id": "my_disk",
4192 "discard": "unmap",
4193 "cache": {
4194 "direct": true,
4195 "writeback": true
4197 "file": {
4198 "driver": "file",
4199 "filename": "/tmp/test.qcow2"
4201 "backing": {
4202 "driver": "raw",
4203 "file": {
4204 "driver": "file",
4205 "filename": "/dev/fdset/4"
4212 <- { "return": {} }
4214 EQMP
4217 .name = "x-blockdev-del",
4218 .args_type = "id:s?,node-name:s?",
4219 .mhandler.cmd_new = qmp_marshal_x_blockdev_del,
4222 SQMP
4223 x-blockdev-del
4224 ------------
4225 Since 2.5
4227 Deletes a block device thas has been added using blockdev-add.
4228 The selected device can be either a block backend or a graph node.
4230 In the former case the backend will be destroyed, along with its
4231 inserted medium if there's any. The command will fail if the backend
4232 or its medium are in use.
4234 In the latter case the node will be destroyed. The command will fail
4235 if the node is attached to a block backend or is otherwise being
4236 used.
4238 One of "id" or "node-name" must be specified, but not both.
4240 This command is still a work in progress and is considered
4241 experimental. Stay away from it unless you want to help with its
4242 development.
4244 Arguments:
4246 - "id": Name of the block backend device to delete (json-string, optional)
4247 - "node-name": Name of the graph node to delete (json-string, optional)
4249 Example:
4251 -> { "execute": "blockdev-add",
4252 "arguments": {
4253 "options": {
4254 "driver": "qcow2",
4255 "id": "drive0",
4256 "file": {
4257 "driver": "file",
4258 "filename": "test.qcow2"
4264 <- { "return": {} }
4266 -> { "execute": "x-blockdev-del",
4267 "arguments": { "id": "drive0" }
4269 <- { "return": {} }
4271 EQMP
4274 .name = "blockdev-open-tray",
4275 .args_type = "device:s,force:b?",
4276 .mhandler.cmd_new = qmp_marshal_blockdev_open_tray,
4279 SQMP
4280 blockdev-open-tray
4281 ------------------
4283 Opens a block device's tray. If there is a block driver state tree inserted as a
4284 medium, it will become inaccessible to the guest (but it will remain associated
4285 to the block device, so closing the tray will make it accessible again).
4287 If the tray was already open before, this will be a no-op.
4289 Once the tray opens, a DEVICE_TRAY_MOVED event is emitted. There are cases in
4290 which no such event will be generated, these include:
4291 - if the guest has locked the tray, @force is false and the guest does not
4292 respond to the eject request
4293 - if the BlockBackend denoted by @device does not have a guest device attached
4294 to it
4295 - if the guest device does not have an actual tray and is empty, for instance
4296 for floppy disk drives
4298 Arguments:
4300 - "device": block device name (json-string)
4301 - "force": if false (the default), an eject request will be sent to the guest if
4302 it has locked the tray (and the tray will not be opened immediately);
4303 if true, the tray will be opened regardless of whether it is locked
4304 (json-bool, optional)
4306 Example:
4308 -> { "execute": "blockdev-open-tray",
4309 "arguments": { "device": "ide1-cd0" } }
4311 <- { "timestamp": { "seconds": 1418751016,
4312 "microseconds": 716996 },
4313 "event": "DEVICE_TRAY_MOVED",
4314 "data": { "device": "ide1-cd0",
4315 "tray-open": true } }
4317 <- { "return": {} }
4319 EQMP
4322 .name = "blockdev-close-tray",
4323 .args_type = "device:s",
4324 .mhandler.cmd_new = qmp_marshal_blockdev_close_tray,
4327 SQMP
4328 blockdev-close-tray
4329 -------------------
4331 Closes a block device's tray. If there is a block driver state tree associated
4332 with the block device (which is currently ejected), that tree will be loaded as
4333 the medium.
4335 If the tray was already closed before, this will be a no-op.
4337 Arguments:
4339 - "device": block device name (json-string)
4341 Example:
4343 -> { "execute": "blockdev-close-tray",
4344 "arguments": { "device": "ide1-cd0" } }
4346 <- { "timestamp": { "seconds": 1418751345,
4347 "microseconds": 272147 },
4348 "event": "DEVICE_TRAY_MOVED",
4349 "data": { "device": "ide1-cd0",
4350 "tray-open": false } }
4352 <- { "return": {} }
4354 EQMP
4357 .name = "x-blockdev-remove-medium",
4358 .args_type = "device:s",
4359 .mhandler.cmd_new = qmp_marshal_x_blockdev_remove_medium,
4362 SQMP
4363 x-blockdev-remove-medium
4364 ------------------------
4366 Removes a medium (a block driver state tree) from a block device. That block
4367 device's tray must currently be open (unless there is no attached guest device).
4369 If the tray is open and there is no medium inserted, this will be a no-op.
4371 This command is still a work in progress and is considered experimental.
4372 Stay away from it unless you want to help with its development.
4374 Arguments:
4376 - "device": block device name (json-string)
4378 Example:
4380 -> { "execute": "x-blockdev-remove-medium",
4381 "arguments": { "device": "ide1-cd0" } }
4383 <- { "error": { "class": "GenericError",
4384 "desc": "Tray of device 'ide1-cd0' is not open" } }
4386 -> { "execute": "blockdev-open-tray",
4387 "arguments": { "device": "ide1-cd0" } }
4389 <- { "timestamp": { "seconds": 1418751627,
4390 "microseconds": 549958 },
4391 "event": "DEVICE_TRAY_MOVED",
4392 "data": { "device": "ide1-cd0",
4393 "tray-open": true } }
4395 <- { "return": {} }
4397 -> { "execute": "x-blockdev-remove-medium",
4398 "arguments": { "device": "ide1-cd0" } }
4400 <- { "return": {} }
4402 EQMP
4405 .name = "x-blockdev-insert-medium",
4406 .args_type = "device:s,node-name:s",
4407 .mhandler.cmd_new = qmp_marshal_x_blockdev_insert_medium,
4410 SQMP
4411 x-blockdev-insert-medium
4412 ------------------------
4414 Inserts a medium (a block driver state tree) into a block device. That block
4415 device's tray must currently be open (unless there is no attached guest device)
4416 and there must be no medium inserted already.
4418 This command is still a work in progress and is considered experimental.
4419 Stay away from it unless you want to help with its development.
4421 Arguments:
4423 - "device": block device name (json-string)
4424 - "node-name": root node of the BDS tree to insert into the block device
4426 Example:
4428 -> { "execute": "blockdev-add",
4429 "arguments": { "options": { "node-name": "node0",
4430 "driver": "raw",
4431 "file": { "driver": "file",
4432 "filename": "fedora.iso" } } } }
4434 <- { "return": {} }
4436 -> { "execute": "x-blockdev-insert-medium",
4437 "arguments": { "device": "ide1-cd0",
4438 "node-name": "node0" } }
4440 <- { "return": {} }
4442 EQMP
4445 .name = "x-blockdev-change",
4446 .args_type = "parent:B,child:B?,node:B?",
4447 .mhandler.cmd_new = qmp_marshal_x_blockdev_change,
4450 SQMP
4451 x-blockdev-change
4452 -----------------
4454 Dynamically reconfigure the block driver state graph. It can be used
4455 to add, remove, insert or replace a graph node. Currently only the
4456 Quorum driver implements this feature to add or remove its child. This
4457 is useful to fix a broken quorum child.
4459 If @node is specified, it will be inserted under @parent. @child
4460 may not be specified in this case. If both @parent and @child are
4461 specified but @node is not, @child will be detached from @parent.
4463 Arguments:
4464 - "parent": the id or name of the parent node (json-string)
4465 - "child": the name of a child under the given parent node (json-string, optional)
4466 - "node": the name of the node that will be added (json-string, optional)
4468 Note: this command is experimental, and not a stable API. It doesn't
4469 support all kinds of operations, all kinds of children, nor all block
4470 drivers.
4472 Warning: The data in a new quorum child MUST be consistent with that of
4473 the rest of the array.
4475 Example:
4477 Add a new node to a quorum
4478 -> { "execute": "blockdev-add",
4479 "arguments": { "options": { "driver": "raw",
4480 "node-name": "new_node",
4481 "file": { "driver": "file",
4482 "filename": "test.raw" } } } }
4483 <- { "return": {} }
4484 -> { "execute": "x-blockdev-change",
4485 "arguments": { "parent": "disk1",
4486 "node": "new_node" } }
4487 <- { "return": {} }
4489 Delete a quorum's node
4490 -> { "execute": "x-blockdev-change",
4491 "arguments": { "parent": "disk1",
4492 "child": "children.1" } }
4493 <- { "return": {} }
4495 EQMP
4498 .name = "query-named-block-nodes",
4499 .args_type = "",
4500 .mhandler.cmd_new = qmp_marshal_query_named_block_nodes,
4503 SQMP
4504 @query-named-block-nodes
4505 ------------------------
4507 Return a list of BlockDeviceInfo for all the named block driver nodes
4509 Example:
4511 -> { "execute": "query-named-block-nodes" }
4512 <- { "return": [ { "ro":false,
4513 "drv":"qcow2",
4514 "encrypted":false,
4515 "file":"disks/test.qcow2",
4516 "node-name": "my-node",
4517 "backing_file_depth":1,
4518 "bps":1000000,
4519 "bps_rd":0,
4520 "bps_wr":0,
4521 "iops":1000000,
4522 "iops_rd":0,
4523 "iops_wr":0,
4524 "bps_max": 8000000,
4525 "bps_rd_max": 0,
4526 "bps_wr_max": 0,
4527 "iops_max": 0,
4528 "iops_rd_max": 0,
4529 "iops_wr_max": 0,
4530 "iops_size": 0,
4531 "write_threshold": 0,
4532 "image":{
4533 "filename":"disks/test.qcow2",
4534 "format":"qcow2",
4535 "virtual-size":2048000,
4536 "backing_file":"base.qcow2",
4537 "full-backing-filename":"disks/base.qcow2",
4538 "backing-filename-format":"qcow2",
4539 "snapshots":[
4541 "id": "1",
4542 "name": "snapshot1",
4543 "vm-state-size": 0,
4544 "date-sec": 10000200,
4545 "date-nsec": 12,
4546 "vm-clock-sec": 206,
4547 "vm-clock-nsec": 30
4550 "backing-image":{
4551 "filename":"disks/base.qcow2",
4552 "format":"qcow2",
4553 "virtual-size":2048000
4555 } } ] }
4557 EQMP
4560 .name = "blockdev-change-medium",
4561 .args_type = "device:B,filename:F,format:s?,read-only-mode:s?",
4562 .mhandler.cmd_new = qmp_marshal_blockdev_change_medium,
4565 SQMP
4566 blockdev-change-medium
4567 ----------------------
4569 Changes the medium inserted into a block device by ejecting the current medium
4570 and loading a new image file which is inserted as the new medium.
4572 Arguments:
4574 - "device": device name (json-string)
4575 - "filename": filename of the new image (json-string)
4576 - "format": format of the new image (json-string, optional)
4577 - "read-only-mode": new read-only mode (json-string, optional)
4578 - Possible values: "retain" (default), "read-only", "read-write"
4580 Examples:
4582 1. Change a removable medium
4584 -> { "execute": "blockdev-change-medium",
4585 "arguments": { "device": "ide1-cd0",
4586 "filename": "/srv/images/Fedora-12-x86_64-DVD.iso",
4587 "format": "raw" } }
4588 <- { "return": {} }
4590 2. Load a read-only medium into a writable drive
4592 -> { "execute": "blockdev-change-medium",
4593 "arguments": { "device": "isa-fd0",
4594 "filename": "/srv/images/ro.img",
4595 "format": "raw",
4596 "read-only-mode": "retain" } }
4598 <- { "error":
4599 { "class": "GenericError",
4600 "desc": "Could not open '/srv/images/ro.img': Permission denied" } }
4602 -> { "execute": "blockdev-change-medium",
4603 "arguments": { "device": "isa-fd0",
4604 "filename": "/srv/images/ro.img",
4605 "format": "raw",
4606 "read-only-mode": "read-only" } }
4608 <- { "return": {} }
4610 EQMP
4613 .name = "query-memdev",
4614 .args_type = "",
4615 .mhandler.cmd_new = qmp_marshal_query_memdev,
4618 SQMP
4619 query-memdev
4620 ------------
4622 Show memory devices information.
4625 Example (1):
4627 -> { "execute": "query-memdev" }
4628 <- { "return": [
4630 "size": 536870912,
4631 "merge": false,
4632 "dump": true,
4633 "prealloc": false,
4634 "host-nodes": [0, 1],
4635 "policy": "bind"
4638 "size": 536870912,
4639 "merge": false,
4640 "dump": true,
4641 "prealloc": true,
4642 "host-nodes": [2, 3],
4643 "policy": "preferred"
4648 EQMP
4651 .name = "query-memory-devices",
4652 .args_type = "",
4653 .mhandler.cmd_new = qmp_marshal_query_memory_devices,
4656 SQMP
4657 @query-memory-devices
4658 --------------------
4660 Return a list of memory devices.
4662 Example:
4663 -> { "execute": "query-memory-devices" }
4664 <- { "return": [ { "data":
4665 { "addr": 5368709120,
4666 "hotpluggable": true,
4667 "hotplugged": true,
4668 "id": "d1",
4669 "memdev": "/objects/memX",
4670 "node": 0,
4671 "size": 1073741824,
4672 "slot": 0},
4673 "type": "dimm"
4674 } ] }
4675 EQMP
4678 .name = "query-acpi-ospm-status",
4679 .args_type = "",
4680 .mhandler.cmd_new = qmp_marshal_query_acpi_ospm_status,
4683 SQMP
4684 @query-acpi-ospm-status
4685 --------------------
4687 Return list of ACPIOSTInfo for devices that support status reporting
4688 via ACPI _OST method.
4690 Example:
4691 -> { "execute": "query-acpi-ospm-status" }
4692 <- { "return": [ { "device": "d1", "slot": "0", "slot-type": "DIMM", "source": 1, "status": 0},
4693 { "slot": "1", "slot-type": "DIMM", "source": 0, "status": 0},
4694 { "slot": "2", "slot-type": "DIMM", "source": 0, "status": 0},
4695 { "slot": "3", "slot-type": "DIMM", "source": 0, "status": 0}
4697 EQMP
4699 #if defined TARGET_I386
4701 .name = "rtc-reset-reinjection",
4702 .args_type = "",
4703 .mhandler.cmd_new = qmp_marshal_rtc_reset_reinjection,
4705 #endif
4707 SQMP
4708 rtc-reset-reinjection
4709 ---------------------
4711 Reset the RTC interrupt reinjection backlog.
4713 Arguments: None.
4715 Example:
4717 -> { "execute": "rtc-reset-reinjection" }
4718 <- { "return": {} }
4719 EQMP
4722 .name = "trace-event-get-state",
4723 .args_type = "name:s,vcpu:i?",
4724 .mhandler.cmd_new = qmp_marshal_trace_event_get_state,
4727 SQMP
4728 trace-event-get-state
4729 ---------------------
4731 Query the state of events.
4733 Arguments:
4735 - "name": Event name pattern (json-string).
4736 - "vcpu": The vCPU to query, any vCPU by default (json-int, optional).
4738 An event is returned if:
4739 - its name matches the "name" pattern, and
4740 - if "vcpu" is given, the event has the "vcpu" property.
4742 Therefore, if "vcpu" is given, the operation will only match per-vCPU events,
4743 returning their state on the specified vCPU. Special case: if "name" is an exact
4744 match, "vcpu" is given and the event does not have the "vcpu" property, an error
4745 is returned.
4747 Example:
4749 -> { "execute": "trace-event-get-state", "arguments": { "name": "qemu_memalign" } }
4750 <- { "return": [ { "name": "qemu_memalign", "state": "disabled" } ] }
4751 EQMP
4754 .name = "trace-event-set-state",
4755 .args_type = "name:s,enable:b,ignore-unavailable:b?,vcpu:i?",
4756 .mhandler.cmd_new = qmp_marshal_trace_event_set_state,
4759 SQMP
4760 trace-event-set-state
4761 ---------------------
4763 Set the state of events.
4765 Arguments:
4767 - "name": Event name pattern (json-string).
4768 - "enable": Whether to enable or disable the event (json-bool).
4769 - "ignore-unavailable": Whether to ignore errors for events that cannot be
4770 changed (json-bool, optional).
4771 - "vcpu": The vCPU to act upon, all vCPUs by default (json-int, optional).
4773 An event's state is modified if:
4774 - its name matches the "name" pattern, and
4775 - if "vcpu" is given, the event has the "vcpu" property.
4777 Therefore, if "vcpu" is given, the operation will only match per-vCPU events,
4778 setting their state on the specified vCPU. Special case: if "name" is an exact
4779 match, "vcpu" is given and the event does not have the "vcpu" property, an error
4780 is returned.
4782 Example:
4784 -> { "execute": "trace-event-set-state", "arguments": { "name": "qemu_memalign", "enable": "true" } }
4785 <- { "return": {} }
4786 EQMP
4789 .name = "input-send-event",
4790 .args_type = "console:i?,events:q",
4791 .mhandler.cmd_new = qmp_marshal_input_send_event,
4794 SQMP
4795 @input-send-event
4796 -----------------
4798 Send input event to guest.
4800 Arguments:
4802 - "device": display device (json-string, optional)
4803 - "head": display head (json-int, optional)
4804 - "events": list of input events
4806 The consoles are visible in the qom tree, under
4807 /backend/console[$index]. They have a device link and head property, so
4808 it is possible to map which console belongs to which device and display.
4810 Example (1):
4812 Press left mouse button.
4814 -> { "execute": "input-send-event",
4815 "arguments": { "device": "video0",
4816 "events": [ { "type": "btn",
4817 "data" : { "down": true, "button": "left" } } ] } }
4818 <- { "return": {} }
4820 -> { "execute": "input-send-event",
4821 "arguments": { "device": "video0",
4822 "events": [ { "type": "btn",
4823 "data" : { "down": false, "button": "left" } } ] } }
4824 <- { "return": {} }
4826 Example (2):
4828 Press ctrl-alt-del.
4830 -> { "execute": "input-send-event",
4831 "arguments": { "events": [
4832 { "type": "key", "data" : { "down": true,
4833 "key": {"type": "qcode", "data": "ctrl" } } },
4834 { "type": "key", "data" : { "down": true,
4835 "key": {"type": "qcode", "data": "alt" } } },
4836 { "type": "key", "data" : { "down": true,
4837 "key": {"type": "qcode", "data": "delete" } } } ] } }
4838 <- { "return": {} }
4840 Example (3):
4842 Move mouse pointer to absolute coordinates (20000, 400).
4844 -> { "execute": "input-send-event" ,
4845 "arguments": { "events": [
4846 { "type": "abs", "data" : { "axis": "x", "value" : 20000 } },
4847 { "type": "abs", "data" : { "axis": "y", "value" : 400 } } ] } }
4848 <- { "return": {} }
4850 EQMP
4853 .name = "block-set-write-threshold",
4854 .args_type = "node-name:s,write-threshold:l",
4855 .mhandler.cmd_new = qmp_marshal_block_set_write_threshold,
4858 SQMP
4859 block-set-write-threshold
4860 ------------
4862 Change the write threshold for a block drive. The threshold is an offset,
4863 thus must be non-negative. Default is no write threshold.
4864 Setting the threshold to zero disables it.
4866 Arguments:
4868 - "node-name": the node name in the block driver state graph (json-string)
4869 - "write-threshold": the write threshold in bytes (json-int)
4871 Example:
4873 -> { "execute": "block-set-write-threshold",
4874 "arguments": { "node-name": "mydev",
4875 "write-threshold": 17179869184 } }
4876 <- { "return": {} }
4878 EQMP
4881 .name = "query-rocker",
4882 .args_type = "name:s",
4883 .mhandler.cmd_new = qmp_marshal_query_rocker,
4886 SQMP
4887 Show rocker switch
4888 ------------------
4890 Arguments:
4892 - "name": switch name
4894 Example:
4896 -> { "execute": "query-rocker", "arguments": { "name": "sw1" } }
4897 <- { "return": {"name": "sw1", "ports": 2, "id": 1327446905938}}
4899 EQMP
4902 .name = "query-rocker-ports",
4903 .args_type = "name:s",
4904 .mhandler.cmd_new = qmp_marshal_query_rocker_ports,
4907 SQMP
4908 Show rocker switch ports
4909 ------------------------
4911 Arguments:
4913 - "name": switch name
4915 Example:
4917 -> { "execute": "query-rocker-ports", "arguments": { "name": "sw1" } }
4918 <- { "return": [ {"duplex": "full", "enabled": true, "name": "sw1.1",
4919 "autoneg": "off", "link-up": true, "speed": 10000},
4920 {"duplex": "full", "enabled": true, "name": "sw1.2",
4921 "autoneg": "off", "link-up": true, "speed": 10000}
4924 EQMP
4927 .name = "query-rocker-of-dpa-flows",
4928 .args_type = "name:s,tbl-id:i?",
4929 .mhandler.cmd_new = qmp_marshal_query_rocker_of_dpa_flows,
4932 SQMP
4933 Show rocker switch OF-DPA flow tables
4934 -------------------------------------
4936 Arguments:
4938 - "name": switch name
4939 - "tbl-id": (optional) flow table ID
4941 Example:
4943 -> { "execute": "query-rocker-of-dpa-flows", "arguments": { "name": "sw1" } }
4944 <- { "return": [ {"key": {"in-pport": 0, "priority": 1, "tbl-id": 0},
4945 "hits": 138,
4946 "cookie": 0,
4947 "action": {"goto-tbl": 10},
4948 "mask": {"in-pport": 4294901760}
4950 {...more...},
4953 EQMP
4956 .name = "query-rocker-of-dpa-groups",
4957 .args_type = "name:s,type:i?",
4958 .mhandler.cmd_new = qmp_marshal_query_rocker_of_dpa_groups,
4961 SQMP
4962 Show rocker OF-DPA group tables
4963 -------------------------------
4965 Arguments:
4967 - "name": switch name
4968 - "type": (optional) group type
4970 Example:
4972 -> { "execute": "query-rocker-of-dpa-groups", "arguments": { "name": "sw1" } }
4973 <- { "return": [ {"type": 0, "out-pport": 2, "pport": 2, "vlan-id": 3841,
4974 "pop-vlan": 1, "id": 251723778},
4975 {"type": 0, "out-pport": 0, "pport": 0, "vlan-id": 3841,
4976 "pop-vlan": 1, "id": 251723776},
4977 {"type": 0, "out-pport": 1, "pport": 1, "vlan-id": 3840,
4978 "pop-vlan": 1, "id": 251658241},
4979 {"type": 0, "out-pport": 0, "pport": 0, "vlan-id": 3840,
4980 "pop-vlan": 1, "id": 251658240}
4983 EQMP
4985 #if defined TARGET_ARM
4987 .name = "query-gic-capabilities",
4988 .args_type = "",
4989 .mhandler.cmd_new = qmp_marshal_query_gic_capabilities,
4991 #endif
4993 SQMP
4994 query-gic-capabilities
4995 ---------------
4997 Return a list of GICCapability objects, describing supported GIC
4998 (Generic Interrupt Controller) versions.
5000 Arguments: None
5002 Example:
5004 -> { "execute": "query-gic-capabilities" }
5005 <- { "return": [{ "version": 2, "emulated": true, "kernel": false },
5006 { "version": 3, "emulated": false, "kernel": true } ] }
5008 EQMP
5011 .name = "query-hotpluggable-cpus",
5012 .args_type = "",
5013 .mhandler.cmd_new = qmp_marshal_query_hotpluggable_cpus,
5016 SQMP
5017 Show existing/possible CPUs
5018 ---------------------------
5020 Arguments: None.
5022 Example for pseries machine type started with
5023 -smp 2,cores=2,maxcpus=4 -cpu POWER8:
5025 -> { "execute": "query-hotpluggable-cpus" }
5026 <- {"return": [
5027 { "props": { "core-id": 8 }, "type": "POWER8-spapr-cpu-core",
5028 "vcpus-count": 1 },
5029 { "props": { "core-id": 0 }, "type": "POWER8-spapr-cpu-core",
5030 "vcpus-count": 1, "qom-path": "/machine/unattached/device[0]"}
5033 Example for pc machine type started with
5034 -smp 1,maxcpus=2:
5035 -> { "execute": "query-hotpluggable-cpus" }
5036 <- {"return": [
5038 "type": "qemu64-x86_64-cpu", "vcpus-count": 1,
5039 "props": {"core-id": 0, "socket-id": 1, "thread-id": 0}
5042 "qom-path": "/machine/unattached/device[0]",
5043 "type": "qemu64-x86_64-cpu", "vcpus-count": 1,
5044 "props": {"core-id": 0, "socket-id": 0, "thread-id": 0}