Merge remote-tracking branch 'remotes/bonzini/tags/for-upstream' into staging
[qemu.git] / qmp-commands.hx
blob7f6876077b6d4b72deabe1910d7379beb2baf793
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 = do_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:O,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 to -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 = "send migration info to spice/vnc client",
788 .mhandler.cmd_async = client_migrate_info,
789 .flags = MONITOR_CMD_ASYNC,
792 SQMP
793 client_migrate_info
794 ------------------
796 Set the spice/vnc connection info for the migration target. The spice/vnc
797 server will ask the spice/vnc client to automatically reconnect using the
798 new parameters (if specified) once the vm migration finished successfully.
800 Arguments:
802 - "protocol": protocol: "spice" or "vnc" (json-string)
803 - "hostname": migration target hostname (json-string)
804 - "port": spice/vnc tcp port for plaintext channels (json-int, optional)
805 - "tls-port": spice tcp port for tls-secured channels (json-int, optional)
806 - "cert-subject": server certificate subject (json-string, optional)
808 Example:
810 -> { "execute": "client_migrate_info",
811 "arguments": { "protocol": "spice",
812 "hostname": "virt42.lab.kraxel.org",
813 "port": 1234 } }
814 <- { "return": {} }
816 EQMP
819 .name = "dump-guest-memory",
820 .args_type = "paging:b,protocol:s,begin:i?,end:i?,format:s?",
821 .params = "-p protocol [begin] [length] [format]",
822 .help = "dump guest memory to file",
823 .mhandler.cmd_new = qmp_marshal_input_dump_guest_memory,
826 SQMP
827 dump
830 Dump guest memory to file. The file can be processed with crash or gdb.
832 Arguments:
834 - "paging": do paging to get guest's memory mapping (json-bool)
835 - "protocol": destination file(started with "file:") or destination file
836 descriptor (started with "fd:") (json-string)
837 - "begin": the starting physical address. It's optional, and should be specified
838 with length together (json-int)
839 - "length": the memory size, in bytes. It's optional, and should be specified
840 with begin together (json-int)
841 - "format": the format of guest memory dump. It's optional, and can be
842 elf|kdump-zlib|kdump-lzo|kdump-snappy, but non-elf formats will
843 conflict with paging and filter, ie. begin and length (json-string)
845 Example:
847 -> { "execute": "dump-guest-memory", "arguments": { "protocol": "fd:dump" } }
848 <- { "return": {} }
850 Notes:
852 (1) All boolean arguments default to false
854 EQMP
857 .name = "query-dump-guest-memory-capability",
858 .args_type = "",
859 .mhandler.cmd_new = qmp_marshal_input_query_dump_guest_memory_capability,
862 SQMP
863 query-dump-guest-memory-capability
864 ----------
866 Show available formats for 'dump-guest-memory'
868 Example:
870 -> { "execute": "query-dump-guest-memory-capability" }
871 <- { "return": { "formats":
872 ["elf", "kdump-zlib", "kdump-lzo", "kdump-snappy"] }
874 EQMP
877 .name = "netdev_add",
878 .args_type = "netdev:O",
879 .mhandler.cmd_new = qmp_netdev_add,
882 SQMP
883 netdev_add
884 ----------
886 Add host network device.
888 Arguments:
890 - "type": the device type, "tap", "user", ... (json-string)
891 - "id": the device's ID, must be unique (json-string)
892 - device options
894 Example:
896 -> { "execute": "netdev_add", "arguments": { "type": "user", "id": "netdev1" } }
897 <- { "return": {} }
899 Note: The supported device options are the same ones supported by the '-netdev'
900 command-line argument, which are listed in the '-help' output or QEMU's
901 manual
903 EQMP
906 .name = "netdev_del",
907 .args_type = "id:s",
908 .mhandler.cmd_new = qmp_marshal_input_netdev_del,
911 SQMP
912 netdev_del
913 ----------
915 Remove host network device.
917 Arguments:
919 - "id": the device's ID, must be unique (json-string)
921 Example:
923 -> { "execute": "netdev_del", "arguments": { "id": "netdev1" } }
924 <- { "return": {} }
927 EQMP
930 .name = "object-add",
931 .args_type = "qom-type:s,id:s,props:q?",
932 .mhandler.cmd_new = qmp_object_add,
935 SQMP
936 object-add
937 ----------
939 Create QOM object.
941 Arguments:
943 - "qom-type": the object's QOM type, i.e. the class name (json-string)
944 - "id": the object's ID, must be unique (json-string)
945 - "props": a dictionary of object property values (optional, json-dict)
947 Example:
949 -> { "execute": "object-add", "arguments": { "qom-type": "rng-random", "id": "rng1",
950 "props": { "filename": "/dev/hwrng" } } }
951 <- { "return": {} }
953 EQMP
956 .name = "object-del",
957 .args_type = "id:s",
958 .mhandler.cmd_new = qmp_marshal_input_object_del,
961 SQMP
962 object-del
963 ----------
965 Remove QOM object.
967 Arguments:
969 - "id": the object's ID (json-string)
971 Example:
973 -> { "execute": "object-del", "arguments": { "id": "rng1" } }
974 <- { "return": {} }
977 EQMP
981 .name = "block_resize",
982 .args_type = "device:s?,node-name:s?,size:o",
983 .mhandler.cmd_new = qmp_marshal_input_block_resize,
986 SQMP
987 block_resize
988 ------------
990 Resize a block image while a guest is running.
992 Arguments:
994 - "device": the device's ID, must be unique (json-string)
995 - "node-name": the node name in the block driver state graph (json-string)
996 - "size": new size
998 Example:
1000 -> { "execute": "block_resize", "arguments": { "device": "scratch", "size": 1073741824 } }
1001 <- { "return": {} }
1003 EQMP
1006 .name = "block-stream",
1007 .args_type = "device:B,base:s?,speed:o?,backing-file:s?,on-error:s?",
1008 .mhandler.cmd_new = qmp_marshal_input_block_stream,
1012 .name = "block-commit",
1013 .args_type = "device:B,base:s?,top:s?,backing-file:s?,speed:o?",
1014 .mhandler.cmd_new = qmp_marshal_input_block_commit,
1017 SQMP
1018 block-commit
1019 ------------
1021 Live commit of data from overlay image nodes into backing nodes - i.e., writes
1022 data between 'top' and 'base' into 'base'.
1024 Arguments:
1026 - "device": The device's ID, must be unique (json-string)
1027 - "base": The file name of the backing image to write data into.
1028 If not specified, this is the deepest backing image
1029 (json-string, optional)
1030 - "top": The file name of the backing image within the image chain,
1031 which contains the topmost data to be committed down. If
1032 not specified, this is the active layer. (json-string, optional)
1034 - backing-file: The backing file string to write into the overlay
1035 image of 'top'. If 'top' is the active layer,
1036 specifying a backing file string is an error. This
1037 filename is not validated.
1039 If a pathname string is such that it cannot be
1040 resolved by QEMU, that means that subsequent QMP or
1041 HMP commands must use node-names for the image in
1042 question, as filename lookup methods will fail.
1044 If not specified, QEMU will automatically determine
1045 the backing file string to use, or error out if
1046 there is no obvious choice. Care should be taken
1047 when specifying the string, to specify a valid
1048 filename or protocol.
1049 (json-string, optional) (Since 2.1)
1051 If top == base, that is an error.
1052 If top == active, the job will not be completed by itself,
1053 user needs to complete the job with the block-job-complete
1054 command after getting the ready event. (Since 2.0)
1056 If the base image is smaller than top, then the base image
1057 will be resized to be the same size as top. If top is
1058 smaller than the base image, the base will not be
1059 truncated. If you want the base image size to match the
1060 size of the smaller top, you can safely truncate it
1061 yourself once the commit operation successfully completes.
1062 (json-string)
1063 - "speed": the maximum speed, in bytes per second (json-int, optional)
1066 Example:
1068 -> { "execute": "block-commit", "arguments": { "device": "virtio0",
1069 "top": "/tmp/snap1.qcow2" } }
1070 <- { "return": {} }
1072 EQMP
1075 .name = "drive-backup",
1076 .args_type = "sync:s,device:B,target:s,speed:i?,mode:s?,format:s?,"
1077 "on-source-error:s?,on-target-error:s?",
1078 .mhandler.cmd_new = qmp_marshal_input_drive_backup,
1081 SQMP
1082 drive-backup
1083 ------------
1085 Start a point-in-time copy of a block device to a new destination. The
1086 status of ongoing drive-backup operations can be checked with
1087 query-block-jobs where the BlockJobInfo.type field has the value 'backup'.
1088 The operation can be stopped before it has completed using the
1089 block-job-cancel command.
1091 Arguments:
1093 - "device": the name of the device which should be copied.
1094 (json-string)
1095 - "target": the target of the new image. If the file exists, or if it is a
1096 device, the existing file/device will be used as the new
1097 destination. If it does not exist, a new file will be created.
1098 (json-string)
1099 - "format": the format of the new destination, default is to probe if 'mode' is
1100 'existing', else the format of the source
1101 (json-string, optional)
1102 - "sync": what parts of the disk image should be copied to the destination;
1103 possibilities include "full" for all the disk, "top" for only the sectors
1104 allocated in the topmost image, or "none" to only replicate new I/O
1105 (MirrorSyncMode).
1106 - "mode": whether and how QEMU should create a new image
1107 (NewImageMode, optional, default 'absolute-paths')
1108 - "speed": the maximum speed, in bytes per second (json-int, optional)
1109 - "on-source-error": the action to take on an error on the source, default
1110 'report'. 'stop' and 'enospc' can only be used
1111 if the block device supports io-status.
1112 (BlockdevOnError, optional)
1113 - "on-target-error": the action to take on an error on the target, default
1114 'report' (no limitations, since this applies to
1115 a different block device than device).
1116 (BlockdevOnError, optional)
1118 Example:
1119 -> { "execute": "drive-backup", "arguments": { "device": "drive0",
1120 "sync": "full",
1121 "target": "backup.img" } }
1122 <- { "return": {} }
1124 EQMP
1127 .name = "blockdev-backup",
1128 .args_type = "sync:s,device:B,target:B,speed:i?,"
1129 "on-source-error:s?,on-target-error:s?",
1130 .mhandler.cmd_new = qmp_marshal_input_blockdev_backup,
1133 SQMP
1134 blockdev-backup
1135 ---------------
1137 The device version of drive-backup: this command takes an existing named device
1138 as backup target.
1140 Arguments:
1142 - "device": the name of the device which should be copied.
1143 (json-string)
1144 - "target": the name of the backup target device. (json-string)
1145 - "sync": what parts of the disk image should be copied to the destination;
1146 possibilities include "full" for all the disk, "top" for only the
1147 sectors allocated in the topmost image, or "none" to only replicate
1148 new I/O (MirrorSyncMode).
1149 - "speed": the maximum speed, in bytes per second (json-int, optional)
1150 - "on-source-error": the action to take on an error on the source, default
1151 'report'. 'stop' and 'enospc' can only be used
1152 if the block device supports io-status.
1153 (BlockdevOnError, optional)
1154 - "on-target-error": the action to take on an error on the target, default
1155 'report' (no limitations, since this applies to
1156 a different block device than device).
1157 (BlockdevOnError, optional)
1159 Example:
1160 -> { "execute": "blockdev-backup", "arguments": { "device": "src-id",
1161 "sync": "full",
1162 "target": "tgt-id" } }
1163 <- { "return": {} }
1165 EQMP
1168 .name = "block-job-set-speed",
1169 .args_type = "device:B,speed:o",
1170 .mhandler.cmd_new = qmp_marshal_input_block_job_set_speed,
1174 .name = "block-job-cancel",
1175 .args_type = "device:B,force:b?",
1176 .mhandler.cmd_new = qmp_marshal_input_block_job_cancel,
1179 .name = "block-job-pause",
1180 .args_type = "device:B",
1181 .mhandler.cmd_new = qmp_marshal_input_block_job_pause,
1184 .name = "block-job-resume",
1185 .args_type = "device:B",
1186 .mhandler.cmd_new = qmp_marshal_input_block_job_resume,
1189 .name = "block-job-complete",
1190 .args_type = "device:B",
1191 .mhandler.cmd_new = qmp_marshal_input_block_job_complete,
1194 .name = "transaction",
1195 .args_type = "actions:q",
1196 .mhandler.cmd_new = qmp_marshal_input_transaction,
1199 SQMP
1200 transaction
1201 -----------
1203 Atomically operate on one or more block devices. The only supported operations
1204 for now are drive-backup, internal and external snapshotting. A list of
1205 dictionaries is accepted, that contains the actions to be performed.
1206 If there is any failure performing any of the operations, all operations
1207 for the group are abandoned.
1209 For external snapshots, the dictionary contains the device, the file to use for
1210 the new snapshot, and the format. The default format, if not specified, is
1211 qcow2.
1213 Each new snapshot defaults to being created by QEMU (wiping any
1214 contents if the file already exists), but it is also possible to reuse
1215 an externally-created file. In the latter case, you should ensure that
1216 the new image file has the same contents as the current one; QEMU cannot
1217 perform any meaningful check. Typically this is achieved by using the
1218 current image file as the backing file for the new image.
1220 On failure, the original disks pre-snapshot attempt will be used.
1222 For internal snapshots, the dictionary contains the device and the snapshot's
1223 name. If an internal snapshot matching name already exists, the request will
1224 be rejected. Only some image formats support it, for example, qcow2, rbd,
1225 and sheepdog.
1227 On failure, qemu will try delete the newly created internal snapshot in the
1228 transaction. When an I/O error occurs during deletion, the user needs to fix
1229 it later with qemu-img or other command.
1231 Arguments:
1233 actions array:
1234 - "type": the operation to perform. The only supported
1235 value is "blockdev-snapshot-sync". (json-string)
1236 - "data": a dictionary. The contents depend on the value
1237 of "type". When "type" is "blockdev-snapshot-sync":
1238 - "device": device name to snapshot (json-string)
1239 - "node-name": graph node name to snapshot (json-string)
1240 - "snapshot-file": name of new image file (json-string)
1241 - "snapshot-node-name": graph node name of the new snapshot (json-string)
1242 - "format": format of new image (json-string, optional)
1243 - "mode": whether and how QEMU should create the snapshot file
1244 (NewImageMode, optional, default "absolute-paths")
1245 When "type" is "blockdev-snapshot-internal-sync":
1246 - "device": device name to snapshot (json-string)
1247 - "name": name of the new snapshot (json-string)
1249 Example:
1251 -> { "execute": "transaction",
1252 "arguments": { "actions": [
1253 { "type": "blockdev-snapshot-sync", "data" : { "device": "ide-hd0",
1254 "snapshot-file": "/some/place/my-image",
1255 "format": "qcow2" } },
1256 { "type": "blockdev-snapshot-sync", "data" : { "node-name": "myfile",
1257 "snapshot-file": "/some/place/my-image2",
1258 "snapshot-node-name": "node3432",
1259 "mode": "existing",
1260 "format": "qcow2" } },
1261 { "type": "blockdev-snapshot-sync", "data" : { "device": "ide-hd1",
1262 "snapshot-file": "/some/place/my-image2",
1263 "mode": "existing",
1264 "format": "qcow2" } },
1265 { "type": "blockdev-snapshot-internal-sync", "data" : {
1266 "device": "ide-hd2",
1267 "name": "snapshot0" } } ] } }
1268 <- { "return": {} }
1270 EQMP
1273 .name = "blockdev-snapshot-sync",
1274 .args_type = "device:s?,node-name:s?,snapshot-file:s,snapshot-node-name:s?,format:s?,mode:s?",
1275 .mhandler.cmd_new = qmp_marshal_input_blockdev_snapshot_sync,
1278 SQMP
1279 blockdev-snapshot-sync
1280 ----------------------
1282 Synchronous snapshot of a block device. snapshot-file specifies the
1283 target of the new image. If the file exists, or if it is a device, the
1284 snapshot will be created in the existing file/device. If does not
1285 exist, a new file will be created. format specifies the format of the
1286 snapshot image, default is qcow2.
1288 Arguments:
1290 - "device": device name to snapshot (json-string)
1291 - "node-name": graph node name to snapshot (json-string)
1292 - "snapshot-file": name of new image file (json-string)
1293 - "snapshot-node-name": graph node name of the new snapshot (json-string)
1294 - "mode": whether and how QEMU should create the snapshot file
1295 (NewImageMode, optional, default "absolute-paths")
1296 - "format": format of new image (json-string, optional)
1298 Example:
1300 -> { "execute": "blockdev-snapshot-sync", "arguments": { "device": "ide-hd0",
1301 "snapshot-file":
1302 "/some/place/my-image",
1303 "format": "qcow2" } }
1304 <- { "return": {} }
1306 EQMP
1309 .name = "blockdev-snapshot-internal-sync",
1310 .args_type = "device:B,name:s",
1311 .mhandler.cmd_new = qmp_marshal_input_blockdev_snapshot_internal_sync,
1314 SQMP
1315 blockdev-snapshot-internal-sync
1316 -------------------------------
1318 Synchronously take an internal snapshot of a block device when the format of
1319 image used supports it. If the name is an empty string, or a snapshot with
1320 name already exists, the operation will fail.
1322 Arguments:
1324 - "device": device name to snapshot (json-string)
1325 - "name": name of the new snapshot (json-string)
1327 Example:
1329 -> { "execute": "blockdev-snapshot-internal-sync",
1330 "arguments": { "device": "ide-hd0",
1331 "name": "snapshot0" }
1333 <- { "return": {} }
1335 EQMP
1338 .name = "blockdev-snapshot-delete-internal-sync",
1339 .args_type = "device:B,id:s?,name:s?",
1340 .mhandler.cmd_new =
1341 qmp_marshal_input_blockdev_snapshot_delete_internal_sync,
1344 SQMP
1345 blockdev-snapshot-delete-internal-sync
1346 --------------------------------------
1348 Synchronously delete an internal snapshot of a block device when the format of
1349 image used supports it. The snapshot is identified by name or id or both. One
1350 of name or id is required. If the snapshot is not found, the operation will
1351 fail.
1353 Arguments:
1355 - "device": device name (json-string)
1356 - "id": ID of the snapshot (json-string, optional)
1357 - "name": name of the snapshot (json-string, optional)
1359 Example:
1361 -> { "execute": "blockdev-snapshot-delete-internal-sync",
1362 "arguments": { "device": "ide-hd0",
1363 "name": "snapshot0" }
1365 <- { "return": {
1366 "id": "1",
1367 "name": "snapshot0",
1368 "vm-state-size": 0,
1369 "date-sec": 1000012,
1370 "date-nsec": 10,
1371 "vm-clock-sec": 100,
1372 "vm-clock-nsec": 20
1376 EQMP
1379 .name = "drive-mirror",
1380 .args_type = "sync:s,device:B,target:s,speed:i?,mode:s?,format:s?,"
1381 "node-name:s?,replaces:s?,"
1382 "on-source-error:s?,on-target-error:s?,"
1383 "granularity:i?,buf-size:i?",
1384 .mhandler.cmd_new = qmp_marshal_input_drive_mirror,
1387 SQMP
1388 drive-mirror
1389 ------------
1391 Start mirroring a block device's writes to a new destination. target
1392 specifies the target of the new image. If the file exists, or if it is
1393 a device, it will be used as the new destination for writes. If it does not
1394 exist, a new file will be created. format specifies the format of the
1395 mirror image, default is to probe if mode='existing', else the format
1396 of the source.
1398 Arguments:
1400 - "device": device name to operate on (json-string)
1401 - "target": name of new image file (json-string)
1402 - "format": format of new image (json-string, optional)
1403 - "node-name": the name of the new block driver state in the node graph
1404 (json-string, optional)
1405 - "replaces": the block driver node name to replace when finished
1406 (json-string, optional)
1407 - "mode": how an image file should be created into the target
1408 file/device (NewImageMode, optional, default 'absolute-paths')
1409 - "speed": maximum speed of the streaming job, in bytes per second
1410 (json-int)
1411 - "granularity": granularity of the dirty bitmap, in bytes (json-int, optional)
1412 - "buf_size": maximum amount of data in flight from source to target, in bytes
1413 (json-int, default 10M)
1414 - "sync": what parts of the disk image should be copied to the destination;
1415 possibilities include "full" for all the disk, "top" for only the sectors
1416 allocated in the topmost image, or "none" to only replicate new I/O
1417 (MirrorSyncMode).
1418 - "on-source-error": the action to take on an error on the source
1419 (BlockdevOnError, default 'report')
1420 - "on-target-error": the action to take on an error on the target
1421 (BlockdevOnError, default 'report')
1423 The default value of the granularity is the image cluster size clamped
1424 between 4096 and 65536, if the image format defines one. If the format
1425 does not define a cluster size, the default value of the granularity
1426 is 65536.
1429 Example:
1431 -> { "execute": "drive-mirror", "arguments": { "device": "ide-hd0",
1432 "target": "/some/place/my-image",
1433 "sync": "full",
1434 "format": "qcow2" } }
1435 <- { "return": {} }
1437 EQMP
1440 .name = "change-backing-file",
1441 .args_type = "device:s,image-node-name:s,backing-file:s",
1442 .mhandler.cmd_new = qmp_marshal_input_change_backing_file,
1445 SQMP
1446 change-backing-file
1447 -------------------
1448 Since: 2.1
1450 Change the backing file in the image file metadata. This does not cause
1451 QEMU to reopen the image file to reparse the backing filename (it may,
1452 however, perform a reopen to change permissions from r/o -> r/w -> r/o,
1453 if needed). The new backing file string is written into the image file
1454 metadata, and the QEMU internal strings are updated.
1456 Arguments:
1458 - "image-node-name": The name of the block driver state node of the
1459 image to modify. The "device" is argument is used to
1460 verify "image-node-name" is in the chain described by
1461 "device".
1462 (json-string, optional)
1464 - "device": The name of the device.
1465 (json-string)
1467 - "backing-file": The string to write as the backing file. This string is
1468 not validated, so care should be taken when specifying
1469 the string or the image chain may not be able to be
1470 reopened again.
1471 (json-string)
1473 Returns: Nothing on success
1474 If "device" does not exist or cannot be determined, DeviceNotFound
1476 EQMP
1479 .name = "balloon",
1480 .args_type = "value:M",
1481 .mhandler.cmd_new = qmp_marshal_input_balloon,
1484 SQMP
1485 balloon
1486 -------
1488 Request VM to change its memory allocation (in bytes).
1490 Arguments:
1492 - "value": New memory allocation (json-int)
1494 Example:
1496 -> { "execute": "balloon", "arguments": { "value": 536870912 } }
1497 <- { "return": {} }
1499 EQMP
1502 .name = "set_link",
1503 .args_type = "name:s,up:b",
1504 .mhandler.cmd_new = qmp_marshal_input_set_link,
1507 SQMP
1508 set_link
1509 --------
1511 Change the link status of a network adapter.
1513 Arguments:
1515 - "name": network device name (json-string)
1516 - "up": status is up (json-bool)
1518 Example:
1520 -> { "execute": "set_link", "arguments": { "name": "e1000.0", "up": false } }
1521 <- { "return": {} }
1523 EQMP
1526 .name = "getfd",
1527 .args_type = "fdname:s",
1528 .params = "getfd name",
1529 .help = "receive a file descriptor via SCM rights and assign it a name",
1530 .mhandler.cmd_new = qmp_marshal_input_getfd,
1533 SQMP
1534 getfd
1535 -----
1537 Receive a file descriptor via SCM rights and assign it a name.
1539 Arguments:
1541 - "fdname": file descriptor name (json-string)
1543 Example:
1545 -> { "execute": "getfd", "arguments": { "fdname": "fd1" } }
1546 <- { "return": {} }
1548 Notes:
1550 (1) If the name specified by the "fdname" argument already exists,
1551 the file descriptor assigned to it will be closed and replaced
1552 by the received file descriptor.
1553 (2) The 'closefd' command can be used to explicitly close the file
1554 descriptor when it is no longer needed.
1556 EQMP
1559 .name = "closefd",
1560 .args_type = "fdname:s",
1561 .params = "closefd name",
1562 .help = "close a file descriptor previously passed via SCM rights",
1563 .mhandler.cmd_new = qmp_marshal_input_closefd,
1566 SQMP
1567 closefd
1568 -------
1570 Close a file descriptor previously passed via SCM rights.
1572 Arguments:
1574 - "fdname": file descriptor name (json-string)
1576 Example:
1578 -> { "execute": "closefd", "arguments": { "fdname": "fd1" } }
1579 <- { "return": {} }
1581 EQMP
1584 .name = "add-fd",
1585 .args_type = "fdset-id:i?,opaque:s?",
1586 .params = "add-fd fdset-id opaque",
1587 .help = "Add a file descriptor, that was passed via SCM rights, to an fd set",
1588 .mhandler.cmd_new = qmp_marshal_input_add_fd,
1591 SQMP
1592 add-fd
1593 -------
1595 Add a file descriptor, that was passed via SCM rights, to an fd set.
1597 Arguments:
1599 - "fdset-id": The ID of the fd set to add the file descriptor to.
1600 (json-int, optional)
1601 - "opaque": A free-form string that can be used to describe the fd.
1602 (json-string, optional)
1604 Return a json-object with the following information:
1606 - "fdset-id": The ID of the fd set that the fd was added to. (json-int)
1607 - "fd": The file descriptor that was received via SCM rights and added to the
1608 fd set. (json-int)
1610 Example:
1612 -> { "execute": "add-fd", "arguments": { "fdset-id": 1 } }
1613 <- { "return": { "fdset-id": 1, "fd": 3 } }
1615 Notes:
1617 (1) The list of fd sets is shared by all monitor connections.
1618 (2) If "fdset-id" is not specified, a new fd set will be created.
1620 EQMP
1623 .name = "remove-fd",
1624 .args_type = "fdset-id:i,fd:i?",
1625 .params = "remove-fd fdset-id fd",
1626 .help = "Remove a file descriptor from an fd set",
1627 .mhandler.cmd_new = qmp_marshal_input_remove_fd,
1630 SQMP
1631 remove-fd
1632 ---------
1634 Remove a file descriptor from an fd set.
1636 Arguments:
1638 - "fdset-id": The ID of the fd set that the file descriptor belongs to.
1639 (json-int)
1640 - "fd": The file descriptor that is to be removed. (json-int, optional)
1642 Example:
1644 -> { "execute": "remove-fd", "arguments": { "fdset-id": 1, "fd": 3 } }
1645 <- { "return": {} }
1647 Notes:
1649 (1) The list of fd sets is shared by all monitor connections.
1650 (2) If "fd" is not specified, all file descriptors in "fdset-id" will be
1651 removed.
1653 EQMP
1656 .name = "query-fdsets",
1657 .args_type = "",
1658 .help = "Return information describing all fd sets",
1659 .mhandler.cmd_new = qmp_marshal_input_query_fdsets,
1662 SQMP
1663 query-fdsets
1664 -------------
1666 Return information describing all fd sets.
1668 Arguments: None
1670 Example:
1672 -> { "execute": "query-fdsets" }
1673 <- { "return": [
1675 "fds": [
1677 "fd": 30,
1678 "opaque": "rdonly:/path/to/file"
1681 "fd": 24,
1682 "opaque": "rdwr:/path/to/file"
1685 "fdset-id": 1
1688 "fds": [
1690 "fd": 28
1693 "fd": 29
1696 "fdset-id": 0
1701 Note: The list of fd sets is shared by all monitor connections.
1703 EQMP
1706 .name = "block_passwd",
1707 .args_type = "device:s?,node-name:s?,password:s",
1708 .mhandler.cmd_new = qmp_marshal_input_block_passwd,
1711 SQMP
1712 block_passwd
1713 ------------
1715 Set the password of encrypted block devices.
1717 Arguments:
1719 - "device": device name (json-string)
1720 - "node-name": name in the block driver state graph (json-string)
1721 - "password": password (json-string)
1723 Example:
1725 -> { "execute": "block_passwd", "arguments": { "device": "ide0-hd0",
1726 "password": "12345" } }
1727 <- { "return": {} }
1729 EQMP
1732 .name = "block_set_io_throttle",
1733 .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?",
1734 .mhandler.cmd_new = qmp_marshal_input_block_set_io_throttle,
1737 SQMP
1738 block_set_io_throttle
1739 ------------
1741 Change I/O throttle limits for a block drive.
1743 Arguments:
1745 - "device": device name (json-string)
1746 - "bps": total throughput limit in bytes per second (json-int)
1747 - "bps_rd": read throughput limit in bytes per second (json-int)
1748 - "bps_wr": write throughput limit in bytes per second (json-int)
1749 - "iops": total I/O operations per second (json-int)
1750 - "iops_rd": read I/O operations per second (json-int)
1751 - "iops_wr": write I/O operations per second (json-int)
1752 - "bps_max": total max in bytes (json-int)
1753 - "bps_rd_max": read max in bytes (json-int)
1754 - "bps_wr_max": write max in bytes (json-int)
1755 - "iops_max": total I/O operations max (json-int)
1756 - "iops_rd_max": read I/O operations max (json-int)
1757 - "iops_wr_max": write I/O operations max (json-int)
1758 - "iops_size": I/O size in bytes when limiting (json-int)
1760 Example:
1762 -> { "execute": "block_set_io_throttle", "arguments": { "device": "virtio0",
1763 "bps": 1000000,
1764 "bps_rd": 0,
1765 "bps_wr": 0,
1766 "iops": 0,
1767 "iops_rd": 0,
1768 "iops_wr": 0,
1769 "bps_max": 8000000,
1770 "bps_rd_max": 0,
1771 "bps_wr_max": 0,
1772 "iops_max": 0,
1773 "iops_rd_max": 0,
1774 "iops_wr_max": 0,
1775 "iops_size": 0 } }
1776 <- { "return": {} }
1778 EQMP
1781 .name = "set_password",
1782 .args_type = "protocol:s,password:s,connected:s?",
1783 .mhandler.cmd_new = qmp_marshal_input_set_password,
1786 SQMP
1787 set_password
1788 ------------
1790 Set the password for vnc/spice protocols.
1792 Arguments:
1794 - "protocol": protocol name (json-string)
1795 - "password": password (json-string)
1796 - "connected": [ keep | disconnect | fail ] (json-string, optional)
1798 Example:
1800 -> { "execute": "set_password", "arguments": { "protocol": "vnc",
1801 "password": "secret" } }
1802 <- { "return": {} }
1804 EQMP
1807 .name = "expire_password",
1808 .args_type = "protocol:s,time:s",
1809 .mhandler.cmd_new = qmp_marshal_input_expire_password,
1812 SQMP
1813 expire_password
1814 ---------------
1816 Set the password expire time for vnc/spice protocols.
1818 Arguments:
1820 - "protocol": protocol name (json-string)
1821 - "time": [ now | never | +secs | secs ] (json-string)
1823 Example:
1825 -> { "execute": "expire_password", "arguments": { "protocol": "vnc",
1826 "time": "+60" } }
1827 <- { "return": {} }
1829 EQMP
1832 .name = "add_client",
1833 .args_type = "protocol:s,fdname:s,skipauth:b?,tls:b?",
1834 .mhandler.cmd_new = qmp_marshal_input_add_client,
1837 SQMP
1838 add_client
1839 ----------
1841 Add a graphics client
1843 Arguments:
1845 - "protocol": protocol name (json-string)
1846 - "fdname": file descriptor name (json-string)
1847 - "skipauth": whether to skip authentication (json-bool, optional)
1848 - "tls": whether to perform TLS (json-bool, optional)
1850 Example:
1852 -> { "execute": "add_client", "arguments": { "protocol": "vnc",
1853 "fdname": "myclient" } }
1854 <- { "return": {} }
1856 EQMP
1858 .name = "qmp_capabilities",
1859 .args_type = "",
1860 .params = "",
1861 .help = "enable QMP capabilities",
1862 .mhandler.cmd_new = do_qmp_capabilities,
1865 SQMP
1866 qmp_capabilities
1867 ----------------
1869 Enable QMP capabilities.
1871 Arguments: None.
1873 Example:
1875 -> { "execute": "qmp_capabilities" }
1876 <- { "return": {} }
1878 Note: This command must be issued before issuing any other command.
1880 EQMP
1883 .name = "human-monitor-command",
1884 .args_type = "command-line:s,cpu-index:i?",
1885 .mhandler.cmd_new = qmp_marshal_input_human_monitor_command,
1888 SQMP
1889 human-monitor-command
1890 ---------------------
1892 Execute a Human Monitor command.
1894 Arguments:
1896 - command-line: the command name and its arguments, just like the
1897 Human Monitor's shell (json-string)
1898 - cpu-index: select the CPU number to be used by commands which access CPU
1899 data, like 'info registers'. The Monitor selects CPU 0 if this
1900 argument is not provided (json-int, optional)
1902 Example:
1904 -> { "execute": "human-monitor-command", "arguments": { "command-line": "info kvm" } }
1905 <- { "return": "kvm support: enabled\r\n" }
1907 Notes:
1909 (1) The Human Monitor is NOT an stable interface, this means that command
1910 names, arguments and responses can change or be removed at ANY time.
1911 Applications that rely on long term stability guarantees should NOT
1912 use this command
1914 (2) Limitations:
1916 o This command is stateless, this means that commands that depend
1917 on state information (such as getfd) might not work
1919 o Commands that prompt the user for data (eg. 'cont' when the block
1920 device is encrypted) don't currently work
1922 3. Query Commands
1923 =================
1925 HXCOMM Each query command below is inside a SQMP/EQMP section, do NOT change
1926 HXCOMM this! We will possibly move query commands definitions inside those
1927 HXCOMM sections, just like regular commands.
1929 EQMP
1931 SQMP
1932 query-version
1933 -------------
1935 Show QEMU version.
1937 Return a json-object with the following information:
1939 - "qemu": A json-object containing three integer values:
1940 - "major": QEMU's major version (json-int)
1941 - "minor": QEMU's minor version (json-int)
1942 - "micro": QEMU's micro version (json-int)
1943 - "package": package's version (json-string)
1945 Example:
1947 -> { "execute": "query-version" }
1948 <- {
1949 "return":{
1950 "qemu":{
1951 "major":0,
1952 "minor":11,
1953 "micro":5
1955 "package":""
1959 EQMP
1962 .name = "query-version",
1963 .args_type = "",
1964 .mhandler.cmd_new = qmp_marshal_input_query_version,
1967 SQMP
1968 query-commands
1969 --------------
1971 List QMP available commands.
1973 Each command is represented by a json-object, the returned value is a json-array
1974 of all commands.
1976 Each json-object contain:
1978 - "name": command's name (json-string)
1980 Example:
1982 -> { "execute": "query-commands" }
1983 <- {
1984 "return":[
1986 "name":"query-balloon"
1989 "name":"system_powerdown"
1994 Note: This example has been shortened as the real response is too long.
1996 EQMP
1999 .name = "query-commands",
2000 .args_type = "",
2001 .mhandler.cmd_new = qmp_marshal_input_query_commands,
2004 SQMP
2005 query-events
2006 --------------
2008 List QMP available events.
2010 Each event is represented by a json-object, the returned value is a json-array
2011 of all events.
2013 Each json-object contains:
2015 - "name": event's name (json-string)
2017 Example:
2019 -> { "execute": "query-events" }
2020 <- {
2021 "return":[
2023 "name":"SHUTDOWN"
2026 "name":"RESET"
2031 Note: This example has been shortened as the real response is too long.
2033 EQMP
2036 .name = "query-events",
2037 .args_type = "",
2038 .mhandler.cmd_new = qmp_marshal_input_query_events,
2041 SQMP
2042 query-chardev
2043 -------------
2045 Each device is represented by a json-object. The returned value is a json-array
2046 of all devices.
2048 Each json-object contain the following:
2050 - "label": device's label (json-string)
2051 - "filename": device's file (json-string)
2052 - "frontend-open": open/closed state of the frontend device attached to this
2053 backend (json-bool)
2055 Example:
2057 -> { "execute": "query-chardev" }
2058 <- {
2059 "return": [
2061 "label": "charchannel0",
2062 "filename": "unix:/var/lib/libvirt/qemu/seabios.rhel6.agent,server",
2063 "frontend-open": false
2066 "label": "charmonitor",
2067 "filename": "unix:/var/lib/libvirt/qemu/seabios.rhel6.monitor,server",
2068 "frontend-open": true
2071 "label": "charserial0",
2072 "filename": "pty:/dev/pts/2",
2073 "frontend-open": true
2078 EQMP
2081 .name = "query-chardev",
2082 .args_type = "",
2083 .mhandler.cmd_new = qmp_marshal_input_query_chardev,
2086 SQMP
2087 query-chardev-backends
2088 -------------
2090 List available character device backends.
2092 Each backend is represented by a json-object, the returned value is a json-array
2093 of all backends.
2095 Each json-object contains:
2097 - "name": backend name (json-string)
2099 Example:
2101 -> { "execute": "query-chardev-backends" }
2102 <- {
2103 "return":[
2105 "name":"udp"
2108 "name":"tcp"
2111 "name":"unix"
2114 "name":"spiceport"
2119 EQMP
2122 .name = "query-chardev-backends",
2123 .args_type = "",
2124 .mhandler.cmd_new = qmp_marshal_input_query_chardev_backends,
2127 SQMP
2128 query-block
2129 -----------
2131 Show the block devices.
2133 Each block device information is stored in a json-object and the returned value
2134 is a json-array of all devices.
2136 Each json-object contain the following:
2138 - "device": device name (json-string)
2139 - "type": device type (json-string)
2140 - deprecated, retained for backward compatibility
2141 - Possible values: "unknown"
2142 - "removable": true if the device is removable, false otherwise (json-bool)
2143 - "locked": true if the device is locked, false otherwise (json-bool)
2144 - "tray_open": only present if removable, true if the device has a tray,
2145 and it is open (json-bool)
2146 - "inserted": only present if the device is inserted, it is a json-object
2147 containing the following:
2148 - "file": device file name (json-string)
2149 - "ro": true if read-only, false otherwise (json-bool)
2150 - "drv": driver format name (json-string)
2151 - Possible values: "blkdebug", "bochs", "cloop", "dmg",
2152 "file", "file", "ftp", "ftps", "host_cdrom",
2153 "host_device", "http", "https",
2154 "nbd", "parallels", "qcow", "qcow2", "raw",
2155 "tftp", "vdi", "vmdk", "vpc", "vvfat"
2156 - "backing_file": backing file name (json-string, optional)
2157 - "backing_file_depth": number of files in the backing file chain (json-int)
2158 - "encrypted": true if encrypted, false otherwise (json-bool)
2159 - "bps": limit total bytes per second (json-int)
2160 - "bps_rd": limit read bytes per second (json-int)
2161 - "bps_wr": limit write bytes per second (json-int)
2162 - "iops": limit total I/O operations per second (json-int)
2163 - "iops_rd": limit read operations per second (json-int)
2164 - "iops_wr": limit write operations per second (json-int)
2165 - "bps_max": total max in bytes (json-int)
2166 - "bps_rd_max": read max in bytes (json-int)
2167 - "bps_wr_max": write max in bytes (json-int)
2168 - "iops_max": total I/O operations max (json-int)
2169 - "iops_rd_max": read I/O operations max (json-int)
2170 - "iops_wr_max": write I/O operations max (json-int)
2171 - "iops_size": I/O size when limiting by iops (json-int)
2172 - "detect_zeroes": detect and optimize zero writing (json-string)
2173 - Possible values: "off", "on", "unmap"
2174 - "write_threshold": write offset threshold in bytes, a event will be
2175 emitted if crossed. Zero if disabled (json-int)
2176 - "image": the detail of the image, it is a json-object containing
2177 the following:
2178 - "filename": image file name (json-string)
2179 - "format": image format (json-string)
2180 - "virtual-size": image capacity in bytes (json-int)
2181 - "dirty-flag": true if image is not cleanly closed, not present
2182 means clean (json-bool, optional)
2183 - "actual-size": actual size on disk in bytes of the image, not
2184 present when image does not support thin
2185 provision (json-int, optional)
2186 - "cluster-size": size of a cluster in bytes, not present if image
2187 format does not support it (json-int, optional)
2188 - "encrypted": true if the image is encrypted, not present means
2189 false or the image format does not support
2190 encryption (json-bool, optional)
2191 - "backing_file": backing file name, not present means no backing
2192 file is used or the image format does not
2193 support backing file chain
2194 (json-string, optional)
2195 - "full-backing-filename": full path of the backing file, not
2196 present if it equals backing_file or no
2197 backing file is used
2198 (json-string, optional)
2199 - "backing-filename-format": the format of the backing file, not
2200 present means unknown or no backing
2201 file (json-string, optional)
2202 - "snapshots": the internal snapshot info, it is an optional list
2203 of json-object containing the following:
2204 - "id": unique snapshot id (json-string)
2205 - "name": snapshot name (json-string)
2206 - "vm-state-size": size of the VM state in bytes (json-int)
2207 - "date-sec": UTC date of the snapshot in seconds (json-int)
2208 - "date-nsec": fractional part in nanoseconds to be used with
2209 date-sec (json-int)
2210 - "vm-clock-sec": VM clock relative to boot in seconds
2211 (json-int)
2212 - "vm-clock-nsec": fractional part in nanoseconds to be used
2213 with vm-clock-sec (json-int)
2214 - "backing-image": the detail of the backing image, it is an
2215 optional json-object only present when a
2216 backing image present for this image
2218 - "io-status": I/O operation status, only present if the device supports it
2219 and the VM is configured to stop on errors. It's always reset
2220 to "ok" when the "cont" command is issued (json_string, optional)
2221 - Possible values: "ok", "failed", "nospace"
2223 Example:
2225 -> { "execute": "query-block" }
2226 <- {
2227 "return":[
2229 "io-status": "ok",
2230 "device":"ide0-hd0",
2231 "locked":false,
2232 "removable":false,
2233 "inserted":{
2234 "ro":false,
2235 "drv":"qcow2",
2236 "encrypted":false,
2237 "file":"disks/test.qcow2",
2238 "backing_file_depth":1,
2239 "bps":1000000,
2240 "bps_rd":0,
2241 "bps_wr":0,
2242 "iops":1000000,
2243 "iops_rd":0,
2244 "iops_wr":0,
2245 "bps_max": 8000000,
2246 "bps_rd_max": 0,
2247 "bps_wr_max": 0,
2248 "iops_max": 0,
2249 "iops_rd_max": 0,
2250 "iops_wr_max": 0,
2251 "iops_size": 0,
2252 "detect_zeroes": "on",
2253 "write_threshold": 0,
2254 "image":{
2255 "filename":"disks/test.qcow2",
2256 "format":"qcow2",
2257 "virtual-size":2048000,
2258 "backing_file":"base.qcow2",
2259 "full-backing-filename":"disks/base.qcow2",
2260 "backing-filename-format:"qcow2",
2261 "snapshots":[
2263 "id": "1",
2264 "name": "snapshot1",
2265 "vm-state-size": 0,
2266 "date-sec": 10000200,
2267 "date-nsec": 12,
2268 "vm-clock-sec": 206,
2269 "vm-clock-nsec": 30
2272 "backing-image":{
2273 "filename":"disks/base.qcow2",
2274 "format":"qcow2",
2275 "virtual-size":2048000
2279 "type":"unknown"
2282 "io-status": "ok",
2283 "device":"ide1-cd0",
2284 "locked":false,
2285 "removable":true,
2286 "type":"unknown"
2289 "device":"floppy0",
2290 "locked":false,
2291 "removable":true,
2292 "type":"unknown"
2295 "device":"sd0",
2296 "locked":false,
2297 "removable":true,
2298 "type":"unknown"
2303 EQMP
2306 .name = "query-block",
2307 .args_type = "",
2308 .mhandler.cmd_new = qmp_marshal_input_query_block,
2311 SQMP
2312 query-blockstats
2313 ----------------
2315 Show block device statistics.
2317 Each device statistic information is stored in a json-object and the returned
2318 value is a json-array of all devices.
2320 Each json-object contain the following:
2322 - "device": device name (json-string)
2323 - "stats": A json-object with the statistics information, it contains:
2324 - "rd_bytes": bytes read (json-int)
2325 - "wr_bytes": bytes written (json-int)
2326 - "rd_operations": read operations (json-int)
2327 - "wr_operations": write operations (json-int)
2328 - "flush_operations": cache flush operations (json-int)
2329 - "wr_total_time_ns": total time spend on writes in nano-seconds (json-int)
2330 - "rd_total_time_ns": total time spend on reads in nano-seconds (json-int)
2331 - "flush_total_time_ns": total time spend on cache flushes in nano-seconds (json-int)
2332 - "wr_highest_offset": Highest offset of a sector written since the
2333 BlockDriverState has been opened (json-int)
2334 - "rd_merged": number of read requests that have been merged into
2335 another request (json-int)
2336 - "wr_merged": number of write requests that have been merged into
2337 another request (json-int)
2338 - "parent": Contains recursively the statistics of the underlying
2339 protocol (e.g. the host file for a qcow2 image). If there is
2340 no underlying protocol, this field is omitted
2341 (json-object, optional)
2343 Example:
2345 -> { "execute": "query-blockstats" }
2346 <- {
2347 "return":[
2349 "device":"ide0-hd0",
2350 "parent":{
2351 "stats":{
2352 "wr_highest_offset":3686448128,
2353 "wr_bytes":9786368,
2354 "wr_operations":751,
2355 "rd_bytes":122567168,
2356 "rd_operations":36772
2357 "wr_total_times_ns":313253456
2358 "rd_total_times_ns":3465673657
2359 "flush_total_times_ns":49653
2360 "flush_operations":61,
2361 "rd_merged":0,
2362 "wr_merged":0
2365 "stats":{
2366 "wr_highest_offset":2821110784,
2367 "wr_bytes":9786368,
2368 "wr_operations":692,
2369 "rd_bytes":122739200,
2370 "rd_operations":36604
2371 "flush_operations":51,
2372 "wr_total_times_ns":313253456
2373 "rd_total_times_ns":3465673657
2374 "flush_total_times_ns":49653,
2375 "rd_merged":0,
2376 "wr_merged":0
2380 "device":"ide1-cd0",
2381 "stats":{
2382 "wr_highest_offset":0,
2383 "wr_bytes":0,
2384 "wr_operations":0,
2385 "rd_bytes":0,
2386 "rd_operations":0
2387 "flush_operations":0,
2388 "wr_total_times_ns":0
2389 "rd_total_times_ns":0
2390 "flush_total_times_ns":0,
2391 "rd_merged":0,
2392 "wr_merged":0
2396 "device":"floppy0",
2397 "stats":{
2398 "wr_highest_offset":0,
2399 "wr_bytes":0,
2400 "wr_operations":0,
2401 "rd_bytes":0,
2402 "rd_operations":0
2403 "flush_operations":0,
2404 "wr_total_times_ns":0
2405 "rd_total_times_ns":0
2406 "flush_total_times_ns":0,
2407 "rd_merged":0,
2408 "wr_merged":0
2412 "device":"sd0",
2413 "stats":{
2414 "wr_highest_offset":0,
2415 "wr_bytes":0,
2416 "wr_operations":0,
2417 "rd_bytes":0,
2418 "rd_operations":0
2419 "flush_operations":0,
2420 "wr_total_times_ns":0
2421 "rd_total_times_ns":0
2422 "flush_total_times_ns":0,
2423 "rd_merged":0,
2424 "wr_merged":0
2430 EQMP
2433 .name = "query-blockstats",
2434 .args_type = "query-nodes:b?",
2435 .mhandler.cmd_new = qmp_marshal_input_query_blockstats,
2438 SQMP
2439 query-cpus
2440 ----------
2442 Show CPU information.
2444 Return a json-array. Each CPU is represented by a json-object, which contains:
2446 - "CPU": CPU index (json-int)
2447 - "current": true if this is the current CPU, false otherwise (json-bool)
2448 - "halted": true if the cpu is halted, false otherwise (json-bool)
2449 - Current program counter. The key's name depends on the architecture:
2450 "pc": i386/x86_64 (json-int)
2451 "nip": PPC (json-int)
2452 "pc" and "npc": sparc (json-int)
2453 "PC": mips (json-int)
2454 - "thread_id": ID of the underlying host thread (json-int)
2456 Example:
2458 -> { "execute": "query-cpus" }
2459 <- {
2460 "return":[
2462 "CPU":0,
2463 "current":true,
2464 "halted":false,
2465 "pc":3227107138
2466 "thread_id":3134
2469 "CPU":1,
2470 "current":false,
2471 "halted":true,
2472 "pc":7108165
2473 "thread_id":3135
2478 EQMP
2481 .name = "query-cpus",
2482 .args_type = "",
2483 .mhandler.cmd_new = qmp_marshal_input_query_cpus,
2486 SQMP
2487 query-iothreads
2488 ---------------
2490 Returns a list of information about each iothread.
2492 Note this list excludes the QEMU main loop thread, which is not declared
2493 using the -object iothread command-line option. It is always the main thread
2494 of the process.
2496 Return a json-array. Each iothread is represented by a json-object, which contains:
2498 - "id": name of iothread (json-str)
2499 - "thread-id": ID of the underlying host thread (json-int)
2501 Example:
2503 -> { "execute": "query-iothreads" }
2504 <- {
2505 "return":[
2507 "id":"iothread0",
2508 "thread-id":3134
2511 "id":"iothread1",
2512 "thread-id":3135
2517 EQMP
2520 .name = "query-iothreads",
2521 .args_type = "",
2522 .mhandler.cmd_new = qmp_marshal_input_query_iothreads,
2525 SQMP
2526 query-pci
2527 ---------
2529 PCI buses and devices information.
2531 The returned value is a json-array of all buses. Each bus is represented by
2532 a json-object, which has a key with a json-array of all PCI devices attached
2533 to it. Each device is represented by a json-object.
2535 The bus json-object contains the following:
2537 - "bus": bus number (json-int)
2538 - "devices": a json-array of json-objects, each json-object represents a
2539 PCI device
2541 The PCI device json-object contains the following:
2543 - "bus": identical to the parent's bus number (json-int)
2544 - "slot": slot number (json-int)
2545 - "function": function number (json-int)
2546 - "class_info": a json-object containing:
2547 - "desc": device class description (json-string, optional)
2548 - "class": device class number (json-int)
2549 - "id": a json-object containing:
2550 - "device": device ID (json-int)
2551 - "vendor": vendor ID (json-int)
2552 - "irq": device's IRQ if assigned (json-int, optional)
2553 - "qdev_id": qdev id string (json-string)
2554 - "pci_bridge": It's a json-object, only present if this device is a
2555 PCI bridge, contains:
2556 - "bus": bus number (json-int)
2557 - "secondary": secondary bus number (json-int)
2558 - "subordinate": subordinate bus number (json-int)
2559 - "io_range": I/O memory range information, a json-object with the
2560 following members:
2561 - "base": base address, in bytes (json-int)
2562 - "limit": limit address, in bytes (json-int)
2563 - "memory_range": memory range information, a json-object with the
2564 following members:
2565 - "base": base address, in bytes (json-int)
2566 - "limit": limit address, in bytes (json-int)
2567 - "prefetchable_range": Prefetchable memory range information, a
2568 json-object with the following members:
2569 - "base": base address, in bytes (json-int)
2570 - "limit": limit address, in bytes (json-int)
2571 - "devices": a json-array of PCI devices if there's any attached, each
2572 each element is represented by a json-object, which contains
2573 the same members of the 'PCI device json-object' described
2574 above (optional)
2575 - "regions": a json-array of json-objects, each json-object represents a
2576 memory region of this device
2578 The memory range json-object contains the following:
2580 - "base": base memory address (json-int)
2581 - "limit": limit value (json-int)
2583 The region json-object can be an I/O region or a memory region, an I/O region
2584 json-object contains the following:
2586 - "type": "io" (json-string, fixed)
2587 - "bar": BAR number (json-int)
2588 - "address": memory address (json-int)
2589 - "size": memory size (json-int)
2591 A memory region json-object contains the following:
2593 - "type": "memory" (json-string, fixed)
2594 - "bar": BAR number (json-int)
2595 - "address": memory address (json-int)
2596 - "size": memory size (json-int)
2597 - "mem_type_64": true or false (json-bool)
2598 - "prefetch": true or false (json-bool)
2600 Example:
2602 -> { "execute": "query-pci" }
2603 <- {
2604 "return":[
2606 "bus":0,
2607 "devices":[
2609 "bus":0,
2610 "qdev_id":"",
2611 "slot":0,
2612 "class_info":{
2613 "class":1536,
2614 "desc":"Host bridge"
2616 "id":{
2617 "device":32902,
2618 "vendor":4663
2620 "function":0,
2621 "regions":[
2626 "bus":0,
2627 "qdev_id":"",
2628 "slot":1,
2629 "class_info":{
2630 "class":1537,
2631 "desc":"ISA bridge"
2633 "id":{
2634 "device":32902,
2635 "vendor":28672
2637 "function":0,
2638 "regions":[
2643 "bus":0,
2644 "qdev_id":"",
2645 "slot":1,
2646 "class_info":{
2647 "class":257,
2648 "desc":"IDE controller"
2650 "id":{
2651 "device":32902,
2652 "vendor":28688
2654 "function":1,
2655 "regions":[
2657 "bar":4,
2658 "size":16,
2659 "address":49152,
2660 "type":"io"
2665 "bus":0,
2666 "qdev_id":"",
2667 "slot":2,
2668 "class_info":{
2669 "class":768,
2670 "desc":"VGA controller"
2672 "id":{
2673 "device":4115,
2674 "vendor":184
2676 "function":0,
2677 "regions":[
2679 "prefetch":true,
2680 "mem_type_64":false,
2681 "bar":0,
2682 "size":33554432,
2683 "address":4026531840,
2684 "type":"memory"
2687 "prefetch":false,
2688 "mem_type_64":false,
2689 "bar":1,
2690 "size":4096,
2691 "address":4060086272,
2692 "type":"memory"
2695 "prefetch":false,
2696 "mem_type_64":false,
2697 "bar":6,
2698 "size":65536,
2699 "address":-1,
2700 "type":"memory"
2705 "bus":0,
2706 "qdev_id":"",
2707 "irq":11,
2708 "slot":4,
2709 "class_info":{
2710 "class":1280,
2711 "desc":"RAM controller"
2713 "id":{
2714 "device":6900,
2715 "vendor":4098
2717 "function":0,
2718 "regions":[
2720 "bar":0,
2721 "size":32,
2722 "address":49280,
2723 "type":"io"
2732 Note: This example has been shortened as the real response is too long.
2734 EQMP
2737 .name = "query-pci",
2738 .args_type = "",
2739 .mhandler.cmd_new = qmp_marshal_input_query_pci,
2742 SQMP
2743 query-kvm
2744 ---------
2746 Show KVM information.
2748 Return a json-object with the following information:
2750 - "enabled": true if KVM support is enabled, false otherwise (json-bool)
2751 - "present": true if QEMU has KVM support, false otherwise (json-bool)
2753 Example:
2755 -> { "execute": "query-kvm" }
2756 <- { "return": { "enabled": true, "present": true } }
2758 EQMP
2761 .name = "query-kvm",
2762 .args_type = "",
2763 .mhandler.cmd_new = qmp_marshal_input_query_kvm,
2766 SQMP
2767 query-status
2768 ------------
2770 Return a json-object with the following information:
2772 - "running": true if the VM is running, or false if it is paused (json-bool)
2773 - "singlestep": true if the VM is in single step mode,
2774 false otherwise (json-bool)
2775 - "status": one of the following values (json-string)
2776 "debug" - QEMU is running on a debugger
2777 "inmigrate" - guest is paused waiting for an incoming migration
2778 "internal-error" - An internal error that prevents further guest
2779 execution has occurred
2780 "io-error" - the last IOP has failed and the device is configured
2781 to pause on I/O errors
2782 "paused" - guest has been paused via the 'stop' command
2783 "postmigrate" - guest is paused following a successful 'migrate'
2784 "prelaunch" - QEMU was started with -S and guest has not started
2785 "finish-migrate" - guest is paused to finish the migration process
2786 "restore-vm" - guest is paused to restore VM state
2787 "running" - guest is actively running
2788 "save-vm" - guest is paused to save the VM state
2789 "shutdown" - guest is shut down (and -no-shutdown is in use)
2790 "watchdog" - the watchdog action is configured to pause and
2791 has been triggered
2793 Example:
2795 -> { "execute": "query-status" }
2796 <- { "return": { "running": true, "singlestep": false, "status": "running" } }
2798 EQMP
2801 .name = "query-status",
2802 .args_type = "",
2803 .mhandler.cmd_new = qmp_marshal_input_query_status,
2806 SQMP
2807 query-mice
2808 ----------
2810 Show VM mice information.
2812 Each mouse is represented by a json-object, the returned value is a json-array
2813 of all mice.
2815 The mouse json-object contains the following:
2817 - "name": mouse's name (json-string)
2818 - "index": mouse's index (json-int)
2819 - "current": true if this mouse is receiving events, false otherwise (json-bool)
2820 - "absolute": true if the mouse generates absolute input events (json-bool)
2822 Example:
2824 -> { "execute": "query-mice" }
2825 <- {
2826 "return":[
2828 "name":"QEMU Microsoft Mouse",
2829 "index":0,
2830 "current":false,
2831 "absolute":false
2834 "name":"QEMU PS/2 Mouse",
2835 "index":1,
2836 "current":true,
2837 "absolute":true
2842 EQMP
2845 .name = "query-mice",
2846 .args_type = "",
2847 .mhandler.cmd_new = qmp_marshal_input_query_mice,
2850 SQMP
2851 query-vnc
2852 ---------
2854 Show VNC server information.
2856 Return a json-object with server information. Connected clients are returned
2857 as a json-array of json-objects.
2859 The main json-object contains the following:
2861 - "enabled": true or false (json-bool)
2862 - "host": server's IP address (json-string)
2863 - "family": address family (json-string)
2864 - Possible values: "ipv4", "ipv6", "unix", "unknown"
2865 - "service": server's port number (json-string)
2866 - "auth": authentication method (json-string)
2867 - Possible values: "invalid", "none", "ra2", "ra2ne", "sasl", "tight",
2868 "tls", "ultra", "unknown", "vencrypt", "vencrypt",
2869 "vencrypt+plain", "vencrypt+tls+none",
2870 "vencrypt+tls+plain", "vencrypt+tls+sasl",
2871 "vencrypt+tls+vnc", "vencrypt+x509+none",
2872 "vencrypt+x509+plain", "vencrypt+x509+sasl",
2873 "vencrypt+x509+vnc", "vnc"
2874 - "clients": a json-array of all connected clients
2876 Clients are described by a json-object, each one contain the following:
2878 - "host": client's IP address (json-string)
2879 - "family": address family (json-string)
2880 - Possible values: "ipv4", "ipv6", "unix", "unknown"
2881 - "service": client's port number (json-string)
2882 - "x509_dname": TLS dname (json-string, optional)
2883 - "sasl_username": SASL username (json-string, optional)
2885 Example:
2887 -> { "execute": "query-vnc" }
2888 <- {
2889 "return":{
2890 "enabled":true,
2891 "host":"0.0.0.0",
2892 "service":"50402",
2893 "auth":"vnc",
2894 "family":"ipv4",
2895 "clients":[
2897 "host":"127.0.0.1",
2898 "service":"50401",
2899 "family":"ipv4"
2905 EQMP
2908 .name = "query-vnc",
2909 .args_type = "",
2910 .mhandler.cmd_new = qmp_marshal_input_query_vnc,
2913 .name = "query-vnc-servers",
2914 .args_type = "",
2915 .mhandler.cmd_new = qmp_marshal_input_query_vnc_servers,
2918 SQMP
2919 query-spice
2920 -----------
2922 Show SPICE server information.
2924 Return a json-object with server information. Connected clients are returned
2925 as a json-array of json-objects.
2927 The main json-object contains the following:
2929 - "enabled": true or false (json-bool)
2930 - "host": server's IP address (json-string)
2931 - "port": server's port number (json-int, optional)
2932 - "tls-port": server's port number (json-int, optional)
2933 - "auth": authentication method (json-string)
2934 - Possible values: "none", "spice"
2935 - "channels": a json-array of all active channels clients
2937 Channels are described by a json-object, each one contain the following:
2939 - "host": client's IP address (json-string)
2940 - "family": address family (json-string)
2941 - Possible values: "ipv4", "ipv6", "unix", "unknown"
2942 - "port": client's port number (json-string)
2943 - "connection-id": spice connection id. All channels with the same id
2944 belong to the same spice session (json-int)
2945 - "channel-type": channel type. "1" is the main control channel, filter for
2946 this one if you want track spice sessions only (json-int)
2947 - "channel-id": channel id. Usually "0", might be different needed when
2948 multiple channels of the same type exist, such as multiple
2949 display channels in a multihead setup (json-int)
2950 - "tls": whether the channel is encrypted (json-bool)
2952 Example:
2954 -> { "execute": "query-spice" }
2955 <- {
2956 "return": {
2957 "enabled": true,
2958 "auth": "spice",
2959 "port": 5920,
2960 "tls-port": 5921,
2961 "host": "0.0.0.0",
2962 "channels": [
2964 "port": "54924",
2965 "family": "ipv4",
2966 "channel-type": 1,
2967 "connection-id": 1804289383,
2968 "host": "127.0.0.1",
2969 "channel-id": 0,
2970 "tls": true
2973 "port": "36710",
2974 "family": "ipv4",
2975 "channel-type": 4,
2976 "connection-id": 1804289383,
2977 "host": "127.0.0.1",
2978 "channel-id": 0,
2979 "tls": false
2981 [ ... more channels follow ... ]
2986 EQMP
2988 #if defined(CONFIG_SPICE)
2990 .name = "query-spice",
2991 .args_type = "",
2992 .mhandler.cmd_new = qmp_marshal_input_query_spice,
2994 #endif
2996 SQMP
2997 query-name
2998 ----------
3000 Show VM name.
3002 Return a json-object with the following information:
3004 - "name": VM's name (json-string, optional)
3006 Example:
3008 -> { "execute": "query-name" }
3009 <- { "return": { "name": "qemu-name" } }
3011 EQMP
3014 .name = "query-name",
3015 .args_type = "",
3016 .mhandler.cmd_new = qmp_marshal_input_query_name,
3019 SQMP
3020 query-uuid
3021 ----------
3023 Show VM UUID.
3025 Return a json-object with the following information:
3027 - "UUID": Universally Unique Identifier (json-string)
3029 Example:
3031 -> { "execute": "query-uuid" }
3032 <- { "return": { "UUID": "550e8400-e29b-41d4-a716-446655440000" } }
3034 EQMP
3037 .name = "query-uuid",
3038 .args_type = "",
3039 .mhandler.cmd_new = qmp_marshal_input_query_uuid,
3042 SQMP
3043 query-command-line-options
3044 --------------------------
3046 Show command line option schema.
3048 Return a json-array of command line option schema for all options (or for
3049 the given option), returning an error if the given option doesn't exist.
3051 Each array entry contains the following:
3053 - "option": option name (json-string)
3054 - "parameters": a json-array describes all parameters of the option:
3055 - "name": parameter name (json-string)
3056 - "type": parameter type (one of 'string', 'boolean', 'number',
3057 or 'size')
3058 - "help": human readable description of the parameter
3059 (json-string, optional)
3060 - "default": default value string for the parameter
3061 (json-string, optional)
3063 Example:
3065 -> { "execute": "query-command-line-options", "arguments": { "option": "option-rom" } }
3066 <- { "return": [
3068 "parameters": [
3070 "name": "romfile",
3071 "type": "string"
3074 "name": "bootindex",
3075 "type": "number"
3078 "option": "option-rom"
3083 EQMP
3086 .name = "query-command-line-options",
3087 .args_type = "option:s?",
3088 .mhandler.cmd_new = qmp_marshal_input_query_command_line_options,
3091 SQMP
3092 query-migrate
3093 -------------
3095 Migration status.
3097 Return a json-object. If migration is active there will be another json-object
3098 with RAM migration status and if block migration is active another one with
3099 block migration status.
3101 The main json-object contains the following:
3103 - "status": migration status (json-string)
3104 - Possible values: "setup", "active", "completed", "failed", "cancelled"
3105 - "total-time": total amount of ms since migration started. If
3106 migration has ended, it returns the total migration
3107 time (json-int)
3108 - "setup-time" amount of setup time in milliseconds _before_ the
3109 iterations begin but _after_ the QMP command is issued.
3110 This is designed to provide an accounting of any activities
3111 (such as RDMA pinning) which may be expensive, but do not
3112 actually occur during the iterative migration rounds
3113 themselves. (json-int)
3114 - "downtime": only present when migration has finished correctly
3115 total amount in ms for downtime that happened (json-int)
3116 - "expected-downtime": only present while migration is active
3117 total amount in ms for downtime that was calculated on
3118 the last bitmap round (json-int)
3119 - "ram": only present if "status" is "active", it is a json-object with the
3120 following RAM information:
3121 - "transferred": amount transferred in bytes (json-int)
3122 - "remaining": amount remaining to transfer in bytes (json-int)
3123 - "total": total amount of memory in bytes (json-int)
3124 - "duplicate": number of pages filled entirely with the same
3125 byte (json-int)
3126 These are sent over the wire much more efficiently.
3127 - "skipped": number of skipped zero pages (json-int)
3128 - "normal" : number of whole pages transferred. I.e. they
3129 were not sent as duplicate or xbzrle pages (json-int)
3130 - "normal-bytes" : number of bytes transferred in whole
3131 pages. This is just normal pages times size of one page,
3132 but this way upper levels don't need to care about page
3133 size (json-int)
3134 - "dirty-sync-count": times that dirty ram was synchronized (json-int)
3135 - "disk": only present if "status" is "active" and it is a block migration,
3136 it is a json-object with the following disk information:
3137 - "transferred": amount transferred in bytes (json-int)
3138 - "remaining": amount remaining to transfer in bytes json-int)
3139 - "total": total disk size in bytes (json-int)
3140 - "xbzrle-cache": only present if XBZRLE is active.
3141 It is a json-object with the following XBZRLE information:
3142 - "cache-size": XBZRLE cache size in bytes
3143 - "bytes": number of bytes transferred for XBZRLE compressed pages
3144 - "pages": number of XBZRLE compressed pages
3145 - "cache-miss": number of XBRZRLE page cache misses
3146 - "cache-miss-rate": rate of XBRZRLE page cache misses
3147 - "overflow": number of times XBZRLE overflows. This means
3148 that the XBZRLE encoding was bigger than just sent the
3149 whole page, and then we sent the whole page instead (as as
3150 normal page).
3152 Examples:
3154 1. Before the first migration
3156 -> { "execute": "query-migrate" }
3157 <- { "return": {} }
3159 2. Migration is done and has succeeded
3161 -> { "execute": "query-migrate" }
3162 <- { "return": {
3163 "status": "completed",
3164 "ram":{
3165 "transferred":123,
3166 "remaining":123,
3167 "total":246,
3168 "total-time":12345,
3169 "setup-time":12345,
3170 "downtime":12345,
3171 "duplicate":123,
3172 "normal":123,
3173 "normal-bytes":123456,
3174 "dirty-sync-count":15
3179 3. Migration is done and has failed
3181 -> { "execute": "query-migrate" }
3182 <- { "return": { "status": "failed" } }
3184 4. Migration is being performed and is not a block migration:
3186 -> { "execute": "query-migrate" }
3187 <- {
3188 "return":{
3189 "status":"active",
3190 "ram":{
3191 "transferred":123,
3192 "remaining":123,
3193 "total":246,
3194 "total-time":12345,
3195 "setup-time":12345,
3196 "expected-downtime":12345,
3197 "duplicate":123,
3198 "normal":123,
3199 "normal-bytes":123456,
3200 "dirty-sync-count":15
3205 5. Migration is being performed and is a block migration:
3207 -> { "execute": "query-migrate" }
3208 <- {
3209 "return":{
3210 "status":"active",
3211 "ram":{
3212 "total":1057024,
3213 "remaining":1053304,
3214 "transferred":3720,
3215 "total-time":12345,
3216 "setup-time":12345,
3217 "expected-downtime":12345,
3218 "duplicate":123,
3219 "normal":123,
3220 "normal-bytes":123456,
3221 "dirty-sync-count":15
3223 "disk":{
3224 "total":20971520,
3225 "remaining":20880384,
3226 "transferred":91136
3231 6. Migration is being performed and XBZRLE is active:
3233 -> { "execute": "query-migrate" }
3234 <- {
3235 "return":{
3236 "status":"active",
3237 "capabilities" : [ { "capability": "xbzrle", "state" : true } ],
3238 "ram":{
3239 "total":1057024,
3240 "remaining":1053304,
3241 "transferred":3720,
3242 "total-time":12345,
3243 "setup-time":12345,
3244 "expected-downtime":12345,
3245 "duplicate":10,
3246 "normal":3333,
3247 "normal-bytes":3412992,
3248 "dirty-sync-count":15
3250 "xbzrle-cache":{
3251 "cache-size":67108864,
3252 "bytes":20971520,
3253 "pages":2444343,
3254 "cache-miss":2244,
3255 "cache-miss-rate":0.123,
3256 "overflow":34434
3261 EQMP
3264 .name = "query-migrate",
3265 .args_type = "",
3266 .mhandler.cmd_new = qmp_marshal_input_query_migrate,
3269 SQMP
3270 migrate-set-capabilities
3271 ------------------------
3273 Enable/Disable migration capabilities
3275 - "xbzrle": XBZRLE support
3276 - "rdma-pin-all": pin all pages when using RDMA during migration
3277 - "auto-converge": throttle down guest to help convergence of migration
3278 - "zero-blocks": compress zero blocks during block migration
3280 Arguments:
3282 Example:
3284 -> { "execute": "migrate-set-capabilities" , "arguments":
3285 { "capabilities": [ { "capability": "xbzrle", "state": true } ] } }
3287 EQMP
3290 .name = "migrate-set-capabilities",
3291 .args_type = "capabilities:O",
3292 .params = "capability:s,state:b",
3293 .mhandler.cmd_new = qmp_marshal_input_migrate_set_capabilities,
3295 SQMP
3296 query-migrate-capabilities
3297 --------------------------
3299 Query current migration capabilities
3301 - "capabilities": migration capabilities state
3302 - "xbzrle" : XBZRLE state (json-bool)
3303 - "rdma-pin-all" : RDMA Pin Page state (json-bool)
3304 - "auto-converge" : Auto Converge state (json-bool)
3305 - "zero-blocks" : Zero Blocks state (json-bool)
3307 Arguments:
3309 Example:
3311 -> { "execute": "query-migrate-capabilities" }
3312 <- { "return": [ { "state": false, "capability": "xbzrle" } ] }
3314 EQMP
3317 .name = "query-migrate-capabilities",
3318 .args_type = "",
3319 .mhandler.cmd_new = qmp_marshal_input_query_migrate_capabilities,
3322 SQMP
3323 query-balloon
3324 -------------
3326 Show balloon information.
3328 Make an asynchronous request for balloon info. When the request completes a
3329 json-object will be returned containing the following data:
3331 - "actual": current balloon value in bytes (json-int)
3333 Example:
3335 -> { "execute": "query-balloon" }
3336 <- {
3337 "return":{
3338 "actual":1073741824,
3342 EQMP
3345 .name = "query-balloon",
3346 .args_type = "",
3347 .mhandler.cmd_new = qmp_marshal_input_query_balloon,
3351 .name = "query-block-jobs",
3352 .args_type = "",
3353 .mhandler.cmd_new = qmp_marshal_input_query_block_jobs,
3357 .name = "qom-list",
3358 .args_type = "path:s",
3359 .mhandler.cmd_new = qmp_marshal_input_qom_list,
3363 .name = "qom-set",
3364 .args_type = "path:s,property:s,value:q",
3365 .mhandler.cmd_new = qmp_qom_set,
3369 .name = "qom-get",
3370 .args_type = "path:s,property:s",
3371 .mhandler.cmd_new = qmp_qom_get,
3375 .name = "nbd-server-start",
3376 .args_type = "addr:q",
3377 .mhandler.cmd_new = qmp_marshal_input_nbd_server_start,
3380 .name = "nbd-server-add",
3381 .args_type = "device:B,writable:b?",
3382 .mhandler.cmd_new = qmp_marshal_input_nbd_server_add,
3385 .name = "nbd-server-stop",
3386 .args_type = "",
3387 .mhandler.cmd_new = qmp_marshal_input_nbd_server_stop,
3391 .name = "change-vnc-password",
3392 .args_type = "password:s",
3393 .mhandler.cmd_new = qmp_marshal_input_change_vnc_password,
3396 .name = "qom-list-types",
3397 .args_type = "implements:s?,abstract:b?",
3398 .mhandler.cmd_new = qmp_marshal_input_qom_list_types,
3402 .name = "device-list-properties",
3403 .args_type = "typename:s",
3404 .mhandler.cmd_new = qmp_marshal_input_device_list_properties,
3408 .name = "query-machines",
3409 .args_type = "",
3410 .mhandler.cmd_new = qmp_marshal_input_query_machines,
3414 .name = "query-cpu-definitions",
3415 .args_type = "",
3416 .mhandler.cmd_new = qmp_marshal_input_query_cpu_definitions,
3420 .name = "query-target",
3421 .args_type = "",
3422 .mhandler.cmd_new = qmp_marshal_input_query_target,
3426 .name = "query-tpm",
3427 .args_type = "",
3428 .mhandler.cmd_new = qmp_marshal_input_query_tpm,
3431 SQMP
3432 query-tpm
3433 ---------
3435 Return information about the TPM device.
3437 Arguments: None
3439 Example:
3441 -> { "execute": "query-tpm" }
3442 <- { "return":
3444 { "model": "tpm-tis",
3445 "options":
3446 { "type": "passthrough",
3447 "data":
3448 { "cancel-path": "/sys/class/misc/tpm0/device/cancel",
3449 "path": "/dev/tpm0"
3452 "id": "tpm0"
3457 EQMP
3460 .name = "query-tpm-models",
3461 .args_type = "",
3462 .mhandler.cmd_new = qmp_marshal_input_query_tpm_models,
3465 SQMP
3466 query-tpm-models
3467 ----------------
3469 Return a list of supported TPM models.
3471 Arguments: None
3473 Example:
3475 -> { "execute": "query-tpm-models" }
3476 <- { "return": [ "tpm-tis" ] }
3478 EQMP
3481 .name = "query-tpm-types",
3482 .args_type = "",
3483 .mhandler.cmd_new = qmp_marshal_input_query_tpm_types,
3486 SQMP
3487 query-tpm-types
3488 ---------------
3490 Return a list of supported TPM types.
3492 Arguments: None
3494 Example:
3496 -> { "execute": "query-tpm-types" }
3497 <- { "return": [ "passthrough" ] }
3499 EQMP
3502 .name = "chardev-add",
3503 .args_type = "id:s,backend:q",
3504 .mhandler.cmd_new = qmp_marshal_input_chardev_add,
3507 SQMP
3508 chardev-add
3509 ----------------
3511 Add a chardev.
3513 Arguments:
3515 - "id": the chardev's ID, must be unique (json-string)
3516 - "backend": chardev backend type + parameters
3518 Examples:
3520 -> { "execute" : "chardev-add",
3521 "arguments" : { "id" : "foo",
3522 "backend" : { "type" : "null", "data" : {} } } }
3523 <- { "return": {} }
3525 -> { "execute" : "chardev-add",
3526 "arguments" : { "id" : "bar",
3527 "backend" : { "type" : "file",
3528 "data" : { "out" : "/tmp/bar.log" } } } }
3529 <- { "return": {} }
3531 -> { "execute" : "chardev-add",
3532 "arguments" : { "id" : "baz",
3533 "backend" : { "type" : "pty", "data" : {} } } }
3534 <- { "return": { "pty" : "/dev/pty/42" } }
3536 EQMP
3539 .name = "chardev-remove",
3540 .args_type = "id:s",
3541 .mhandler.cmd_new = qmp_marshal_input_chardev_remove,
3545 SQMP
3546 chardev-remove
3547 --------------
3549 Remove a chardev.
3551 Arguments:
3553 - "id": the chardev's ID, must exist and not be in use (json-string)
3555 Example:
3557 -> { "execute": "chardev-remove", "arguments": { "id" : "foo" } }
3558 <- { "return": {} }
3560 EQMP
3562 .name = "query-rx-filter",
3563 .args_type = "name:s?",
3564 .mhandler.cmd_new = qmp_marshal_input_query_rx_filter,
3567 SQMP
3568 query-rx-filter
3569 ---------------
3571 Show rx-filter information.
3573 Returns a json-array of rx-filter information for all NICs (or for the
3574 given NIC), returning an error if the given NIC doesn't exist, or
3575 given NIC doesn't support rx-filter querying, or given net client
3576 isn't a NIC.
3578 The query will clear the event notification flag of each NIC, then qemu
3579 will start to emit event to QMP monitor.
3581 Each array entry contains the following:
3583 - "name": net client name (json-string)
3584 - "promiscuous": promiscuous mode is enabled (json-bool)
3585 - "multicast": multicast receive state (one of 'normal', 'none', 'all')
3586 - "unicast": unicast receive state (one of 'normal', 'none', 'all')
3587 - "vlan": vlan receive state (one of 'normal', 'none', 'all') (Since 2.0)
3588 - "broadcast-allowed": allow to receive broadcast (json-bool)
3589 - "multicast-overflow": multicast table is overflowed (json-bool)
3590 - "unicast-overflow": unicast table is overflowed (json-bool)
3591 - "main-mac": main macaddr string (json-string)
3592 - "vlan-table": a json-array of active vlan id
3593 - "unicast-table": a json-array of unicast macaddr string
3594 - "multicast-table": a json-array of multicast macaddr string
3596 Example:
3598 -> { "execute": "query-rx-filter", "arguments": { "name": "vnet0" } }
3599 <- { "return": [
3601 "promiscuous": true,
3602 "name": "vnet0",
3603 "main-mac": "52:54:00:12:34:56",
3604 "unicast": "normal",
3605 "vlan": "normal",
3606 "vlan-table": [
3610 "unicast-table": [
3612 "multicast": "normal",
3613 "multicast-overflow": false,
3614 "unicast-overflow": false,
3615 "multicast-table": [
3616 "01:00:5e:00:00:01",
3617 "33:33:00:00:00:01",
3618 "33:33:ff:12:34:56"
3620 "broadcast-allowed": false
3625 EQMP
3628 .name = "blockdev-add",
3629 .args_type = "options:q",
3630 .mhandler.cmd_new = qmp_marshal_input_blockdev_add,
3633 SQMP
3634 blockdev-add
3635 ------------
3637 Add a block device.
3639 Arguments:
3641 - "options": block driver options
3643 Example (1):
3645 -> { "execute": "blockdev-add",
3646 "arguments": { "options" : { "driver": "qcow2",
3647 "file": { "driver": "file",
3648 "filename": "test.qcow2" } } } }
3649 <- { "return": {} }
3651 Example (2):
3653 -> { "execute": "blockdev-add",
3654 "arguments": {
3655 "options": {
3656 "driver": "qcow2",
3657 "id": "my_disk",
3658 "discard": "unmap",
3659 "cache": {
3660 "direct": true,
3661 "writeback": true
3663 "file": {
3664 "driver": "file",
3665 "filename": "/tmp/test.qcow2"
3667 "backing": {
3668 "driver": "raw",
3669 "file": {
3670 "driver": "file",
3671 "filename": "/dev/fdset/4"
3678 <- { "return": {} }
3680 EQMP
3683 .name = "query-named-block-nodes",
3684 .args_type = "",
3685 .mhandler.cmd_new = qmp_marshal_input_query_named_block_nodes,
3688 SQMP
3689 @query-named-block-nodes
3690 ------------------------
3692 Return a list of BlockDeviceInfo for all the named block driver nodes
3694 Example:
3696 -> { "execute": "query-named-block-nodes" }
3697 <- { "return": [ { "ro":false,
3698 "drv":"qcow2",
3699 "encrypted":false,
3700 "file":"disks/test.qcow2",
3701 "node-name": "my-node",
3702 "backing_file_depth":1,
3703 "bps":1000000,
3704 "bps_rd":0,
3705 "bps_wr":0,
3706 "iops":1000000,
3707 "iops_rd":0,
3708 "iops_wr":0,
3709 "bps_max": 8000000,
3710 "bps_rd_max": 0,
3711 "bps_wr_max": 0,
3712 "iops_max": 0,
3713 "iops_rd_max": 0,
3714 "iops_wr_max": 0,
3715 "iops_size": 0,
3716 "write_threshold": 0,
3717 "image":{
3718 "filename":"disks/test.qcow2",
3719 "format":"qcow2",
3720 "virtual-size":2048000,
3721 "backing_file":"base.qcow2",
3722 "full-backing-filename":"disks/base.qcow2",
3723 "backing-filename-format:"qcow2",
3724 "snapshots":[
3726 "id": "1",
3727 "name": "snapshot1",
3728 "vm-state-size": 0,
3729 "date-sec": 10000200,
3730 "date-nsec": 12,
3731 "vm-clock-sec": 206,
3732 "vm-clock-nsec": 30
3735 "backing-image":{
3736 "filename":"disks/base.qcow2",
3737 "format":"qcow2",
3738 "virtual-size":2048000
3740 } } ] }
3742 EQMP
3745 .name = "query-memdev",
3746 .args_type = "",
3747 .mhandler.cmd_new = qmp_marshal_input_query_memdev,
3750 SQMP
3751 query-memdev
3752 ------------
3754 Show memory devices information.
3757 Example (1):
3759 -> { "execute": "query-memdev" }
3760 <- { "return": [
3762 "size": 536870912,
3763 "merge": false,
3764 "dump": true,
3765 "prealloc": false,
3766 "host-nodes": [0, 1],
3767 "policy": "bind"
3770 "size": 536870912,
3771 "merge": false,
3772 "dump": true,
3773 "prealloc": true,
3774 "host-nodes": [2, 3],
3775 "policy": "preferred"
3780 EQMP
3783 .name = "query-memory-devices",
3784 .args_type = "",
3785 .mhandler.cmd_new = qmp_marshal_input_query_memory_devices,
3788 SQMP
3789 @query-memory-devices
3790 --------------------
3792 Return a list of memory devices.
3794 Example:
3795 -> { "execute": "query-memory-devices" }
3796 <- { "return": [ { "data":
3797 { "addr": 5368709120,
3798 "hotpluggable": true,
3799 "hotplugged": true,
3800 "id": "d1",
3801 "memdev": "/objects/memX",
3802 "node": 0,
3803 "size": 1073741824,
3804 "slot": 0},
3805 "type": "dimm"
3806 } ] }
3807 EQMP
3810 .name = "query-acpi-ospm-status",
3811 .args_type = "",
3812 .mhandler.cmd_new = qmp_marshal_input_query_acpi_ospm_status,
3815 SQMP
3816 @query-acpi-ospm-status
3817 --------------------
3819 Return list of ACPIOSTInfo for devices that support status reporting
3820 via ACPI _OST method.
3822 Example:
3823 -> { "execute": "query-acpi-ospm-status" }
3824 <- { "return": [ { "device": "d1", "slot": "0", "slot-type": "DIMM", "source": 1, "status": 0},
3825 { "slot": "1", "slot-type": "DIMM", "source": 0, "status": 0},
3826 { "slot": "2", "slot-type": "DIMM", "source": 0, "status": 0},
3827 { "slot": "3", "slot-type": "DIMM", "source": 0, "status": 0}
3829 EQMP
3831 #if defined TARGET_I386
3833 .name = "rtc-reset-reinjection",
3834 .args_type = "",
3835 .mhandler.cmd_new = qmp_marshal_input_rtc_reset_reinjection,
3837 #endif
3839 SQMP
3840 rtc-reset-reinjection
3841 ---------------------
3843 Reset the RTC interrupt reinjection backlog.
3845 Arguments: None.
3847 Example:
3849 -> { "execute": "rtc-reset-reinjection" }
3850 <- { "return": {} }
3851 EQMP
3854 .name = "trace-event-get-state",
3855 .args_type = "name:s",
3856 .mhandler.cmd_new = qmp_marshal_input_trace_event_get_state,
3859 SQMP
3860 trace-event-get-state
3861 ---------------------
3863 Query the state of events.
3865 Example:
3867 -> { "execute": "trace-event-get-state", "arguments": { "name": "qemu_memalign" } }
3868 <- { "return": [ { "name": "qemu_memalign", "state": "disabled" } ] }
3869 EQMP
3872 .name = "trace-event-set-state",
3873 .args_type = "name:s,enable:b,ignore-unavailable:b?",
3874 .mhandler.cmd_new = qmp_marshal_input_trace_event_set_state,
3877 SQMP
3878 trace-event-set-state
3879 ---------------------
3881 Set the state of events.
3883 Example:
3885 -> { "execute": "trace-event-set-state", "arguments": { "name": "qemu_memalign", "enable": "true" } }
3886 <- { "return": {} }
3887 EQMP
3890 .name = "x-input-send-event",
3891 .args_type = "console:i?,events:q",
3892 .mhandler.cmd_new = qmp_marshal_input_x_input_send_event,
3895 SQMP
3896 @x-input-send-event
3897 -----------------
3899 Send input event to guest.
3901 Arguments:
3903 - "console": console index. (json-int, optional)
3904 - "events": list of input events.
3906 The consoles are visible in the qom tree, under
3907 /backend/console[$index]. They have a device link and head property, so
3908 it is possible to map which console belongs to which device and display.
3910 Note: this command is experimental, and not a stable API.
3912 Example (1):
3914 Press left mouse button.
3916 -> { "execute": "x-input-send-event",
3917 "arguments": { "console": 0,
3918 "events": [ { "type": "btn",
3919 "data" : { "down": true, "button": "Left" } } ] } }
3920 <- { "return": {} }
3922 -> { "execute": "x-input-send-event",
3923 "arguments": { "console": 0,
3924 "events": [ { "type": "btn",
3925 "data" : { "down": false, "button": "Left" } } ] } }
3926 <- { "return": {} }
3928 Example (2):
3930 Press ctrl-alt-del.
3932 -> { "execute": "x-input-send-event",
3933 "arguments": { "console": 0, "events": [
3934 { "type": "key", "data" : { "down": true,
3935 "key": {"type": "qcode", "data": "ctrl" } } },
3936 { "type": "key", "data" : { "down": true,
3937 "key": {"type": "qcode", "data": "alt" } } },
3938 { "type": "key", "data" : { "down": true,
3939 "key": {"type": "qcode", "data": "delete" } } } ] } }
3940 <- { "return": {} }
3942 Example (3):
3944 Move mouse pointer to absolute coordinates (20000, 400).
3946 -> { "execute": "x-input-send-event" ,
3947 "arguments": { "console": 0, "events": [
3948 { "type": "abs", "data" : { "axis": "X", "value" : 20000 } },
3949 { "type": "abs", "data" : { "axis": "Y", "value" : 400 } } ] } }
3950 <- { "return": {} }
3952 EQMP
3955 .name = "block-set-write-threshold",
3956 .args_type = "node-name:s,write-threshold:l",
3957 .mhandler.cmd_new = qmp_marshal_input_block_set_write_threshold,
3960 SQMP
3961 block-set-write-threshold
3962 ------------
3964 Change the write threshold for a block drive. The threshold is an offset,
3965 thus must be non-negative. Default is no write threshold.
3966 Setting the threshold to zero disables it.
3968 Arguments:
3970 - "node-name": the node name in the block driver state graph (json-string)
3971 - "write-threshold": the write threshold in bytes (json-int)
3973 Example:
3975 -> { "execute": "block-set-write-threshold",
3976 "arguments": { "node-name": "mydev",
3977 "write-threshold": 17179869184 } }
3978 <- { "return": {} }
3980 EQMP