Reorganize build system
[qemu/aliguori.git] / qmp-commands.hx
blob2319e68a7811dace3a98ab370bf38b9bc70f19ac
1 HXCOMM QMP dispatch table and documentation
2 HXCOMM Text between SQMP and EQMP is copied to the QMP documention 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 efect 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 .params = "",
67 .help = "quit the emulator",
68 .user_print = monitor_user_noop,
69 .mhandler.cmd_new = do_quit,
72 SQMP
73 quit
74 ----
76 Quit the emulator.
78 Arguments: None.
80 Example:
82 -> { "execute": "quit" }
83 <- { "return": {} }
85 EQMP
88 .name = "plug_create",
89 .args_type = "device:O",
90 .params = "type=value,id=value[,prop=value][,...]",
91 .help = "create a plug",
92 .user_print = monitor_user_noop,
93 .mhandler.cmd_new = do_plug_create,
97 .name = "plug_list",
98 .args_type = "",
99 .params = "",
100 .help = "list plugs",
101 .user_print = monitor_user_noop,
102 .mhandler.cmd_new = do_plug_list,
106 .name = "plug_get",
107 .args_type = "options:O",
108 .params = "",
109 .help = "get plug property",
110 .user_print = monitor_user_noop,
111 .mhandler.cmd_new = do_plug_get,
115 .name = "plug_set",
116 .args_type = "options:O",
117 .params = "",
118 .help = "set plug property",
119 .user_print = monitor_user_noop,
120 .mhandler.cmd_new = do_plug_set,
124 .name = "plug_list_props",
125 .args_type = "id:s",
126 .params = "",
127 .help = "list plug properties",
128 .user_print = monitor_user_noop,
129 .mhandler.cmd_new = do_plug_list_props,
133 .name = "eject",
134 .args_type = "force:-f,device:B",
135 .params = "[-f] device",
136 .help = "eject a removable medium (use -f to force it)",
137 .user_print = monitor_user_noop,
138 .mhandler.cmd_new = do_eject,
141 SQMP
142 eject
143 -----
145 Eject a removable medium.
147 Arguments:
149 - force: force ejection (json-bool, optional)
150 - device: device name (json-string)
152 Example:
154 -> { "execute": "eject", "arguments": { "device": "ide1-cd0" } }
155 <- { "return": {} }
157 Note: The "force" argument defaults to false.
159 EQMP
162 .name = "change",
163 .args_type = "device:B,target:F,arg:s?",
164 .params = "device filename [format]",
165 .help = "change a removable medium, optional format",
166 .user_print = monitor_user_noop,
167 .mhandler.cmd_new = do_change,
170 SQMP
171 change
172 ------
174 Change a removable medium or VNC configuration.
176 Arguments:
178 - "device": device name (json-string)
179 - "target": filename or item (json-string)
180 - "arg": additional argument (json-string, optional)
182 Examples:
184 1. Change a removable medium
186 -> { "execute": "change",
187 "arguments": { "device": "ide1-cd0",
188 "target": "/srv/images/Fedora-12-x86_64-DVD.iso" } }
189 <- { "return": {} }
191 2. Change VNC password
193 -> { "execute": "change",
194 "arguments": { "device": "vnc", "target": "password",
195 "arg": "foobar1" } }
196 <- { "return": {} }
198 EQMP
201 .name = "screendump",
202 .args_type = "filename:F",
203 .params = "filename",
204 .help = "save screen into PPM image 'filename'",
205 .user_print = monitor_user_noop,
206 .mhandler.cmd_new = do_screen_dump,
209 SQMP
210 screendump
211 ----------
213 Save screen into PPM image.
215 Arguments:
217 - "filename": file path (json-string)
219 Example:
221 -> { "execute": "screendump", "arguments": { "filename": "/tmp/image" } }
222 <- { "return": {} }
224 EQMP
227 .name = "stop",
228 .args_type = "",
229 .params = "",
230 .help = "stop emulation",
231 .user_print = monitor_user_noop,
232 .mhandler.cmd_new = do_stop,
235 SQMP
236 stop
237 ----
239 Stop the emulator.
241 Arguments: None.
243 Example:
245 -> { "execute": "stop" }
246 <- { "return": {} }
248 EQMP
251 .name = "cont",
252 .args_type = "",
253 .params = "",
254 .help = "resume emulation",
255 .user_print = monitor_user_noop,
256 .mhandler.cmd_new = do_cont,
259 SQMP
260 cont
261 ----
263 Resume emulation.
265 Arguments: None.
267 Example:
269 -> { "execute": "cont" }
270 <- { "return": {} }
272 EQMP
275 .name = "system_reset",
276 .args_type = "",
277 .params = "",
278 .help = "reset the system",
279 .user_print = monitor_user_noop,
280 .mhandler.cmd_new = do_system_reset,
283 SQMP
284 system_reset
285 ------------
287 Reset the system.
289 Arguments: None.
291 Example:
293 -> { "execute": "system_reset" }
294 <- { "return": {} }
296 EQMP
299 .name = "system_powerdown",
300 .args_type = "",
301 .params = "",
302 .help = "send system power down event",
303 .user_print = monitor_user_noop,
304 .mhandler.cmd_new = do_system_powerdown,
307 SQMP
308 system_powerdown
309 ----------------
311 Send system power down event.
313 Arguments: None.
315 Example:
317 -> { "execute": "system_powerdown" }
318 <- { "return": {} }
320 EQMP
323 .name = "device_add",
324 .args_type = "device:O",
325 .params = "driver[,prop=value][,...]",
326 .help = "add device, like -device on the command line",
327 .user_print = monitor_user_noop,
328 .mhandler.cmd_new = do_device_add,
331 SQMP
332 device_add
333 ----------
335 Add a device.
337 Arguments:
339 - "driver": the name of the new device's driver (json-string)
340 - "bus": the device's parent bus (device tree path, json-string, optional)
341 - "id": the device's ID, must be unique (json-string)
342 - device properties
344 Example:
346 -> { "execute": "device_add", "arguments": { "driver": "e1000", "id": "net1" } }
347 <- { "return": {} }
349 Notes:
351 (1) For detailed information about this command, please refer to the
352 'docs/qdev-device-use.txt' file.
354 (2) It's possible to list device properties by running QEMU with the
355 "-device DEVICE,\?" command-line argument, where DEVICE is the device's name
357 EQMP
360 .name = "device_del",
361 .args_type = "id:s",
362 .params = "device",
363 .help = "remove device",
364 .user_print = monitor_user_noop,
365 .mhandler.cmd_new = do_device_del,
368 SQMP
369 device_del
370 ----------
372 Remove a device.
374 Arguments:
376 - "id": the device's ID (json-string)
378 Example:
380 -> { "execute": "device_del", "arguments": { "id": "net1" } }
381 <- { "return": {} }
383 EQMP
386 .name = "cpu",
387 .args_type = "index:i",
388 .params = "index",
389 .help = "set the default CPU",
390 .user_print = monitor_user_noop,
391 .mhandler.cmd_new = do_cpu_set,
394 SQMP
398 Set the default CPU.
400 Arguments:
402 - "index": the CPU's index (json-int)
404 Example:
406 -> { "execute": "cpu", "arguments": { "index": 0 } }
407 <- { "return": {} }
409 Note: CPUs' indexes are obtained with the 'query-cpus' command.
411 EQMP
414 .name = "memsave",
415 .args_type = "val:l,size:i,filename:s",
416 .params = "addr size file",
417 .help = "save to disk virtual memory dump starting at 'addr' of size 'size'",
418 .user_print = monitor_user_noop,
419 .mhandler.cmd_new = do_memory_save,
422 SQMP
423 memsave
424 -------
426 Save to disk virtual memory dump starting at 'val' of size 'size'.
428 Arguments:
430 - "val": the starting address (json-int)
431 - "size": the memory size, in bytes (json-int)
432 - "filename": file path (json-string)
434 Example:
436 -> { "execute": "memsave",
437 "arguments": { "val": 10,
438 "size": 100,
439 "filename": "/tmp/virtual-mem-dump" } }
440 <- { "return": {} }
442 Note: Depends on the current CPU.
444 EQMP
447 .name = "pmemsave",
448 .args_type = "val:l,size:i,filename:s",
449 .params = "addr size file",
450 .help = "save to disk physical memory dump starting at 'addr' of size 'size'",
451 .user_print = monitor_user_noop,
452 .mhandler.cmd_new = do_physical_memory_save,
455 SQMP
456 pmemsave
457 --------
459 Save to disk physical memory dump starting at 'val' of size 'size'.
461 Arguments:
463 - "val": the starting address (json-int)
464 - "size": the memory size, in bytes (json-int)
465 - "filename": file path (json-string)
467 Example:
469 -> { "execute": "pmemsave",
470 "arguments": { "val": 10,
471 "size": 100,
472 "filename": "/tmp/physical-mem-dump" } }
473 <- { "return": {} }
475 EQMP
478 .name = "inject-nmi",
479 .args_type = "",
480 .params = "",
481 .help = "",
482 .user_print = monitor_user_noop,
483 .mhandler.cmd_new = do_inject_nmi,
486 SQMP
487 inject-nmi
488 ----------
490 Inject an NMI on guest's CPUs.
492 Arguments: None.
494 Example:
496 -> { "execute": "inject-nmi" }
497 <- { "return": {} }
499 Note: inject-nmi is only supported for x86 guest currently, it will
500 returns "Unsupported" error for non-x86 guest.
502 EQMP
505 .name = "migrate",
506 .args_type = "detach:-d,blk:-b,inc:-i,uri:s",
507 .params = "[-d] [-b] [-i] uri",
508 .help = "migrate to URI (using -d to not wait for completion)"
509 "\n\t\t\t -b for migration without shared storage with"
510 " full copy of disk\n\t\t\t -i for migration without "
511 "shared storage with incremental copy of disk "
512 "(base image shared between src and destination)",
513 .user_print = monitor_user_noop,
514 .mhandler.cmd_new = do_migrate,
517 SQMP
518 migrate
519 -------
521 Migrate to URI.
523 Arguments:
525 - "blk": block migration, full disk copy (json-bool, optional)
526 - "inc": incremental disk copy (json-bool, optional)
527 - "uri": Destination URI (json-string)
529 Example:
531 -> { "execute": "migrate", "arguments": { "uri": "tcp:0:4446" } }
532 <- { "return": {} }
534 Notes:
536 (1) The 'query-migrate' command should be used to check migration's progress
537 and final result (this information is provided by the 'status' member)
538 (2) All boolean arguments default to false
539 (3) The user Monitor's "detach" argument is invalid in QMP and should not
540 be used
542 EQMP
545 .name = "migrate_cancel",
546 .args_type = "",
547 .params = "",
548 .help = "cancel the current VM migration",
549 .user_print = monitor_user_noop,
550 .mhandler.cmd_new = do_migrate_cancel,
553 SQMP
554 migrate_cancel
555 --------------
557 Cancel the current migration.
559 Arguments: None.
561 Example:
563 -> { "execute": "migrate_cancel" }
564 <- { "return": {} }
566 EQMP
569 .name = "migrate_set_speed",
570 .args_type = "value:o",
571 .params = "value",
572 .help = "set maximum speed (in bytes) for migrations",
573 .user_print = monitor_user_noop,
574 .mhandler.cmd_new = do_migrate_set_speed,
577 SQMP
578 migrate_set_speed
579 -----------------
581 Set maximum speed for migrations.
583 Arguments:
585 - "value": maximum speed, in bytes per second (json-int)
587 Example:
589 -> { "execute": "migrate_set_speed", "arguments": { "value": 1024 } }
590 <- { "return": {} }
592 EQMP
595 .name = "migrate_set_downtime",
596 .args_type = "value:T",
597 .params = "value",
598 .help = "set maximum tolerated downtime (in seconds) for migrations",
599 .user_print = monitor_user_noop,
600 .mhandler.cmd_new = do_migrate_set_downtime,
603 SQMP
604 migrate_set_downtime
605 --------------------
607 Set maximum tolerated downtime (in seconds) for migrations.
609 Arguments:
611 - "value": maximum downtime (json-number)
613 Example:
615 -> { "execute": "migrate_set_downtime", "arguments": { "value": 0.1 } }
616 <- { "return": {} }
618 EQMP
621 .name = "client_migrate_info",
622 .args_type = "protocol:s,hostname:s,port:i?,tls-port:i?,cert-subject:s?",
623 .params = "protocol hostname port tls-port cert-subject",
624 .help = "send migration info to spice/vnc client",
625 .user_print = monitor_user_noop,
626 .mhandler.cmd_new = client_migrate_info,
629 SQMP
630 client_migrate_info
631 ------------------
633 Set the spice/vnc connection info for the migration target. The spice/vnc
634 server will ask the spice/vnc client to automatically reconnect using the
635 new parameters (if specified) once the vm migration finished successfully.
637 Arguments:
639 - "protocol": protocol: "spice" or "vnc" (json-string)
640 - "hostname": migration target hostname (json-string)
641 - "port": spice/vnc tcp port for plaintext channels (json-int, optional)
642 - "tls-port": spice tcp port for tls-secured channels (json-int, optional)
643 - "cert-subject": server certificate subject (json-string, optional)
645 Example:
647 -> { "execute": "client_migrate_info",
648 "arguments": { "protocol": "spice",
649 "hostname": "virt42.lab.kraxel.org",
650 "port": 1234 } }
651 <- { "return": {} }
653 EQMP
656 .name = "netdev_add",
657 .args_type = "netdev:O",
658 .params = "[user|tap|socket],id=str[,prop=value][,...]",
659 .help = "add host network device",
660 .user_print = monitor_user_noop,
661 .mhandler.cmd_new = do_netdev_add,
664 SQMP
665 netdev_add
666 ----------
668 Add host network device.
670 Arguments:
672 - "type": the device type, "tap", "user", ... (json-string)
673 - "id": the device's ID, must be unique (json-string)
674 - device options
676 Example:
678 -> { "execute": "netdev_add", "arguments": { "type": "user", "id": "netdev1" } }
679 <- { "return": {} }
681 Note: The supported device options are the same ones supported by the '-net'
682 command-line argument, which are listed in the '-help' output or QEMU's
683 manual
685 EQMP
688 .name = "netdev_del",
689 .args_type = "id:s",
690 .params = "id",
691 .help = "remove host network device",
692 .user_print = monitor_user_noop,
693 .mhandler.cmd_new = do_netdev_del,
696 SQMP
697 netdev_del
698 ----------
700 Remove host network device.
702 Arguments:
704 - "id": the device's ID, must be unique (json-string)
706 Example:
708 -> { "execute": "netdev_del", "arguments": { "id": "netdev1" } }
709 <- { "return": {} }
712 EQMP
715 .name = "block_resize",
716 .args_type = "device:B,size:o",
717 .params = "device size",
718 .help = "resize a block image",
719 .user_print = monitor_user_noop,
720 .mhandler.cmd_new = do_block_resize,
723 SQMP
724 block_resize
725 ------------
727 Resize a block image while a guest is running.
729 Arguments:
731 - "device": the device's ID, must be unique (json-string)
732 - "size": new size
734 Example:
736 -> { "execute": "block_resize", "arguments": { "device": "scratch", "size": 1073741824 } }
737 <- { "return": {} }
739 EQMP
742 .name = "balloon",
743 .args_type = "value:M",
744 .params = "target",
745 .help = "request VM to change its memory allocation (in MB)",
746 .user_print = monitor_user_noop,
747 .mhandler.cmd_async = do_balloon,
748 .flags = MONITOR_CMD_ASYNC,
751 SQMP
752 balloon
753 -------
755 Request VM to change its memory allocation (in bytes).
757 Arguments:
759 - "value": New memory allocation (json-int)
761 Example:
763 -> { "execute": "balloon", "arguments": { "value": 536870912 } }
764 <- { "return": {} }
766 EQMP
769 .name = "set_link",
770 .args_type = "name:s,up:b",
771 .params = "name on|off",
772 .help = "change the link status of a network adapter",
773 .user_print = monitor_user_noop,
774 .mhandler.cmd_new = do_set_link,
777 SQMP
778 set_link
779 --------
781 Change the link status of a network adapter.
783 Arguments:
785 - "name": network device name (json-string)
786 - "up": status is up (json-bool)
788 Example:
790 -> { "execute": "set_link", "arguments": { "name": "e1000.0", "up": false } }
791 <- { "return": {} }
793 EQMP
796 .name = "getfd",
797 .args_type = "fdname:s",
798 .params = "getfd name",
799 .help = "receive a file descriptor via SCM rights and assign it a name",
800 .user_print = monitor_user_noop,
801 .mhandler.cmd_new = do_getfd,
804 SQMP
805 getfd
806 -----
808 Receive a file descriptor via SCM rights and assign it a name.
810 Arguments:
812 - "fdname": file descriptor name (json-string)
814 Example:
816 -> { "execute": "getfd", "arguments": { "fdname": "fd1" } }
817 <- { "return": {} }
819 EQMP
822 .name = "closefd",
823 .args_type = "fdname:s",
824 .params = "closefd name",
825 .help = "close a file descriptor previously passed via SCM rights",
826 .user_print = monitor_user_noop,
827 .mhandler.cmd_new = do_closefd,
830 SQMP
831 closefd
832 -------
834 Close a file descriptor previously passed via SCM rights.
836 Arguments:
838 - "fdname": file descriptor name (json-string)
840 Example:
842 -> { "execute": "closefd", "arguments": { "fdname": "fd1" } }
843 <- { "return": {} }
845 EQMP
848 .name = "block_passwd",
849 .args_type = "device:B,password:s",
850 .params = "block_passwd device password",
851 .help = "set the password of encrypted block devices",
852 .user_print = monitor_user_noop,
853 .mhandler.cmd_new = do_block_set_passwd,
856 SQMP
857 block_passwd
858 ------------
860 Set the password of encrypted block devices.
862 Arguments:
864 - "device": device name (json-string)
865 - "password": password (json-string)
867 Example:
869 -> { "execute": "block_passwd", "arguments": { "device": "ide0-hd0",
870 "password": "12345" } }
871 <- { "return": {} }
873 EQMP
876 .name = "set_password",
877 .args_type = "protocol:s,password:s,connected:s?",
878 .params = "protocol password action-if-connected",
879 .help = "set spice/vnc password",
880 .user_print = monitor_user_noop,
881 .mhandler.cmd_new = set_password,
884 SQMP
885 set_password
886 ------------
888 Set the password for vnc/spice protocols.
890 Arguments:
892 - "protocol": protocol name (json-string)
893 - "password": password (json-string)
894 - "connected": [ keep | disconnect | fail ] (josn-string, optional)
896 Example:
898 -> { "execute": "set_password", "arguments": { "protocol": "vnc",
899 "password": "secret" } }
900 <- { "return": {} }
902 EQMP
905 .name = "expire_password",
906 .args_type = "protocol:s,time:s",
907 .params = "protocol time",
908 .help = "set spice/vnc password expire-time",
909 .user_print = monitor_user_noop,
910 .mhandler.cmd_new = expire_password,
913 SQMP
914 expire_password
915 ---------------
917 Set the password expire time for vnc/spice protocols.
919 Arguments:
921 - "protocol": protocol name (json-string)
922 - "time": [ now | never | +secs | secs ] (json-string)
924 Example:
926 -> { "execute": "expire_password", "arguments": { "protocol": "vnc",
927 "time": "+60" } }
928 <- { "return": {} }
930 EQMP
933 .name = "qmp_capabilities",
934 .args_type = "",
935 .params = "",
936 .help = "enable QMP capabilities",
937 .user_print = monitor_user_noop,
938 .mhandler.cmd_new = do_qmp_capabilities,
941 SQMP
942 qmp_capabilities
943 ----------------
945 Enable QMP capabilities.
947 Arguments: None.
949 Example:
951 -> { "execute": "qmp_capabilities" }
952 <- { "return": {} }
954 Note: This command must be issued before issuing any other command.
956 EQMP
959 .name = "human-monitor-command",
960 .args_type = "command-line:s,cpu-index:i?",
961 .params = "",
962 .help = "",
963 .user_print = monitor_user_noop,
964 .mhandler.cmd_new = do_hmp_passthrough,
967 SQMP
968 human-monitor-command
969 ---------------------
971 Execute a Human Monitor command.
973 Arguments:
975 - command-line: the command name and its arguments, just like the
976 Human Monitor's shell (json-string)
977 - cpu-index: select the CPU number to be used by commands which access CPU
978 data, like 'info registers'. The Monitor selects CPU 0 if this
979 argument is not provided (json-int, optional)
981 Example:
983 -> { "execute": "human-monitor-command", "arguments": { "command-line": "info kvm" } }
984 <- { "return": "kvm support: enabled\r\n" }
986 Notes:
988 (1) The Human Monitor is NOT an stable interface, this means that command
989 names, arguments and responses can change or be removed at ANY time.
990 Applications that rely on long term stability guarantees should NOT
991 use this command
993 (2) Limitations:
995 o This command is stateless, this means that commands that depend
996 on state information (such as getfd) might not work
998 o Commands that prompt the user for data (eg. 'cont' when the block
999 device is encrypted) don't currently work
1001 3. Query Commands
1002 =================
1004 HXCOMM Each query command below is inside a SQMP/EQMP section, do NOT change
1005 HXCOMM this! We will possibly move query commands definitions inside those
1006 HXCOMM sections, just like regular commands.
1008 EQMP
1010 SQMP
1011 query-version
1012 -------------
1014 Show QEMU version.
1016 Return a json-object with the following information:
1018 - "qemu": A json-object containing three integer values:
1019 - "major": QEMU's major version (json-int)
1020 - "minor": QEMU's minor version (json-int)
1021 - "micro": QEMU's micro version (json-int)
1022 - "package": package's version (json-string)
1024 Example:
1026 -> { "execute": "query-version" }
1027 <- {
1028 "return":{
1029 "qemu":{
1030 "major":0,
1031 "minor":11,
1032 "micro":5
1034 "package":""
1038 EQMP
1040 SQMP
1041 query-commands
1042 --------------
1044 List QMP available commands.
1046 Each command is represented by a json-object, the returned value is a json-array
1047 of all commands.
1049 Each json-object contain:
1051 - "name": command's name (json-string)
1053 Example:
1055 -> { "execute": "query-commands" }
1056 <- {
1057 "return":[
1059 "name":"query-balloon"
1062 "name":"system_powerdown"
1067 Note: This example has been shortened as the real response is too long.
1069 EQMP
1071 SQMP
1072 query-chardev
1073 -------------
1075 Each device is represented by a json-object. The returned value is a json-array
1076 of all devices.
1078 Each json-object contain the following:
1080 - "label": device's label (json-string)
1081 - "filename": device's file (json-string)
1083 Example:
1085 -> { "execute": "query-chardev" }
1086 <- {
1087 "return":[
1089 "label":"monitor",
1090 "filename":"stdio"
1093 "label":"serial0",
1094 "filename":"vc"
1099 EQMP
1101 SQMP
1102 query-block
1103 -----------
1105 Show the block devices.
1107 Each block device information is stored in a json-object and the returned value
1108 is a json-array of all devices.
1110 Each json-object contain the following:
1112 - "device": device name (json-string)
1113 - "type": device type (json-string)
1114 - deprecated, retained for backward compatibility
1115 - Possible values: "unknown"
1116 - "removable": true if the device is removable, false otherwise (json-bool)
1117 - "locked": true if the device is locked, false otherwise (json-bool)
1118 - "inserted": only present if the device is inserted, it is a json-object
1119 containing the following:
1120 - "file": device file name (json-string)
1121 - "ro": true if read-only, false otherwise (json-bool)
1122 - "drv": driver format name (json-string)
1123 - Possible values: "blkdebug", "bochs", "cloop", "cow", "dmg",
1124 "file", "file", "ftp", "ftps", "host_cdrom",
1125 "host_device", "host_floppy", "http", "https",
1126 "nbd", "parallels", "qcow", "qcow2", "raw",
1127 "tftp", "vdi", "vmdk", "vpc", "vvfat"
1128 - "backing_file": backing file name (json-string, optional)
1129 - "encrypted": true if encrypted, false otherwise (json-bool)
1131 Example:
1133 -> { "execute": "query-block" }
1134 <- {
1135 "return":[
1137 "device":"ide0-hd0",
1138 "locked":false,
1139 "removable":false,
1140 "inserted":{
1141 "ro":false,
1142 "drv":"qcow2",
1143 "encrypted":false,
1144 "file":"disks/test.img"
1146 "type":"unknown"
1149 "device":"ide1-cd0",
1150 "locked":false,
1151 "removable":true,
1152 "type":"unknown"
1155 "device":"floppy0",
1156 "locked":false,
1157 "removable":true,
1158 "type":"unknown"
1161 "device":"sd0",
1162 "locked":false,
1163 "removable":true,
1164 "type":"unknown"
1169 EQMP
1171 SQMP
1172 query-blockstats
1173 ----------------
1175 Show block device statistics.
1177 Each device statistic information is stored in a json-object and the returned
1178 value is a json-array of all devices.
1180 Each json-object contain the following:
1182 - "device": device name (json-string)
1183 - "stats": A json-object with the statistics information, it contains:
1184 - "rd_bytes": bytes read (json-int)
1185 - "wr_bytes": bytes written (json-int)
1186 - "rd_operations": read operations (json-int)
1187 - "wr_operations": write operations (json-int)
1188 - "wr_highest_offset": Highest offset of a sector written since the
1189 BlockDriverState has been opened (json-int)
1190 - "parent": Contains recursively the statistics of the underlying
1191 protocol (e.g. the host file for a qcow2 image). If there is
1192 no underlying protocol, this field is omitted
1193 (json-object, optional)
1195 Example:
1197 -> { "execute": "query-blockstats" }
1198 <- {
1199 "return":[
1201 "device":"ide0-hd0",
1202 "parent":{
1203 "stats":{
1204 "wr_highest_offset":3686448128,
1205 "wr_bytes":9786368,
1206 "wr_operations":751,
1207 "rd_bytes":122567168,
1208 "rd_operations":36772
1211 "stats":{
1212 "wr_highest_offset":2821110784,
1213 "wr_bytes":9786368,
1214 "wr_operations":692,
1215 "rd_bytes":122739200,
1216 "rd_operations":36604
1220 "device":"ide1-cd0",
1221 "stats":{
1222 "wr_highest_offset":0,
1223 "wr_bytes":0,
1224 "wr_operations":0,
1225 "rd_bytes":0,
1226 "rd_operations":0
1230 "device":"floppy0",
1231 "stats":{
1232 "wr_highest_offset":0,
1233 "wr_bytes":0,
1234 "wr_operations":0,
1235 "rd_bytes":0,
1236 "rd_operations":0
1240 "device":"sd0",
1241 "stats":{
1242 "wr_highest_offset":0,
1243 "wr_bytes":0,
1244 "wr_operations":0,
1245 "rd_bytes":0,
1246 "rd_operations":0
1252 EQMP
1254 SQMP
1255 query-cpus
1256 ----------
1258 Show CPU information.
1260 Return a json-array. Each CPU is represented by a json-object, which contains:
1262 - "CPU": CPU index (json-int)
1263 - "current": true if this is the current CPU, false otherwise (json-bool)
1264 - "halted": true if the cpu is halted, false otherwise (json-bool)
1265 - Current program counter. The key's name depends on the architecture:
1266 "pc": i386/x86_64 (json-int)
1267 "nip": PPC (json-int)
1268 "pc" and "npc": sparc (json-int)
1269 "PC": mips (json-int)
1270 - "thread_id": ID of the underlying host thread (json-int)
1272 Example:
1274 -> { "execute": "query-cpus" }
1275 <- {
1276 "return":[
1278 "CPU":0,
1279 "current":true,
1280 "halted":false,
1281 "pc":3227107138
1282 "thread_id":3134
1285 "CPU":1,
1286 "current":false,
1287 "halted":true,
1288 "pc":7108165
1289 "thread_id":3135
1294 EQMP
1296 SQMP
1297 query-pci
1298 ---------
1300 PCI buses and devices information.
1302 The returned value is a json-array of all buses. Each bus is represented by
1303 a json-object, which has a key with a json-array of all PCI devices attached
1304 to it. Each device is represented by a json-object.
1306 The bus json-object contains the following:
1308 - "bus": bus number (json-int)
1309 - "devices": a json-array of json-objects, each json-object represents a
1310 PCI device
1312 The PCI device json-object contains the following:
1314 - "bus": identical to the parent's bus number (json-int)
1315 - "slot": slot number (json-int)
1316 - "function": function number (json-int)
1317 - "class_info": a json-object containing:
1318 - "desc": device class description (json-string, optional)
1319 - "class": device class number (json-int)
1320 - "id": a json-object containing:
1321 - "device": device ID (json-int)
1322 - "vendor": vendor ID (json-int)
1323 - "irq": device's IRQ if assigned (json-int, optional)
1324 - "qdev_id": qdev id string (json-string)
1325 - "pci_bridge": It's a json-object, only present if this device is a
1326 PCI bridge, contains:
1327 - "bus": bus number (json-int)
1328 - "secondary": secondary bus number (json-int)
1329 - "subordinate": subordinate bus number (json-int)
1330 - "io_range": I/O memory range information, a json-object with the
1331 following members:
1332 - "base": base address, in bytes (json-int)
1333 - "limit": limit address, in bytes (json-int)
1334 - "memory_range": memory range information, a json-object with the
1335 following members:
1336 - "base": base address, in bytes (json-int)
1337 - "limit": limit address, in bytes (json-int)
1338 - "prefetchable_range": Prefetchable memory range information, a
1339 json-object with the following members:
1340 - "base": base address, in bytes (json-int)
1341 - "limit": limit address, in bytes (json-int)
1342 - "devices": a json-array of PCI devices if there's any attached, each
1343 each element is represented by a json-object, which contains
1344 the same members of the 'PCI device json-object' described
1345 above (optional)
1346 - "regions": a json-array of json-objects, each json-object represents a
1347 memory region of this device
1349 The memory range json-object contains the following:
1351 - "base": base memory address (json-int)
1352 - "limit": limit value (json-int)
1354 The region json-object can be an I/O region or a memory region, an I/O region
1355 json-object contains the following:
1357 - "type": "io" (json-string, fixed)
1358 - "bar": BAR number (json-int)
1359 - "address": memory address (json-int)
1360 - "size": memory size (json-int)
1362 A memory region json-object contains the following:
1364 - "type": "memory" (json-string, fixed)
1365 - "bar": BAR number (json-int)
1366 - "address": memory address (json-int)
1367 - "size": memory size (json-int)
1368 - "mem_type_64": true or false (json-bool)
1369 - "prefetch": true or false (json-bool)
1371 Example:
1373 -> { "execute": "query-pci" }
1374 <- {
1375 "return":[
1377 "bus":0,
1378 "devices":[
1380 "bus":0,
1381 "qdev_id":"",
1382 "slot":0,
1383 "class_info":{
1384 "class":1536,
1385 "desc":"Host bridge"
1387 "id":{
1388 "device":32902,
1389 "vendor":4663
1391 "function":0,
1392 "regions":[
1397 "bus":0,
1398 "qdev_id":"",
1399 "slot":1,
1400 "class_info":{
1401 "class":1537,
1402 "desc":"ISA bridge"
1404 "id":{
1405 "device":32902,
1406 "vendor":28672
1408 "function":0,
1409 "regions":[
1414 "bus":0,
1415 "qdev_id":"",
1416 "slot":1,
1417 "class_info":{
1418 "class":257,
1419 "desc":"IDE controller"
1421 "id":{
1422 "device":32902,
1423 "vendor":28688
1425 "function":1,
1426 "regions":[
1428 "bar":4,
1429 "size":16,
1430 "address":49152,
1431 "type":"io"
1436 "bus":0,
1437 "qdev_id":"",
1438 "slot":2,
1439 "class_info":{
1440 "class":768,
1441 "desc":"VGA controller"
1443 "id":{
1444 "device":4115,
1445 "vendor":184
1447 "function":0,
1448 "regions":[
1450 "prefetch":true,
1451 "mem_type_64":false,
1452 "bar":0,
1453 "size":33554432,
1454 "address":4026531840,
1455 "type":"memory"
1458 "prefetch":false,
1459 "mem_type_64":false,
1460 "bar":1,
1461 "size":4096,
1462 "address":4060086272,
1463 "type":"memory"
1466 "prefetch":false,
1467 "mem_type_64":false,
1468 "bar":6,
1469 "size":65536,
1470 "address":-1,
1471 "type":"memory"
1476 "bus":0,
1477 "qdev_id":"",
1478 "irq":11,
1479 "slot":4,
1480 "class_info":{
1481 "class":1280,
1482 "desc":"RAM controller"
1484 "id":{
1485 "device":6900,
1486 "vendor":4098
1488 "function":0,
1489 "regions":[
1491 "bar":0,
1492 "size":32,
1493 "address":49280,
1494 "type":"io"
1503 Note: This example has been shortened as the real response is too long.
1505 EQMP
1507 SQMP
1508 query-kvm
1509 ---------
1511 Show KVM information.
1513 Return a json-object with the following information:
1515 - "enabled": true if KVM support is enabled, false otherwise (json-bool)
1516 - "present": true if QEMU has KVM support, false otherwise (json-bool)
1518 Example:
1520 -> { "execute": "query-kvm" }
1521 <- { "return": { "enabled": true, "present": true } }
1523 EQMP
1525 SQMP
1526 query-status
1527 ------------
1529 Return a json-object with the following information:
1531 - "running": true if the VM is running, or false if it is paused (json-bool)
1532 - "singlestep": true if the VM is in single step mode,
1533 false otherwise (json-bool)
1535 Example:
1537 -> { "execute": "query-status" }
1538 <- { "return": { "running": true, "singlestep": false } }
1540 EQMP
1542 SQMP
1543 query-mice
1544 ----------
1546 Show VM mice information.
1548 Each mouse is represented by a json-object, the returned value is a json-array
1549 of all mice.
1551 The mouse json-object contains the following:
1553 - "name": mouse's name (json-string)
1554 - "index": mouse's index (json-int)
1555 - "current": true if this mouse is receiving events, false otherwise (json-bool)
1556 - "absolute": true if the mouse generates absolute input events (json-bool)
1558 Example:
1560 -> { "execute": "query-mice" }
1561 <- {
1562 "return":[
1564 "name":"QEMU Microsoft Mouse",
1565 "index":0,
1566 "current":false,
1567 "absolute":false
1570 "name":"QEMU PS/2 Mouse",
1571 "index":1,
1572 "current":true,
1573 "absolute":true
1578 EQMP
1580 SQMP
1581 query-vnc
1582 ---------
1584 Show VNC server information.
1586 Return a json-object with server information. Connected clients are returned
1587 as a json-array of json-objects.
1589 The main json-object contains the following:
1591 - "enabled": true or false (json-bool)
1592 - "host": server's IP address (json-string)
1593 - "family": address family (json-string)
1594 - Possible values: "ipv4", "ipv6", "unix", "unknown"
1595 - "service": server's port number (json-string)
1596 - "auth": authentication method (json-string)
1597 - Possible values: "invalid", "none", "ra2", "ra2ne", "sasl", "tight",
1598 "tls", "ultra", "unknown", "vencrypt", "vencrypt",
1599 "vencrypt+plain", "vencrypt+tls+none",
1600 "vencrypt+tls+plain", "vencrypt+tls+sasl",
1601 "vencrypt+tls+vnc", "vencrypt+x509+none",
1602 "vencrypt+x509+plain", "vencrypt+x509+sasl",
1603 "vencrypt+x509+vnc", "vnc"
1604 - "clients": a json-array of all connected clients
1606 Clients are described by a json-object, each one contain the following:
1608 - "host": client's IP address (json-string)
1609 - "family": address family (json-string)
1610 - Possible values: "ipv4", "ipv6", "unix", "unknown"
1611 - "service": client's port number (json-string)
1612 - "x509_dname": TLS dname (json-string, optional)
1613 - "sasl_username": SASL username (json-string, optional)
1615 Example:
1617 -> { "execute": "query-vnc" }
1618 <- {
1619 "return":{
1620 "enabled":true,
1621 "host":"0.0.0.0",
1622 "service":"50402",
1623 "auth":"vnc",
1624 "family":"ipv4",
1625 "clients":[
1627 "host":"127.0.0.1",
1628 "service":"50401",
1629 "family":"ipv4"
1635 EQMP
1637 SQMP
1638 query-spice
1639 -----------
1641 Show SPICE server information.
1643 Return a json-object with server information. Connected clients are returned
1644 as a json-array of json-objects.
1646 The main json-object contains the following:
1648 - "enabled": true or false (json-bool)
1649 - "host": server's IP address (json-string)
1650 - "port": server's port number (json-int, optional)
1651 - "tls-port": server's port number (json-int, optional)
1652 - "auth": authentication method (json-string)
1653 - Possible values: "none", "spice"
1654 - "channels": a json-array of all active channels clients
1656 Channels are described by a json-object, each one contain the following:
1658 - "host": client's IP address (json-string)
1659 - "family": address family (json-string)
1660 - Possible values: "ipv4", "ipv6", "unix", "unknown"
1661 - "port": client's port number (json-string)
1662 - "connection-id": spice connection id. All channels with the same id
1663 belong to the same spice session (json-int)
1664 - "channel-type": channel type. "1" is the main control channel, filter for
1665 this one if you want track spice sessions only (json-int)
1666 - "channel-id": channel id. Usually "0", might be different needed when
1667 multiple channels of the same type exist, such as multiple
1668 display channels in a multihead setup (json-int)
1669 - "tls": whevener the channel is encrypted (json-bool)
1671 Example:
1673 -> { "execute": "query-spice" }
1674 <- {
1675 "return": {
1676 "enabled": true,
1677 "auth": "spice",
1678 "port": 5920,
1679 "tls-port": 5921,
1680 "host": "0.0.0.0",
1681 "channels": [
1683 "port": "54924",
1684 "family": "ipv4",
1685 "channel-type": 1,
1686 "connection-id": 1804289383,
1687 "host": "127.0.0.1",
1688 "channel-id": 0,
1689 "tls": true
1692 "port": "36710",
1693 "family": "ipv4",
1694 "channel-type": 4,
1695 "connection-id": 1804289383,
1696 "host": "127.0.0.1",
1697 "channel-id": 0,
1698 "tls": false
1700 [ ... more channels follow ... ]
1705 EQMP
1707 SQMP
1708 query-name
1709 ----------
1711 Show VM name.
1713 Return a json-object with the following information:
1715 - "name": VM's name (json-string, optional)
1717 Example:
1719 -> { "execute": "query-name" }
1720 <- { "return": { "name": "qemu-name" } }
1722 EQMP
1724 SQMP
1725 query-uuid
1726 ----------
1728 Show VM UUID.
1730 Return a json-object with the following information:
1732 - "UUID": Universally Unique Identifier (json-string)
1734 Example:
1736 -> { "execute": "query-uuid" }
1737 <- { "return": { "UUID": "550e8400-e29b-41d4-a716-446655440000" } }
1739 EQMP
1741 SQMP
1742 query-migrate
1743 -------------
1745 Migration status.
1747 Return a json-object. If migration is active there will be another json-object
1748 with RAM migration status and if block migration is active another one with
1749 block migration status.
1751 The main json-object contains the following:
1753 - "status": migration status (json-string)
1754 - Possible values: "active", "completed", "failed", "cancelled"
1755 - "ram": only present if "status" is "active", it is a json-object with the
1756 following RAM information (in bytes):
1757 - "transferred": amount transferred (json-int)
1758 - "remaining": amount remaining (json-int)
1759 - "total": total (json-int)
1760 - "disk": only present if "status" is "active" and it is a block migration,
1761 it is a json-object with the following disk information (in bytes):
1762 - "transferred": amount transferred (json-int)
1763 - "remaining": amount remaining (json-int)
1764 - "total": total (json-int)
1766 Examples:
1768 1. Before the first migration
1770 -> { "execute": "query-migrate" }
1771 <- { "return": {} }
1773 2. Migration is done and has succeeded
1775 -> { "execute": "query-migrate" }
1776 <- { "return": { "status": "completed" } }
1778 3. Migration is done and has failed
1780 -> { "execute": "query-migrate" }
1781 <- { "return": { "status": "failed" } }
1783 4. Migration is being performed and is not a block migration:
1785 -> { "execute": "query-migrate" }
1786 <- {
1787 "return":{
1788 "status":"active",
1789 "ram":{
1790 "transferred":123,
1791 "remaining":123,
1792 "total":246
1797 5. Migration is being performed and is a block migration:
1799 -> { "execute": "query-migrate" }
1800 <- {
1801 "return":{
1802 "status":"active",
1803 "ram":{
1804 "total":1057024,
1805 "remaining":1053304,
1806 "transferred":3720
1808 "disk":{
1809 "total":20971520,
1810 "remaining":20880384,
1811 "transferred":91136
1816 EQMP
1818 SQMP
1819 query-balloon
1820 -------------
1822 Show balloon information.
1824 Make an asynchronous request for balloon info. When the request completes a
1825 json-object will be returned containing the following data:
1827 - "actual": current balloon value in bytes (json-int)
1828 - "mem_swapped_in": Amount of memory swapped in bytes (json-int, optional)
1829 - "mem_swapped_out": Amount of memory swapped out in bytes (json-int, optional)
1830 - "major_page_faults": Number of major faults (json-int, optional)
1831 - "minor_page_faults": Number of minor faults (json-int, optional)
1832 - "free_mem": Total amount of free and unused memory in
1833 bytes (json-int, optional)
1834 - "total_mem": Total amount of available memory in bytes (json-int, optional)
1836 Example:
1838 -> { "execute": "query-balloon" }
1839 <- {
1840 "return":{
1841 "actual":1073741824,
1842 "mem_swapped_in":0,
1843 "mem_swapped_out":0,
1844 "major_page_faults":142,
1845 "minor_page_faults":239245,
1846 "free_mem":1014185984,
1847 "total_mem":1044668416
1851 EQMP