block: Accept node-name for blockdev-mirror
[qemu.git] / qmp-commands.hx
blob034d51718c56dc25ddec1aea6867eeada62ed574
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 name of the device 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": device name to snapshot (json-string)
1411 - "name": name of the new snapshot (json-string)
1413 Example:
1415 -> { "execute": "transaction",
1416 "arguments": { "actions": [
1417 { "type": "blockdev-snapshot-sync", "data" : { "device": "ide-hd0",
1418 "snapshot-file": "/some/place/my-image",
1419 "format": "qcow2" } },
1420 { "type": "blockdev-snapshot-sync", "data" : { "node-name": "myfile",
1421 "snapshot-file": "/some/place/my-image2",
1422 "snapshot-node-name": "node3432",
1423 "mode": "existing",
1424 "format": "qcow2" } },
1425 { "type": "blockdev-snapshot-sync", "data" : { "device": "ide-hd1",
1426 "snapshot-file": "/some/place/my-image2",
1427 "mode": "existing",
1428 "format": "qcow2" } },
1429 { "type": "blockdev-snapshot-internal-sync", "data" : {
1430 "device": "ide-hd2",
1431 "name": "snapshot0" } } ] } }
1432 <- { "return": {} }
1434 EQMP
1437 .name = "block-dirty-bitmap-add",
1438 .args_type = "node:B,name:s,granularity:i?",
1439 .mhandler.cmd_new = qmp_marshal_block_dirty_bitmap_add,
1442 SQMP
1444 block-dirty-bitmap-add
1445 ----------------------
1446 Since 2.4
1448 Create a dirty bitmap with a name on the device, and start tracking the writes.
1450 Arguments:
1452 - "node": device/node on which to create dirty bitmap (json-string)
1453 - "name": name of the new dirty bitmap (json-string)
1454 - "granularity": granularity to track writes with (int, optional)
1456 Example:
1458 -> { "execute": "block-dirty-bitmap-add", "arguments": { "node": "drive0",
1459 "name": "bitmap0" } }
1460 <- { "return": {} }
1462 EQMP
1465 .name = "block-dirty-bitmap-remove",
1466 .args_type = "node:B,name:s",
1467 .mhandler.cmd_new = qmp_marshal_block_dirty_bitmap_remove,
1470 SQMP
1472 block-dirty-bitmap-remove
1473 -------------------------
1474 Since 2.4
1476 Stop write tracking and remove the dirty bitmap that was created with
1477 block-dirty-bitmap-add.
1479 Arguments:
1481 - "node": device/node on which to remove dirty bitmap (json-string)
1482 - "name": name of the dirty bitmap to remove (json-string)
1484 Example:
1486 -> { "execute": "block-dirty-bitmap-remove", "arguments": { "node": "drive0",
1487 "name": "bitmap0" } }
1488 <- { "return": {} }
1490 EQMP
1493 .name = "block-dirty-bitmap-clear",
1494 .args_type = "node:B,name:s",
1495 .mhandler.cmd_new = qmp_marshal_block_dirty_bitmap_clear,
1498 SQMP
1500 block-dirty-bitmap-clear
1501 ------------------------
1502 Since 2.4
1504 Reset the dirty bitmap associated with a node so that an incremental backup
1505 from this point in time forward will only backup clusters modified after this
1506 clear operation.
1508 Arguments:
1510 - "node": device/node on which to remove dirty bitmap (json-string)
1511 - "name": name of the dirty bitmap to remove (json-string)
1513 Example:
1515 -> { "execute": "block-dirty-bitmap-clear", "arguments": { "node": "drive0",
1516 "name": "bitmap0" } }
1517 <- { "return": {} }
1519 EQMP
1522 .name = "blockdev-snapshot-sync",
1523 .args_type = "device:s?,node-name:s?,snapshot-file:s,snapshot-node-name:s?,format:s?,mode:s?",
1524 .mhandler.cmd_new = qmp_marshal_blockdev_snapshot_sync,
1527 SQMP
1528 blockdev-snapshot-sync
1529 ----------------------
1531 Synchronous snapshot of a block device. snapshot-file specifies the
1532 target of the new image. If the file exists, or if it is a device, the
1533 snapshot will be created in the existing file/device. If does not
1534 exist, a new file will be created. format specifies the format of the
1535 snapshot image, default is qcow2.
1537 Arguments:
1539 - "device": device name to snapshot (json-string)
1540 - "node-name": graph node name to snapshot (json-string)
1541 - "snapshot-file": name of new image file (json-string)
1542 - "snapshot-node-name": graph node name of the new snapshot (json-string)
1543 - "mode": whether and how QEMU should create the snapshot file
1544 (NewImageMode, optional, default "absolute-paths")
1545 - "format": format of new image (json-string, optional)
1547 Example:
1549 -> { "execute": "blockdev-snapshot-sync", "arguments": { "device": "ide-hd0",
1550 "snapshot-file":
1551 "/some/place/my-image",
1552 "format": "qcow2" } }
1553 <- { "return": {} }
1555 EQMP
1558 .name = "blockdev-snapshot",
1559 .args_type = "node:s,overlay:s",
1560 .mhandler.cmd_new = qmp_marshal_blockdev_snapshot,
1563 SQMP
1564 blockdev-snapshot
1565 -----------------
1566 Since 2.5
1568 Create a snapshot, by installing 'node' as the backing image of
1569 'overlay'. Additionally, if 'node' is associated with a block
1570 device, the block device changes to using 'overlay' as its new active
1571 image.
1573 Arguments:
1575 - "node": device that will have a snapshot created (json-string)
1576 - "overlay": device that will have 'node' as its backing image (json-string)
1578 Example:
1580 -> { "execute": "blockdev-add",
1581 "arguments": { "options": { "driver": "qcow2",
1582 "node-name": "node1534",
1583 "file": { "driver": "file",
1584 "filename": "hd1.qcow2" },
1585 "backing": "" } } }
1587 <- { "return": {} }
1589 -> { "execute": "blockdev-snapshot", "arguments": { "node": "ide-hd0",
1590 "overlay": "node1534" } }
1591 <- { "return": {} }
1593 EQMP
1596 .name = "blockdev-snapshot-internal-sync",
1597 .args_type = "device:B,name:s",
1598 .mhandler.cmd_new = qmp_marshal_blockdev_snapshot_internal_sync,
1601 SQMP
1602 blockdev-snapshot-internal-sync
1603 -------------------------------
1605 Synchronously take an internal snapshot of a block device when the format of
1606 image used supports it. If the name is an empty string, or a snapshot with
1607 name already exists, the operation will fail.
1609 Arguments:
1611 - "device": device name to snapshot (json-string)
1612 - "name": name of the new snapshot (json-string)
1614 Example:
1616 -> { "execute": "blockdev-snapshot-internal-sync",
1617 "arguments": { "device": "ide-hd0",
1618 "name": "snapshot0" }
1620 <- { "return": {} }
1622 EQMP
1625 .name = "blockdev-snapshot-delete-internal-sync",
1626 .args_type = "device:B,id:s?,name:s?",
1627 .mhandler.cmd_new =
1628 qmp_marshal_blockdev_snapshot_delete_internal_sync,
1631 SQMP
1632 blockdev-snapshot-delete-internal-sync
1633 --------------------------------------
1635 Synchronously delete an internal snapshot of a block device when the format of
1636 image used supports it. The snapshot is identified by name or id or both. One
1637 of name or id is required. If the snapshot is not found, the operation will
1638 fail.
1640 Arguments:
1642 - "device": device name (json-string)
1643 - "id": ID of the snapshot (json-string, optional)
1644 - "name": name of the snapshot (json-string, optional)
1646 Example:
1648 -> { "execute": "blockdev-snapshot-delete-internal-sync",
1649 "arguments": { "device": "ide-hd0",
1650 "name": "snapshot0" }
1652 <- { "return": {
1653 "id": "1",
1654 "name": "snapshot0",
1655 "vm-state-size": 0,
1656 "date-sec": 1000012,
1657 "date-nsec": 10,
1658 "vm-clock-sec": 100,
1659 "vm-clock-nsec": 20
1663 EQMP
1666 .name = "drive-mirror",
1667 .args_type = "job-id:s?,sync:s,device:B,target:s,speed:i?,mode:s?,"
1668 "format:s?,node-name:s?,replaces:s?,"
1669 "on-source-error:s?,on-target-error:s?,"
1670 "unmap:b?,"
1671 "granularity:i?,buf-size:i?",
1672 .mhandler.cmd_new = qmp_marshal_drive_mirror,
1675 SQMP
1676 drive-mirror
1677 ------------
1679 Start mirroring a block device's writes to a new destination. target
1680 specifies the target of the new image. If the file exists, or if it is
1681 a device, it will be used as the new destination for writes. If it does not
1682 exist, a new file will be created. format specifies the format of the
1683 mirror image, default is to probe if mode='existing', else the format
1684 of the source.
1686 Arguments:
1688 - "job-id": Identifier for the newly-created block job. If omitted,
1689 the device name will be used. (json-string, optional)
1690 - "device": device name to operate on (json-string)
1691 - "target": name of new image file (json-string)
1692 - "format": format of new image (json-string, optional)
1693 - "node-name": the name of the new block driver state in the node graph
1694 (json-string, optional)
1695 - "replaces": the block driver node name to replace when finished
1696 (json-string, optional)
1697 - "mode": how an image file should be created into the target
1698 file/device (NewImageMode, optional, default 'absolute-paths')
1699 - "speed": maximum speed of the streaming job, in bytes per second
1700 (json-int)
1701 - "granularity": granularity of the dirty bitmap, in bytes (json-int, optional)
1702 - "buf-size": maximum amount of data in flight from source to target, in bytes
1703 (json-int, default 10M)
1704 - "sync": what parts of the disk image should be copied to the destination;
1705 possibilities include "full" for all the disk, "top" for only the sectors
1706 allocated in the topmost image, or "none" to only replicate new I/O
1707 (MirrorSyncMode).
1708 - "on-source-error": the action to take on an error on the source
1709 (BlockdevOnError, default 'report')
1710 - "on-target-error": the action to take on an error on the target
1711 (BlockdevOnError, default 'report')
1712 - "unmap": whether the target sectors should be discarded where source has only
1713 zeroes. (json-bool, optional, default true)
1715 The default value of the granularity is the image cluster size clamped
1716 between 4096 and 65536, if the image format defines one. If the format
1717 does not define a cluster size, the default value of the granularity
1718 is 65536.
1721 Example:
1723 -> { "execute": "drive-mirror", "arguments": { "device": "ide-hd0",
1724 "target": "/some/place/my-image",
1725 "sync": "full",
1726 "format": "qcow2" } }
1727 <- { "return": {} }
1729 EQMP
1732 .name = "blockdev-mirror",
1733 .args_type = "job-id:s?,sync:s,device:B,target:B,replaces:s?,speed:i?,"
1734 "on-source-error:s?,on-target-error:s?,"
1735 "granularity:i?,buf-size:i?",
1736 .mhandler.cmd_new = qmp_marshal_blockdev_mirror,
1739 SQMP
1740 blockdev-mirror
1741 ------------
1743 Start mirroring a block device's writes to another block device. target
1744 specifies the target of mirror operation.
1746 Arguments:
1748 - "job-id": Identifier for the newly-created block job. If omitted,
1749 the device name will be used. (json-string, optional)
1750 - "device": The device name or node-name of a root node whose writes should be
1751 mirrored (json-string)
1752 - "target": device name to mirror to (json-string)
1753 - "replaces": the block driver node name to replace when finished
1754 (json-string, optional)
1755 - "speed": maximum speed of the streaming job, in bytes per second
1756 (json-int)
1757 - "granularity": granularity of the dirty bitmap, in bytes (json-int, optional)
1758 - "buf_size": maximum amount of data in flight from source to target, in bytes
1759 (json-int, default 10M)
1760 - "sync": what parts of the disk image should be copied to the destination;
1761 possibilities include "full" for all the disk, "top" for only the sectors
1762 allocated in the topmost image, or "none" to only replicate new I/O
1763 (MirrorSyncMode).
1764 - "on-source-error": the action to take on an error on the source
1765 (BlockdevOnError, default 'report')
1766 - "on-target-error": the action to take on an error on the target
1767 (BlockdevOnError, default 'report')
1769 The default value of the granularity is the image cluster size clamped
1770 between 4096 and 65536, if the image format defines one. If the format
1771 does not define a cluster size, the default value of the granularity
1772 is 65536.
1774 Example:
1776 -> { "execute": "blockdev-mirror", "arguments": { "device": "ide-hd0",
1777 "target": "target0",
1778 "sync": "full" } }
1779 <- { "return": {} }
1781 EQMP
1783 .name = "change-backing-file",
1784 .args_type = "device:s,image-node-name:s,backing-file:s",
1785 .mhandler.cmd_new = qmp_marshal_change_backing_file,
1788 SQMP
1789 change-backing-file
1790 -------------------
1791 Since: 2.1
1793 Change the backing file in the image file metadata. This does not cause
1794 QEMU to reopen the image file to reparse the backing filename (it may,
1795 however, perform a reopen to change permissions from r/o -> r/w -> r/o,
1796 if needed). The new backing file string is written into the image file
1797 metadata, and the QEMU internal strings are updated.
1799 Arguments:
1801 - "image-node-name": The name of the block driver state node of the
1802 image to modify. The "device" is argument is used to
1803 verify "image-node-name" is in the chain described by
1804 "device".
1805 (json-string, optional)
1807 - "device": The name of the device.
1808 (json-string)
1810 - "backing-file": The string to write as the backing file. This string is
1811 not validated, so care should be taken when specifying
1812 the string or the image chain may not be able to be
1813 reopened again.
1814 (json-string)
1816 Returns: Nothing on success
1817 If "device" does not exist or cannot be determined, DeviceNotFound
1819 EQMP
1822 .name = "balloon",
1823 .args_type = "value:M",
1824 .mhandler.cmd_new = qmp_marshal_balloon,
1827 SQMP
1828 balloon
1829 -------
1831 Request VM to change its memory allocation (in bytes).
1833 Arguments:
1835 - "value": New memory allocation (json-int)
1837 Example:
1839 -> { "execute": "balloon", "arguments": { "value": 536870912 } }
1840 <- { "return": {} }
1842 EQMP
1845 .name = "set_link",
1846 .args_type = "name:s,up:b",
1847 .mhandler.cmd_new = qmp_marshal_set_link,
1850 SQMP
1851 set_link
1852 --------
1854 Change the link status of a network adapter.
1856 Arguments:
1858 - "name": network device name (json-string)
1859 - "up": status is up (json-bool)
1861 Example:
1863 -> { "execute": "set_link", "arguments": { "name": "e1000.0", "up": false } }
1864 <- { "return": {} }
1866 EQMP
1869 .name = "getfd",
1870 .args_type = "fdname:s",
1871 .params = "getfd name",
1872 .help = "receive a file descriptor via SCM rights and assign it a name",
1873 .mhandler.cmd_new = qmp_marshal_getfd,
1876 SQMP
1877 getfd
1878 -----
1880 Receive a file descriptor via SCM rights and assign it a name.
1882 Arguments:
1884 - "fdname": file descriptor name (json-string)
1886 Example:
1888 -> { "execute": "getfd", "arguments": { "fdname": "fd1" } }
1889 <- { "return": {} }
1891 Notes:
1893 (1) If the name specified by the "fdname" argument already exists,
1894 the file descriptor assigned to it will be closed and replaced
1895 by the received file descriptor.
1896 (2) The 'closefd' command can be used to explicitly close the file
1897 descriptor when it is no longer needed.
1899 EQMP
1902 .name = "closefd",
1903 .args_type = "fdname:s",
1904 .params = "closefd name",
1905 .help = "close a file descriptor previously passed via SCM rights",
1906 .mhandler.cmd_new = qmp_marshal_closefd,
1909 SQMP
1910 closefd
1911 -------
1913 Close a file descriptor previously passed via SCM rights.
1915 Arguments:
1917 - "fdname": file descriptor name (json-string)
1919 Example:
1921 -> { "execute": "closefd", "arguments": { "fdname": "fd1" } }
1922 <- { "return": {} }
1924 EQMP
1927 .name = "add-fd",
1928 .args_type = "fdset-id:i?,opaque:s?",
1929 .params = "add-fd fdset-id opaque",
1930 .help = "Add a file descriptor, that was passed via SCM rights, to an fd set",
1931 .mhandler.cmd_new = qmp_marshal_add_fd,
1934 SQMP
1935 add-fd
1936 -------
1938 Add a file descriptor, that was passed via SCM rights, to an fd set.
1940 Arguments:
1942 - "fdset-id": The ID of the fd set to add the file descriptor to.
1943 (json-int, optional)
1944 - "opaque": A free-form string that can be used to describe the fd.
1945 (json-string, optional)
1947 Return a json-object with the following information:
1949 - "fdset-id": The ID of the fd set that the fd was added to. (json-int)
1950 - "fd": The file descriptor that was received via SCM rights and added to the
1951 fd set. (json-int)
1953 Example:
1955 -> { "execute": "add-fd", "arguments": { "fdset-id": 1 } }
1956 <- { "return": { "fdset-id": 1, "fd": 3 } }
1958 Notes:
1960 (1) The list of fd sets is shared by all monitor connections.
1961 (2) If "fdset-id" is not specified, a new fd set will be created.
1963 EQMP
1966 .name = "remove-fd",
1967 .args_type = "fdset-id:i,fd:i?",
1968 .params = "remove-fd fdset-id fd",
1969 .help = "Remove a file descriptor from an fd set",
1970 .mhandler.cmd_new = qmp_marshal_remove_fd,
1973 SQMP
1974 remove-fd
1975 ---------
1977 Remove a file descriptor from an fd set.
1979 Arguments:
1981 - "fdset-id": The ID of the fd set that the file descriptor belongs to.
1982 (json-int)
1983 - "fd": The file descriptor that is to be removed. (json-int, optional)
1985 Example:
1987 -> { "execute": "remove-fd", "arguments": { "fdset-id": 1, "fd": 3 } }
1988 <- { "return": {} }
1990 Notes:
1992 (1) The list of fd sets is shared by all monitor connections.
1993 (2) If "fd" is not specified, all file descriptors in "fdset-id" will be
1994 removed.
1996 EQMP
1999 .name = "query-fdsets",
2000 .args_type = "",
2001 .help = "Return information describing all fd sets",
2002 .mhandler.cmd_new = qmp_marshal_query_fdsets,
2005 SQMP
2006 query-fdsets
2007 -------------
2009 Return information describing all fd sets.
2011 Arguments: None
2013 Example:
2015 -> { "execute": "query-fdsets" }
2016 <- { "return": [
2018 "fds": [
2020 "fd": 30,
2021 "opaque": "rdonly:/path/to/file"
2024 "fd": 24,
2025 "opaque": "rdwr:/path/to/file"
2028 "fdset-id": 1
2031 "fds": [
2033 "fd": 28
2036 "fd": 29
2039 "fdset-id": 0
2044 Note: The list of fd sets is shared by all monitor connections.
2046 EQMP
2049 .name = "block_passwd",
2050 .args_type = "device:s?,node-name:s?,password:s",
2051 .mhandler.cmd_new = qmp_marshal_block_passwd,
2054 SQMP
2055 block_passwd
2056 ------------
2058 Set the password of encrypted block devices.
2060 Arguments:
2062 - "device": device name (json-string)
2063 - "node-name": name in the block driver state graph (json-string)
2064 - "password": password (json-string)
2066 Example:
2068 -> { "execute": "block_passwd", "arguments": { "device": "ide0-hd0",
2069 "password": "12345" } }
2070 <- { "return": {} }
2072 EQMP
2075 .name = "block_set_io_throttle",
2076 .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?",
2077 .mhandler.cmd_new = qmp_marshal_block_set_io_throttle,
2080 SQMP
2081 block_set_io_throttle
2082 ------------
2084 Change I/O throttle limits for a block drive.
2086 Arguments:
2088 - "device": device name (json-string)
2089 - "bps": total throughput limit in bytes per second (json-int)
2090 - "bps_rd": read throughput limit in bytes per second (json-int)
2091 - "bps_wr": write throughput limit in bytes per second (json-int)
2092 - "iops": total I/O operations per second (json-int)
2093 - "iops_rd": read I/O operations per second (json-int)
2094 - "iops_wr": write I/O operations per second (json-int)
2095 - "bps_max": total throughput limit during bursts, in bytes (json-int, optional)
2096 - "bps_rd_max": read throughput limit during bursts, in bytes (json-int, optional)
2097 - "bps_wr_max": write throughput limit during bursts, in bytes (json-int, optional)
2098 - "iops_max": total I/O operations per second during bursts (json-int, optional)
2099 - "iops_rd_max": read I/O operations per second during bursts (json-int, optional)
2100 - "iops_wr_max": write I/O operations per second during bursts (json-int, optional)
2101 - "bps_max_length": maximum length of the @bps_max burst period, in seconds (json-int, optional)
2102 - "bps_rd_max_length": maximum length of the @bps_rd_max burst period, in seconds (json-int, optional)
2103 - "bps_wr_max_length": maximum length of the @bps_wr_max burst period, in seconds (json-int, optional)
2104 - "iops_max_length": maximum length of the @iops_max burst period, in seconds (json-int, optional)
2105 - "iops_rd_max_length": maximum length of the @iops_rd_max burst period, in seconds (json-int, optional)
2106 - "iops_wr_max_length": maximum length of the @iops_wr_max burst period, in seconds (json-int, optional)
2107 - "iops_size": I/O size in bytes when limiting (json-int, optional)
2108 - "group": throttle group name (json-string, optional)
2110 Example:
2112 -> { "execute": "block_set_io_throttle", "arguments": { "device": "virtio0",
2113 "bps": 1000000,
2114 "bps_rd": 0,
2115 "bps_wr": 0,
2116 "iops": 0,
2117 "iops_rd": 0,
2118 "iops_wr": 0,
2119 "bps_max": 8000000,
2120 "bps_rd_max": 0,
2121 "bps_wr_max": 0,
2122 "iops_max": 0,
2123 "iops_rd_max": 0,
2124 "iops_wr_max": 0,
2125 "bps_max_length": 60,
2126 "iops_size": 0 } }
2127 <- { "return": {} }
2129 EQMP
2132 .name = "set_password",
2133 .args_type = "protocol:s,password:s,connected:s?",
2134 .mhandler.cmd_new = qmp_marshal_set_password,
2137 SQMP
2138 set_password
2139 ------------
2141 Set the password for vnc/spice protocols.
2143 Arguments:
2145 - "protocol": protocol name (json-string)
2146 - "password": password (json-string)
2147 - "connected": [ keep | disconnect | fail ] (json-string, optional)
2149 Example:
2151 -> { "execute": "set_password", "arguments": { "protocol": "vnc",
2152 "password": "secret" } }
2153 <- { "return": {} }
2155 EQMP
2158 .name = "expire_password",
2159 .args_type = "protocol:s,time:s",
2160 .mhandler.cmd_new = qmp_marshal_expire_password,
2163 SQMP
2164 expire_password
2165 ---------------
2167 Set the password expire time for vnc/spice protocols.
2169 Arguments:
2171 - "protocol": protocol name (json-string)
2172 - "time": [ now | never | +secs | secs ] (json-string)
2174 Example:
2176 -> { "execute": "expire_password", "arguments": { "protocol": "vnc",
2177 "time": "+60" } }
2178 <- { "return": {} }
2180 EQMP
2183 .name = "add_client",
2184 .args_type = "protocol:s,fdname:s,skipauth:b?,tls:b?",
2185 .mhandler.cmd_new = qmp_marshal_add_client,
2188 SQMP
2189 add_client
2190 ----------
2192 Add a graphics client
2194 Arguments:
2196 - "protocol": protocol name (json-string)
2197 - "fdname": file descriptor name (json-string)
2198 - "skipauth": whether to skip authentication (json-bool, optional)
2199 - "tls": whether to perform TLS (json-bool, optional)
2201 Example:
2203 -> { "execute": "add_client", "arguments": { "protocol": "vnc",
2204 "fdname": "myclient" } }
2205 <- { "return": {} }
2207 EQMP
2209 .name = "qmp_capabilities",
2210 .args_type = "",
2211 .params = "",
2212 .help = "enable QMP capabilities",
2213 .mhandler.cmd_new = qmp_capabilities,
2216 SQMP
2217 qmp_capabilities
2218 ----------------
2220 Enable QMP capabilities.
2222 Arguments: None.
2224 Example:
2226 -> { "execute": "qmp_capabilities" }
2227 <- { "return": {} }
2229 Note: This command must be issued before issuing any other command.
2231 EQMP
2234 .name = "human-monitor-command",
2235 .args_type = "command-line:s,cpu-index:i?",
2236 .mhandler.cmd_new = qmp_marshal_human_monitor_command,
2239 SQMP
2240 human-monitor-command
2241 ---------------------
2243 Execute a Human Monitor command.
2245 Arguments:
2247 - command-line: the command name and its arguments, just like the
2248 Human Monitor's shell (json-string)
2249 - cpu-index: select the CPU number to be used by commands which access CPU
2250 data, like 'info registers'. The Monitor selects CPU 0 if this
2251 argument is not provided (json-int, optional)
2253 Example:
2255 -> { "execute": "human-monitor-command", "arguments": { "command-line": "info kvm" } }
2256 <- { "return": "kvm support: enabled\r\n" }
2258 Notes:
2260 (1) The Human Monitor is NOT an stable interface, this means that command
2261 names, arguments and responses can change or be removed at ANY time.
2262 Applications that rely on long term stability guarantees should NOT
2263 use this command
2265 (2) Limitations:
2267 o This command is stateless, this means that commands that depend
2268 on state information (such as getfd) might not work
2270 o Commands that prompt the user for data (eg. 'cont' when the block
2271 device is encrypted) don't currently work
2273 3. Query Commands
2274 =================
2276 HXCOMM Each query command below is inside a SQMP/EQMP section, do NOT change
2277 HXCOMM this! We will possibly move query commands definitions inside those
2278 HXCOMM sections, just like regular commands.
2280 EQMP
2282 SQMP
2283 query-version
2284 -------------
2286 Show QEMU version.
2288 Return a json-object with the following information:
2290 - "qemu": A json-object containing three integer values:
2291 - "major": QEMU's major version (json-int)
2292 - "minor": QEMU's minor version (json-int)
2293 - "micro": QEMU's micro version (json-int)
2294 - "package": package's version (json-string)
2296 Example:
2298 -> { "execute": "query-version" }
2299 <- {
2300 "return":{
2301 "qemu":{
2302 "major":0,
2303 "minor":11,
2304 "micro":5
2306 "package":""
2310 EQMP
2313 .name = "query-version",
2314 .args_type = "",
2315 .mhandler.cmd_new = qmp_marshal_query_version,
2318 SQMP
2319 query-commands
2320 --------------
2322 List QMP available commands.
2324 Each command is represented by a json-object, the returned value is a json-array
2325 of all commands.
2327 Each json-object contain:
2329 - "name": command's name (json-string)
2331 Example:
2333 -> { "execute": "query-commands" }
2334 <- {
2335 "return":[
2337 "name":"query-balloon"
2340 "name":"system_powerdown"
2345 Note: This example has been shortened as the real response is too long.
2347 EQMP
2350 .name = "query-commands",
2351 .args_type = "",
2352 .mhandler.cmd_new = qmp_marshal_query_commands,
2355 SQMP
2356 query-events
2357 --------------
2359 List QMP available events.
2361 Each event is represented by a json-object, the returned value is a json-array
2362 of all events.
2364 Each json-object contains:
2366 - "name": event's name (json-string)
2368 Example:
2370 -> { "execute": "query-events" }
2371 <- {
2372 "return":[
2374 "name":"SHUTDOWN"
2377 "name":"RESET"
2382 Note: This example has been shortened as the real response is too long.
2384 EQMP
2387 .name = "query-events",
2388 .args_type = "",
2389 .mhandler.cmd_new = qmp_marshal_query_events,
2392 SQMP
2393 query-qmp-schema
2394 ----------------
2396 Return the QMP wire schema. The returned value is a json-array of
2397 named schema entities. Entities are commands, events and various
2398 types. See docs/qapi-code-gen.txt for information on their structure
2399 and intended use.
2401 EQMP
2404 .name = "query-qmp-schema",
2405 .args_type = "",
2406 .mhandler.cmd_new = qmp_query_qmp_schema,
2409 SQMP
2410 query-chardev
2411 -------------
2413 Each device is represented by a json-object. The returned value is a json-array
2414 of all devices.
2416 Each json-object contain the following:
2418 - "label": device's label (json-string)
2419 - "filename": device's file (json-string)
2420 - "frontend-open": open/closed state of the frontend device attached to this
2421 backend (json-bool)
2423 Example:
2425 -> { "execute": "query-chardev" }
2426 <- {
2427 "return": [
2429 "label": "charchannel0",
2430 "filename": "unix:/var/lib/libvirt/qemu/seabios.rhel6.agent,server",
2431 "frontend-open": false
2434 "label": "charmonitor",
2435 "filename": "unix:/var/lib/libvirt/qemu/seabios.rhel6.monitor,server",
2436 "frontend-open": true
2439 "label": "charserial0",
2440 "filename": "pty:/dev/pts/2",
2441 "frontend-open": true
2446 EQMP
2449 .name = "query-chardev",
2450 .args_type = "",
2451 .mhandler.cmd_new = qmp_marshal_query_chardev,
2454 SQMP
2455 query-chardev-backends
2456 -------------
2458 List available character device backends.
2460 Each backend is represented by a json-object, the returned value is a json-array
2461 of all backends.
2463 Each json-object contains:
2465 - "name": backend name (json-string)
2467 Example:
2469 -> { "execute": "query-chardev-backends" }
2470 <- {
2471 "return":[
2473 "name":"udp"
2476 "name":"tcp"
2479 "name":"unix"
2482 "name":"spiceport"
2487 EQMP
2490 .name = "query-chardev-backends",
2491 .args_type = "",
2492 .mhandler.cmd_new = qmp_marshal_query_chardev_backends,
2495 SQMP
2496 query-block
2497 -----------
2499 Show the block devices.
2501 Each block device information is stored in a json-object and the returned value
2502 is a json-array of all devices.
2504 Each json-object contain the following:
2506 - "device": device name (json-string)
2507 - "type": device type (json-string)
2508 - deprecated, retained for backward compatibility
2509 - Possible values: "unknown"
2510 - "removable": true if the device is removable, false otherwise (json-bool)
2511 - "locked": true if the device is locked, false otherwise (json-bool)
2512 - "tray_open": only present if removable, true if the device has a tray,
2513 and it is open (json-bool)
2514 - "inserted": only present if the device is inserted, it is a json-object
2515 containing the following:
2516 - "file": device file name (json-string)
2517 - "ro": true if read-only, false otherwise (json-bool)
2518 - "drv": driver format name (json-string)
2519 - Possible values: "blkdebug", "bochs", "cloop", "dmg",
2520 "file", "file", "ftp", "ftps", "host_cdrom",
2521 "host_device", "http", "https",
2522 "nbd", "parallels", "qcow", "qcow2", "raw",
2523 "tftp", "vdi", "vmdk", "vpc", "vvfat"
2524 - "backing_file": backing file name (json-string, optional)
2525 - "backing_file_depth": number of files in the backing file chain (json-int)
2526 - "encrypted": true if encrypted, false otherwise (json-bool)
2527 - "bps": limit total bytes per second (json-int)
2528 - "bps_rd": limit read bytes per second (json-int)
2529 - "bps_wr": limit write bytes per second (json-int)
2530 - "iops": limit total I/O operations per second (json-int)
2531 - "iops_rd": limit read operations per second (json-int)
2532 - "iops_wr": limit write operations per second (json-int)
2533 - "bps_max": total max in bytes (json-int)
2534 - "bps_rd_max": read max in bytes (json-int)
2535 - "bps_wr_max": write max in bytes (json-int)
2536 - "iops_max": total I/O operations max (json-int)
2537 - "iops_rd_max": read I/O operations max (json-int)
2538 - "iops_wr_max": write I/O operations max (json-int)
2539 - "iops_size": I/O size when limiting by iops (json-int)
2540 - "detect_zeroes": detect and optimize zero writing (json-string)
2541 - Possible values: "off", "on", "unmap"
2542 - "write_threshold": write offset threshold in bytes, a event will be
2543 emitted if crossed. Zero if disabled (json-int)
2544 - "image": the detail of the image, it is a json-object containing
2545 the following:
2546 - "filename": image file name (json-string)
2547 - "format": image format (json-string)
2548 - "virtual-size": image capacity in bytes (json-int)
2549 - "dirty-flag": true if image is not cleanly closed, not present
2550 means clean (json-bool, optional)
2551 - "actual-size": actual size on disk in bytes of the image, not
2552 present when image does not support thin
2553 provision (json-int, optional)
2554 - "cluster-size": size of a cluster in bytes, not present if image
2555 format does not support it (json-int, optional)
2556 - "encrypted": true if the image is encrypted, not present means
2557 false or the image format does not support
2558 encryption (json-bool, optional)
2559 - "backing_file": backing file name, not present means no backing
2560 file is used or the image format does not
2561 support backing file chain
2562 (json-string, optional)
2563 - "full-backing-filename": full path of the backing file, not
2564 present if it equals backing_file or no
2565 backing file is used
2566 (json-string, optional)
2567 - "backing-filename-format": the format of the backing file, not
2568 present means unknown or no backing
2569 file (json-string, optional)
2570 - "snapshots": the internal snapshot info, it is an optional list
2571 of json-object containing the following:
2572 - "id": unique snapshot id (json-string)
2573 - "name": snapshot name (json-string)
2574 - "vm-state-size": size of the VM state in bytes (json-int)
2575 - "date-sec": UTC date of the snapshot in seconds (json-int)
2576 - "date-nsec": fractional part in nanoseconds to be used with
2577 date-sec (json-int)
2578 - "vm-clock-sec": VM clock relative to boot in seconds
2579 (json-int)
2580 - "vm-clock-nsec": fractional part in nanoseconds to be used
2581 with vm-clock-sec (json-int)
2582 - "backing-image": the detail of the backing image, it is an
2583 optional json-object only present when a
2584 backing image present for this image
2586 - "io-status": I/O operation status, only present if the device supports it
2587 and the VM is configured to stop on errors. It's always reset
2588 to "ok" when the "cont" command is issued (json_string, optional)
2589 - Possible values: "ok", "failed", "nospace"
2591 Example:
2593 -> { "execute": "query-block" }
2594 <- {
2595 "return":[
2597 "io-status": "ok",
2598 "device":"ide0-hd0",
2599 "locked":false,
2600 "removable":false,
2601 "inserted":{
2602 "ro":false,
2603 "drv":"qcow2",
2604 "encrypted":false,
2605 "file":"disks/test.qcow2",
2606 "backing_file_depth":1,
2607 "bps":1000000,
2608 "bps_rd":0,
2609 "bps_wr":0,
2610 "iops":1000000,
2611 "iops_rd":0,
2612 "iops_wr":0,
2613 "bps_max": 8000000,
2614 "bps_rd_max": 0,
2615 "bps_wr_max": 0,
2616 "iops_max": 0,
2617 "iops_rd_max": 0,
2618 "iops_wr_max": 0,
2619 "iops_size": 0,
2620 "detect_zeroes": "on",
2621 "write_threshold": 0,
2622 "image":{
2623 "filename":"disks/test.qcow2",
2624 "format":"qcow2",
2625 "virtual-size":2048000,
2626 "backing_file":"base.qcow2",
2627 "full-backing-filename":"disks/base.qcow2",
2628 "backing-filename-format":"qcow2",
2629 "snapshots":[
2631 "id": "1",
2632 "name": "snapshot1",
2633 "vm-state-size": 0,
2634 "date-sec": 10000200,
2635 "date-nsec": 12,
2636 "vm-clock-sec": 206,
2637 "vm-clock-nsec": 30
2640 "backing-image":{
2641 "filename":"disks/base.qcow2",
2642 "format":"qcow2",
2643 "virtual-size":2048000
2647 "type":"unknown"
2650 "io-status": "ok",
2651 "device":"ide1-cd0",
2652 "locked":false,
2653 "removable":true,
2654 "type":"unknown"
2657 "device":"floppy0",
2658 "locked":false,
2659 "removable":true,
2660 "type":"unknown"
2663 "device":"sd0",
2664 "locked":false,
2665 "removable":true,
2666 "type":"unknown"
2671 EQMP
2674 .name = "query-block",
2675 .args_type = "",
2676 .mhandler.cmd_new = qmp_marshal_query_block,
2679 SQMP
2680 query-blockstats
2681 ----------------
2683 Show block device statistics.
2685 Each device statistic information is stored in a json-object and the returned
2686 value is a json-array of all devices.
2688 Each json-object contain the following:
2690 - "device": device name (json-string)
2691 - "stats": A json-object with the statistics information, it contains:
2692 - "rd_bytes": bytes read (json-int)
2693 - "wr_bytes": bytes written (json-int)
2694 - "rd_operations": read operations (json-int)
2695 - "wr_operations": write operations (json-int)
2696 - "flush_operations": cache flush operations (json-int)
2697 - "wr_total_time_ns": total time spend on writes in nano-seconds (json-int)
2698 - "rd_total_time_ns": total time spend on reads in nano-seconds (json-int)
2699 - "flush_total_time_ns": total time spend on cache flushes in nano-seconds (json-int)
2700 - "wr_highest_offset": The offset after the greatest byte written to the
2701 BlockDriverState since it has been opened (json-int)
2702 - "rd_merged": number of read requests that have been merged into
2703 another request (json-int)
2704 - "wr_merged": number of write requests that have been merged into
2705 another request (json-int)
2706 - "idle_time_ns": time since the last I/O operation, in
2707 nanoseconds. If the field is absent it means
2708 that there haven't been any operations yet
2709 (json-int, optional)
2710 - "failed_rd_operations": number of failed read operations
2711 (json-int)
2712 - "failed_wr_operations": number of failed write operations
2713 (json-int)
2714 - "failed_flush_operations": number of failed flush operations
2715 (json-int)
2716 - "invalid_rd_operations": number of invalid read operations
2717 (json-int)
2718 - "invalid_wr_operations": number of invalid write operations
2719 (json-int)
2720 - "invalid_flush_operations": number of invalid flush operations
2721 (json-int)
2722 - "account_invalid": whether invalid operations are included in
2723 the last access statistics (json-bool)
2724 - "account_failed": whether failed operations are included in the
2725 latency and last access statistics
2726 (json-bool)
2727 - "timed_stats": A json-array containing statistics collected in
2728 specific intervals, with the following members:
2729 - "interval_length": interval used for calculating the
2730 statistics, in seconds (json-int)
2731 - "min_rd_latency_ns": minimum latency of read operations in
2732 the defined interval, in nanoseconds
2733 (json-int)
2734 - "min_wr_latency_ns": minimum latency of write operations in
2735 the defined interval, in nanoseconds
2736 (json-int)
2737 - "min_flush_latency_ns": minimum latency of flush operations
2738 in the defined interval, in
2739 nanoseconds (json-int)
2740 - "max_rd_latency_ns": maximum latency of read operations in
2741 the defined interval, in nanoseconds
2742 (json-int)
2743 - "max_wr_latency_ns": maximum latency of write operations in
2744 the defined interval, in nanoseconds
2745 (json-int)
2746 - "max_flush_latency_ns": maximum latency of flush operations
2747 in the defined interval, in
2748 nanoseconds (json-int)
2749 - "avg_rd_latency_ns": average latency of read operations in
2750 the defined interval, in nanoseconds
2751 (json-int)
2752 - "avg_wr_latency_ns": average latency of write operations in
2753 the defined interval, in nanoseconds
2754 (json-int)
2755 - "avg_flush_latency_ns": average latency of flush operations
2756 in the defined interval, in
2757 nanoseconds (json-int)
2758 - "avg_rd_queue_depth": average number of pending read
2759 operations in the defined interval
2760 (json-number)
2761 - "avg_wr_queue_depth": average number of pending write
2762 operations in the defined interval
2763 (json-number).
2764 - "parent": Contains recursively the statistics of the underlying
2765 protocol (e.g. the host file for a qcow2 image). If there is
2766 no underlying protocol, this field is omitted
2767 (json-object, optional)
2769 Example:
2771 -> { "execute": "query-blockstats" }
2772 <- {
2773 "return":[
2775 "device":"ide0-hd0",
2776 "parent":{
2777 "stats":{
2778 "wr_highest_offset":3686448128,
2779 "wr_bytes":9786368,
2780 "wr_operations":751,
2781 "rd_bytes":122567168,
2782 "rd_operations":36772
2783 "wr_total_times_ns":313253456
2784 "rd_total_times_ns":3465673657
2785 "flush_total_times_ns":49653
2786 "flush_operations":61,
2787 "rd_merged":0,
2788 "wr_merged":0,
2789 "idle_time_ns":2953431879,
2790 "account_invalid":true,
2791 "account_failed":false
2794 "stats":{
2795 "wr_highest_offset":2821110784,
2796 "wr_bytes":9786368,
2797 "wr_operations":692,
2798 "rd_bytes":122739200,
2799 "rd_operations":36604
2800 "flush_operations":51,
2801 "wr_total_times_ns":313253456
2802 "rd_total_times_ns":3465673657
2803 "flush_total_times_ns":49653,
2804 "rd_merged":0,
2805 "wr_merged":0,
2806 "idle_time_ns":2953431879,
2807 "account_invalid":true,
2808 "account_failed":false
2812 "device":"ide1-cd0",
2813 "stats":{
2814 "wr_highest_offset":0,
2815 "wr_bytes":0,
2816 "wr_operations":0,
2817 "rd_bytes":0,
2818 "rd_operations":0
2819 "flush_operations":0,
2820 "wr_total_times_ns":0
2821 "rd_total_times_ns":0
2822 "flush_total_times_ns":0,
2823 "rd_merged":0,
2824 "wr_merged":0,
2825 "account_invalid":false,
2826 "account_failed":false
2830 "device":"floppy0",
2831 "stats":{
2832 "wr_highest_offset":0,
2833 "wr_bytes":0,
2834 "wr_operations":0,
2835 "rd_bytes":0,
2836 "rd_operations":0
2837 "flush_operations":0,
2838 "wr_total_times_ns":0
2839 "rd_total_times_ns":0
2840 "flush_total_times_ns":0,
2841 "rd_merged":0,
2842 "wr_merged":0,
2843 "account_invalid":false,
2844 "account_failed":false
2848 "device":"sd0",
2849 "stats":{
2850 "wr_highest_offset":0,
2851 "wr_bytes":0,
2852 "wr_operations":0,
2853 "rd_bytes":0,
2854 "rd_operations":0
2855 "flush_operations":0,
2856 "wr_total_times_ns":0
2857 "rd_total_times_ns":0
2858 "flush_total_times_ns":0,
2859 "rd_merged":0,
2860 "wr_merged":0,
2861 "account_invalid":false,
2862 "account_failed":false
2868 EQMP
2871 .name = "query-blockstats",
2872 .args_type = "query-nodes:b?",
2873 .mhandler.cmd_new = qmp_marshal_query_blockstats,
2876 SQMP
2877 query-cpus
2878 ----------
2880 Show CPU information.
2882 Return a json-array. Each CPU is represented by a json-object, which contains:
2884 - "CPU": CPU index (json-int)
2885 - "current": true if this is the current CPU, false otherwise (json-bool)
2886 - "halted": true if the cpu is halted, false otherwise (json-bool)
2887 - "qom_path": path to the CPU object in the QOM tree (json-str)
2888 - "arch": architecture of the cpu, which determines what additional
2889 keys will be present (json-str)
2890 - Current program counter. The key's name depends on the architecture:
2891 "pc": i386/x86_64 (json-int)
2892 "nip": PPC (json-int)
2893 "pc" and "npc": sparc (json-int)
2894 "PC": mips (json-int)
2895 - "thread_id": ID of the underlying host thread (json-int)
2897 Example:
2899 -> { "execute": "query-cpus" }
2900 <- {
2901 "return":[
2903 "CPU":0,
2904 "current":true,
2905 "halted":false,
2906 "qom_path":"/machine/unattached/device[0]",
2907 "arch":"x86",
2908 "pc":3227107138,
2909 "thread_id":3134
2912 "CPU":1,
2913 "current":false,
2914 "halted":true,
2915 "qom_path":"/machine/unattached/device[2]",
2916 "arch":"x86",
2917 "pc":7108165,
2918 "thread_id":3135
2923 EQMP
2926 .name = "query-cpus",
2927 .args_type = "",
2928 .mhandler.cmd_new = qmp_marshal_query_cpus,
2931 SQMP
2932 query-iothreads
2933 ---------------
2935 Returns a list of information about each iothread.
2937 Note this list excludes the QEMU main loop thread, which is not declared
2938 using the -object iothread command-line option. It is always the main thread
2939 of the process.
2941 Return a json-array. Each iothread is represented by a json-object, which contains:
2943 - "id": name of iothread (json-str)
2944 - "thread-id": ID of the underlying host thread (json-int)
2946 Example:
2948 -> { "execute": "query-iothreads" }
2949 <- {
2950 "return":[
2952 "id":"iothread0",
2953 "thread-id":3134
2956 "id":"iothread1",
2957 "thread-id":3135
2962 EQMP
2965 .name = "query-iothreads",
2966 .args_type = "",
2967 .mhandler.cmd_new = qmp_marshal_query_iothreads,
2970 SQMP
2971 query-pci
2972 ---------
2974 PCI buses and devices information.
2976 The returned value is a json-array of all buses. Each bus is represented by
2977 a json-object, which has a key with a json-array of all PCI devices attached
2978 to it. Each device is represented by a json-object.
2980 The bus json-object contains the following:
2982 - "bus": bus number (json-int)
2983 - "devices": a json-array of json-objects, each json-object represents a
2984 PCI device
2986 The PCI device json-object contains the following:
2988 - "bus": identical to the parent's bus number (json-int)
2989 - "slot": slot number (json-int)
2990 - "function": function number (json-int)
2991 - "class_info": a json-object containing:
2992 - "desc": device class description (json-string, optional)
2993 - "class": device class number (json-int)
2994 - "id": a json-object containing:
2995 - "device": device ID (json-int)
2996 - "vendor": vendor ID (json-int)
2997 - "irq": device's IRQ if assigned (json-int, optional)
2998 - "qdev_id": qdev id string (json-string)
2999 - "pci_bridge": It's a json-object, only present if this device is a
3000 PCI bridge, contains:
3001 - "bus": bus number (json-int)
3002 - "secondary": secondary bus number (json-int)
3003 - "subordinate": subordinate bus number (json-int)
3004 - "io_range": I/O memory range information, a json-object with the
3005 following members:
3006 - "base": base address, in bytes (json-int)
3007 - "limit": limit address, in bytes (json-int)
3008 - "memory_range": 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 - "prefetchable_range": Prefetchable memory range information, a
3013 json-object with the following members:
3014 - "base": base address, in bytes (json-int)
3015 - "limit": limit address, in bytes (json-int)
3016 - "devices": a json-array of PCI devices if there's any attached, each
3017 each element is represented by a json-object, which contains
3018 the same members of the 'PCI device json-object' described
3019 above (optional)
3020 - "regions": a json-array of json-objects, each json-object represents a
3021 memory region of this device
3023 The memory range json-object contains the following:
3025 - "base": base memory address (json-int)
3026 - "limit": limit value (json-int)
3028 The region json-object can be an I/O region or a memory region, an I/O region
3029 json-object contains the following:
3031 - "type": "io" (json-string, fixed)
3032 - "bar": BAR number (json-int)
3033 - "address": memory address (json-int)
3034 - "size": memory size (json-int)
3036 A memory region json-object contains the following:
3038 - "type": "memory" (json-string, fixed)
3039 - "bar": BAR number (json-int)
3040 - "address": memory address (json-int)
3041 - "size": memory size (json-int)
3042 - "mem_type_64": true or false (json-bool)
3043 - "prefetch": true or false (json-bool)
3045 Example:
3047 -> { "execute": "query-pci" }
3048 <- {
3049 "return":[
3051 "bus":0,
3052 "devices":[
3054 "bus":0,
3055 "qdev_id":"",
3056 "slot":0,
3057 "class_info":{
3058 "class":1536,
3059 "desc":"Host bridge"
3061 "id":{
3062 "device":32902,
3063 "vendor":4663
3065 "function":0,
3066 "regions":[
3071 "bus":0,
3072 "qdev_id":"",
3073 "slot":1,
3074 "class_info":{
3075 "class":1537,
3076 "desc":"ISA bridge"
3078 "id":{
3079 "device":32902,
3080 "vendor":28672
3082 "function":0,
3083 "regions":[
3088 "bus":0,
3089 "qdev_id":"",
3090 "slot":1,
3091 "class_info":{
3092 "class":257,
3093 "desc":"IDE controller"
3095 "id":{
3096 "device":32902,
3097 "vendor":28688
3099 "function":1,
3100 "regions":[
3102 "bar":4,
3103 "size":16,
3104 "address":49152,
3105 "type":"io"
3110 "bus":0,
3111 "qdev_id":"",
3112 "slot":2,
3113 "class_info":{
3114 "class":768,
3115 "desc":"VGA controller"
3117 "id":{
3118 "device":4115,
3119 "vendor":184
3121 "function":0,
3122 "regions":[
3124 "prefetch":true,
3125 "mem_type_64":false,
3126 "bar":0,
3127 "size":33554432,
3128 "address":4026531840,
3129 "type":"memory"
3132 "prefetch":false,
3133 "mem_type_64":false,
3134 "bar":1,
3135 "size":4096,
3136 "address":4060086272,
3137 "type":"memory"
3140 "prefetch":false,
3141 "mem_type_64":false,
3142 "bar":6,
3143 "size":65536,
3144 "address":-1,
3145 "type":"memory"
3150 "bus":0,
3151 "qdev_id":"",
3152 "irq":11,
3153 "slot":4,
3154 "class_info":{
3155 "class":1280,
3156 "desc":"RAM controller"
3158 "id":{
3159 "device":6900,
3160 "vendor":4098
3162 "function":0,
3163 "regions":[
3165 "bar":0,
3166 "size":32,
3167 "address":49280,
3168 "type":"io"
3177 Note: This example has been shortened as the real response is too long.
3179 EQMP
3182 .name = "query-pci",
3183 .args_type = "",
3184 .mhandler.cmd_new = qmp_marshal_query_pci,
3187 SQMP
3188 query-kvm
3189 ---------
3191 Show KVM information.
3193 Return a json-object with the following information:
3195 - "enabled": true if KVM support is enabled, false otherwise (json-bool)
3196 - "present": true if QEMU has KVM support, false otherwise (json-bool)
3198 Example:
3200 -> { "execute": "query-kvm" }
3201 <- { "return": { "enabled": true, "present": true } }
3203 EQMP
3206 .name = "query-kvm",
3207 .args_type = "",
3208 .mhandler.cmd_new = qmp_marshal_query_kvm,
3211 SQMP
3212 query-status
3213 ------------
3215 Return a json-object with the following information:
3217 - "running": true if the VM is running, or false if it is paused (json-bool)
3218 - "singlestep": true if the VM is in single step mode,
3219 false otherwise (json-bool)
3220 - "status": one of the following values (json-string)
3221 "debug" - QEMU is running on a debugger
3222 "inmigrate" - guest is paused waiting for an incoming migration
3223 "internal-error" - An internal error that prevents further guest
3224 execution has occurred
3225 "io-error" - the last IOP has failed and the device is configured
3226 to pause on I/O errors
3227 "paused" - guest has been paused via the 'stop' command
3228 "postmigrate" - guest is paused following a successful 'migrate'
3229 "prelaunch" - QEMU was started with -S and guest has not started
3230 "finish-migrate" - guest is paused to finish the migration process
3231 "restore-vm" - guest is paused to restore VM state
3232 "running" - guest is actively running
3233 "save-vm" - guest is paused to save the VM state
3234 "shutdown" - guest is shut down (and -no-shutdown is in use)
3235 "watchdog" - the watchdog action is configured to pause and
3236 has been triggered
3238 Example:
3240 -> { "execute": "query-status" }
3241 <- { "return": { "running": true, "singlestep": false, "status": "running" } }
3243 EQMP
3246 .name = "query-status",
3247 .args_type = "",
3248 .mhandler.cmd_new = qmp_marshal_query_status,
3251 SQMP
3252 query-mice
3253 ----------
3255 Show VM mice information.
3257 Each mouse is represented by a json-object, the returned value is a json-array
3258 of all mice.
3260 The mouse json-object contains the following:
3262 - "name": mouse's name (json-string)
3263 - "index": mouse's index (json-int)
3264 - "current": true if this mouse is receiving events, false otherwise (json-bool)
3265 - "absolute": true if the mouse generates absolute input events (json-bool)
3267 Example:
3269 -> { "execute": "query-mice" }
3270 <- {
3271 "return":[
3273 "name":"QEMU Microsoft Mouse",
3274 "index":0,
3275 "current":false,
3276 "absolute":false
3279 "name":"QEMU PS/2 Mouse",
3280 "index":1,
3281 "current":true,
3282 "absolute":true
3287 EQMP
3290 .name = "query-mice",
3291 .args_type = "",
3292 .mhandler.cmd_new = qmp_marshal_query_mice,
3295 SQMP
3296 query-vnc
3297 ---------
3299 Show VNC server information.
3301 Return a json-object with server information. Connected clients are returned
3302 as a json-array of json-objects.
3304 The main json-object contains the following:
3306 - "enabled": true or false (json-bool)
3307 - "host": server's IP address (json-string)
3308 - "family": address family (json-string)
3309 - Possible values: "ipv4", "ipv6", "unix", "unknown"
3310 - "service": server's port number (json-string)
3311 - "auth": authentication method (json-string)
3312 - Possible values: "invalid", "none", "ra2", "ra2ne", "sasl", "tight",
3313 "tls", "ultra", "unknown", "vencrypt", "vencrypt",
3314 "vencrypt+plain", "vencrypt+tls+none",
3315 "vencrypt+tls+plain", "vencrypt+tls+sasl",
3316 "vencrypt+tls+vnc", "vencrypt+x509+none",
3317 "vencrypt+x509+plain", "vencrypt+x509+sasl",
3318 "vencrypt+x509+vnc", "vnc"
3319 - "clients": a json-array of all connected clients
3321 Clients are described by a json-object, each one contain the following:
3323 - "host": client's IP address (json-string)
3324 - "family": address family (json-string)
3325 - Possible values: "ipv4", "ipv6", "unix", "unknown"
3326 - "service": client's port number (json-string)
3327 - "x509_dname": TLS dname (json-string, optional)
3328 - "sasl_username": SASL username (json-string, optional)
3330 Example:
3332 -> { "execute": "query-vnc" }
3333 <- {
3334 "return":{
3335 "enabled":true,
3336 "host":"0.0.0.0",
3337 "service":"50402",
3338 "auth":"vnc",
3339 "family":"ipv4",
3340 "clients":[
3342 "host":"127.0.0.1",
3343 "service":"50401",
3344 "family":"ipv4"
3350 EQMP
3353 .name = "query-vnc",
3354 .args_type = "",
3355 .mhandler.cmd_new = qmp_marshal_query_vnc,
3358 .name = "query-vnc-servers",
3359 .args_type = "",
3360 .mhandler.cmd_new = qmp_marshal_query_vnc_servers,
3363 SQMP
3364 query-spice
3365 -----------
3367 Show SPICE server information.
3369 Return a json-object with server information. Connected clients are returned
3370 as a json-array of json-objects.
3372 The main json-object contains the following:
3374 - "enabled": true or false (json-bool)
3375 - "host": server's IP address (json-string)
3376 - "port": server's port number (json-int, optional)
3377 - "tls-port": server's port number (json-int, optional)
3378 - "auth": authentication method (json-string)
3379 - Possible values: "none", "spice"
3380 - "channels": a json-array of all active channels clients
3382 Channels are described by a json-object, each one contain the following:
3384 - "host": client's IP address (json-string)
3385 - "family": address family (json-string)
3386 - Possible values: "ipv4", "ipv6", "unix", "unknown"
3387 - "port": client's port number (json-string)
3388 - "connection-id": spice connection id. All channels with the same id
3389 belong to the same spice session (json-int)
3390 - "channel-type": channel type. "1" is the main control channel, filter for
3391 this one if you want track spice sessions only (json-int)
3392 - "channel-id": channel id. Usually "0", might be different needed when
3393 multiple channels of the same type exist, such as multiple
3394 display channels in a multihead setup (json-int)
3395 - "tls": whether the channel is encrypted (json-bool)
3397 Example:
3399 -> { "execute": "query-spice" }
3400 <- {
3401 "return": {
3402 "enabled": true,
3403 "auth": "spice",
3404 "port": 5920,
3405 "tls-port": 5921,
3406 "host": "0.0.0.0",
3407 "channels": [
3409 "port": "54924",
3410 "family": "ipv4",
3411 "channel-type": 1,
3412 "connection-id": 1804289383,
3413 "host": "127.0.0.1",
3414 "channel-id": 0,
3415 "tls": true
3418 "port": "36710",
3419 "family": "ipv4",
3420 "channel-type": 4,
3421 "connection-id": 1804289383,
3422 "host": "127.0.0.1",
3423 "channel-id": 0,
3424 "tls": false
3426 [ ... more channels follow ... ]
3431 EQMP
3433 #if defined(CONFIG_SPICE)
3435 .name = "query-spice",
3436 .args_type = "",
3437 .mhandler.cmd_new = qmp_marshal_query_spice,
3439 #endif
3441 SQMP
3442 query-name
3443 ----------
3445 Show VM name.
3447 Return a json-object with the following information:
3449 - "name": VM's name (json-string, optional)
3451 Example:
3453 -> { "execute": "query-name" }
3454 <- { "return": { "name": "qemu-name" } }
3456 EQMP
3459 .name = "query-name",
3460 .args_type = "",
3461 .mhandler.cmd_new = qmp_marshal_query_name,
3464 SQMP
3465 query-uuid
3466 ----------
3468 Show VM UUID.
3470 Return a json-object with the following information:
3472 - "UUID": Universally Unique Identifier (json-string)
3474 Example:
3476 -> { "execute": "query-uuid" }
3477 <- { "return": { "UUID": "550e8400-e29b-41d4-a716-446655440000" } }
3479 EQMP
3482 .name = "query-uuid",
3483 .args_type = "",
3484 .mhandler.cmd_new = qmp_marshal_query_uuid,
3487 SQMP
3488 query-command-line-options
3489 --------------------------
3491 Show command line option schema.
3493 Return a json-array of command line option schema for all options (or for
3494 the given option), returning an error if the given option doesn't exist.
3496 Each array entry contains the following:
3498 - "option": option name (json-string)
3499 - "parameters": a json-array describes all parameters of the option:
3500 - "name": parameter name (json-string)
3501 - "type": parameter type (one of 'string', 'boolean', 'number',
3502 or 'size')
3503 - "help": human readable description of the parameter
3504 (json-string, optional)
3505 - "default": default value string for the parameter
3506 (json-string, optional)
3508 Example:
3510 -> { "execute": "query-command-line-options", "arguments": { "option": "option-rom" } }
3511 <- { "return": [
3513 "parameters": [
3515 "name": "romfile",
3516 "type": "string"
3519 "name": "bootindex",
3520 "type": "number"
3523 "option": "option-rom"
3528 EQMP
3531 .name = "query-command-line-options",
3532 .args_type = "option:s?",
3533 .mhandler.cmd_new = qmp_marshal_query_command_line_options,
3536 SQMP
3537 query-migrate
3538 -------------
3540 Migration status.
3542 Return a json-object. If migration is active there will be another json-object
3543 with RAM migration status and if block migration is active another one with
3544 block migration status.
3546 The main json-object contains the following:
3548 - "status": migration status (json-string)
3549 - Possible values: "setup", "active", "completed", "failed", "cancelled"
3550 - "total-time": total amount of ms since migration started. If
3551 migration has ended, it returns the total migration
3552 time (json-int)
3553 - "setup-time" amount of setup time in milliseconds _before_ the
3554 iterations begin but _after_ the QMP command is issued.
3555 This is designed to provide an accounting of any activities
3556 (such as RDMA pinning) which may be expensive, but do not
3557 actually occur during the iterative migration rounds
3558 themselves. (json-int)
3559 - "downtime": only present when migration has finished correctly
3560 total amount in ms for downtime that happened (json-int)
3561 - "expected-downtime": only present while migration is active
3562 total amount in ms for downtime that was calculated on
3563 the last bitmap round (json-int)
3564 - "ram": only present if "status" is "active", it is a json-object with the
3565 following RAM information:
3566 - "transferred": amount transferred in bytes (json-int)
3567 - "remaining": amount remaining to transfer in bytes (json-int)
3568 - "total": total amount of memory in bytes (json-int)
3569 - "duplicate": number of pages filled entirely with the same
3570 byte (json-int)
3571 These are sent over the wire much more efficiently.
3572 - "skipped": number of skipped zero pages (json-int)
3573 - "normal" : number of whole pages transferred. I.e. they
3574 were not sent as duplicate or xbzrle pages (json-int)
3575 - "normal-bytes" : number of bytes transferred in whole
3576 pages. This is just normal pages times size of one page,
3577 but this way upper levels don't need to care about page
3578 size (json-int)
3579 - "dirty-sync-count": times that dirty ram was synchronized (json-int)
3580 - "disk": only present if "status" is "active" and it is a block migration,
3581 it is a json-object with the following disk information:
3582 - "transferred": amount transferred in bytes (json-int)
3583 - "remaining": amount remaining to transfer in bytes json-int)
3584 - "total": total disk size in bytes (json-int)
3585 - "xbzrle-cache": only present if XBZRLE is active.
3586 It is a json-object with the following XBZRLE information:
3587 - "cache-size": XBZRLE cache size in bytes
3588 - "bytes": number of bytes transferred for XBZRLE compressed pages
3589 - "pages": number of XBZRLE compressed pages
3590 - "cache-miss": number of XBRZRLE page cache misses
3591 - "cache-miss-rate": rate of XBRZRLE page cache misses
3592 - "overflow": number of times XBZRLE overflows. This means
3593 that the XBZRLE encoding was bigger than just sent the
3594 whole page, and then we sent the whole page instead (as as
3595 normal page).
3597 Examples:
3599 1. Before the first migration
3601 -> { "execute": "query-migrate" }
3602 <- { "return": {} }
3604 2. Migration is done and has succeeded
3606 -> { "execute": "query-migrate" }
3607 <- { "return": {
3608 "status": "completed",
3609 "ram":{
3610 "transferred":123,
3611 "remaining":123,
3612 "total":246,
3613 "total-time":12345,
3614 "setup-time":12345,
3615 "downtime":12345,
3616 "duplicate":123,
3617 "normal":123,
3618 "normal-bytes":123456,
3619 "dirty-sync-count":15
3624 3. Migration is done and has failed
3626 -> { "execute": "query-migrate" }
3627 <- { "return": { "status": "failed" } }
3629 4. Migration is being performed and is not a block migration:
3631 -> { "execute": "query-migrate" }
3632 <- {
3633 "return":{
3634 "status":"active",
3635 "ram":{
3636 "transferred":123,
3637 "remaining":123,
3638 "total":246,
3639 "total-time":12345,
3640 "setup-time":12345,
3641 "expected-downtime":12345,
3642 "duplicate":123,
3643 "normal":123,
3644 "normal-bytes":123456,
3645 "dirty-sync-count":15
3650 5. Migration is being performed and is a block migration:
3652 -> { "execute": "query-migrate" }
3653 <- {
3654 "return":{
3655 "status":"active",
3656 "ram":{
3657 "total":1057024,
3658 "remaining":1053304,
3659 "transferred":3720,
3660 "total-time":12345,
3661 "setup-time":12345,
3662 "expected-downtime":12345,
3663 "duplicate":123,
3664 "normal":123,
3665 "normal-bytes":123456,
3666 "dirty-sync-count":15
3668 "disk":{
3669 "total":20971520,
3670 "remaining":20880384,
3671 "transferred":91136
3676 6. Migration is being performed and XBZRLE is active:
3678 -> { "execute": "query-migrate" }
3679 <- {
3680 "return":{
3681 "status":"active",
3682 "capabilities" : [ { "capability": "xbzrle", "state" : true } ],
3683 "ram":{
3684 "total":1057024,
3685 "remaining":1053304,
3686 "transferred":3720,
3687 "total-time":12345,
3688 "setup-time":12345,
3689 "expected-downtime":12345,
3690 "duplicate":10,
3691 "normal":3333,
3692 "normal-bytes":3412992,
3693 "dirty-sync-count":15
3695 "xbzrle-cache":{
3696 "cache-size":67108864,
3697 "bytes":20971520,
3698 "pages":2444343,
3699 "cache-miss":2244,
3700 "cache-miss-rate":0.123,
3701 "overflow":34434
3706 EQMP
3709 .name = "query-migrate",
3710 .args_type = "",
3711 .mhandler.cmd_new = qmp_marshal_query_migrate,
3714 SQMP
3715 migrate-set-capabilities
3716 ------------------------
3718 Enable/Disable migration capabilities
3720 - "xbzrle": XBZRLE support
3721 - "rdma-pin-all": pin all pages when using RDMA during migration
3722 - "auto-converge": throttle down guest to help convergence of migration
3723 - "zero-blocks": compress zero blocks during block migration
3724 - "compress": use multiple compression threads to accelerate live migration
3725 - "events": generate events for each migration state change
3726 - "postcopy-ram": postcopy mode for live migration
3728 Arguments:
3730 Example:
3732 -> { "execute": "migrate-set-capabilities" , "arguments":
3733 { "capabilities": [ { "capability": "xbzrle", "state": true } ] } }
3735 EQMP
3738 .name = "migrate-set-capabilities",
3739 .args_type = "capabilities:q",
3740 .params = "capability:s,state:b",
3741 .mhandler.cmd_new = qmp_marshal_migrate_set_capabilities,
3743 SQMP
3744 query-migrate-capabilities
3745 --------------------------
3747 Query current migration capabilities
3749 - "capabilities": migration capabilities state
3750 - "xbzrle" : XBZRLE state (json-bool)
3751 - "rdma-pin-all" : RDMA Pin Page state (json-bool)
3752 - "auto-converge" : Auto Converge state (json-bool)
3753 - "zero-blocks" : Zero Blocks state (json-bool)
3754 - "compress": Multiple compression threads state (json-bool)
3755 - "events": Migration state change event state (json-bool)
3756 - "postcopy-ram": postcopy ram state (json-bool)
3758 Arguments:
3760 Example:
3762 -> { "execute": "query-migrate-capabilities" }
3763 <- {"return": [
3764 {"state": false, "capability": "xbzrle"},
3765 {"state": false, "capability": "rdma-pin-all"},
3766 {"state": false, "capability": "auto-converge"},
3767 {"state": false, "capability": "zero-blocks"},
3768 {"state": false, "capability": "compress"},
3769 {"state": true, "capability": "events"},
3770 {"state": false, "capability": "postcopy-ram"}
3773 EQMP
3776 .name = "query-migrate-capabilities",
3777 .args_type = "",
3778 .mhandler.cmd_new = qmp_marshal_query_migrate_capabilities,
3781 SQMP
3782 migrate-set-parameters
3783 ----------------------
3785 Set migration parameters
3787 - "compress-level": set compression level during migration (json-int)
3788 - "compress-threads": set compression thread count for migration (json-int)
3789 - "decompress-threads": set decompression thread count for migration (json-int)
3790 - "cpu-throttle-initial": set initial percentage of time guest cpus are
3791 throttled for auto-converge (json-int)
3792 - "cpu-throttle-increment": set throttle increasing percentage for
3793 auto-converge (json-int)
3795 Arguments:
3797 Example:
3799 -> { "execute": "migrate-set-parameters" , "arguments":
3800 { "compress-level": 1 } }
3802 EQMP
3805 .name = "migrate-set-parameters",
3806 .args_type =
3807 "compress-level:i?,compress-threads:i?,decompress-threads:i?,cpu-throttle-initial:i?,cpu-throttle-increment:i?",
3808 .mhandler.cmd_new = qmp_marshal_migrate_set_parameters,
3810 SQMP
3811 query-migrate-parameters
3812 ------------------------
3814 Query current migration parameters
3816 - "parameters": migration parameters value
3817 - "compress-level" : compression level value (json-int)
3818 - "compress-threads" : compression thread count value (json-int)
3819 - "decompress-threads" : decompression thread count value (json-int)
3820 - "cpu-throttle-initial" : initial percentage of time guest cpus are
3821 throttled (json-int)
3822 - "cpu-throttle-increment" : throttle increasing percentage for
3823 auto-converge (json-int)
3825 Arguments:
3827 Example:
3829 -> { "execute": "query-migrate-parameters" }
3830 <- {
3831 "return": {
3832 "decompress-threads": 2,
3833 "cpu-throttle-increment": 10,
3834 "compress-threads": 8,
3835 "compress-level": 1,
3836 "cpu-throttle-initial": 20
3840 EQMP
3843 .name = "query-migrate-parameters",
3844 .args_type = "",
3845 .mhandler.cmd_new = qmp_marshal_query_migrate_parameters,
3848 SQMP
3849 query-balloon
3850 -------------
3852 Show balloon information.
3854 Make an asynchronous request for balloon info. When the request completes a
3855 json-object will be returned containing the following data:
3857 - "actual": current balloon value in bytes (json-int)
3859 Example:
3861 -> { "execute": "query-balloon" }
3862 <- {
3863 "return":{
3864 "actual":1073741824,
3868 EQMP
3871 .name = "query-balloon",
3872 .args_type = "",
3873 .mhandler.cmd_new = qmp_marshal_query_balloon,
3877 .name = "query-block-jobs",
3878 .args_type = "",
3879 .mhandler.cmd_new = qmp_marshal_query_block_jobs,
3883 .name = "qom-list",
3884 .args_type = "path:s",
3885 .mhandler.cmd_new = qmp_marshal_qom_list,
3889 .name = "qom-set",
3890 .args_type = "path:s,property:s,value:q",
3891 .mhandler.cmd_new = qmp_marshal_qom_set,
3895 .name = "qom-get",
3896 .args_type = "path:s,property:s",
3897 .mhandler.cmd_new = qmp_marshal_qom_get,
3901 .name = "nbd-server-start",
3902 .args_type = "addr:q,tls-creds:s?",
3903 .mhandler.cmd_new = qmp_marshal_nbd_server_start,
3906 .name = "nbd-server-add",
3907 .args_type = "device:B,writable:b?",
3908 .mhandler.cmd_new = qmp_marshal_nbd_server_add,
3911 .name = "nbd-server-stop",
3912 .args_type = "",
3913 .mhandler.cmd_new = qmp_marshal_nbd_server_stop,
3917 .name = "change-vnc-password",
3918 .args_type = "password:s",
3919 .mhandler.cmd_new = qmp_marshal_change_vnc_password,
3922 .name = "qom-list-types",
3923 .args_type = "implements:s?,abstract:b?",
3924 .mhandler.cmd_new = qmp_marshal_qom_list_types,
3928 .name = "device-list-properties",
3929 .args_type = "typename:s",
3930 .mhandler.cmd_new = qmp_marshal_device_list_properties,
3934 .name = "query-machines",
3935 .args_type = "",
3936 .mhandler.cmd_new = qmp_marshal_query_machines,
3940 .name = "query-cpu-definitions",
3941 .args_type = "",
3942 .mhandler.cmd_new = qmp_marshal_query_cpu_definitions,
3946 .name = "query-target",
3947 .args_type = "",
3948 .mhandler.cmd_new = qmp_marshal_query_target,
3952 .name = "query-tpm",
3953 .args_type = "",
3954 .mhandler.cmd_new = qmp_marshal_query_tpm,
3957 SQMP
3958 query-tpm
3959 ---------
3961 Return information about the TPM device.
3963 Arguments: None
3965 Example:
3967 -> { "execute": "query-tpm" }
3968 <- { "return":
3970 { "model": "tpm-tis",
3971 "options":
3972 { "type": "passthrough",
3973 "data":
3974 { "cancel-path": "/sys/class/misc/tpm0/device/cancel",
3975 "path": "/dev/tpm0"
3978 "id": "tpm0"
3983 EQMP
3986 .name = "query-tpm-models",
3987 .args_type = "",
3988 .mhandler.cmd_new = qmp_marshal_query_tpm_models,
3991 SQMP
3992 query-tpm-models
3993 ----------------
3995 Return a list of supported TPM models.
3997 Arguments: None
3999 Example:
4001 -> { "execute": "query-tpm-models" }
4002 <- { "return": [ "tpm-tis" ] }
4004 EQMP
4007 .name = "query-tpm-types",
4008 .args_type = "",
4009 .mhandler.cmd_new = qmp_marshal_query_tpm_types,
4012 SQMP
4013 query-tpm-types
4014 ---------------
4016 Return a list of supported TPM types.
4018 Arguments: None
4020 Example:
4022 -> { "execute": "query-tpm-types" }
4023 <- { "return": [ "passthrough" ] }
4025 EQMP
4028 .name = "chardev-add",
4029 .args_type = "id:s,backend:q",
4030 .mhandler.cmd_new = qmp_marshal_chardev_add,
4033 SQMP
4034 chardev-add
4035 ----------------
4037 Add a chardev.
4039 Arguments:
4041 - "id": the chardev's ID, must be unique (json-string)
4042 - "backend": chardev backend type + parameters
4044 Examples:
4046 -> { "execute" : "chardev-add",
4047 "arguments" : { "id" : "foo",
4048 "backend" : { "type" : "null", "data" : {} } } }
4049 <- { "return": {} }
4051 -> { "execute" : "chardev-add",
4052 "arguments" : { "id" : "bar",
4053 "backend" : { "type" : "file",
4054 "data" : { "out" : "/tmp/bar.log" } } } }
4055 <- { "return": {} }
4057 -> { "execute" : "chardev-add",
4058 "arguments" : { "id" : "baz",
4059 "backend" : { "type" : "pty", "data" : {} } } }
4060 <- { "return": { "pty" : "/dev/pty/42" } }
4062 EQMP
4065 .name = "chardev-remove",
4066 .args_type = "id:s",
4067 .mhandler.cmd_new = qmp_marshal_chardev_remove,
4071 SQMP
4072 chardev-remove
4073 --------------
4075 Remove a chardev.
4077 Arguments:
4079 - "id": the chardev's ID, must exist and not be in use (json-string)
4081 Example:
4083 -> { "execute": "chardev-remove", "arguments": { "id" : "foo" } }
4084 <- { "return": {} }
4086 EQMP
4088 .name = "query-rx-filter",
4089 .args_type = "name:s?",
4090 .mhandler.cmd_new = qmp_marshal_query_rx_filter,
4093 SQMP
4094 query-rx-filter
4095 ---------------
4097 Show rx-filter information.
4099 Returns a json-array of rx-filter information for all NICs (or for the
4100 given NIC), returning an error if the given NIC doesn't exist, or
4101 given NIC doesn't support rx-filter querying, or given net client
4102 isn't a NIC.
4104 The query will clear the event notification flag of each NIC, then qemu
4105 will start to emit event to QMP monitor.
4107 Each array entry contains the following:
4109 - "name": net client name (json-string)
4110 - "promiscuous": promiscuous mode is enabled (json-bool)
4111 - "multicast": multicast receive state (one of 'normal', 'none', 'all')
4112 - "unicast": unicast receive state (one of 'normal', 'none', 'all')
4113 - "vlan": vlan receive state (one of 'normal', 'none', 'all') (Since 2.0)
4114 - "broadcast-allowed": allow to receive broadcast (json-bool)
4115 - "multicast-overflow": multicast table is overflowed (json-bool)
4116 - "unicast-overflow": unicast table is overflowed (json-bool)
4117 - "main-mac": main macaddr string (json-string)
4118 - "vlan-table": a json-array of active vlan id
4119 - "unicast-table": a json-array of unicast macaddr string
4120 - "multicast-table": a json-array of multicast macaddr string
4122 Example:
4124 -> { "execute": "query-rx-filter", "arguments": { "name": "vnet0" } }
4125 <- { "return": [
4127 "promiscuous": true,
4128 "name": "vnet0",
4129 "main-mac": "52:54:00:12:34:56",
4130 "unicast": "normal",
4131 "vlan": "normal",
4132 "vlan-table": [
4136 "unicast-table": [
4138 "multicast": "normal",
4139 "multicast-overflow": false,
4140 "unicast-overflow": false,
4141 "multicast-table": [
4142 "01:00:5e:00:00:01",
4143 "33:33:00:00:00:01",
4144 "33:33:ff:12:34:56"
4146 "broadcast-allowed": false
4151 EQMP
4154 .name = "blockdev-add",
4155 .args_type = "options:q",
4156 .mhandler.cmd_new = qmp_marshal_blockdev_add,
4159 SQMP
4160 blockdev-add
4161 ------------
4163 Add a block device.
4165 This command is still a work in progress. It doesn't support all
4166 block drivers among other things. Stay away from it unless you want
4167 to help with its development.
4169 Arguments:
4171 - "options": block driver options
4173 Example (1):
4175 -> { "execute": "blockdev-add",
4176 "arguments": { "options" : { "driver": "qcow2",
4177 "file": { "driver": "file",
4178 "filename": "test.qcow2" } } } }
4179 <- { "return": {} }
4181 Example (2):
4183 -> { "execute": "blockdev-add",
4184 "arguments": {
4185 "options": {
4186 "driver": "qcow2",
4187 "id": "my_disk",
4188 "discard": "unmap",
4189 "cache": {
4190 "direct": true,
4191 "writeback": true
4193 "file": {
4194 "driver": "file",
4195 "filename": "/tmp/test.qcow2"
4197 "backing": {
4198 "driver": "raw",
4199 "file": {
4200 "driver": "file",
4201 "filename": "/dev/fdset/4"
4208 <- { "return": {} }
4210 EQMP
4213 .name = "x-blockdev-del",
4214 .args_type = "id:s?,node-name:s?",
4215 .mhandler.cmd_new = qmp_marshal_x_blockdev_del,
4218 SQMP
4219 x-blockdev-del
4220 ------------
4221 Since 2.5
4223 Deletes a block device thas has been added using blockdev-add.
4224 The selected device can be either a block backend or a graph node.
4226 In the former case the backend will be destroyed, along with its
4227 inserted medium if there's any. The command will fail if the backend
4228 or its medium are in use.
4230 In the latter case the node will be destroyed. The command will fail
4231 if the node is attached to a block backend or is otherwise being
4232 used.
4234 One of "id" or "node-name" must be specified, but not both.
4236 This command is still a work in progress and is considered
4237 experimental. Stay away from it unless you want to help with its
4238 development.
4240 Arguments:
4242 - "id": Name of the block backend device to delete (json-string, optional)
4243 - "node-name": Name of the graph node to delete (json-string, optional)
4245 Example:
4247 -> { "execute": "blockdev-add",
4248 "arguments": {
4249 "options": {
4250 "driver": "qcow2",
4251 "id": "drive0",
4252 "file": {
4253 "driver": "file",
4254 "filename": "test.qcow2"
4260 <- { "return": {} }
4262 -> { "execute": "x-blockdev-del",
4263 "arguments": { "id": "drive0" }
4265 <- { "return": {} }
4267 EQMP
4270 .name = "blockdev-open-tray",
4271 .args_type = "device:s,force:b?",
4272 .mhandler.cmd_new = qmp_marshal_blockdev_open_tray,
4275 SQMP
4276 blockdev-open-tray
4277 ------------------
4279 Opens a block device's tray. If there is a block driver state tree inserted as a
4280 medium, it will become inaccessible to the guest (but it will remain associated
4281 to the block device, so closing the tray will make it accessible again).
4283 If the tray was already open before, this will be a no-op.
4285 Once the tray opens, a DEVICE_TRAY_MOVED event is emitted. There are cases in
4286 which no such event will be generated, these include:
4287 - if the guest has locked the tray, @force is false and the guest does not
4288 respond to the eject request
4289 - if the BlockBackend denoted by @device does not have a guest device attached
4290 to it
4291 - if the guest device does not have an actual tray and is empty, for instance
4292 for floppy disk drives
4294 Arguments:
4296 - "device": block device name (json-string)
4297 - "force": if false (the default), an eject request will be sent to the guest if
4298 it has locked the tray (and the tray will not be opened immediately);
4299 if true, the tray will be opened regardless of whether it is locked
4300 (json-bool, optional)
4302 Example:
4304 -> { "execute": "blockdev-open-tray",
4305 "arguments": { "device": "ide1-cd0" } }
4307 <- { "timestamp": { "seconds": 1418751016,
4308 "microseconds": 716996 },
4309 "event": "DEVICE_TRAY_MOVED",
4310 "data": { "device": "ide1-cd0",
4311 "tray-open": true } }
4313 <- { "return": {} }
4315 EQMP
4318 .name = "blockdev-close-tray",
4319 .args_type = "device:s",
4320 .mhandler.cmd_new = qmp_marshal_blockdev_close_tray,
4323 SQMP
4324 blockdev-close-tray
4325 -------------------
4327 Closes a block device's tray. If there is a block driver state tree associated
4328 with the block device (which is currently ejected), that tree will be loaded as
4329 the medium.
4331 If the tray was already closed before, this will be a no-op.
4333 Arguments:
4335 - "device": block device name (json-string)
4337 Example:
4339 -> { "execute": "blockdev-close-tray",
4340 "arguments": { "device": "ide1-cd0" } }
4342 <- { "timestamp": { "seconds": 1418751345,
4343 "microseconds": 272147 },
4344 "event": "DEVICE_TRAY_MOVED",
4345 "data": { "device": "ide1-cd0",
4346 "tray-open": false } }
4348 <- { "return": {} }
4350 EQMP
4353 .name = "x-blockdev-remove-medium",
4354 .args_type = "device:s",
4355 .mhandler.cmd_new = qmp_marshal_x_blockdev_remove_medium,
4358 SQMP
4359 x-blockdev-remove-medium
4360 ------------------------
4362 Removes a medium (a block driver state tree) from a block device. That block
4363 device's tray must currently be open (unless there is no attached guest device).
4365 If the tray is open and there is no medium inserted, this will be a no-op.
4367 This command is still a work in progress and is considered experimental.
4368 Stay away from it unless you want to help with its development.
4370 Arguments:
4372 - "device": block device name (json-string)
4374 Example:
4376 -> { "execute": "x-blockdev-remove-medium",
4377 "arguments": { "device": "ide1-cd0" } }
4379 <- { "error": { "class": "GenericError",
4380 "desc": "Tray of device 'ide1-cd0' is not open" } }
4382 -> { "execute": "blockdev-open-tray",
4383 "arguments": { "device": "ide1-cd0" } }
4385 <- { "timestamp": { "seconds": 1418751627,
4386 "microseconds": 549958 },
4387 "event": "DEVICE_TRAY_MOVED",
4388 "data": { "device": "ide1-cd0",
4389 "tray-open": true } }
4391 <- { "return": {} }
4393 -> { "execute": "x-blockdev-remove-medium",
4394 "arguments": { "device": "ide1-cd0" } }
4396 <- { "return": {} }
4398 EQMP
4401 .name = "x-blockdev-insert-medium",
4402 .args_type = "device:s,node-name:s",
4403 .mhandler.cmd_new = qmp_marshal_x_blockdev_insert_medium,
4406 SQMP
4407 x-blockdev-insert-medium
4408 ------------------------
4410 Inserts a medium (a block driver state tree) into a block device. That block
4411 device's tray must currently be open (unless there is no attached guest device)
4412 and there must be no medium inserted already.
4414 This command is still a work in progress and is considered experimental.
4415 Stay away from it unless you want to help with its development.
4417 Arguments:
4419 - "device": block device name (json-string)
4420 - "node-name": root node of the BDS tree to insert into the block device
4422 Example:
4424 -> { "execute": "blockdev-add",
4425 "arguments": { "options": { "node-name": "node0",
4426 "driver": "raw",
4427 "file": { "driver": "file",
4428 "filename": "fedora.iso" } } } }
4430 <- { "return": {} }
4432 -> { "execute": "x-blockdev-insert-medium",
4433 "arguments": { "device": "ide1-cd0",
4434 "node-name": "node0" } }
4436 <- { "return": {} }
4438 EQMP
4441 .name = "x-blockdev-change",
4442 .args_type = "parent:B,child:B?,node:B?",
4443 .mhandler.cmd_new = qmp_marshal_x_blockdev_change,
4446 SQMP
4447 x-blockdev-change
4448 -----------------
4450 Dynamically reconfigure the block driver state graph. It can be used
4451 to add, remove, insert or replace a graph node. Currently only the
4452 Quorum driver implements this feature to add or remove its child. This
4453 is useful to fix a broken quorum child.
4455 If @node is specified, it will be inserted under @parent. @child
4456 may not be specified in this case. If both @parent and @child are
4457 specified but @node is not, @child will be detached from @parent.
4459 Arguments:
4460 - "parent": the id or name of the parent node (json-string)
4461 - "child": the name of a child under the given parent node (json-string, optional)
4462 - "node": the name of the node that will be added (json-string, optional)
4464 Note: this command is experimental, and not a stable API. It doesn't
4465 support all kinds of operations, all kinds of children, nor all block
4466 drivers.
4468 Warning: The data in a new quorum child MUST be consistent with that of
4469 the rest of the array.
4471 Example:
4473 Add a new node to a quorum
4474 -> { "execute": "blockdev-add",
4475 "arguments": { "options": { "driver": "raw",
4476 "node-name": "new_node",
4477 "file": { "driver": "file",
4478 "filename": "test.raw" } } } }
4479 <- { "return": {} }
4480 -> { "execute": "x-blockdev-change",
4481 "arguments": { "parent": "disk1",
4482 "node": "new_node" } }
4483 <- { "return": {} }
4485 Delete a quorum's node
4486 -> { "execute": "x-blockdev-change",
4487 "arguments": { "parent": "disk1",
4488 "child": "children.1" } }
4489 <- { "return": {} }
4491 EQMP
4494 .name = "query-named-block-nodes",
4495 .args_type = "",
4496 .mhandler.cmd_new = qmp_marshal_query_named_block_nodes,
4499 SQMP
4500 @query-named-block-nodes
4501 ------------------------
4503 Return a list of BlockDeviceInfo for all the named block driver nodes
4505 Example:
4507 -> { "execute": "query-named-block-nodes" }
4508 <- { "return": [ { "ro":false,
4509 "drv":"qcow2",
4510 "encrypted":false,
4511 "file":"disks/test.qcow2",
4512 "node-name": "my-node",
4513 "backing_file_depth":1,
4514 "bps":1000000,
4515 "bps_rd":0,
4516 "bps_wr":0,
4517 "iops":1000000,
4518 "iops_rd":0,
4519 "iops_wr":0,
4520 "bps_max": 8000000,
4521 "bps_rd_max": 0,
4522 "bps_wr_max": 0,
4523 "iops_max": 0,
4524 "iops_rd_max": 0,
4525 "iops_wr_max": 0,
4526 "iops_size": 0,
4527 "write_threshold": 0,
4528 "image":{
4529 "filename":"disks/test.qcow2",
4530 "format":"qcow2",
4531 "virtual-size":2048000,
4532 "backing_file":"base.qcow2",
4533 "full-backing-filename":"disks/base.qcow2",
4534 "backing-filename-format":"qcow2",
4535 "snapshots":[
4537 "id": "1",
4538 "name": "snapshot1",
4539 "vm-state-size": 0,
4540 "date-sec": 10000200,
4541 "date-nsec": 12,
4542 "vm-clock-sec": 206,
4543 "vm-clock-nsec": 30
4546 "backing-image":{
4547 "filename":"disks/base.qcow2",
4548 "format":"qcow2",
4549 "virtual-size":2048000
4551 } } ] }
4553 EQMP
4556 .name = "blockdev-change-medium",
4557 .args_type = "device:B,filename:F,format:s?,read-only-mode:s?",
4558 .mhandler.cmd_new = qmp_marshal_blockdev_change_medium,
4561 SQMP
4562 blockdev-change-medium
4563 ----------------------
4565 Changes the medium inserted into a block device by ejecting the current medium
4566 and loading a new image file which is inserted as the new medium.
4568 Arguments:
4570 - "device": device name (json-string)
4571 - "filename": filename of the new image (json-string)
4572 - "format": format of the new image (json-string, optional)
4573 - "read-only-mode": new read-only mode (json-string, optional)
4574 - Possible values: "retain" (default), "read-only", "read-write"
4576 Examples:
4578 1. Change a removable medium
4580 -> { "execute": "blockdev-change-medium",
4581 "arguments": { "device": "ide1-cd0",
4582 "filename": "/srv/images/Fedora-12-x86_64-DVD.iso",
4583 "format": "raw" } }
4584 <- { "return": {} }
4586 2. Load a read-only medium into a writable drive
4588 -> { "execute": "blockdev-change-medium",
4589 "arguments": { "device": "isa-fd0",
4590 "filename": "/srv/images/ro.img",
4591 "format": "raw",
4592 "read-only-mode": "retain" } }
4594 <- { "error":
4595 { "class": "GenericError",
4596 "desc": "Could not open '/srv/images/ro.img': Permission denied" } }
4598 -> { "execute": "blockdev-change-medium",
4599 "arguments": { "device": "isa-fd0",
4600 "filename": "/srv/images/ro.img",
4601 "format": "raw",
4602 "read-only-mode": "read-only" } }
4604 <- { "return": {} }
4606 EQMP
4609 .name = "query-memdev",
4610 .args_type = "",
4611 .mhandler.cmd_new = qmp_marshal_query_memdev,
4614 SQMP
4615 query-memdev
4616 ------------
4618 Show memory devices information.
4621 Example (1):
4623 -> { "execute": "query-memdev" }
4624 <- { "return": [
4626 "size": 536870912,
4627 "merge": false,
4628 "dump": true,
4629 "prealloc": false,
4630 "host-nodes": [0, 1],
4631 "policy": "bind"
4634 "size": 536870912,
4635 "merge": false,
4636 "dump": true,
4637 "prealloc": true,
4638 "host-nodes": [2, 3],
4639 "policy": "preferred"
4644 EQMP
4647 .name = "query-memory-devices",
4648 .args_type = "",
4649 .mhandler.cmd_new = qmp_marshal_query_memory_devices,
4652 SQMP
4653 @query-memory-devices
4654 --------------------
4656 Return a list of memory devices.
4658 Example:
4659 -> { "execute": "query-memory-devices" }
4660 <- { "return": [ { "data":
4661 { "addr": 5368709120,
4662 "hotpluggable": true,
4663 "hotplugged": true,
4664 "id": "d1",
4665 "memdev": "/objects/memX",
4666 "node": 0,
4667 "size": 1073741824,
4668 "slot": 0},
4669 "type": "dimm"
4670 } ] }
4671 EQMP
4674 .name = "query-acpi-ospm-status",
4675 .args_type = "",
4676 .mhandler.cmd_new = qmp_marshal_query_acpi_ospm_status,
4679 SQMP
4680 @query-acpi-ospm-status
4681 --------------------
4683 Return list of ACPIOSTInfo for devices that support status reporting
4684 via ACPI _OST method.
4686 Example:
4687 -> { "execute": "query-acpi-ospm-status" }
4688 <- { "return": [ { "device": "d1", "slot": "0", "slot-type": "DIMM", "source": 1, "status": 0},
4689 { "slot": "1", "slot-type": "DIMM", "source": 0, "status": 0},
4690 { "slot": "2", "slot-type": "DIMM", "source": 0, "status": 0},
4691 { "slot": "3", "slot-type": "DIMM", "source": 0, "status": 0}
4693 EQMP
4695 #if defined TARGET_I386
4697 .name = "rtc-reset-reinjection",
4698 .args_type = "",
4699 .mhandler.cmd_new = qmp_marshal_rtc_reset_reinjection,
4701 #endif
4703 SQMP
4704 rtc-reset-reinjection
4705 ---------------------
4707 Reset the RTC interrupt reinjection backlog.
4709 Arguments: None.
4711 Example:
4713 -> { "execute": "rtc-reset-reinjection" }
4714 <- { "return": {} }
4715 EQMP
4718 .name = "trace-event-get-state",
4719 .args_type = "name:s,vcpu:i?",
4720 .mhandler.cmd_new = qmp_marshal_trace_event_get_state,
4723 SQMP
4724 trace-event-get-state
4725 ---------------------
4727 Query the state of events.
4729 Arguments:
4731 - "name": Event name pattern (json-string).
4732 - "vcpu": The vCPU to query, any vCPU by default (json-int, optional).
4734 An event is returned if:
4735 - its name matches the "name" pattern, and
4736 - if "vcpu" is given, the event has the "vcpu" property.
4738 Therefore, if "vcpu" is given, the operation will only match per-vCPU events,
4739 returning their state on the specified vCPU. Special case: if "name" is an exact
4740 match, "vcpu" is given and the event does not have the "vcpu" property, an error
4741 is returned.
4743 Example:
4745 -> { "execute": "trace-event-get-state", "arguments": { "name": "qemu_memalign" } }
4746 <- { "return": [ { "name": "qemu_memalign", "state": "disabled" } ] }
4747 EQMP
4750 .name = "trace-event-set-state",
4751 .args_type = "name:s,enable:b,ignore-unavailable:b?,vcpu:i?",
4752 .mhandler.cmd_new = qmp_marshal_trace_event_set_state,
4755 SQMP
4756 trace-event-set-state
4757 ---------------------
4759 Set the state of events.
4761 Arguments:
4763 - "name": Event name pattern (json-string).
4764 - "enable": Whether to enable or disable the event (json-bool).
4765 - "ignore-unavailable": Whether to ignore errors for events that cannot be
4766 changed (json-bool, optional).
4767 - "vcpu": The vCPU to act upon, all vCPUs by default (json-int, optional).
4769 An event's state is modified if:
4770 - its name matches the "name" pattern, and
4771 - if "vcpu" is given, the event has the "vcpu" property.
4773 Therefore, if "vcpu" is given, the operation will only match per-vCPU events,
4774 setting their state on the specified vCPU. Special case: if "name" is an exact
4775 match, "vcpu" is given and the event does not have the "vcpu" property, an error
4776 is returned.
4778 Example:
4780 -> { "execute": "trace-event-set-state", "arguments": { "name": "qemu_memalign", "enable": "true" } }
4781 <- { "return": {} }
4782 EQMP
4785 .name = "input-send-event",
4786 .args_type = "console:i?,events:q",
4787 .mhandler.cmd_new = qmp_marshal_input_send_event,
4790 SQMP
4791 @input-send-event
4792 -----------------
4794 Send input event to guest.
4796 Arguments:
4798 - "device": display device (json-string, optional)
4799 - "head": display head (json-int, optional)
4800 - "events": list of input events
4802 The consoles are visible in the qom tree, under
4803 /backend/console[$index]. They have a device link and head property, so
4804 it is possible to map which console belongs to which device and display.
4806 Example (1):
4808 Press left mouse button.
4810 -> { "execute": "input-send-event",
4811 "arguments": { "device": "video0",
4812 "events": [ { "type": "btn",
4813 "data" : { "down": true, "button": "left" } } ] } }
4814 <- { "return": {} }
4816 -> { "execute": "input-send-event",
4817 "arguments": { "device": "video0",
4818 "events": [ { "type": "btn",
4819 "data" : { "down": false, "button": "left" } } ] } }
4820 <- { "return": {} }
4822 Example (2):
4824 Press ctrl-alt-del.
4826 -> { "execute": "input-send-event",
4827 "arguments": { "events": [
4828 { "type": "key", "data" : { "down": true,
4829 "key": {"type": "qcode", "data": "ctrl" } } },
4830 { "type": "key", "data" : { "down": true,
4831 "key": {"type": "qcode", "data": "alt" } } },
4832 { "type": "key", "data" : { "down": true,
4833 "key": {"type": "qcode", "data": "delete" } } } ] } }
4834 <- { "return": {} }
4836 Example (3):
4838 Move mouse pointer to absolute coordinates (20000, 400).
4840 -> { "execute": "input-send-event" ,
4841 "arguments": { "events": [
4842 { "type": "abs", "data" : { "axis": "x", "value" : 20000 } },
4843 { "type": "abs", "data" : { "axis": "y", "value" : 400 } } ] } }
4844 <- { "return": {} }
4846 EQMP
4849 .name = "block-set-write-threshold",
4850 .args_type = "node-name:s,write-threshold:l",
4851 .mhandler.cmd_new = qmp_marshal_block_set_write_threshold,
4854 SQMP
4855 block-set-write-threshold
4856 ------------
4858 Change the write threshold for a block drive. The threshold is an offset,
4859 thus must be non-negative. Default is no write threshold.
4860 Setting the threshold to zero disables it.
4862 Arguments:
4864 - "node-name": the node name in the block driver state graph (json-string)
4865 - "write-threshold": the write threshold in bytes (json-int)
4867 Example:
4869 -> { "execute": "block-set-write-threshold",
4870 "arguments": { "node-name": "mydev",
4871 "write-threshold": 17179869184 } }
4872 <- { "return": {} }
4874 EQMP
4877 .name = "query-rocker",
4878 .args_type = "name:s",
4879 .mhandler.cmd_new = qmp_marshal_query_rocker,
4882 SQMP
4883 Show rocker switch
4884 ------------------
4886 Arguments:
4888 - "name": switch name
4890 Example:
4892 -> { "execute": "query-rocker", "arguments": { "name": "sw1" } }
4893 <- { "return": {"name": "sw1", "ports": 2, "id": 1327446905938}}
4895 EQMP
4898 .name = "query-rocker-ports",
4899 .args_type = "name:s",
4900 .mhandler.cmd_new = qmp_marshal_query_rocker_ports,
4903 SQMP
4904 Show rocker switch ports
4905 ------------------------
4907 Arguments:
4909 - "name": switch name
4911 Example:
4913 -> { "execute": "query-rocker-ports", "arguments": { "name": "sw1" } }
4914 <- { "return": [ {"duplex": "full", "enabled": true, "name": "sw1.1",
4915 "autoneg": "off", "link-up": true, "speed": 10000},
4916 {"duplex": "full", "enabled": true, "name": "sw1.2",
4917 "autoneg": "off", "link-up": true, "speed": 10000}
4920 EQMP
4923 .name = "query-rocker-of-dpa-flows",
4924 .args_type = "name:s,tbl-id:i?",
4925 .mhandler.cmd_new = qmp_marshal_query_rocker_of_dpa_flows,
4928 SQMP
4929 Show rocker switch OF-DPA flow tables
4930 -------------------------------------
4932 Arguments:
4934 - "name": switch name
4935 - "tbl-id": (optional) flow table ID
4937 Example:
4939 -> { "execute": "query-rocker-of-dpa-flows", "arguments": { "name": "sw1" } }
4940 <- { "return": [ {"key": {"in-pport": 0, "priority": 1, "tbl-id": 0},
4941 "hits": 138,
4942 "cookie": 0,
4943 "action": {"goto-tbl": 10},
4944 "mask": {"in-pport": 4294901760}
4946 {...more...},
4949 EQMP
4952 .name = "query-rocker-of-dpa-groups",
4953 .args_type = "name:s,type:i?",
4954 .mhandler.cmd_new = qmp_marshal_query_rocker_of_dpa_groups,
4957 SQMP
4958 Show rocker OF-DPA group tables
4959 -------------------------------
4961 Arguments:
4963 - "name": switch name
4964 - "type": (optional) group type
4966 Example:
4968 -> { "execute": "query-rocker-of-dpa-groups", "arguments": { "name": "sw1" } }
4969 <- { "return": [ {"type": 0, "out-pport": 2, "pport": 2, "vlan-id": 3841,
4970 "pop-vlan": 1, "id": 251723778},
4971 {"type": 0, "out-pport": 0, "pport": 0, "vlan-id": 3841,
4972 "pop-vlan": 1, "id": 251723776},
4973 {"type": 0, "out-pport": 1, "pport": 1, "vlan-id": 3840,
4974 "pop-vlan": 1, "id": 251658241},
4975 {"type": 0, "out-pport": 0, "pport": 0, "vlan-id": 3840,
4976 "pop-vlan": 1, "id": 251658240}
4979 EQMP
4981 #if defined TARGET_ARM
4983 .name = "query-gic-capabilities",
4984 .args_type = "",
4985 .mhandler.cmd_new = qmp_marshal_query_gic_capabilities,
4987 #endif
4989 SQMP
4990 query-gic-capabilities
4991 ---------------
4993 Return a list of GICCapability objects, describing supported GIC
4994 (Generic Interrupt Controller) versions.
4996 Arguments: None
4998 Example:
5000 -> { "execute": "query-gic-capabilities" }
5001 <- { "return": [{ "version": 2, "emulated": true, "kernel": false },
5002 { "version": 3, "emulated": false, "kernel": true } ] }
5004 EQMP
5007 .name = "query-hotpluggable-cpus",
5008 .args_type = "",
5009 .mhandler.cmd_new = qmp_marshal_query_hotpluggable_cpus,
5012 SQMP
5013 Show existing/possible CPUs
5014 ---------------------------
5016 Arguments: None.
5018 Example for pseries machine type started with
5019 -smp 2,cores=2,maxcpus=4 -cpu POWER8:
5021 -> { "execute": "query-hotpluggable-cpus" }
5022 <- {"return": [
5023 { "props": { "core-id": 8 }, "type": "POWER8-spapr-cpu-core",
5024 "vcpus-count": 1 },
5025 { "props": { "core-id": 0 }, "type": "POWER8-spapr-cpu-core",
5026 "vcpus-count": 1, "qom-path": "/machine/unattached/device[0]"}
5029 Example for pc machine type started with
5030 -smp 1,maxcpus=2:
5031 -> { "execute": "query-hotpluggable-cpus" }
5032 <- {"return": [
5034 "type": "qemu64-x86_64-cpu", "vcpus-count": 1,
5035 "props": {"core-id": 0, "socket-id": 1, "thread-id": 0}
5038 "qom-path": "/machine/unattached/device[0]",
5039 "type": "qemu64-x86_64-cpu", "vcpus-count": 1,
5040 "props": {"core-id": 0, "socket-id": 0, "thread-id": 0}