machine: MACHINE_TYPE_NAME macro
[qemu.git] / qmp-commands.hx
blob9848fd88f02bc2e3bcadcad33e2c57c83ffa9df1
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_input_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_input_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_input_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_input_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_input_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_input_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_input_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_input_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_input_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_input_device_del,
316 SQMP
317 device_del
318 ----------
320 Remove a device.
322 Arguments:
324 - "id": the device's ID (json-string)
326 Example:
328 -> { "execute": "device_del", "arguments": { "id": "net1" } }
329 <- { "return": {} }
331 EQMP
334 .name = "send-key",
335 .args_type = "keys:q,hold-time:i?",
336 .mhandler.cmd_new = qmp_marshal_input_send_key,
339 SQMP
340 send-key
341 ----------
343 Send keys to VM.
345 Arguments:
347 keys array:
348 - "key": key sequence (a json-array of key union values,
349 union can be number or qcode enum)
351 - hold-time: time to delay key up events, milliseconds. Defaults to 100
352 (json-int, optional)
354 Example:
356 -> { "execute": "send-key",
357 "arguments": { "keys": [ { "type": "qcode", "data": "ctrl" },
358 { "type": "qcode", "data": "alt" },
359 { "type": "qcode", "data": "delete" } ] } }
360 <- { "return": {} }
362 EQMP
365 .name = "cpu",
366 .args_type = "index:i",
367 .mhandler.cmd_new = qmp_marshal_input_cpu,
370 SQMP
374 Set the default CPU.
376 Arguments:
378 - "index": the CPU's index (json-int)
380 Example:
382 -> { "execute": "cpu", "arguments": { "index": 0 } }
383 <- { "return": {} }
385 Note: CPUs' indexes are obtained with the 'query-cpus' command.
387 EQMP
390 .name = "cpu-add",
391 .args_type = "id:i",
392 .mhandler.cmd_new = qmp_marshal_input_cpu_add,
395 SQMP
396 cpu-add
397 -------
399 Adds virtual cpu
401 Arguments:
403 - "id": cpu id (json-int)
405 Example:
407 -> { "execute": "cpu-add", "arguments": { "id": 2 } }
408 <- { "return": {} }
410 EQMP
413 .name = "memsave",
414 .args_type = "val:l,size:i,filename:s,cpu:i?",
415 .mhandler.cmd_new = qmp_marshal_input_memsave,
418 SQMP
419 memsave
420 -------
422 Save to disk virtual memory dump starting at 'val' of size 'size'.
424 Arguments:
426 - "val": the starting address (json-int)
427 - "size": the memory size, in bytes (json-int)
428 - "filename": file path (json-string)
429 - "cpu": virtual CPU index (json-int, optional)
431 Example:
433 -> { "execute": "memsave",
434 "arguments": { "val": 10,
435 "size": 100,
436 "filename": "/tmp/virtual-mem-dump" } }
437 <- { "return": {} }
439 EQMP
442 .name = "pmemsave",
443 .args_type = "val:l,size:i,filename:s",
444 .mhandler.cmd_new = qmp_marshal_input_pmemsave,
447 SQMP
448 pmemsave
449 --------
451 Save to disk physical memory dump starting at 'val' of size 'size'.
453 Arguments:
455 - "val": the starting address (json-int)
456 - "size": the memory size, in bytes (json-int)
457 - "filename": file path (json-string)
459 Example:
461 -> { "execute": "pmemsave",
462 "arguments": { "val": 10,
463 "size": 100,
464 "filename": "/tmp/physical-mem-dump" } }
465 <- { "return": {} }
467 EQMP
470 .name = "inject-nmi",
471 .args_type = "",
472 .mhandler.cmd_new = qmp_marshal_input_inject_nmi,
475 SQMP
476 inject-nmi
477 ----------
479 Inject an NMI on the default CPU (x86/s390) or all CPUs (ppc64).
481 Arguments: None.
483 Example:
485 -> { "execute": "inject-nmi" }
486 <- { "return": {} }
488 Note: inject-nmi fails when the guest doesn't support injecting.
490 EQMP
493 .name = "ringbuf-write",
494 .args_type = "device:s,data:s,format:s?",
495 .mhandler.cmd_new = qmp_marshal_input_ringbuf_write,
498 SQMP
499 ringbuf-write
500 -------------
502 Write to a ring buffer character device.
504 Arguments:
506 - "device": ring buffer character device name (json-string)
507 - "data": data to write (json-string)
508 - "format": data format (json-string, optional)
509 - Possible values: "utf8" (default), "base64"
510 Bug: invalid base64 is currently not rejected.
511 Whitespace *is* invalid.
513 Example:
515 -> { "execute": "ringbuf-write",
516 "arguments": { "device": "foo",
517 "data": "abcdefgh",
518 "format": "utf8" } }
519 <- { "return": {} }
521 EQMP
524 .name = "ringbuf-read",
525 .args_type = "device:s,size:i,format:s?",
526 .mhandler.cmd_new = qmp_marshal_input_ringbuf_read,
529 SQMP
530 ringbuf-read
531 -------------
533 Read from a ring buffer character device.
535 Arguments:
537 - "device": ring buffer character device name (json-string)
538 - "size": how many bytes to read at most (json-int)
539 - Number of data bytes, not number of characters in encoded data
540 - "format": data format (json-string, optional)
541 - Possible values: "utf8" (default), "base64"
542 - Naturally, format "utf8" works only when the ring buffer
543 contains valid UTF-8 text. Invalid UTF-8 sequences get
544 replaced. Bug: replacement doesn't work. Bug: can screw
545 up on encountering NUL characters, after the ring buffer
546 lost data, and when reading stops because the size limit
547 is reached.
549 Example:
551 -> { "execute": "ringbuf-read",
552 "arguments": { "device": "foo",
553 "size": 1000,
554 "format": "utf8" } }
555 <- {"return": "abcdefgh"}
557 EQMP
560 .name = "xen-save-devices-state",
561 .args_type = "filename:F",
562 .mhandler.cmd_new = qmp_marshal_input_xen_save_devices_state,
565 SQMP
566 xen-save-devices-state
567 -------
569 Save the state of all devices to file. The RAM and the block devices
570 of the VM are not saved by this command.
572 Arguments:
574 - "filename": the file to save the state of the devices to as binary
575 data. See xen-save-devices-state.txt for a description of the binary
576 format.
578 Example:
580 -> { "execute": "xen-save-devices-state",
581 "arguments": { "filename": "/tmp/save" } }
582 <- { "return": {} }
584 EQMP
587 .name = "xen-set-global-dirty-log",
588 .args_type = "enable:b",
589 .mhandler.cmd_new = qmp_marshal_input_xen_set_global_dirty_log,
592 SQMP
593 xen-set-global-dirty-log
594 -------
596 Enable or disable the global dirty log mode.
598 Arguments:
600 - "enable": Enable it or disable it.
602 Example:
604 -> { "execute": "xen-set-global-dirty-log",
605 "arguments": { "enable": true } }
606 <- { "return": {} }
608 EQMP
611 .name = "migrate",
612 .args_type = "detach:-d,blk:-b,inc:-i,uri:s",
613 .mhandler.cmd_new = qmp_marshal_input_migrate,
616 SQMP
617 migrate
618 -------
620 Migrate to URI.
622 Arguments:
624 - "blk": block migration, full disk copy (json-bool, optional)
625 - "inc": incremental disk copy (json-bool, optional)
626 - "uri": Destination URI (json-string)
628 Example:
630 -> { "execute": "migrate", "arguments": { "uri": "tcp:0:4446" } }
631 <- { "return": {} }
633 Notes:
635 (1) The 'query-migrate' command should be used to check migration's progress
636 and final result (this information is provided by the 'status' member)
637 (2) All boolean arguments default to false
638 (3) The user Monitor's "detach" argument is invalid in QMP and should not
639 be used
641 EQMP
644 .name = "migrate_cancel",
645 .args_type = "",
646 .mhandler.cmd_new = qmp_marshal_input_migrate_cancel,
649 SQMP
650 migrate_cancel
651 --------------
653 Cancel the current migration.
655 Arguments: None.
657 Example:
659 -> { "execute": "migrate_cancel" }
660 <- { "return": {} }
662 EQMP
665 .name = "migrate-incoming",
666 .args_type = "uri:s",
667 .mhandler.cmd_new = qmp_marshal_input_migrate_incoming,
670 SQMP
671 migrate-incoming
672 ----------------
674 Continue an incoming migration
676 Arguments:
678 - "uri": Source/listening URI (json-string)
680 Example:
682 -> { "execute": "migrate-incoming", "arguments": { "uri": "tcp::4446" } }
683 <- { "return": {} }
685 Notes:
687 (1) QEMU must be started with -incoming defer to allow migrate-incoming to
688 be used
689 (2) The uri format is the same as for -incoming
691 EQMP
693 .name = "migrate-set-cache-size",
694 .args_type = "value:o",
695 .mhandler.cmd_new = qmp_marshal_input_migrate_set_cache_size,
698 SQMP
699 migrate-set-cache-size
700 ----------------------
702 Set cache size to be used by XBZRLE migration, the cache size will be rounded
703 down to the nearest power of 2
705 Arguments:
707 - "value": cache size in bytes (json-int)
709 Example:
711 -> { "execute": "migrate-set-cache-size", "arguments": { "value": 536870912 } }
712 <- { "return": {} }
714 EQMP
716 .name = "query-migrate-cache-size",
717 .args_type = "",
718 .mhandler.cmd_new = qmp_marshal_input_query_migrate_cache_size,
721 SQMP
722 query-migrate-cache-size
723 ------------------------
725 Show cache size to be used by XBZRLE migration
727 returns a json-object with the following information:
728 - "size" : json-int
730 Example:
732 -> { "execute": "query-migrate-cache-size" }
733 <- { "return": 67108864 }
735 EQMP
738 .name = "migrate_set_speed",
739 .args_type = "value:o",
740 .mhandler.cmd_new = qmp_marshal_input_migrate_set_speed,
743 SQMP
744 migrate_set_speed
745 -----------------
747 Set maximum speed for migrations.
749 Arguments:
751 - "value": maximum speed, in bytes per second (json-int)
753 Example:
755 -> { "execute": "migrate_set_speed", "arguments": { "value": 1024 } }
756 <- { "return": {} }
758 EQMP
761 .name = "migrate_set_downtime",
762 .args_type = "value:T",
763 .mhandler.cmd_new = qmp_marshal_input_migrate_set_downtime,
766 SQMP
767 migrate_set_downtime
768 --------------------
770 Set maximum tolerated downtime (in seconds) for migrations.
772 Arguments:
774 - "value": maximum downtime (json-number)
776 Example:
778 -> { "execute": "migrate_set_downtime", "arguments": { "value": 0.1 } }
779 <- { "return": {} }
781 EQMP
784 .name = "client_migrate_info",
785 .args_type = "protocol:s,hostname:s,port:i?,tls-port:i?,cert-subject:s?",
786 .params = "protocol hostname port tls-port cert-subject",
787 .help = "set migration information for remote display",
788 .mhandler.cmd_new = qmp_marshal_input_client_migrate_info,
791 SQMP
792 client_migrate_info
793 -------------------
795 Set migration information for remote display. This makes the server
796 ask the client to automatically reconnect using the new parameters
797 once migration finished successfully. Only implemented for SPICE.
799 Arguments:
801 - "protocol": must be "spice" (json-string)
802 - "hostname": migration target hostname (json-string)
803 - "port": spice tcp port for plaintext channels (json-int, optional)
804 - "tls-port": spice tcp port for tls-secured channels (json-int, optional)
805 - "cert-subject": server certificate subject (json-string, optional)
807 Example:
809 -> { "execute": "client_migrate_info",
810 "arguments": { "protocol": "spice",
811 "hostname": "virt42.lab.kraxel.org",
812 "port": 1234 } }
813 <- { "return": {} }
815 EQMP
818 .name = "dump-guest-memory",
819 .args_type = "paging:b,protocol:s,begin:i?,end:i?,format:s?",
820 .params = "-p protocol [begin] [length] [format]",
821 .help = "dump guest memory to file",
822 .mhandler.cmd_new = qmp_marshal_input_dump_guest_memory,
825 SQMP
826 dump
829 Dump guest memory to file. The file can be processed with crash or gdb.
831 Arguments:
833 - "paging": do paging to get guest's memory mapping (json-bool)
834 - "protocol": destination file(started with "file:") or destination file
835 descriptor (started with "fd:") (json-string)
836 - "begin": the starting physical address. It's optional, and should be specified
837 with length together (json-int)
838 - "length": the memory size, in bytes. It's optional, and should be specified
839 with begin together (json-int)
840 - "format": the format of guest memory dump. It's optional, and can be
841 elf|kdump-zlib|kdump-lzo|kdump-snappy, but non-elf formats will
842 conflict with paging and filter, ie. begin and length (json-string)
844 Example:
846 -> { "execute": "dump-guest-memory", "arguments": { "protocol": "fd:dump" } }
847 <- { "return": {} }
849 Notes:
851 (1) All boolean arguments default to false
853 EQMP
856 .name = "query-dump-guest-memory-capability",
857 .args_type = "",
858 .mhandler.cmd_new = qmp_marshal_input_query_dump_guest_memory_capability,
861 SQMP
862 query-dump-guest-memory-capability
863 ----------
865 Show available formats for 'dump-guest-memory'
867 Example:
869 -> { "execute": "query-dump-guest-memory-capability" }
870 <- { "return": { "formats":
871 ["elf", "kdump-zlib", "kdump-lzo", "kdump-snappy"] }
873 EQMP
875 #if defined TARGET_S390X
877 .name = "dump-skeys",
878 .args_type = "filename:F",
879 .mhandler.cmd_new = qmp_marshal_input_dump_skeys,
881 #endif
883 SQMP
884 dump-skeys
885 ----------
887 Save guest storage keys to file.
889 Arguments:
891 - "filename": file path (json-string)
893 Example:
895 -> { "execute": "dump-skeys", "arguments": { "filename": "/tmp/skeys" } }
896 <- { "return": {} }
898 EQMP
901 .name = "netdev_add",
902 .args_type = "netdev:O",
903 .mhandler.cmd_new = qmp_netdev_add,
906 SQMP
907 netdev_add
908 ----------
910 Add host network device.
912 Arguments:
914 - "type": the device type, "tap", "user", ... (json-string)
915 - "id": the device's ID, must be unique (json-string)
916 - device options
918 Example:
920 -> { "execute": "netdev_add", "arguments": { "type": "user", "id": "netdev1" } }
921 <- { "return": {} }
923 Note: The supported device options are the same ones supported by the '-netdev'
924 command-line argument, which are listed in the '-help' output or QEMU's
925 manual
927 EQMP
930 .name = "netdev_del",
931 .args_type = "id:s",
932 .mhandler.cmd_new = qmp_marshal_input_netdev_del,
935 SQMP
936 netdev_del
937 ----------
939 Remove host network device.
941 Arguments:
943 - "id": the device's ID, must be unique (json-string)
945 Example:
947 -> { "execute": "netdev_del", "arguments": { "id": "netdev1" } }
948 <- { "return": {} }
951 EQMP
954 .name = "object-add",
955 .args_type = "qom-type:s,id:s,props:q?",
956 .mhandler.cmd_new = qmp_object_add,
959 SQMP
960 object-add
961 ----------
963 Create QOM object.
965 Arguments:
967 - "qom-type": the object's QOM type, i.e. the class name (json-string)
968 - "id": the object's ID, must be unique (json-string)
969 - "props": a dictionary of object property values (optional, json-dict)
971 Example:
973 -> { "execute": "object-add", "arguments": { "qom-type": "rng-random", "id": "rng1",
974 "props": { "filename": "/dev/hwrng" } } }
975 <- { "return": {} }
977 EQMP
980 .name = "object-del",
981 .args_type = "id:s",
982 .mhandler.cmd_new = qmp_marshal_input_object_del,
985 SQMP
986 object-del
987 ----------
989 Remove QOM object.
991 Arguments:
993 - "id": the object's ID (json-string)
995 Example:
997 -> { "execute": "object-del", "arguments": { "id": "rng1" } }
998 <- { "return": {} }
1001 EQMP
1005 .name = "block_resize",
1006 .args_type = "device:s?,node-name:s?,size:o",
1007 .mhandler.cmd_new = qmp_marshal_input_block_resize,
1010 SQMP
1011 block_resize
1012 ------------
1014 Resize a block image while a guest is running.
1016 Arguments:
1018 - "device": the device's ID, must be unique (json-string)
1019 - "node-name": the node name in the block driver state graph (json-string)
1020 - "size": new size
1022 Example:
1024 -> { "execute": "block_resize", "arguments": { "device": "scratch", "size": 1073741824 } }
1025 <- { "return": {} }
1027 EQMP
1030 .name = "block-stream",
1031 .args_type = "device:B,base:s?,speed:o?,backing-file:s?,on-error:s?",
1032 .mhandler.cmd_new = qmp_marshal_input_block_stream,
1035 SQMP
1036 block-stream
1037 ------------
1039 Copy data from a backing file into a block device.
1041 Arguments:
1043 - "device": The device's ID, must be unique (json-string)
1044 - "base": The file name of the backing image above which copying starts
1045 (json-string, optional)
1046 - "backing-file": The backing file string to write into the active layer. This
1047 filename is not validated.
1049 If a pathname string is such that it cannot be resolved by
1050 QEMU, that means that subsequent QMP or HMP commands must use
1051 node-names for the image in question, as filename lookup
1052 methods will fail.
1054 If not specified, QEMU will automatically determine the
1055 backing file string to use, or error out if there is no
1056 obvious choice. Care should be taken when specifying the
1057 string, to specify a valid filename or protocol.
1058 (json-string, optional) (Since 2.1)
1059 - "speed": the maximum speed, in bytes per second (json-int, optional)
1060 - "on-error": the action to take on an error (default 'report'). 'stop' and
1061 'enospc' can only be used if the block device supports io-status.
1062 (json-string, optional) (Since 2.1)
1064 Example:
1066 -> { "execute": "block-stream", "arguments": { "device": "virtio0",
1067 "base": "/tmp/master.qcow2" } }
1068 <- { "return": {} }
1070 EQMP
1073 .name = "block-commit",
1074 .args_type = "device:B,base:s?,top:s?,backing-file:s?,speed:o?",
1075 .mhandler.cmd_new = qmp_marshal_input_block_commit,
1078 SQMP
1079 block-commit
1080 ------------
1082 Live commit of data from overlay image nodes into backing nodes - i.e., writes
1083 data between 'top' and 'base' into 'base'.
1085 Arguments:
1087 - "device": The device's ID, must be unique (json-string)
1088 - "base": The file name of the backing image to write data into.
1089 If not specified, this is the deepest backing image
1090 (json-string, optional)
1091 - "top": The file name of the backing image within the image chain,
1092 which contains the topmost data to be committed down. If
1093 not specified, this is the active layer. (json-string, optional)
1095 - backing-file: The backing file string to write into the overlay
1096 image of 'top'. If 'top' is the active layer,
1097 specifying a backing file string is an error. This
1098 filename is not validated.
1100 If a pathname string is such that it cannot be
1101 resolved by QEMU, that means that subsequent QMP or
1102 HMP commands must use node-names for the image in
1103 question, as filename lookup methods will fail.
1105 If not specified, QEMU will automatically determine
1106 the backing file string to use, or error out if
1107 there is no obvious choice. Care should be taken
1108 when specifying the string, to specify a valid
1109 filename or protocol.
1110 (json-string, optional) (Since 2.1)
1112 If top == base, that is an error.
1113 If top == active, the job will not be completed by itself,
1114 user needs to complete the job with the block-job-complete
1115 command after getting the ready event. (Since 2.0)
1117 If the base image is smaller than top, then the base image
1118 will be resized to be the same size as top. If top is
1119 smaller than the base image, the base will not be
1120 truncated. If you want the base image size to match the
1121 size of the smaller top, you can safely truncate it
1122 yourself once the commit operation successfully completes.
1123 (json-string)
1124 - "speed": the maximum speed, in bytes per second (json-int, optional)
1127 Example:
1129 -> { "execute": "block-commit", "arguments": { "device": "virtio0",
1130 "top": "/tmp/snap1.qcow2" } }
1131 <- { "return": {} }
1133 EQMP
1136 .name = "drive-backup",
1137 .args_type = "sync:s,device:B,target:s,speed:i?,mode:s?,format:s?,"
1138 "bitmap:s?,on-source-error:s?,on-target-error:s?",
1139 .mhandler.cmd_new = qmp_marshal_input_drive_backup,
1142 SQMP
1143 drive-backup
1144 ------------
1146 Start a point-in-time copy of a block device to a new destination. The
1147 status of ongoing drive-backup operations can be checked with
1148 query-block-jobs where the BlockJobInfo.type field has the value 'backup'.
1149 The operation can be stopped before it has completed using the
1150 block-job-cancel command.
1152 Arguments:
1154 - "device": the name of the device which should be copied.
1155 (json-string)
1156 - "target": the target of the new image. If the file exists, or if it is a
1157 device, the existing file/device will be used as the new
1158 destination. If it does not exist, a new file will be created.
1159 (json-string)
1160 - "format": the format of the new destination, default is to probe if 'mode' is
1161 'existing', else the format of the source
1162 (json-string, optional)
1163 - "sync": what parts of the disk image should be copied to the destination;
1164 possibilities include "full" for all the disk, "top" for only the sectors
1165 allocated in the topmost image, "incremental" for only the dirty sectors in
1166 the bitmap, or "none" to only replicate new I/O (MirrorSyncMode).
1167 - "bitmap": dirty bitmap name for sync==incremental. Must be present if sync
1168 is "incremental", must NOT be present otherwise.
1169 - "mode": whether and how QEMU should create a new image
1170 (NewImageMode, optional, default 'absolute-paths')
1171 - "speed": the maximum speed, in bytes per second (json-int, optional)
1172 - "on-source-error": the action to take on an error on the source, default
1173 'report'. 'stop' and 'enospc' can only be used
1174 if the block device supports io-status.
1175 (BlockdevOnError, optional)
1176 - "on-target-error": the action to take on an error on the target, default
1177 'report' (no limitations, since this applies to
1178 a different block device than device).
1179 (BlockdevOnError, optional)
1181 Example:
1182 -> { "execute": "drive-backup", "arguments": { "device": "drive0",
1183 "sync": "full",
1184 "target": "backup.img" } }
1185 <- { "return": {} }
1187 EQMP
1190 .name = "blockdev-backup",
1191 .args_type = "sync:s,device:B,target:B,speed:i?,"
1192 "on-source-error:s?,on-target-error:s?",
1193 .mhandler.cmd_new = qmp_marshal_input_blockdev_backup,
1196 SQMP
1197 blockdev-backup
1198 ---------------
1200 The device version of drive-backup: this command takes an existing named device
1201 as backup target.
1203 Arguments:
1205 - "device": the name of the device which should be copied.
1206 (json-string)
1207 - "target": the name of the backup target device. (json-string)
1208 - "sync": what parts of the disk image should be copied to the destination;
1209 possibilities include "full" for all the disk, "top" for only the
1210 sectors allocated in the topmost image, or "none" to only replicate
1211 new I/O (MirrorSyncMode).
1212 - "speed": the maximum speed, in bytes per second (json-int, optional)
1213 - "on-source-error": the action to take on an error on the source, default
1214 'report'. 'stop' and 'enospc' can only be used
1215 if the block device supports io-status.
1216 (BlockdevOnError, optional)
1217 - "on-target-error": the action to take on an error on the target, default
1218 'report' (no limitations, since this applies to
1219 a different block device than device).
1220 (BlockdevOnError, optional)
1222 Example:
1223 -> { "execute": "blockdev-backup", "arguments": { "device": "src-id",
1224 "sync": "full",
1225 "target": "tgt-id" } }
1226 <- { "return": {} }
1228 EQMP
1231 .name = "block-job-set-speed",
1232 .args_type = "device:B,speed:o",
1233 .mhandler.cmd_new = qmp_marshal_input_block_job_set_speed,
1237 .name = "block-job-cancel",
1238 .args_type = "device:B,force:b?",
1239 .mhandler.cmd_new = qmp_marshal_input_block_job_cancel,
1242 .name = "block-job-pause",
1243 .args_type = "device:B",
1244 .mhandler.cmd_new = qmp_marshal_input_block_job_pause,
1247 .name = "block-job-resume",
1248 .args_type = "device:B",
1249 .mhandler.cmd_new = qmp_marshal_input_block_job_resume,
1252 .name = "block-job-complete",
1253 .args_type = "device:B",
1254 .mhandler.cmd_new = qmp_marshal_input_block_job_complete,
1257 .name = "transaction",
1258 .args_type = "actions:q",
1259 .mhandler.cmd_new = qmp_marshal_input_transaction,
1262 SQMP
1263 transaction
1264 -----------
1266 Atomically operate on one or more block devices. The only supported operations
1267 for now are drive-backup, internal and external snapshotting. A list of
1268 dictionaries is accepted, that contains the actions to be performed.
1269 If there is any failure performing any of the operations, all operations
1270 for the group are abandoned.
1272 For external snapshots, the dictionary contains the device, the file to use for
1273 the new snapshot, and the format. The default format, if not specified, is
1274 qcow2.
1276 Each new snapshot defaults to being created by QEMU (wiping any
1277 contents if the file already exists), but it is also possible to reuse
1278 an externally-created file. In the latter case, you should ensure that
1279 the new image file has the same contents as the current one; QEMU cannot
1280 perform any meaningful check. Typically this is achieved by using the
1281 current image file as the backing file for the new image.
1283 On failure, the original disks pre-snapshot attempt will be used.
1285 For internal snapshots, the dictionary contains the device and the snapshot's
1286 name. If an internal snapshot matching name already exists, the request will
1287 be rejected. Only some image formats support it, for example, qcow2, rbd,
1288 and sheepdog.
1290 On failure, qemu will try delete the newly created internal snapshot in the
1291 transaction. When an I/O error occurs during deletion, the user needs to fix
1292 it later with qemu-img or other command.
1294 Arguments:
1296 actions array:
1297 - "type": the operation to perform. The only supported
1298 value is "blockdev-snapshot-sync". (json-string)
1299 - "data": a dictionary. The contents depend on the value
1300 of "type". When "type" is "blockdev-snapshot-sync":
1301 - "device": device name to snapshot (json-string)
1302 - "node-name": graph node name to snapshot (json-string)
1303 - "snapshot-file": name of new image file (json-string)
1304 - "snapshot-node-name": graph node name of the new snapshot (json-string)
1305 - "format": format of new image (json-string, optional)
1306 - "mode": whether and how QEMU should create the snapshot file
1307 (NewImageMode, optional, default "absolute-paths")
1308 When "type" is "blockdev-snapshot-internal-sync":
1309 - "device": device name to snapshot (json-string)
1310 - "name": name of the new snapshot (json-string)
1312 Example:
1314 -> { "execute": "transaction",
1315 "arguments": { "actions": [
1316 { "type": "blockdev-snapshot-sync", "data" : { "device": "ide-hd0",
1317 "snapshot-file": "/some/place/my-image",
1318 "format": "qcow2" } },
1319 { "type": "blockdev-snapshot-sync", "data" : { "node-name": "myfile",
1320 "snapshot-file": "/some/place/my-image2",
1321 "snapshot-node-name": "node3432",
1322 "mode": "existing",
1323 "format": "qcow2" } },
1324 { "type": "blockdev-snapshot-sync", "data" : { "device": "ide-hd1",
1325 "snapshot-file": "/some/place/my-image2",
1326 "mode": "existing",
1327 "format": "qcow2" } },
1328 { "type": "blockdev-snapshot-internal-sync", "data" : {
1329 "device": "ide-hd2",
1330 "name": "snapshot0" } } ] } }
1331 <- { "return": {} }
1333 EQMP
1336 .name = "block-dirty-bitmap-add",
1337 .args_type = "node:B,name:s,granularity:i?",
1338 .mhandler.cmd_new = qmp_marshal_input_block_dirty_bitmap_add,
1341 SQMP
1343 block-dirty-bitmap-add
1344 ----------------------
1345 Since 2.4
1347 Create a dirty bitmap with a name on the device, and start tracking the writes.
1349 Arguments:
1351 - "node": device/node on which to create dirty bitmap (json-string)
1352 - "name": name of the new dirty bitmap (json-string)
1353 - "granularity": granularity to track writes with (int, optional)
1355 Example:
1357 -> { "execute": "block-dirty-bitmap-add", "arguments": { "node": "drive0",
1358 "name": "bitmap0" } }
1359 <- { "return": {} }
1361 EQMP
1364 .name = "block-dirty-bitmap-remove",
1365 .args_type = "node:B,name:s",
1366 .mhandler.cmd_new = qmp_marshal_input_block_dirty_bitmap_remove,
1369 SQMP
1371 block-dirty-bitmap-remove
1372 -------------------------
1373 Since 2.4
1375 Stop write tracking and remove the dirty bitmap that was created with
1376 block-dirty-bitmap-add.
1378 Arguments:
1380 - "node": device/node on which to remove dirty bitmap (json-string)
1381 - "name": name of the dirty bitmap to remove (json-string)
1383 Example:
1385 -> { "execute": "block-dirty-bitmap-remove", "arguments": { "node": "drive0",
1386 "name": "bitmap0" } }
1387 <- { "return": {} }
1389 EQMP
1392 .name = "block-dirty-bitmap-clear",
1393 .args_type = "node:B,name:s",
1394 .mhandler.cmd_new = qmp_marshal_input_block_dirty_bitmap_clear,
1397 SQMP
1399 block-dirty-bitmap-clear
1400 ------------------------
1401 Since 2.4
1403 Reset the dirty bitmap associated with a node so that an incremental backup
1404 from this point in time forward will only backup clusters modified after this
1405 clear operation.
1407 Arguments:
1409 - "node": device/node on which to remove dirty bitmap (json-string)
1410 - "name": name of the dirty bitmap to remove (json-string)
1412 Example:
1414 -> { "execute": "block-dirty-bitmap-clear", "arguments": { "node": "drive0",
1415 "name": "bitmap0" } }
1416 <- { "return": {} }
1418 EQMP
1421 .name = "blockdev-snapshot-sync",
1422 .args_type = "device:s?,node-name:s?,snapshot-file:s,snapshot-node-name:s?,format:s?,mode:s?",
1423 .mhandler.cmd_new = qmp_marshal_input_blockdev_snapshot_sync,
1426 SQMP
1427 blockdev-snapshot-sync
1428 ----------------------
1430 Synchronous snapshot of a block device. snapshot-file specifies the
1431 target of the new image. If the file exists, or if it is a device, the
1432 snapshot will be created in the existing file/device. If does not
1433 exist, a new file will be created. format specifies the format of the
1434 snapshot image, default is qcow2.
1436 Arguments:
1438 - "device": device name to snapshot (json-string)
1439 - "node-name": graph node name to snapshot (json-string)
1440 - "snapshot-file": name of new image file (json-string)
1441 - "snapshot-node-name": graph node name of the new snapshot (json-string)
1442 - "mode": whether and how QEMU should create the snapshot file
1443 (NewImageMode, optional, default "absolute-paths")
1444 - "format": format of new image (json-string, optional)
1446 Example:
1448 -> { "execute": "blockdev-snapshot-sync", "arguments": { "device": "ide-hd0",
1449 "snapshot-file":
1450 "/some/place/my-image",
1451 "format": "qcow2" } }
1452 <- { "return": {} }
1454 EQMP
1457 .name = "blockdev-snapshot-internal-sync",
1458 .args_type = "device:B,name:s",
1459 .mhandler.cmd_new = qmp_marshal_input_blockdev_snapshot_internal_sync,
1462 SQMP
1463 blockdev-snapshot-internal-sync
1464 -------------------------------
1466 Synchronously take an internal snapshot of a block device when the format of
1467 image used supports it. If the name is an empty string, or a snapshot with
1468 name already exists, the operation will fail.
1470 Arguments:
1472 - "device": device name to snapshot (json-string)
1473 - "name": name of the new snapshot (json-string)
1475 Example:
1477 -> { "execute": "blockdev-snapshot-internal-sync",
1478 "arguments": { "device": "ide-hd0",
1479 "name": "snapshot0" }
1481 <- { "return": {} }
1483 EQMP
1486 .name = "blockdev-snapshot-delete-internal-sync",
1487 .args_type = "device:B,id:s?,name:s?",
1488 .mhandler.cmd_new =
1489 qmp_marshal_input_blockdev_snapshot_delete_internal_sync,
1492 SQMP
1493 blockdev-snapshot-delete-internal-sync
1494 --------------------------------------
1496 Synchronously delete an internal snapshot of a block device when the format of
1497 image used supports it. The snapshot is identified by name or id or both. One
1498 of name or id is required. If the snapshot is not found, the operation will
1499 fail.
1501 Arguments:
1503 - "device": device name (json-string)
1504 - "id": ID of the snapshot (json-string, optional)
1505 - "name": name of the snapshot (json-string, optional)
1507 Example:
1509 -> { "execute": "blockdev-snapshot-delete-internal-sync",
1510 "arguments": { "device": "ide-hd0",
1511 "name": "snapshot0" }
1513 <- { "return": {
1514 "id": "1",
1515 "name": "snapshot0",
1516 "vm-state-size": 0,
1517 "date-sec": 1000012,
1518 "date-nsec": 10,
1519 "vm-clock-sec": 100,
1520 "vm-clock-nsec": 20
1524 EQMP
1527 .name = "drive-mirror",
1528 .args_type = "sync:s,device:B,target:s,speed:i?,mode:s?,format:s?,"
1529 "node-name:s?,replaces:s?,"
1530 "on-source-error:s?,on-target-error:s?,"
1531 "unmap:b?,"
1532 "granularity:i?,buf-size:i?",
1533 .mhandler.cmd_new = qmp_marshal_input_drive_mirror,
1536 SQMP
1537 drive-mirror
1538 ------------
1540 Start mirroring a block device's writes to a new destination. target
1541 specifies the target of the new image. If the file exists, or if it is
1542 a device, it will be used as the new destination for writes. If it does not
1543 exist, a new file will be created. format specifies the format of the
1544 mirror image, default is to probe if mode='existing', else the format
1545 of the source.
1547 Arguments:
1549 - "device": device name to operate on (json-string)
1550 - "target": name of new image file (json-string)
1551 - "format": format of new image (json-string, optional)
1552 - "node-name": the name of the new block driver state in the node graph
1553 (json-string, optional)
1554 - "replaces": the block driver node name to replace when finished
1555 (json-string, optional)
1556 - "mode": how an image file should be created into the target
1557 file/device (NewImageMode, optional, default 'absolute-paths')
1558 - "speed": maximum speed of the streaming job, in bytes per second
1559 (json-int)
1560 - "granularity": granularity of the dirty bitmap, in bytes (json-int, optional)
1561 - "buf_size": maximum amount of data in flight from source to target, in bytes
1562 (json-int, default 10M)
1563 - "sync": what parts of the disk image should be copied to the destination;
1564 possibilities include "full" for all the disk, "top" for only the sectors
1565 allocated in the topmost image, or "none" to only replicate new I/O
1566 (MirrorSyncMode).
1567 - "on-source-error": the action to take on an error on the source
1568 (BlockdevOnError, default 'report')
1569 - "on-target-error": the action to take on an error on the target
1570 (BlockdevOnError, default 'report')
1571 - "unmap": whether the target sectors should be discarded where source has only
1572 zeroes. (json-bool, optional, default true)
1574 The default value of the granularity is the image cluster size clamped
1575 between 4096 and 65536, if the image format defines one. If the format
1576 does not define a cluster size, the default value of the granularity
1577 is 65536.
1580 Example:
1582 -> { "execute": "drive-mirror", "arguments": { "device": "ide-hd0",
1583 "target": "/some/place/my-image",
1584 "sync": "full",
1585 "format": "qcow2" } }
1586 <- { "return": {} }
1588 EQMP
1591 .name = "change-backing-file",
1592 .args_type = "device:s,image-node-name:s,backing-file:s",
1593 .mhandler.cmd_new = qmp_marshal_input_change_backing_file,
1596 SQMP
1597 change-backing-file
1598 -------------------
1599 Since: 2.1
1601 Change the backing file in the image file metadata. This does not cause
1602 QEMU to reopen the image file to reparse the backing filename (it may,
1603 however, perform a reopen to change permissions from r/o -> r/w -> r/o,
1604 if needed). The new backing file string is written into the image file
1605 metadata, and the QEMU internal strings are updated.
1607 Arguments:
1609 - "image-node-name": The name of the block driver state node of the
1610 image to modify. The "device" is argument is used to
1611 verify "image-node-name" is in the chain described by
1612 "device".
1613 (json-string, optional)
1615 - "device": The name of the device.
1616 (json-string)
1618 - "backing-file": The string to write as the backing file. This string is
1619 not validated, so care should be taken when specifying
1620 the string or the image chain may not be able to be
1621 reopened again.
1622 (json-string)
1624 Returns: Nothing on success
1625 If "device" does not exist or cannot be determined, DeviceNotFound
1627 EQMP
1630 .name = "balloon",
1631 .args_type = "value:M",
1632 .mhandler.cmd_new = qmp_marshal_input_balloon,
1635 SQMP
1636 balloon
1637 -------
1639 Request VM to change its memory allocation (in bytes).
1641 Arguments:
1643 - "value": New memory allocation (json-int)
1645 Example:
1647 -> { "execute": "balloon", "arguments": { "value": 536870912 } }
1648 <- { "return": {} }
1650 EQMP
1653 .name = "set_link",
1654 .args_type = "name:s,up:b",
1655 .mhandler.cmd_new = qmp_marshal_input_set_link,
1658 SQMP
1659 set_link
1660 --------
1662 Change the link status of a network adapter.
1664 Arguments:
1666 - "name": network device name (json-string)
1667 - "up": status is up (json-bool)
1669 Example:
1671 -> { "execute": "set_link", "arguments": { "name": "e1000.0", "up": false } }
1672 <- { "return": {} }
1674 EQMP
1677 .name = "getfd",
1678 .args_type = "fdname:s",
1679 .params = "getfd name",
1680 .help = "receive a file descriptor via SCM rights and assign it a name",
1681 .mhandler.cmd_new = qmp_marshal_input_getfd,
1684 SQMP
1685 getfd
1686 -----
1688 Receive a file descriptor via SCM rights and assign it a name.
1690 Arguments:
1692 - "fdname": file descriptor name (json-string)
1694 Example:
1696 -> { "execute": "getfd", "arguments": { "fdname": "fd1" } }
1697 <- { "return": {} }
1699 Notes:
1701 (1) If the name specified by the "fdname" argument already exists,
1702 the file descriptor assigned to it will be closed and replaced
1703 by the received file descriptor.
1704 (2) The 'closefd' command can be used to explicitly close the file
1705 descriptor when it is no longer needed.
1707 EQMP
1710 .name = "closefd",
1711 .args_type = "fdname:s",
1712 .params = "closefd name",
1713 .help = "close a file descriptor previously passed via SCM rights",
1714 .mhandler.cmd_new = qmp_marshal_input_closefd,
1717 SQMP
1718 closefd
1719 -------
1721 Close a file descriptor previously passed via SCM rights.
1723 Arguments:
1725 - "fdname": file descriptor name (json-string)
1727 Example:
1729 -> { "execute": "closefd", "arguments": { "fdname": "fd1" } }
1730 <- { "return": {} }
1732 EQMP
1735 .name = "add-fd",
1736 .args_type = "fdset-id:i?,opaque:s?",
1737 .params = "add-fd fdset-id opaque",
1738 .help = "Add a file descriptor, that was passed via SCM rights, to an fd set",
1739 .mhandler.cmd_new = qmp_marshal_input_add_fd,
1742 SQMP
1743 add-fd
1744 -------
1746 Add a file descriptor, that was passed via SCM rights, to an fd set.
1748 Arguments:
1750 - "fdset-id": The ID of the fd set to add the file descriptor to.
1751 (json-int, optional)
1752 - "opaque": A free-form string that can be used to describe the fd.
1753 (json-string, optional)
1755 Return a json-object with the following information:
1757 - "fdset-id": The ID of the fd set that the fd was added to. (json-int)
1758 - "fd": The file descriptor that was received via SCM rights and added to the
1759 fd set. (json-int)
1761 Example:
1763 -> { "execute": "add-fd", "arguments": { "fdset-id": 1 } }
1764 <- { "return": { "fdset-id": 1, "fd": 3 } }
1766 Notes:
1768 (1) The list of fd sets is shared by all monitor connections.
1769 (2) If "fdset-id" is not specified, a new fd set will be created.
1771 EQMP
1774 .name = "remove-fd",
1775 .args_type = "fdset-id:i,fd:i?",
1776 .params = "remove-fd fdset-id fd",
1777 .help = "Remove a file descriptor from an fd set",
1778 .mhandler.cmd_new = qmp_marshal_input_remove_fd,
1781 SQMP
1782 remove-fd
1783 ---------
1785 Remove a file descriptor from an fd set.
1787 Arguments:
1789 - "fdset-id": The ID of the fd set that the file descriptor belongs to.
1790 (json-int)
1791 - "fd": The file descriptor that is to be removed. (json-int, optional)
1793 Example:
1795 -> { "execute": "remove-fd", "arguments": { "fdset-id": 1, "fd": 3 } }
1796 <- { "return": {} }
1798 Notes:
1800 (1) The list of fd sets is shared by all monitor connections.
1801 (2) If "fd" is not specified, all file descriptors in "fdset-id" will be
1802 removed.
1804 EQMP
1807 .name = "query-fdsets",
1808 .args_type = "",
1809 .help = "Return information describing all fd sets",
1810 .mhandler.cmd_new = qmp_marshal_input_query_fdsets,
1813 SQMP
1814 query-fdsets
1815 -------------
1817 Return information describing all fd sets.
1819 Arguments: None
1821 Example:
1823 -> { "execute": "query-fdsets" }
1824 <- { "return": [
1826 "fds": [
1828 "fd": 30,
1829 "opaque": "rdonly:/path/to/file"
1832 "fd": 24,
1833 "opaque": "rdwr:/path/to/file"
1836 "fdset-id": 1
1839 "fds": [
1841 "fd": 28
1844 "fd": 29
1847 "fdset-id": 0
1852 Note: The list of fd sets is shared by all monitor connections.
1854 EQMP
1857 .name = "block_passwd",
1858 .args_type = "device:s?,node-name:s?,password:s",
1859 .mhandler.cmd_new = qmp_marshal_input_block_passwd,
1862 SQMP
1863 block_passwd
1864 ------------
1866 Set the password of encrypted block devices.
1868 Arguments:
1870 - "device": device name (json-string)
1871 - "node-name": name in the block driver state graph (json-string)
1872 - "password": password (json-string)
1874 Example:
1876 -> { "execute": "block_passwd", "arguments": { "device": "ide0-hd0",
1877 "password": "12345" } }
1878 <- { "return": {} }
1880 EQMP
1883 .name = "block_set_io_throttle",
1884 .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?,iops_size:l?,group:s?",
1885 .mhandler.cmd_new = qmp_marshal_input_block_set_io_throttle,
1888 SQMP
1889 block_set_io_throttle
1890 ------------
1892 Change I/O throttle limits for a block drive.
1894 Arguments:
1896 - "device": device name (json-string)
1897 - "bps": total throughput limit in bytes per second (json-int)
1898 - "bps_rd": read throughput limit in bytes per second (json-int)
1899 - "bps_wr": write throughput limit in bytes per second (json-int)
1900 - "iops": total I/O operations per second (json-int)
1901 - "iops_rd": read I/O operations per second (json-int)
1902 - "iops_wr": write I/O operations per second (json-int)
1903 - "bps_max": total max in bytes (json-int)
1904 - "bps_rd_max": read max in bytes (json-int)
1905 - "bps_wr_max": write max in bytes (json-int)
1906 - "iops_max": total I/O operations max (json-int)
1907 - "iops_rd_max": read I/O operations max (json-int)
1908 - "iops_wr_max": write I/O operations max (json-int)
1909 - "iops_size": I/O size in bytes when limiting (json-int)
1910 - "group": throttle group name (json-string)
1912 Example:
1914 -> { "execute": "block_set_io_throttle", "arguments": { "device": "virtio0",
1915 "bps": 1000000,
1916 "bps_rd": 0,
1917 "bps_wr": 0,
1918 "iops": 0,
1919 "iops_rd": 0,
1920 "iops_wr": 0,
1921 "bps_max": 8000000,
1922 "bps_rd_max": 0,
1923 "bps_wr_max": 0,
1924 "iops_max": 0,
1925 "iops_rd_max": 0,
1926 "iops_wr_max": 0,
1927 "iops_size": 0 } }
1928 <- { "return": {} }
1930 EQMP
1933 .name = "set_password",
1934 .args_type = "protocol:s,password:s,connected:s?",
1935 .mhandler.cmd_new = qmp_marshal_input_set_password,
1938 SQMP
1939 set_password
1940 ------------
1942 Set the password for vnc/spice protocols.
1944 Arguments:
1946 - "protocol": protocol name (json-string)
1947 - "password": password (json-string)
1948 - "connected": [ keep | disconnect | fail ] (json-string, optional)
1950 Example:
1952 -> { "execute": "set_password", "arguments": { "protocol": "vnc",
1953 "password": "secret" } }
1954 <- { "return": {} }
1956 EQMP
1959 .name = "expire_password",
1960 .args_type = "protocol:s,time:s",
1961 .mhandler.cmd_new = qmp_marshal_input_expire_password,
1964 SQMP
1965 expire_password
1966 ---------------
1968 Set the password expire time for vnc/spice protocols.
1970 Arguments:
1972 - "protocol": protocol name (json-string)
1973 - "time": [ now | never | +secs | secs ] (json-string)
1975 Example:
1977 -> { "execute": "expire_password", "arguments": { "protocol": "vnc",
1978 "time": "+60" } }
1979 <- { "return": {} }
1981 EQMP
1984 .name = "add_client",
1985 .args_type = "protocol:s,fdname:s,skipauth:b?,tls:b?",
1986 .mhandler.cmd_new = qmp_marshal_input_add_client,
1989 SQMP
1990 add_client
1991 ----------
1993 Add a graphics client
1995 Arguments:
1997 - "protocol": protocol name (json-string)
1998 - "fdname": file descriptor name (json-string)
1999 - "skipauth": whether to skip authentication (json-bool, optional)
2000 - "tls": whether to perform TLS (json-bool, optional)
2002 Example:
2004 -> { "execute": "add_client", "arguments": { "protocol": "vnc",
2005 "fdname": "myclient" } }
2006 <- { "return": {} }
2008 EQMP
2010 .name = "qmp_capabilities",
2011 .args_type = "",
2012 .params = "",
2013 .help = "enable QMP capabilities",
2014 .mhandler.cmd_new = qmp_capabilities,
2017 SQMP
2018 qmp_capabilities
2019 ----------------
2021 Enable QMP capabilities.
2023 Arguments: None.
2025 Example:
2027 -> { "execute": "qmp_capabilities" }
2028 <- { "return": {} }
2030 Note: This command must be issued before issuing any other command.
2032 EQMP
2035 .name = "human-monitor-command",
2036 .args_type = "command-line:s,cpu-index:i?",
2037 .mhandler.cmd_new = qmp_marshal_input_human_monitor_command,
2040 SQMP
2041 human-monitor-command
2042 ---------------------
2044 Execute a Human Monitor command.
2046 Arguments:
2048 - command-line: the command name and its arguments, just like the
2049 Human Monitor's shell (json-string)
2050 - cpu-index: select the CPU number to be used by commands which access CPU
2051 data, like 'info registers'. The Monitor selects CPU 0 if this
2052 argument is not provided (json-int, optional)
2054 Example:
2056 -> { "execute": "human-monitor-command", "arguments": { "command-line": "info kvm" } }
2057 <- { "return": "kvm support: enabled\r\n" }
2059 Notes:
2061 (1) The Human Monitor is NOT an stable interface, this means that command
2062 names, arguments and responses can change or be removed at ANY time.
2063 Applications that rely on long term stability guarantees should NOT
2064 use this command
2066 (2) Limitations:
2068 o This command is stateless, this means that commands that depend
2069 on state information (such as getfd) might not work
2071 o Commands that prompt the user for data (eg. 'cont' when the block
2072 device is encrypted) don't currently work
2074 3. Query Commands
2075 =================
2077 HXCOMM Each query command below is inside a SQMP/EQMP section, do NOT change
2078 HXCOMM this! We will possibly move query commands definitions inside those
2079 HXCOMM sections, just like regular commands.
2081 EQMP
2083 SQMP
2084 query-version
2085 -------------
2087 Show QEMU version.
2089 Return a json-object with the following information:
2091 - "qemu": A json-object containing three integer values:
2092 - "major": QEMU's major version (json-int)
2093 - "minor": QEMU's minor version (json-int)
2094 - "micro": QEMU's micro version (json-int)
2095 - "package": package's version (json-string)
2097 Example:
2099 -> { "execute": "query-version" }
2100 <- {
2101 "return":{
2102 "qemu":{
2103 "major":0,
2104 "minor":11,
2105 "micro":5
2107 "package":""
2111 EQMP
2114 .name = "query-version",
2115 .args_type = "",
2116 .mhandler.cmd_new = qmp_marshal_input_query_version,
2119 SQMP
2120 query-commands
2121 --------------
2123 List QMP available commands.
2125 Each command is represented by a json-object, the returned value is a json-array
2126 of all commands.
2128 Each json-object contain:
2130 - "name": command's name (json-string)
2132 Example:
2134 -> { "execute": "query-commands" }
2135 <- {
2136 "return":[
2138 "name":"query-balloon"
2141 "name":"system_powerdown"
2146 Note: This example has been shortened as the real response is too long.
2148 EQMP
2151 .name = "query-commands",
2152 .args_type = "",
2153 .mhandler.cmd_new = qmp_marshal_input_query_commands,
2156 SQMP
2157 query-events
2158 --------------
2160 List QMP available events.
2162 Each event is represented by a json-object, the returned value is a json-array
2163 of all events.
2165 Each json-object contains:
2167 - "name": event's name (json-string)
2169 Example:
2171 -> { "execute": "query-events" }
2172 <- {
2173 "return":[
2175 "name":"SHUTDOWN"
2178 "name":"RESET"
2183 Note: This example has been shortened as the real response is too long.
2185 EQMP
2188 .name = "query-events",
2189 .args_type = "",
2190 .mhandler.cmd_new = qmp_marshal_input_query_events,
2193 SQMP
2194 query-chardev
2195 -------------
2197 Each device is represented by a json-object. The returned value is a json-array
2198 of all devices.
2200 Each json-object contain the following:
2202 - "label": device's label (json-string)
2203 - "filename": device's file (json-string)
2204 - "frontend-open": open/closed state of the frontend device attached to this
2205 backend (json-bool)
2207 Example:
2209 -> { "execute": "query-chardev" }
2210 <- {
2211 "return": [
2213 "label": "charchannel0",
2214 "filename": "unix:/var/lib/libvirt/qemu/seabios.rhel6.agent,server",
2215 "frontend-open": false
2218 "label": "charmonitor",
2219 "filename": "unix:/var/lib/libvirt/qemu/seabios.rhel6.monitor,server",
2220 "frontend-open": true
2223 "label": "charserial0",
2224 "filename": "pty:/dev/pts/2",
2225 "frontend-open": true
2230 EQMP
2233 .name = "query-chardev",
2234 .args_type = "",
2235 .mhandler.cmd_new = qmp_marshal_input_query_chardev,
2238 SQMP
2239 query-chardev-backends
2240 -------------
2242 List available character device backends.
2244 Each backend is represented by a json-object, the returned value is a json-array
2245 of all backends.
2247 Each json-object contains:
2249 - "name": backend name (json-string)
2251 Example:
2253 -> { "execute": "query-chardev-backends" }
2254 <- {
2255 "return":[
2257 "name":"udp"
2260 "name":"tcp"
2263 "name":"unix"
2266 "name":"spiceport"
2271 EQMP
2274 .name = "query-chardev-backends",
2275 .args_type = "",
2276 .mhandler.cmd_new = qmp_marshal_input_query_chardev_backends,
2279 SQMP
2280 query-block
2281 -----------
2283 Show the block devices.
2285 Each block device information is stored in a json-object and the returned value
2286 is a json-array of all devices.
2288 Each json-object contain the following:
2290 - "device": device name (json-string)
2291 - "type": device type (json-string)
2292 - deprecated, retained for backward compatibility
2293 - Possible values: "unknown"
2294 - "removable": true if the device is removable, false otherwise (json-bool)
2295 - "locked": true if the device is locked, false otherwise (json-bool)
2296 - "tray_open": only present if removable, true if the device has a tray,
2297 and it is open (json-bool)
2298 - "inserted": only present if the device is inserted, it is a json-object
2299 containing the following:
2300 - "file": device file name (json-string)
2301 - "ro": true if read-only, false otherwise (json-bool)
2302 - "drv": driver format name (json-string)
2303 - Possible values: "blkdebug", "bochs", "cloop", "dmg",
2304 "file", "file", "ftp", "ftps", "host_cdrom",
2305 "host_device", "http", "https",
2306 "nbd", "parallels", "qcow", "qcow2", "raw",
2307 "tftp", "vdi", "vmdk", "vpc", "vvfat"
2308 - "backing_file": backing file name (json-string, optional)
2309 - "backing_file_depth": number of files in the backing file chain (json-int)
2310 - "encrypted": true if encrypted, false otherwise (json-bool)
2311 - "bps": limit total bytes per second (json-int)
2312 - "bps_rd": limit read bytes per second (json-int)
2313 - "bps_wr": limit write bytes per second (json-int)
2314 - "iops": limit total I/O operations per second (json-int)
2315 - "iops_rd": limit read operations per second (json-int)
2316 - "iops_wr": limit write operations per second (json-int)
2317 - "bps_max": total max in bytes (json-int)
2318 - "bps_rd_max": read max in bytes (json-int)
2319 - "bps_wr_max": write max in bytes (json-int)
2320 - "iops_max": total I/O operations max (json-int)
2321 - "iops_rd_max": read I/O operations max (json-int)
2322 - "iops_wr_max": write I/O operations max (json-int)
2323 - "iops_size": I/O size when limiting by iops (json-int)
2324 - "detect_zeroes": detect and optimize zero writing (json-string)
2325 - Possible values: "off", "on", "unmap"
2326 - "write_threshold": write offset threshold in bytes, a event will be
2327 emitted if crossed. Zero if disabled (json-int)
2328 - "image": the detail of the image, it is a json-object containing
2329 the following:
2330 - "filename": image file name (json-string)
2331 - "format": image format (json-string)
2332 - "virtual-size": image capacity in bytes (json-int)
2333 - "dirty-flag": true if image is not cleanly closed, not present
2334 means clean (json-bool, optional)
2335 - "actual-size": actual size on disk in bytes of the image, not
2336 present when image does not support thin
2337 provision (json-int, optional)
2338 - "cluster-size": size of a cluster in bytes, not present if image
2339 format does not support it (json-int, optional)
2340 - "encrypted": true if the image is encrypted, not present means
2341 false or the image format does not support
2342 encryption (json-bool, optional)
2343 - "backing_file": backing file name, not present means no backing
2344 file is used or the image format does not
2345 support backing file chain
2346 (json-string, optional)
2347 - "full-backing-filename": full path of the backing file, not
2348 present if it equals backing_file or no
2349 backing file is used
2350 (json-string, optional)
2351 - "backing-filename-format": the format of the backing file, not
2352 present means unknown or no backing
2353 file (json-string, optional)
2354 - "snapshots": the internal snapshot info, it is an optional list
2355 of json-object containing the following:
2356 - "id": unique snapshot id (json-string)
2357 - "name": snapshot name (json-string)
2358 - "vm-state-size": size of the VM state in bytes (json-int)
2359 - "date-sec": UTC date of the snapshot in seconds (json-int)
2360 - "date-nsec": fractional part in nanoseconds to be used with
2361 date-sec (json-int)
2362 - "vm-clock-sec": VM clock relative to boot in seconds
2363 (json-int)
2364 - "vm-clock-nsec": fractional part in nanoseconds to be used
2365 with vm-clock-sec (json-int)
2366 - "backing-image": the detail of the backing image, it is an
2367 optional json-object only present when a
2368 backing image present for this image
2370 - "io-status": I/O operation status, only present if the device supports it
2371 and the VM is configured to stop on errors. It's always reset
2372 to "ok" when the "cont" command is issued (json_string, optional)
2373 - Possible values: "ok", "failed", "nospace"
2375 Example:
2377 -> { "execute": "query-block" }
2378 <- {
2379 "return":[
2381 "io-status": "ok",
2382 "device":"ide0-hd0",
2383 "locked":false,
2384 "removable":false,
2385 "inserted":{
2386 "ro":false,
2387 "drv":"qcow2",
2388 "encrypted":false,
2389 "file":"disks/test.qcow2",
2390 "backing_file_depth":1,
2391 "bps":1000000,
2392 "bps_rd":0,
2393 "bps_wr":0,
2394 "iops":1000000,
2395 "iops_rd":0,
2396 "iops_wr":0,
2397 "bps_max": 8000000,
2398 "bps_rd_max": 0,
2399 "bps_wr_max": 0,
2400 "iops_max": 0,
2401 "iops_rd_max": 0,
2402 "iops_wr_max": 0,
2403 "iops_size": 0,
2404 "detect_zeroes": "on",
2405 "write_threshold": 0,
2406 "image":{
2407 "filename":"disks/test.qcow2",
2408 "format":"qcow2",
2409 "virtual-size":2048000,
2410 "backing_file":"base.qcow2",
2411 "full-backing-filename":"disks/base.qcow2",
2412 "backing-filename-format":"qcow2",
2413 "snapshots":[
2415 "id": "1",
2416 "name": "snapshot1",
2417 "vm-state-size": 0,
2418 "date-sec": 10000200,
2419 "date-nsec": 12,
2420 "vm-clock-sec": 206,
2421 "vm-clock-nsec": 30
2424 "backing-image":{
2425 "filename":"disks/base.qcow2",
2426 "format":"qcow2",
2427 "virtual-size":2048000
2431 "type":"unknown"
2434 "io-status": "ok",
2435 "device":"ide1-cd0",
2436 "locked":false,
2437 "removable":true,
2438 "type":"unknown"
2441 "device":"floppy0",
2442 "locked":false,
2443 "removable":true,
2444 "type":"unknown"
2447 "device":"sd0",
2448 "locked":false,
2449 "removable":true,
2450 "type":"unknown"
2455 EQMP
2458 .name = "query-block",
2459 .args_type = "",
2460 .mhandler.cmd_new = qmp_marshal_input_query_block,
2463 SQMP
2464 query-blockstats
2465 ----------------
2467 Show block device statistics.
2469 Each device statistic information is stored in a json-object and the returned
2470 value is a json-array of all devices.
2472 Each json-object contain the following:
2474 - "device": device name (json-string)
2475 - "stats": A json-object with the statistics information, it contains:
2476 - "rd_bytes": bytes read (json-int)
2477 - "wr_bytes": bytes written (json-int)
2478 - "rd_operations": read operations (json-int)
2479 - "wr_operations": write operations (json-int)
2480 - "flush_operations": cache flush operations (json-int)
2481 - "wr_total_time_ns": total time spend on writes in nano-seconds (json-int)
2482 - "rd_total_time_ns": total time spend on reads in nano-seconds (json-int)
2483 - "flush_total_time_ns": total time spend on cache flushes in nano-seconds (json-int)
2484 - "wr_highest_offset": Highest offset of a sector written since the
2485 BlockDriverState has been opened (json-int)
2486 - "rd_merged": number of read requests that have been merged into
2487 another request (json-int)
2488 - "wr_merged": number of write requests that have been merged into
2489 another request (json-int)
2490 - "parent": Contains recursively the statistics of the underlying
2491 protocol (e.g. the host file for a qcow2 image). If there is
2492 no underlying protocol, this field is omitted
2493 (json-object, optional)
2495 Example:
2497 -> { "execute": "query-blockstats" }
2498 <- {
2499 "return":[
2501 "device":"ide0-hd0",
2502 "parent":{
2503 "stats":{
2504 "wr_highest_offset":3686448128,
2505 "wr_bytes":9786368,
2506 "wr_operations":751,
2507 "rd_bytes":122567168,
2508 "rd_operations":36772
2509 "wr_total_times_ns":313253456
2510 "rd_total_times_ns":3465673657
2511 "flush_total_times_ns":49653
2512 "flush_operations":61,
2513 "rd_merged":0,
2514 "wr_merged":0
2517 "stats":{
2518 "wr_highest_offset":2821110784,
2519 "wr_bytes":9786368,
2520 "wr_operations":692,
2521 "rd_bytes":122739200,
2522 "rd_operations":36604
2523 "flush_operations":51,
2524 "wr_total_times_ns":313253456
2525 "rd_total_times_ns":3465673657
2526 "flush_total_times_ns":49653,
2527 "rd_merged":0,
2528 "wr_merged":0
2532 "device":"ide1-cd0",
2533 "stats":{
2534 "wr_highest_offset":0,
2535 "wr_bytes":0,
2536 "wr_operations":0,
2537 "rd_bytes":0,
2538 "rd_operations":0
2539 "flush_operations":0,
2540 "wr_total_times_ns":0
2541 "rd_total_times_ns":0
2542 "flush_total_times_ns":0,
2543 "rd_merged":0,
2544 "wr_merged":0
2548 "device":"floppy0",
2549 "stats":{
2550 "wr_highest_offset":0,
2551 "wr_bytes":0,
2552 "wr_operations":0,
2553 "rd_bytes":0,
2554 "rd_operations":0
2555 "flush_operations":0,
2556 "wr_total_times_ns":0
2557 "rd_total_times_ns":0
2558 "flush_total_times_ns":0,
2559 "rd_merged":0,
2560 "wr_merged":0
2564 "device":"sd0",
2565 "stats":{
2566 "wr_highest_offset":0,
2567 "wr_bytes":0,
2568 "wr_operations":0,
2569 "rd_bytes":0,
2570 "rd_operations":0
2571 "flush_operations":0,
2572 "wr_total_times_ns":0
2573 "rd_total_times_ns":0
2574 "flush_total_times_ns":0,
2575 "rd_merged":0,
2576 "wr_merged":0
2582 EQMP
2585 .name = "query-blockstats",
2586 .args_type = "query-nodes:b?",
2587 .mhandler.cmd_new = qmp_marshal_input_query_blockstats,
2590 SQMP
2591 query-cpus
2592 ----------
2594 Show CPU information.
2596 Return a json-array. Each CPU is represented by a json-object, which contains:
2598 - "CPU": CPU index (json-int)
2599 - "current": true if this is the current CPU, false otherwise (json-bool)
2600 - "halted": true if the cpu is halted, false otherwise (json-bool)
2601 - "qom_path": path to the CPU object in the QOM tree (json-str)
2602 - Current program counter. The key's name depends on the architecture:
2603 "pc": i386/x86_64 (json-int)
2604 "nip": PPC (json-int)
2605 "pc" and "npc": sparc (json-int)
2606 "PC": mips (json-int)
2607 - "thread_id": ID of the underlying host thread (json-int)
2609 Example:
2611 -> { "execute": "query-cpus" }
2612 <- {
2613 "return":[
2615 "CPU":0,
2616 "current":true,
2617 "halted":false,
2618 "qom_path":"/machine/unattached/device[0]",
2619 "pc":3227107138,
2620 "thread_id":3134
2623 "CPU":1,
2624 "current":false,
2625 "halted":true,
2626 "qom_path":"/machine/unattached/device[2]",
2627 "pc":7108165,
2628 "thread_id":3135
2633 EQMP
2636 .name = "query-cpus",
2637 .args_type = "",
2638 .mhandler.cmd_new = qmp_marshal_input_query_cpus,
2641 SQMP
2642 query-iothreads
2643 ---------------
2645 Returns a list of information about each iothread.
2647 Note this list excludes the QEMU main loop thread, which is not declared
2648 using the -object iothread command-line option. It is always the main thread
2649 of the process.
2651 Return a json-array. Each iothread is represented by a json-object, which contains:
2653 - "id": name of iothread (json-str)
2654 - "thread-id": ID of the underlying host thread (json-int)
2656 Example:
2658 -> { "execute": "query-iothreads" }
2659 <- {
2660 "return":[
2662 "id":"iothread0",
2663 "thread-id":3134
2666 "id":"iothread1",
2667 "thread-id":3135
2672 EQMP
2675 .name = "query-iothreads",
2676 .args_type = "",
2677 .mhandler.cmd_new = qmp_marshal_input_query_iothreads,
2680 SQMP
2681 query-pci
2682 ---------
2684 PCI buses and devices information.
2686 The returned value is a json-array of all buses. Each bus is represented by
2687 a json-object, which has a key with a json-array of all PCI devices attached
2688 to it. Each device is represented by a json-object.
2690 The bus json-object contains the following:
2692 - "bus": bus number (json-int)
2693 - "devices": a json-array of json-objects, each json-object represents a
2694 PCI device
2696 The PCI device json-object contains the following:
2698 - "bus": identical to the parent's bus number (json-int)
2699 - "slot": slot number (json-int)
2700 - "function": function number (json-int)
2701 - "class_info": a json-object containing:
2702 - "desc": device class description (json-string, optional)
2703 - "class": device class number (json-int)
2704 - "id": a json-object containing:
2705 - "device": device ID (json-int)
2706 - "vendor": vendor ID (json-int)
2707 - "irq": device's IRQ if assigned (json-int, optional)
2708 - "qdev_id": qdev id string (json-string)
2709 - "pci_bridge": It's a json-object, only present if this device is a
2710 PCI bridge, contains:
2711 - "bus": bus number (json-int)
2712 - "secondary": secondary bus number (json-int)
2713 - "subordinate": subordinate bus number (json-int)
2714 - "io_range": I/O memory range information, a json-object with the
2715 following members:
2716 - "base": base address, in bytes (json-int)
2717 - "limit": limit address, in bytes (json-int)
2718 - "memory_range": memory range information, a json-object with the
2719 following members:
2720 - "base": base address, in bytes (json-int)
2721 - "limit": limit address, in bytes (json-int)
2722 - "prefetchable_range": Prefetchable memory range information, a
2723 json-object with the following members:
2724 - "base": base address, in bytes (json-int)
2725 - "limit": limit address, in bytes (json-int)
2726 - "devices": a json-array of PCI devices if there's any attached, each
2727 each element is represented by a json-object, which contains
2728 the same members of the 'PCI device json-object' described
2729 above (optional)
2730 - "regions": a json-array of json-objects, each json-object represents a
2731 memory region of this device
2733 The memory range json-object contains the following:
2735 - "base": base memory address (json-int)
2736 - "limit": limit value (json-int)
2738 The region json-object can be an I/O region or a memory region, an I/O region
2739 json-object contains the following:
2741 - "type": "io" (json-string, fixed)
2742 - "bar": BAR number (json-int)
2743 - "address": memory address (json-int)
2744 - "size": memory size (json-int)
2746 A memory region json-object contains the following:
2748 - "type": "memory" (json-string, fixed)
2749 - "bar": BAR number (json-int)
2750 - "address": memory address (json-int)
2751 - "size": memory size (json-int)
2752 - "mem_type_64": true or false (json-bool)
2753 - "prefetch": true or false (json-bool)
2755 Example:
2757 -> { "execute": "query-pci" }
2758 <- {
2759 "return":[
2761 "bus":0,
2762 "devices":[
2764 "bus":0,
2765 "qdev_id":"",
2766 "slot":0,
2767 "class_info":{
2768 "class":1536,
2769 "desc":"Host bridge"
2771 "id":{
2772 "device":32902,
2773 "vendor":4663
2775 "function":0,
2776 "regions":[
2781 "bus":0,
2782 "qdev_id":"",
2783 "slot":1,
2784 "class_info":{
2785 "class":1537,
2786 "desc":"ISA bridge"
2788 "id":{
2789 "device":32902,
2790 "vendor":28672
2792 "function":0,
2793 "regions":[
2798 "bus":0,
2799 "qdev_id":"",
2800 "slot":1,
2801 "class_info":{
2802 "class":257,
2803 "desc":"IDE controller"
2805 "id":{
2806 "device":32902,
2807 "vendor":28688
2809 "function":1,
2810 "regions":[
2812 "bar":4,
2813 "size":16,
2814 "address":49152,
2815 "type":"io"
2820 "bus":0,
2821 "qdev_id":"",
2822 "slot":2,
2823 "class_info":{
2824 "class":768,
2825 "desc":"VGA controller"
2827 "id":{
2828 "device":4115,
2829 "vendor":184
2831 "function":0,
2832 "regions":[
2834 "prefetch":true,
2835 "mem_type_64":false,
2836 "bar":0,
2837 "size":33554432,
2838 "address":4026531840,
2839 "type":"memory"
2842 "prefetch":false,
2843 "mem_type_64":false,
2844 "bar":1,
2845 "size":4096,
2846 "address":4060086272,
2847 "type":"memory"
2850 "prefetch":false,
2851 "mem_type_64":false,
2852 "bar":6,
2853 "size":65536,
2854 "address":-1,
2855 "type":"memory"
2860 "bus":0,
2861 "qdev_id":"",
2862 "irq":11,
2863 "slot":4,
2864 "class_info":{
2865 "class":1280,
2866 "desc":"RAM controller"
2868 "id":{
2869 "device":6900,
2870 "vendor":4098
2872 "function":0,
2873 "regions":[
2875 "bar":0,
2876 "size":32,
2877 "address":49280,
2878 "type":"io"
2887 Note: This example has been shortened as the real response is too long.
2889 EQMP
2892 .name = "query-pci",
2893 .args_type = "",
2894 .mhandler.cmd_new = qmp_marshal_input_query_pci,
2897 SQMP
2898 query-kvm
2899 ---------
2901 Show KVM information.
2903 Return a json-object with the following information:
2905 - "enabled": true if KVM support is enabled, false otherwise (json-bool)
2906 - "present": true if QEMU has KVM support, false otherwise (json-bool)
2908 Example:
2910 -> { "execute": "query-kvm" }
2911 <- { "return": { "enabled": true, "present": true } }
2913 EQMP
2916 .name = "query-kvm",
2917 .args_type = "",
2918 .mhandler.cmd_new = qmp_marshal_input_query_kvm,
2921 SQMP
2922 query-status
2923 ------------
2925 Return a json-object with the following information:
2927 - "running": true if the VM is running, or false if it is paused (json-bool)
2928 - "singlestep": true if the VM is in single step mode,
2929 false otherwise (json-bool)
2930 - "status": one of the following values (json-string)
2931 "debug" - QEMU is running on a debugger
2932 "inmigrate" - guest is paused waiting for an incoming migration
2933 "internal-error" - An internal error that prevents further guest
2934 execution has occurred
2935 "io-error" - the last IOP has failed and the device is configured
2936 to pause on I/O errors
2937 "paused" - guest has been paused via the 'stop' command
2938 "postmigrate" - guest is paused following a successful 'migrate'
2939 "prelaunch" - QEMU was started with -S and guest has not started
2940 "finish-migrate" - guest is paused to finish the migration process
2941 "restore-vm" - guest is paused to restore VM state
2942 "running" - guest is actively running
2943 "save-vm" - guest is paused to save the VM state
2944 "shutdown" - guest is shut down (and -no-shutdown is in use)
2945 "watchdog" - the watchdog action is configured to pause and
2946 has been triggered
2948 Example:
2950 -> { "execute": "query-status" }
2951 <- { "return": { "running": true, "singlestep": false, "status": "running" } }
2953 EQMP
2956 .name = "query-status",
2957 .args_type = "",
2958 .mhandler.cmd_new = qmp_marshal_input_query_status,
2961 SQMP
2962 query-mice
2963 ----------
2965 Show VM mice information.
2967 Each mouse is represented by a json-object, the returned value is a json-array
2968 of all mice.
2970 The mouse json-object contains the following:
2972 - "name": mouse's name (json-string)
2973 - "index": mouse's index (json-int)
2974 - "current": true if this mouse is receiving events, false otherwise (json-bool)
2975 - "absolute": true if the mouse generates absolute input events (json-bool)
2977 Example:
2979 -> { "execute": "query-mice" }
2980 <- {
2981 "return":[
2983 "name":"QEMU Microsoft Mouse",
2984 "index":0,
2985 "current":false,
2986 "absolute":false
2989 "name":"QEMU PS/2 Mouse",
2990 "index":1,
2991 "current":true,
2992 "absolute":true
2997 EQMP
3000 .name = "query-mice",
3001 .args_type = "",
3002 .mhandler.cmd_new = qmp_marshal_input_query_mice,
3005 SQMP
3006 query-vnc
3007 ---------
3009 Show VNC server information.
3011 Return a json-object with server information. Connected clients are returned
3012 as a json-array of json-objects.
3014 The main json-object contains the following:
3016 - "enabled": true or false (json-bool)
3017 - "host": server's IP address (json-string)
3018 - "family": address family (json-string)
3019 - Possible values: "ipv4", "ipv6", "unix", "unknown"
3020 - "service": server's port number (json-string)
3021 - "auth": authentication method (json-string)
3022 - Possible values: "invalid", "none", "ra2", "ra2ne", "sasl", "tight",
3023 "tls", "ultra", "unknown", "vencrypt", "vencrypt",
3024 "vencrypt+plain", "vencrypt+tls+none",
3025 "vencrypt+tls+plain", "vencrypt+tls+sasl",
3026 "vencrypt+tls+vnc", "vencrypt+x509+none",
3027 "vencrypt+x509+plain", "vencrypt+x509+sasl",
3028 "vencrypt+x509+vnc", "vnc"
3029 - "clients": a json-array of all connected clients
3031 Clients are described by a json-object, each one contain the following:
3033 - "host": client's IP address (json-string)
3034 - "family": address family (json-string)
3035 - Possible values: "ipv4", "ipv6", "unix", "unknown"
3036 - "service": client's port number (json-string)
3037 - "x509_dname": TLS dname (json-string, optional)
3038 - "sasl_username": SASL username (json-string, optional)
3040 Example:
3042 -> { "execute": "query-vnc" }
3043 <- {
3044 "return":{
3045 "enabled":true,
3046 "host":"0.0.0.0",
3047 "service":"50402",
3048 "auth":"vnc",
3049 "family":"ipv4",
3050 "clients":[
3052 "host":"127.0.0.1",
3053 "service":"50401",
3054 "family":"ipv4"
3060 EQMP
3063 .name = "query-vnc",
3064 .args_type = "",
3065 .mhandler.cmd_new = qmp_marshal_input_query_vnc,
3068 .name = "query-vnc-servers",
3069 .args_type = "",
3070 .mhandler.cmd_new = qmp_marshal_input_query_vnc_servers,
3073 SQMP
3074 query-spice
3075 -----------
3077 Show SPICE server information.
3079 Return a json-object with server information. Connected clients are returned
3080 as a json-array of json-objects.
3082 The main json-object contains the following:
3084 - "enabled": true or false (json-bool)
3085 - "host": server's IP address (json-string)
3086 - "port": server's port number (json-int, optional)
3087 - "tls-port": server's port number (json-int, optional)
3088 - "auth": authentication method (json-string)
3089 - Possible values: "none", "spice"
3090 - "channels": a json-array of all active channels clients
3092 Channels are described by a json-object, each one contain the following:
3094 - "host": client's IP address (json-string)
3095 - "family": address family (json-string)
3096 - Possible values: "ipv4", "ipv6", "unix", "unknown"
3097 - "port": client's port number (json-string)
3098 - "connection-id": spice connection id. All channels with the same id
3099 belong to the same spice session (json-int)
3100 - "channel-type": channel type. "1" is the main control channel, filter for
3101 this one if you want track spice sessions only (json-int)
3102 - "channel-id": channel id. Usually "0", might be different needed when
3103 multiple channels of the same type exist, such as multiple
3104 display channels in a multihead setup (json-int)
3105 - "tls": whether the channel is encrypted (json-bool)
3107 Example:
3109 -> { "execute": "query-spice" }
3110 <- {
3111 "return": {
3112 "enabled": true,
3113 "auth": "spice",
3114 "port": 5920,
3115 "tls-port": 5921,
3116 "host": "0.0.0.0",
3117 "channels": [
3119 "port": "54924",
3120 "family": "ipv4",
3121 "channel-type": 1,
3122 "connection-id": 1804289383,
3123 "host": "127.0.0.1",
3124 "channel-id": 0,
3125 "tls": true
3128 "port": "36710",
3129 "family": "ipv4",
3130 "channel-type": 4,
3131 "connection-id": 1804289383,
3132 "host": "127.0.0.1",
3133 "channel-id": 0,
3134 "tls": false
3136 [ ... more channels follow ... ]
3141 EQMP
3143 #if defined(CONFIG_SPICE)
3145 .name = "query-spice",
3146 .args_type = "",
3147 .mhandler.cmd_new = qmp_marshal_input_query_spice,
3149 #endif
3151 SQMP
3152 query-name
3153 ----------
3155 Show VM name.
3157 Return a json-object with the following information:
3159 - "name": VM's name (json-string, optional)
3161 Example:
3163 -> { "execute": "query-name" }
3164 <- { "return": { "name": "qemu-name" } }
3166 EQMP
3169 .name = "query-name",
3170 .args_type = "",
3171 .mhandler.cmd_new = qmp_marshal_input_query_name,
3174 SQMP
3175 query-uuid
3176 ----------
3178 Show VM UUID.
3180 Return a json-object with the following information:
3182 - "UUID": Universally Unique Identifier (json-string)
3184 Example:
3186 -> { "execute": "query-uuid" }
3187 <- { "return": { "UUID": "550e8400-e29b-41d4-a716-446655440000" } }
3189 EQMP
3192 .name = "query-uuid",
3193 .args_type = "",
3194 .mhandler.cmd_new = qmp_marshal_input_query_uuid,
3197 SQMP
3198 query-command-line-options
3199 --------------------------
3201 Show command line option schema.
3203 Return a json-array of command line option schema for all options (or for
3204 the given option), returning an error if the given option doesn't exist.
3206 Each array entry contains the following:
3208 - "option": option name (json-string)
3209 - "parameters": a json-array describes all parameters of the option:
3210 - "name": parameter name (json-string)
3211 - "type": parameter type (one of 'string', 'boolean', 'number',
3212 or 'size')
3213 - "help": human readable description of the parameter
3214 (json-string, optional)
3215 - "default": default value string for the parameter
3216 (json-string, optional)
3218 Example:
3220 -> { "execute": "query-command-line-options", "arguments": { "option": "option-rom" } }
3221 <- { "return": [
3223 "parameters": [
3225 "name": "romfile",
3226 "type": "string"
3229 "name": "bootindex",
3230 "type": "number"
3233 "option": "option-rom"
3238 EQMP
3241 .name = "query-command-line-options",
3242 .args_type = "option:s?",
3243 .mhandler.cmd_new = qmp_marshal_input_query_command_line_options,
3246 SQMP
3247 query-migrate
3248 -------------
3250 Migration status.
3252 Return a json-object. If migration is active there will be another json-object
3253 with RAM migration status and if block migration is active another one with
3254 block migration status.
3256 The main json-object contains the following:
3258 - "status": migration status (json-string)
3259 - Possible values: "setup", "active", "completed", "failed", "cancelled"
3260 - "total-time": total amount of ms since migration started. If
3261 migration has ended, it returns the total migration
3262 time (json-int)
3263 - "setup-time" amount of setup time in milliseconds _before_ the
3264 iterations begin but _after_ the QMP command is issued.
3265 This is designed to provide an accounting of any activities
3266 (such as RDMA pinning) which may be expensive, but do not
3267 actually occur during the iterative migration rounds
3268 themselves. (json-int)
3269 - "downtime": only present when migration has finished correctly
3270 total amount in ms for downtime that happened (json-int)
3271 - "expected-downtime": only present while migration is active
3272 total amount in ms for downtime that was calculated on
3273 the last bitmap round (json-int)
3274 - "ram": only present if "status" is "active", it is a json-object with the
3275 following RAM information:
3276 - "transferred": amount transferred in bytes (json-int)
3277 - "remaining": amount remaining to transfer in bytes (json-int)
3278 - "total": total amount of memory in bytes (json-int)
3279 - "duplicate": number of pages filled entirely with the same
3280 byte (json-int)
3281 These are sent over the wire much more efficiently.
3282 - "skipped": number of skipped zero pages (json-int)
3283 - "normal" : number of whole pages transferred. I.e. they
3284 were not sent as duplicate or xbzrle pages (json-int)
3285 - "normal-bytes" : number of bytes transferred in whole
3286 pages. This is just normal pages times size of one page,
3287 but this way upper levels don't need to care about page
3288 size (json-int)
3289 - "dirty-sync-count": times that dirty ram was synchronized (json-int)
3290 - "disk": only present if "status" is "active" and it is a block migration,
3291 it is a json-object with the following disk information:
3292 - "transferred": amount transferred in bytes (json-int)
3293 - "remaining": amount remaining to transfer in bytes json-int)
3294 - "total": total disk size in bytes (json-int)
3295 - "xbzrle-cache": only present if XBZRLE is active.
3296 It is a json-object with the following XBZRLE information:
3297 - "cache-size": XBZRLE cache size in bytes
3298 - "bytes": number of bytes transferred for XBZRLE compressed pages
3299 - "pages": number of XBZRLE compressed pages
3300 - "cache-miss": number of XBRZRLE page cache misses
3301 - "cache-miss-rate": rate of XBRZRLE page cache misses
3302 - "overflow": number of times XBZRLE overflows. This means
3303 that the XBZRLE encoding was bigger than just sent the
3304 whole page, and then we sent the whole page instead (as as
3305 normal page).
3307 Examples:
3309 1. Before the first migration
3311 -> { "execute": "query-migrate" }
3312 <- { "return": {} }
3314 2. Migration is done and has succeeded
3316 -> { "execute": "query-migrate" }
3317 <- { "return": {
3318 "status": "completed",
3319 "ram":{
3320 "transferred":123,
3321 "remaining":123,
3322 "total":246,
3323 "total-time":12345,
3324 "setup-time":12345,
3325 "downtime":12345,
3326 "duplicate":123,
3327 "normal":123,
3328 "normal-bytes":123456,
3329 "dirty-sync-count":15
3334 3. Migration is done and has failed
3336 -> { "execute": "query-migrate" }
3337 <- { "return": { "status": "failed" } }
3339 4. Migration is being performed and is not a block migration:
3341 -> { "execute": "query-migrate" }
3342 <- {
3343 "return":{
3344 "status":"active",
3345 "ram":{
3346 "transferred":123,
3347 "remaining":123,
3348 "total":246,
3349 "total-time":12345,
3350 "setup-time":12345,
3351 "expected-downtime":12345,
3352 "duplicate":123,
3353 "normal":123,
3354 "normal-bytes":123456,
3355 "dirty-sync-count":15
3360 5. Migration is being performed and is a block migration:
3362 -> { "execute": "query-migrate" }
3363 <- {
3364 "return":{
3365 "status":"active",
3366 "ram":{
3367 "total":1057024,
3368 "remaining":1053304,
3369 "transferred":3720,
3370 "total-time":12345,
3371 "setup-time":12345,
3372 "expected-downtime":12345,
3373 "duplicate":123,
3374 "normal":123,
3375 "normal-bytes":123456,
3376 "dirty-sync-count":15
3378 "disk":{
3379 "total":20971520,
3380 "remaining":20880384,
3381 "transferred":91136
3386 6. Migration is being performed and XBZRLE is active:
3388 -> { "execute": "query-migrate" }
3389 <- {
3390 "return":{
3391 "status":"active",
3392 "capabilities" : [ { "capability": "xbzrle", "state" : true } ],
3393 "ram":{
3394 "total":1057024,
3395 "remaining":1053304,
3396 "transferred":3720,
3397 "total-time":12345,
3398 "setup-time":12345,
3399 "expected-downtime":12345,
3400 "duplicate":10,
3401 "normal":3333,
3402 "normal-bytes":3412992,
3403 "dirty-sync-count":15
3405 "xbzrle-cache":{
3406 "cache-size":67108864,
3407 "bytes":20971520,
3408 "pages":2444343,
3409 "cache-miss":2244,
3410 "cache-miss-rate":0.123,
3411 "overflow":34434
3416 EQMP
3419 .name = "query-migrate",
3420 .args_type = "",
3421 .mhandler.cmd_new = qmp_marshal_input_query_migrate,
3424 SQMP
3425 migrate-set-capabilities
3426 ------------------------
3428 Enable/Disable migration capabilities
3430 - "xbzrle": XBZRLE support
3431 - "rdma-pin-all": pin all pages when using RDMA during migration
3432 - "auto-converge": throttle down guest to help convergence of migration
3433 - "zero-blocks": compress zero blocks during block migration
3434 - "events": generate events for each migration state change
3436 Arguments:
3438 Example:
3440 -> { "execute": "migrate-set-capabilities" , "arguments":
3441 { "capabilities": [ { "capability": "xbzrle", "state": true } ] } }
3443 EQMP
3446 .name = "migrate-set-capabilities",
3447 .args_type = "capabilities:q",
3448 .params = "capability:s,state:b",
3449 .mhandler.cmd_new = qmp_marshal_input_migrate_set_capabilities,
3451 SQMP
3452 query-migrate-capabilities
3453 --------------------------
3455 Query current migration capabilities
3457 - "capabilities": migration capabilities state
3458 - "xbzrle" : XBZRLE state (json-bool)
3459 - "rdma-pin-all" : RDMA Pin Page state (json-bool)
3460 - "auto-converge" : Auto Converge state (json-bool)
3461 - "zero-blocks" : Zero Blocks state (json-bool)
3463 Arguments:
3465 Example:
3467 -> { "execute": "query-migrate-capabilities" }
3468 <- { "return": [ { "state": false, "capability": "xbzrle" } ] }
3470 EQMP
3473 .name = "query-migrate-capabilities",
3474 .args_type = "",
3475 .mhandler.cmd_new = qmp_marshal_input_query_migrate_capabilities,
3478 SQMP
3479 migrate-set-parameters
3480 ----------------------
3482 Set migration parameters
3484 - "compress-level": set compression level during migration (json-int)
3485 - "compress-threads": set compression thread count for migration (json-int)
3486 - "decompress-threads": set decompression thread count for migration (json-int)
3488 Arguments:
3490 Example:
3492 -> { "execute": "migrate-set-parameters" , "arguments":
3493 { "compress-level": 1 } }
3495 EQMP
3498 .name = "migrate-set-parameters",
3499 .args_type =
3500 "compress-level:i?,compress-threads:i?,decompress-threads:i?",
3501 .mhandler.cmd_new = qmp_marshal_input_migrate_set_parameters,
3503 SQMP
3504 query-migrate-parameters
3505 ------------------------
3507 Query current migration parameters
3509 - "parameters": migration parameters value
3510 - "compress-level" : compression level value (json-int)
3511 - "compress-threads" : compression thread count value (json-int)
3512 - "decompress-threads" : decompression thread count value (json-int)
3514 Arguments:
3516 Example:
3518 -> { "execute": "query-migrate-parameters" }
3519 <- {
3520 "return": {
3521 "decompress-threads", 2,
3522 "compress-threads", 8,
3523 "compress-level", 1
3527 EQMP
3530 .name = "query-migrate-parameters",
3531 .args_type = "",
3532 .mhandler.cmd_new = qmp_marshal_input_query_migrate_parameters,
3535 SQMP
3536 query-balloon
3537 -------------
3539 Show balloon information.
3541 Make an asynchronous request for balloon info. When the request completes a
3542 json-object will be returned containing the following data:
3544 - "actual": current balloon value in bytes (json-int)
3546 Example:
3548 -> { "execute": "query-balloon" }
3549 <- {
3550 "return":{
3551 "actual":1073741824,
3555 EQMP
3558 .name = "query-balloon",
3559 .args_type = "",
3560 .mhandler.cmd_new = qmp_marshal_input_query_balloon,
3564 .name = "query-block-jobs",
3565 .args_type = "",
3566 .mhandler.cmd_new = qmp_marshal_input_query_block_jobs,
3570 .name = "qom-list",
3571 .args_type = "path:s",
3572 .mhandler.cmd_new = qmp_marshal_input_qom_list,
3576 .name = "qom-set",
3577 .args_type = "path:s,property:s,value:q",
3578 .mhandler.cmd_new = qmp_qom_set,
3582 .name = "qom-get",
3583 .args_type = "path:s,property:s",
3584 .mhandler.cmd_new = qmp_qom_get,
3588 .name = "nbd-server-start",
3589 .args_type = "addr:q",
3590 .mhandler.cmd_new = qmp_marshal_input_nbd_server_start,
3593 .name = "nbd-server-add",
3594 .args_type = "device:B,writable:b?",
3595 .mhandler.cmd_new = qmp_marshal_input_nbd_server_add,
3598 .name = "nbd-server-stop",
3599 .args_type = "",
3600 .mhandler.cmd_new = qmp_marshal_input_nbd_server_stop,
3604 .name = "change-vnc-password",
3605 .args_type = "password:s",
3606 .mhandler.cmd_new = qmp_marshal_input_change_vnc_password,
3609 .name = "qom-list-types",
3610 .args_type = "implements:s?,abstract:b?",
3611 .mhandler.cmd_new = qmp_marshal_input_qom_list_types,
3615 .name = "device-list-properties",
3616 .args_type = "typename:s",
3617 .mhandler.cmd_new = qmp_marshal_input_device_list_properties,
3621 .name = "query-machines",
3622 .args_type = "",
3623 .mhandler.cmd_new = qmp_marshal_input_query_machines,
3627 .name = "query-cpu-definitions",
3628 .args_type = "",
3629 .mhandler.cmd_new = qmp_marshal_input_query_cpu_definitions,
3633 .name = "query-target",
3634 .args_type = "",
3635 .mhandler.cmd_new = qmp_marshal_input_query_target,
3639 .name = "query-tpm",
3640 .args_type = "",
3641 .mhandler.cmd_new = qmp_marshal_input_query_tpm,
3644 SQMP
3645 query-tpm
3646 ---------
3648 Return information about the TPM device.
3650 Arguments: None
3652 Example:
3654 -> { "execute": "query-tpm" }
3655 <- { "return":
3657 { "model": "tpm-tis",
3658 "options":
3659 { "type": "passthrough",
3660 "data":
3661 { "cancel-path": "/sys/class/misc/tpm0/device/cancel",
3662 "path": "/dev/tpm0"
3665 "id": "tpm0"
3670 EQMP
3673 .name = "query-tpm-models",
3674 .args_type = "",
3675 .mhandler.cmd_new = qmp_marshal_input_query_tpm_models,
3678 SQMP
3679 query-tpm-models
3680 ----------------
3682 Return a list of supported TPM models.
3684 Arguments: None
3686 Example:
3688 -> { "execute": "query-tpm-models" }
3689 <- { "return": [ "tpm-tis" ] }
3691 EQMP
3694 .name = "query-tpm-types",
3695 .args_type = "",
3696 .mhandler.cmd_new = qmp_marshal_input_query_tpm_types,
3699 SQMP
3700 query-tpm-types
3701 ---------------
3703 Return a list of supported TPM types.
3705 Arguments: None
3707 Example:
3709 -> { "execute": "query-tpm-types" }
3710 <- { "return": [ "passthrough" ] }
3712 EQMP
3715 .name = "chardev-add",
3716 .args_type = "id:s,backend:q",
3717 .mhandler.cmd_new = qmp_marshal_input_chardev_add,
3720 SQMP
3721 chardev-add
3722 ----------------
3724 Add a chardev.
3726 Arguments:
3728 - "id": the chardev's ID, must be unique (json-string)
3729 - "backend": chardev backend type + parameters
3731 Examples:
3733 -> { "execute" : "chardev-add",
3734 "arguments" : { "id" : "foo",
3735 "backend" : { "type" : "null", "data" : {} } } }
3736 <- { "return": {} }
3738 -> { "execute" : "chardev-add",
3739 "arguments" : { "id" : "bar",
3740 "backend" : { "type" : "file",
3741 "data" : { "out" : "/tmp/bar.log" } } } }
3742 <- { "return": {} }
3744 -> { "execute" : "chardev-add",
3745 "arguments" : { "id" : "baz",
3746 "backend" : { "type" : "pty", "data" : {} } } }
3747 <- { "return": { "pty" : "/dev/pty/42" } }
3749 EQMP
3752 .name = "chardev-remove",
3753 .args_type = "id:s",
3754 .mhandler.cmd_new = qmp_marshal_input_chardev_remove,
3758 SQMP
3759 chardev-remove
3760 --------------
3762 Remove a chardev.
3764 Arguments:
3766 - "id": the chardev's ID, must exist and not be in use (json-string)
3768 Example:
3770 -> { "execute": "chardev-remove", "arguments": { "id" : "foo" } }
3771 <- { "return": {} }
3773 EQMP
3775 .name = "query-rx-filter",
3776 .args_type = "name:s?",
3777 .mhandler.cmd_new = qmp_marshal_input_query_rx_filter,
3780 SQMP
3781 query-rx-filter
3782 ---------------
3784 Show rx-filter information.
3786 Returns a json-array of rx-filter information for all NICs (or for the
3787 given NIC), returning an error if the given NIC doesn't exist, or
3788 given NIC doesn't support rx-filter querying, or given net client
3789 isn't a NIC.
3791 The query will clear the event notification flag of each NIC, then qemu
3792 will start to emit event to QMP monitor.
3794 Each array entry contains the following:
3796 - "name": net client name (json-string)
3797 - "promiscuous": promiscuous mode is enabled (json-bool)
3798 - "multicast": multicast receive state (one of 'normal', 'none', 'all')
3799 - "unicast": unicast receive state (one of 'normal', 'none', 'all')
3800 - "vlan": vlan receive state (one of 'normal', 'none', 'all') (Since 2.0)
3801 - "broadcast-allowed": allow to receive broadcast (json-bool)
3802 - "multicast-overflow": multicast table is overflowed (json-bool)
3803 - "unicast-overflow": unicast table is overflowed (json-bool)
3804 - "main-mac": main macaddr string (json-string)
3805 - "vlan-table": a json-array of active vlan id
3806 - "unicast-table": a json-array of unicast macaddr string
3807 - "multicast-table": a json-array of multicast macaddr string
3809 Example:
3811 -> { "execute": "query-rx-filter", "arguments": { "name": "vnet0" } }
3812 <- { "return": [
3814 "promiscuous": true,
3815 "name": "vnet0",
3816 "main-mac": "52:54:00:12:34:56",
3817 "unicast": "normal",
3818 "vlan": "normal",
3819 "vlan-table": [
3823 "unicast-table": [
3825 "multicast": "normal",
3826 "multicast-overflow": false,
3827 "unicast-overflow": false,
3828 "multicast-table": [
3829 "01:00:5e:00:00:01",
3830 "33:33:00:00:00:01",
3831 "33:33:ff:12:34:56"
3833 "broadcast-allowed": false
3838 EQMP
3841 .name = "blockdev-add",
3842 .args_type = "options:q",
3843 .mhandler.cmd_new = qmp_marshal_input_blockdev_add,
3846 SQMP
3847 blockdev-add
3848 ------------
3850 Add a block device.
3852 This command is still a work in progress. It doesn't support all
3853 block drivers, it lacks a matching blockdev-del, and more. Stay away
3854 from it unless you want to help with its development.
3856 Arguments:
3858 - "options": block driver options
3860 Example (1):
3862 -> { "execute": "blockdev-add",
3863 "arguments": { "options" : { "driver": "qcow2",
3864 "file": { "driver": "file",
3865 "filename": "test.qcow2" } } } }
3866 <- { "return": {} }
3868 Example (2):
3870 -> { "execute": "blockdev-add",
3871 "arguments": {
3872 "options": {
3873 "driver": "qcow2",
3874 "id": "my_disk",
3875 "discard": "unmap",
3876 "cache": {
3877 "direct": true,
3878 "writeback": true
3880 "file": {
3881 "driver": "file",
3882 "filename": "/tmp/test.qcow2"
3884 "backing": {
3885 "driver": "raw",
3886 "file": {
3887 "driver": "file",
3888 "filename": "/dev/fdset/4"
3895 <- { "return": {} }
3897 EQMP
3900 .name = "query-named-block-nodes",
3901 .args_type = "",
3902 .mhandler.cmd_new = qmp_marshal_input_query_named_block_nodes,
3905 SQMP
3906 @query-named-block-nodes
3907 ------------------------
3909 Return a list of BlockDeviceInfo for all the named block driver nodes
3911 Example:
3913 -> { "execute": "query-named-block-nodes" }
3914 <- { "return": [ { "ro":false,
3915 "drv":"qcow2",
3916 "encrypted":false,
3917 "file":"disks/test.qcow2",
3918 "node-name": "my-node",
3919 "backing_file_depth":1,
3920 "bps":1000000,
3921 "bps_rd":0,
3922 "bps_wr":0,
3923 "iops":1000000,
3924 "iops_rd":0,
3925 "iops_wr":0,
3926 "bps_max": 8000000,
3927 "bps_rd_max": 0,
3928 "bps_wr_max": 0,
3929 "iops_max": 0,
3930 "iops_rd_max": 0,
3931 "iops_wr_max": 0,
3932 "iops_size": 0,
3933 "write_threshold": 0,
3934 "image":{
3935 "filename":"disks/test.qcow2",
3936 "format":"qcow2",
3937 "virtual-size":2048000,
3938 "backing_file":"base.qcow2",
3939 "full-backing-filename":"disks/base.qcow2",
3940 "backing-filename-format":"qcow2",
3941 "snapshots":[
3943 "id": "1",
3944 "name": "snapshot1",
3945 "vm-state-size": 0,
3946 "date-sec": 10000200,
3947 "date-nsec": 12,
3948 "vm-clock-sec": 206,
3949 "vm-clock-nsec": 30
3952 "backing-image":{
3953 "filename":"disks/base.qcow2",
3954 "format":"qcow2",
3955 "virtual-size":2048000
3957 } } ] }
3959 EQMP
3962 .name = "query-memdev",
3963 .args_type = "",
3964 .mhandler.cmd_new = qmp_marshal_input_query_memdev,
3967 SQMP
3968 query-memdev
3969 ------------
3971 Show memory devices information.
3974 Example (1):
3976 -> { "execute": "query-memdev" }
3977 <- { "return": [
3979 "size": 536870912,
3980 "merge": false,
3981 "dump": true,
3982 "prealloc": false,
3983 "host-nodes": [0, 1],
3984 "policy": "bind"
3987 "size": 536870912,
3988 "merge": false,
3989 "dump": true,
3990 "prealloc": true,
3991 "host-nodes": [2, 3],
3992 "policy": "preferred"
3997 EQMP
4000 .name = "query-memory-devices",
4001 .args_type = "",
4002 .mhandler.cmd_new = qmp_marshal_input_query_memory_devices,
4005 SQMP
4006 @query-memory-devices
4007 --------------------
4009 Return a list of memory devices.
4011 Example:
4012 -> { "execute": "query-memory-devices" }
4013 <- { "return": [ { "data":
4014 { "addr": 5368709120,
4015 "hotpluggable": true,
4016 "hotplugged": true,
4017 "id": "d1",
4018 "memdev": "/objects/memX",
4019 "node": 0,
4020 "size": 1073741824,
4021 "slot": 0},
4022 "type": "dimm"
4023 } ] }
4024 EQMP
4027 .name = "query-acpi-ospm-status",
4028 .args_type = "",
4029 .mhandler.cmd_new = qmp_marshal_input_query_acpi_ospm_status,
4032 SQMP
4033 @query-acpi-ospm-status
4034 --------------------
4036 Return list of ACPIOSTInfo for devices that support status reporting
4037 via ACPI _OST method.
4039 Example:
4040 -> { "execute": "query-acpi-ospm-status" }
4041 <- { "return": [ { "device": "d1", "slot": "0", "slot-type": "DIMM", "source": 1, "status": 0},
4042 { "slot": "1", "slot-type": "DIMM", "source": 0, "status": 0},
4043 { "slot": "2", "slot-type": "DIMM", "source": 0, "status": 0},
4044 { "slot": "3", "slot-type": "DIMM", "source": 0, "status": 0}
4046 EQMP
4048 #if defined TARGET_I386
4050 .name = "rtc-reset-reinjection",
4051 .args_type = "",
4052 .mhandler.cmd_new = qmp_marshal_input_rtc_reset_reinjection,
4054 #endif
4056 SQMP
4057 rtc-reset-reinjection
4058 ---------------------
4060 Reset the RTC interrupt reinjection backlog.
4062 Arguments: None.
4064 Example:
4066 -> { "execute": "rtc-reset-reinjection" }
4067 <- { "return": {} }
4068 EQMP
4071 .name = "trace-event-get-state",
4072 .args_type = "name:s",
4073 .mhandler.cmd_new = qmp_marshal_input_trace_event_get_state,
4076 SQMP
4077 trace-event-get-state
4078 ---------------------
4080 Query the state of events.
4082 Example:
4084 -> { "execute": "trace-event-get-state", "arguments": { "name": "qemu_memalign" } }
4085 <- { "return": [ { "name": "qemu_memalign", "state": "disabled" } ] }
4086 EQMP
4089 .name = "trace-event-set-state",
4090 .args_type = "name:s,enable:b,ignore-unavailable:b?",
4091 .mhandler.cmd_new = qmp_marshal_input_trace_event_set_state,
4094 SQMP
4095 trace-event-set-state
4096 ---------------------
4098 Set the state of events.
4100 Example:
4102 -> { "execute": "trace-event-set-state", "arguments": { "name": "qemu_memalign", "enable": "true" } }
4103 <- { "return": {} }
4104 EQMP
4107 .name = "x-input-send-event",
4108 .args_type = "console:i?,events:q",
4109 .mhandler.cmd_new = qmp_marshal_input_x_input_send_event,
4112 SQMP
4113 @x-input-send-event
4114 -----------------
4116 Send input event to guest.
4118 Arguments:
4120 - "console": console index. (json-int, optional)
4121 - "events": list of input events.
4123 The consoles are visible in the qom tree, under
4124 /backend/console[$index]. They have a device link and head property, so
4125 it is possible to map which console belongs to which device and display.
4127 Note: this command is experimental, and not a stable API.
4129 Example (1):
4131 Press left mouse button.
4133 -> { "execute": "x-input-send-event",
4134 "arguments": { "console": 0,
4135 "events": [ { "type": "btn",
4136 "data" : { "down": true, "button": "Left" } } ] } }
4137 <- { "return": {} }
4139 -> { "execute": "x-input-send-event",
4140 "arguments": { "console": 0,
4141 "events": [ { "type": "btn",
4142 "data" : { "down": false, "button": "Left" } } ] } }
4143 <- { "return": {} }
4145 Example (2):
4147 Press ctrl-alt-del.
4149 -> { "execute": "x-input-send-event",
4150 "arguments": { "console": 0, "events": [
4151 { "type": "key", "data" : { "down": true,
4152 "key": {"type": "qcode", "data": "ctrl" } } },
4153 { "type": "key", "data" : { "down": true,
4154 "key": {"type": "qcode", "data": "alt" } } },
4155 { "type": "key", "data" : { "down": true,
4156 "key": {"type": "qcode", "data": "delete" } } } ] } }
4157 <- { "return": {} }
4159 Example (3):
4161 Move mouse pointer to absolute coordinates (20000, 400).
4163 -> { "execute": "x-input-send-event" ,
4164 "arguments": { "console": 0, "events": [
4165 { "type": "abs", "data" : { "axis": "X", "value" : 20000 } },
4166 { "type": "abs", "data" : { "axis": "Y", "value" : 400 } } ] } }
4167 <- { "return": {} }
4169 EQMP
4172 .name = "block-set-write-threshold",
4173 .args_type = "node-name:s,write-threshold:l",
4174 .mhandler.cmd_new = qmp_marshal_input_block_set_write_threshold,
4177 SQMP
4178 block-set-write-threshold
4179 ------------
4181 Change the write threshold for a block drive. The threshold is an offset,
4182 thus must be non-negative. Default is no write threshold.
4183 Setting the threshold to zero disables it.
4185 Arguments:
4187 - "node-name": the node name in the block driver state graph (json-string)
4188 - "write-threshold": the write threshold in bytes (json-int)
4190 Example:
4192 -> { "execute": "block-set-write-threshold",
4193 "arguments": { "node-name": "mydev",
4194 "write-threshold": 17179869184 } }
4195 <- { "return": {} }
4197 EQMP
4200 .name = "query-rocker",
4201 .args_type = "name:s",
4202 .mhandler.cmd_new = qmp_marshal_input_query_rocker,
4205 SQMP
4206 Show rocker switch
4207 ------------------
4209 Arguments:
4211 - "name": switch name
4213 Example:
4215 -> { "execute": "query-rocker", "arguments": { "name": "sw1" } }
4216 <- { "return": {"name": "sw1", "ports": 2, "id": 1327446905938}}
4218 EQMP
4221 .name = "query-rocker-ports",
4222 .args_type = "name:s",
4223 .mhandler.cmd_new = qmp_marshal_input_query_rocker_ports,
4226 SQMP
4227 Show rocker switch ports
4228 ------------------------
4230 Arguments:
4232 - "name": switch name
4234 Example:
4236 -> { "execute": "query-rocker-ports", "arguments": { "name": "sw1" } }
4237 <- { "return": [ {"duplex": "full", "enabled": true, "name": "sw1.1",
4238 "autoneg": "off", "link-up": true, "speed": 10000},
4239 {"duplex": "full", "enabled": true, "name": "sw1.2",
4240 "autoneg": "off", "link-up": true, "speed": 10000}
4243 EQMP
4246 .name = "query-rocker-of-dpa-flows",
4247 .args_type = "name:s,tbl-id:i?",
4248 .mhandler.cmd_new = qmp_marshal_input_query_rocker_of_dpa_flows,
4251 SQMP
4252 Show rocker switch OF-DPA flow tables
4253 -------------------------------------
4255 Arguments:
4257 - "name": switch name
4258 - "tbl-id": (optional) flow table ID
4260 Example:
4262 -> { "execute": "query-rocker-of-dpa-flows", "arguments": { "name": "sw1" } }
4263 <- { "return": [ {"key": {"in-pport": 0, "priority": 1, "tbl-id": 0},
4264 "hits": 138,
4265 "cookie": 0,
4266 "action": {"goto-tbl": 10},
4267 "mask": {"in-pport": 4294901760}
4269 {...more...},
4272 EQMP
4275 .name = "query-rocker-of-dpa-groups",
4276 .args_type = "name:s,type:i?",
4277 .mhandler.cmd_new = qmp_marshal_input_query_rocker_of_dpa_groups,
4280 SQMP
4281 Show rocker OF-DPA group tables
4282 -------------------------------
4284 Arguments:
4286 - "name": switch name
4287 - "type": (optional) group type
4289 Example:
4291 -> { "execute": "query-rocker-of-dpa-groups", "arguments": { "name": "sw1" } }
4292 <- { "return": [ {"type": 0, "out-pport": 2, "pport": 2, "vlan-id": 3841,
4293 "pop-vlan": 1, "id": 251723778},
4294 {"type": 0, "out-pport": 0, "pport": 0, "vlan-id": 3841,
4295 "pop-vlan": 1, "id": 251723776},
4296 {"type": 0, "out-pport": 1, "pport": 1, "vlan-id": 3840,
4297 "pop-vlan": 1, "id": 251658241},
4298 {"type": 0, "out-pport": 0, "pport": 0, "vlan-id": 3840,
4299 "pop-vlan": 1, "id": 251658240}