Merge branch 'vhost' of git://git.kernel.org/pub/scm/linux/kernel/git/mst/qemu-kvm
[qemu-kvm/stefanha.git] / qemu-monitor.hx
blob620f937af16627af66395d7a9575fb9302463369
1 HXCOMM Use DEFHEADING() to define headings in both help text and texi
2 HXCOMM Text between STEXI and ETEXI are copied to texi version and
3 HXCOMM discarded from C version
4 HXCOMM Text between SQMP and EQMP is copied to the QMP documention file and
5 HXCOMM does not show up in the other formats.
6 HXCOMM DEF(command, args, callback, arg_string, help) is used to construct
7 HXCOMM monitor commands
8 HXCOMM HXCOMM can be used for comments, discarded from both texi and C
10 SQMP
11 QMP Supported Commands
12 ----------------------
14 This document describes all commands currently supported by QMP.
16 Most of the time their usage is exactly the same as in the user Monitor, this
17 means that any other document which also describe commands (the manpage,
18 QEMU's manual, etc) can and should be consulted.
20 QMP has two types of commands: regular and query commands. Regular commands
21 usually change the Virtual Machine's state someway, while query commands just
22 return information. The sections below are divided accordingly.
24 It's important to observe that all communication examples are formatted in
25 a reader-friendly way, so that they're easier to understand. However, in real
26 protocol usage, they're emitted as a single line.
28 Also, the following notation is used to denote data flow:
30 -> data issued by the Client
31 <- Server data response
33 Please, refer to the QMP specification (QMP/qmp-spec.txt) for detailed
34 information on the Server command and response formats.
36 NOTE: This document is temporary and will be replaced soon.
38 1. Stability Considerations
39 ===========================
41 The current QMP command set (described in this file) may be useful for a
42 number of use cases, however it's limited and several commands have bad
43 defined semantics, specially with regard to command completion.
45 These problems are going to be solved incrementally in the next QEMU releases
46 and we're going to establish a deprecation policy for badly defined commands.
48 If you're planning to adopt QMP, please observe the following:
50 1. The deprecation policy will take efect and be documented soon, please
51 check the documentation of each used command as soon as a new release of
52 QEMU is available
54 2. DO NOT rely on anything which is not explicit documented
56 3. Errors, in special, are not documented. Applications should NOT check
57 for specific errors classes or data (it's strongly recommended to only
58 check for the "error" key)
60 2. Regular Commands
61 ===================
63 Server's responses in the examples below are always a success response, please
64 refer to the QMP specification for more details on error responses.
66 EQMP
68 STEXI
69 @table @option
70 ETEXI
73 .name = "help|?",
74 .args_type = "name:s?",
75 .params = "[cmd]",
76 .help = "show the help",
77 .mhandler.cmd = do_help_cmd,
80 STEXI
81 @item help or ? [@var{cmd}]
82 @findex help
83 Show the help for all commands or just for command @var{cmd}.
84 ETEXI
87 .name = "commit",
88 .args_type = "device:B",
89 .params = "device|all",
90 .help = "commit changes to the disk images (if -snapshot is used) or backing files",
91 .mhandler.cmd = do_commit,
94 STEXI
95 @item commit
96 @findex commit
97 Commit changes to the disk images (if -snapshot is used) or backing files.
98 ETEXI
101 .name = "q|quit",
102 .args_type = "",
103 .params = "",
104 .help = "quit the emulator",
105 .user_print = monitor_user_noop,
106 .mhandler.cmd_new = do_quit,
109 STEXI
110 @item q or quit
111 @findex quit
112 Quit the emulator.
113 ETEXI
114 SQMP
115 quit
116 ----
118 Quit the emulator.
120 Arguments: None.
122 Example:
124 -> { "execute": "quit" }
125 <- { "return": {} }
127 EQMP
130 .name = "eject",
131 .args_type = "force:-f,device:B",
132 .params = "[-f] device",
133 .help = "eject a removable medium (use -f to force it)",
134 .user_print = monitor_user_noop,
135 .mhandler.cmd_new = do_eject,
138 STEXI
139 @item eject [-f] @var{device}
140 @findex eject
141 Eject a removable medium (use -f to force it).
142 ETEXI
143 SQMP
144 eject
145 -----
147 Eject a removable medium.
149 Arguments:
151 - force: force ejection (json-bool, optional)
152 - device: device name (json-string)
154 Example:
156 -> { "execute": "eject", "arguments": { "device": "ide1-cd0" } }
157 <- { "return": {} }
159 Note: The "force" argument defaults to false.
161 EQMP
164 .name = "change",
165 .args_type = "device:B,target:F,arg:s?",
166 .params = "device filename [format]",
167 .help = "change a removable medium, optional format",
168 .user_print = monitor_user_noop,
169 .mhandler.cmd_new = do_change,
172 STEXI
173 @item change @var{device} @var{setting}
174 @findex change
176 Change the configuration of a device.
178 @table @option
179 @item change @var{diskdevice} @var{filename} [@var{format}]
180 Change the medium for a removable disk device to point to @var{filename}. eg
182 @example
183 (qemu) change ide1-cd0 /path/to/some.iso
184 @end example
186 @var{format} is optional.
188 @item change vnc @var{display},@var{options}
189 Change the configuration of the VNC server. The valid syntax for @var{display}
190 and @var{options} are described at @ref{sec_invocation}. eg
192 @example
193 (qemu) change vnc localhost:1
194 @end example
196 @item change vnc password [@var{password}]
198 Change the password associated with the VNC server. If the new password is not
199 supplied, the monitor will prompt for it to be entered. VNC passwords are only
200 significant up to 8 letters. eg
202 @example
203 (qemu) change vnc password
204 Password: ********
205 @end example
207 @end table
208 ETEXI
209 SQMP
210 change
211 ------
213 Change a removable medium or VNC configuration.
215 Arguments:
217 - "device": device name (json-string)
218 - "target": filename or item (json-string)
219 - "arg": additional argument (json-string, optional)
221 Examples:
223 1. Change a removable medium
225 -> { "execute": "change",
226 "arguments": { "device": "ide1-cd0",
227 "target": "/srv/images/Fedora-12-x86_64-DVD.iso" } }
228 <- { "return": {} }
230 2. Change VNC password
232 -> { "execute": "change",
233 "arguments": { "device": "vnc", "target": "password",
234 "arg": "foobar1" } }
235 <- { "return": {} }
237 EQMP
240 .name = "screendump",
241 .args_type = "filename:F",
242 .params = "filename",
243 .help = "save screen into PPM image 'filename'",
244 .user_print = monitor_user_noop,
245 .mhandler.cmd_new = do_screen_dump,
248 STEXI
249 @item screendump @var{filename}
250 @findex screendump
251 Save screen into PPM image @var{filename}.
252 ETEXI
253 SQMP
254 screendump
255 ----------
257 Save screen into PPM image.
259 Arguments:
261 - "filename": file path (json-string)
263 Example:
265 -> { "execute": "screendump", "arguments": { "filename": "/tmp/image" } }
266 <- { "return": {} }
268 EQMP
271 .name = "logfile",
272 .args_type = "filename:F",
273 .params = "filename",
274 .help = "output logs to 'filename'",
275 .mhandler.cmd = do_logfile,
278 STEXI
279 @item logfile @var{filename}
280 @findex logfile
281 Output logs to @var{filename}.
282 ETEXI
284 #ifdef CONFIG_SIMPLE_TRACE
286 .name = "trace-event",
287 .args_type = "name:s,option:b",
288 .params = "name on|off",
289 .help = "changes status of a specific trace event",
290 .mhandler.cmd = do_change_trace_event_state,
293 STEXI
294 @item trace-event
295 @findex trace-event
296 changes status of a trace event
297 ETEXI
300 .name = "trace-file",
301 .args_type = "op:s?,arg:F?",
302 .params = "on|off|flush|set [arg]",
303 .help = "open, close, or flush trace file, or set a new file name",
304 .mhandler.cmd = do_trace_file,
307 STEXI
308 @item trace-file on|off|flush
309 @findex trace-file
310 Open, close, or flush the trace file. If no argument is given, the status of the trace file is displayed.
311 ETEXI
312 #endif
315 .name = "log",
316 .args_type = "items:s",
317 .params = "item1[,...]",
318 .help = "activate logging of the specified items to '/tmp/qemu.log'",
319 .mhandler.cmd = do_log,
322 STEXI
323 @item log @var{item1}[,...]
324 @findex log
325 Activate logging of the specified items to @file{/tmp/qemu.log}.
326 ETEXI
329 .name = "savevm",
330 .args_type = "name:s?",
331 .params = "[tag|id]",
332 .help = "save a VM snapshot. If no tag or id are provided, a new snapshot is created",
333 .mhandler.cmd = do_savevm,
336 STEXI
337 @item savevm [@var{tag}|@var{id}]
338 @findex savevm
339 Create a snapshot of the whole virtual machine. If @var{tag} is
340 provided, it is used as human readable identifier. If there is already
341 a snapshot with the same tag or ID, it is replaced. More info at
342 @ref{vm_snapshots}.
343 ETEXI
346 .name = "loadvm",
347 .args_type = "name:s",
348 .params = "tag|id",
349 .help = "restore a VM snapshot from its tag or id",
350 .mhandler.cmd = do_loadvm,
353 STEXI
354 @item loadvm @var{tag}|@var{id}
355 @findex loadvm
356 Set the whole virtual machine to the snapshot identified by the tag
357 @var{tag} or the unique snapshot ID @var{id}.
358 ETEXI
361 .name = "delvm",
362 .args_type = "name:s",
363 .params = "tag|id",
364 .help = "delete a VM snapshot from its tag or id",
365 .mhandler.cmd = do_delvm,
368 STEXI
369 @item delvm @var{tag}|@var{id}
370 @findex delvm
371 Delete the snapshot identified by @var{tag} or @var{id}.
372 ETEXI
375 .name = "singlestep",
376 .args_type = "option:s?",
377 .params = "[on|off]",
378 .help = "run emulation in singlestep mode or switch to normal mode",
379 .mhandler.cmd = do_singlestep,
382 STEXI
383 @item singlestep [off]
384 @findex singlestep
385 Run the emulation in single step mode.
386 If called with option off, the emulation returns to normal mode.
387 ETEXI
390 .name = "stop",
391 .args_type = "",
392 .params = "",
393 .help = "stop emulation",
394 .user_print = monitor_user_noop,
395 .mhandler.cmd_new = do_stop,
398 STEXI
399 @item stop
400 @findex stop
401 Stop emulation.
402 ETEXI
403 SQMP
404 stop
405 ----
407 Stop the emulator.
409 Arguments: None.
411 Example:
413 -> { "execute": "stop" }
414 <- { "return": {} }
416 EQMP
419 .name = "c|cont",
420 .args_type = "",
421 .params = "",
422 .help = "resume emulation",
423 .user_print = monitor_user_noop,
424 .mhandler.cmd_new = do_cont,
427 STEXI
428 @item c or cont
429 @findex cont
430 Resume emulation.
431 ETEXI
432 SQMP
433 cont
434 ----
436 Resume emulation.
438 Arguments: None.
440 Example:
442 -> { "execute": "cont" }
443 <- { "return": {} }
445 EQMP
448 .name = "gdbserver",
449 .args_type = "device:s?",
450 .params = "[device]",
451 .help = "start gdbserver on given device (default 'tcp::1234'), stop with 'none'",
452 .mhandler.cmd = do_gdbserver,
455 STEXI
456 @item gdbserver [@var{port}]
457 @findex gdbserver
458 Start gdbserver session (default @var{port}=1234)
459 ETEXI
462 .name = "x",
463 .args_type = "fmt:/,addr:l",
464 .params = "/fmt addr",
465 .help = "virtual memory dump starting at 'addr'",
466 .mhandler.cmd = do_memory_dump,
469 STEXI
470 @item x/fmt @var{addr}
471 @findex x
472 Virtual memory dump starting at @var{addr}.
473 ETEXI
476 .name = "xp",
477 .args_type = "fmt:/,addr:l",
478 .params = "/fmt addr",
479 .help = "physical memory dump starting at 'addr'",
480 .mhandler.cmd = do_physical_memory_dump,
483 STEXI
484 @item xp /@var{fmt} @var{addr}
485 @findex xp
486 Physical memory dump starting at @var{addr}.
488 @var{fmt} is a format which tells the command how to format the
489 data. Its syntax is: @option{/@{count@}@{format@}@{size@}}
491 @table @var
492 @item count
493 is the number of items to be dumped.
495 @item format
496 can be x (hex), d (signed decimal), u (unsigned decimal), o (octal),
497 c (char) or i (asm instruction).
499 @item size
500 can be b (8 bits), h (16 bits), w (32 bits) or g (64 bits). On x86,
501 @code{h} or @code{w} can be specified with the @code{i} format to
502 respectively select 16 or 32 bit code instruction size.
504 @end table
506 Examples:
507 @itemize
508 @item
509 Dump 10 instructions at the current instruction pointer:
510 @example
511 (qemu) x/10i $eip
512 0x90107063: ret
513 0x90107064: sti
514 0x90107065: lea 0x0(%esi,1),%esi
515 0x90107069: lea 0x0(%edi,1),%edi
516 0x90107070: ret
517 0x90107071: jmp 0x90107080
518 0x90107073: nop
519 0x90107074: nop
520 0x90107075: nop
521 0x90107076: nop
522 @end example
524 @item
525 Dump 80 16 bit values at the start of the video memory.
526 @smallexample
527 (qemu) xp/80hx 0xb8000
528 0x000b8000: 0x0b50 0x0b6c 0x0b65 0x0b78 0x0b38 0x0b36 0x0b2f 0x0b42
529 0x000b8010: 0x0b6f 0x0b63 0x0b68 0x0b73 0x0b20 0x0b56 0x0b47 0x0b41
530 0x000b8020: 0x0b42 0x0b69 0x0b6f 0x0b73 0x0b20 0x0b63 0x0b75 0x0b72
531 0x000b8030: 0x0b72 0x0b65 0x0b6e 0x0b74 0x0b2d 0x0b63 0x0b76 0x0b73
532 0x000b8040: 0x0b20 0x0b30 0x0b35 0x0b20 0x0b4e 0x0b6f 0x0b76 0x0b20
533 0x000b8050: 0x0b32 0x0b30 0x0b30 0x0b33 0x0720 0x0720 0x0720 0x0720
534 0x000b8060: 0x0720 0x0720 0x0720 0x0720 0x0720 0x0720 0x0720 0x0720
535 0x000b8070: 0x0720 0x0720 0x0720 0x0720 0x0720 0x0720 0x0720 0x0720
536 0x000b8080: 0x0720 0x0720 0x0720 0x0720 0x0720 0x0720 0x0720 0x0720
537 0x000b8090: 0x0720 0x0720 0x0720 0x0720 0x0720 0x0720 0x0720 0x0720
538 @end smallexample
539 @end itemize
540 ETEXI
543 .name = "p|print",
544 .args_type = "fmt:/,val:l",
545 .params = "/fmt expr",
546 .help = "print expression value (use $reg for CPU register access)",
547 .mhandler.cmd = do_print,
550 STEXI
551 @item p or print/@var{fmt} @var{expr}
552 @findex print
554 Print expression value. Only the @var{format} part of @var{fmt} is
555 used.
556 ETEXI
559 .name = "i",
560 .args_type = "fmt:/,addr:i,index:i.",
561 .params = "/fmt addr",
562 .help = "I/O port read",
563 .mhandler.cmd = do_ioport_read,
566 STEXI
567 Read I/O port.
568 ETEXI
571 .name = "o",
572 .args_type = "fmt:/,addr:i,val:i",
573 .params = "/fmt addr value",
574 .help = "I/O port write",
575 .mhandler.cmd = do_ioport_write,
578 STEXI
579 Write to I/O port.
580 ETEXI
583 .name = "sendkey",
584 .args_type = "string:s,hold_time:i?",
585 .params = "keys [hold_ms]",
586 .help = "send keys to the VM (e.g. 'sendkey ctrl-alt-f1', default hold time=100 ms)",
587 .mhandler.cmd = do_sendkey,
590 STEXI
591 @item sendkey @var{keys}
592 @findex sendkey
594 Send @var{keys} to the emulator. @var{keys} could be the name of the
595 key or @code{#} followed by the raw value in either decimal or hexadecimal
596 format. Use @code{-} to press several keys simultaneously. Example:
597 @example
598 sendkey ctrl-alt-f1
599 @end example
601 This command is useful to send keys that your graphical user interface
602 intercepts at low level, such as @code{ctrl-alt-f1} in X Window.
603 ETEXI
606 .name = "system_reset",
607 .args_type = "",
608 .params = "",
609 .help = "reset the system",
610 .user_print = monitor_user_noop,
611 .mhandler.cmd_new = do_system_reset,
614 STEXI
615 @item system_reset
616 @findex system_reset
618 Reset the system.
619 ETEXI
620 SQMP
621 system_reset
622 ------------
624 Reset the system.
626 Arguments: None.
628 Example:
630 -> { "execute": "system_reset" }
631 <- { "return": {} }
633 EQMP
636 .name = "system_powerdown",
637 .args_type = "",
638 .params = "",
639 .help = "send system power down event",
640 .user_print = monitor_user_noop,
641 .mhandler.cmd_new = do_system_powerdown,
644 STEXI
645 @item system_powerdown
646 @findex system_powerdown
648 Power down the system (if supported).
649 ETEXI
650 SQMP
651 system_powerdown
652 ----------------
654 Send system power down event.
656 Arguments: None.
658 Example:
660 -> { "execute": "system_powerdown" }
661 <- { "return": {} }
663 EQMP
666 .name = "sum",
667 .args_type = "start:i,size:i",
668 .params = "addr size",
669 .help = "compute the checksum of a memory region",
670 .mhandler.cmd = do_sum,
673 STEXI
674 @item sum @var{addr} @var{size}
675 @findex sum
677 Compute the checksum of a memory region.
678 ETEXI
681 .name = "usb_add",
682 .args_type = "devname:s",
683 .params = "device",
684 .help = "add USB device (e.g. 'host:bus.addr' or 'host:vendor_id:product_id')",
685 .mhandler.cmd = do_usb_add,
688 STEXI
689 @item usb_add @var{devname}
690 @findex usb_add
692 Add the USB device @var{devname}. For details of available devices see
693 @ref{usb_devices}
694 ETEXI
697 .name = "usb_del",
698 .args_type = "devname:s",
699 .params = "device",
700 .help = "remove USB device 'bus.addr'",
701 .mhandler.cmd = do_usb_del,
704 STEXI
705 @item usb_del @var{devname}
706 @findex usb_del
708 Remove the USB device @var{devname} from the QEMU virtual USB
709 hub. @var{devname} has the syntax @code{bus.addr}. Use the monitor
710 command @code{info usb} to see the devices you can remove.
711 ETEXI
714 .name = "device_add",
715 .args_type = "device:O",
716 .params = "driver[,prop=value][,...]",
717 .help = "add device, like -device on the command line",
718 .user_print = monitor_user_noop,
719 .mhandler.cmd_new = do_device_add,
722 STEXI
723 @item device_add @var{config}
724 @findex device_add
726 Add device.
727 ETEXI
728 SQMP
729 device_add
730 ----------
732 Add a device.
734 Arguments:
736 - "driver": the name of the new device's driver (json-string)
737 - "bus": the device's parent bus (device tree path, json-string, optional)
738 - "id": the device's ID, must be unique (json-string)
739 - device properties
741 Example:
743 -> { "execute": "device_add", "arguments": { "driver": "e1000", "id": "net1" } }
744 <- { "return": {} }
746 Notes:
748 (1) For detailed information about this command, please refer to the
749 'docs/qdev-device-use.txt' file.
751 (2) It's possible to list device properties by running QEMU with the
752 "-device DEVICE,\?" command-line argument, where DEVICE is the device's name
754 EQMP
757 .name = "device_del",
758 .args_type = "id:s",
759 .params = "device",
760 .help = "remove device",
761 .user_print = monitor_user_noop,
762 .mhandler.cmd_new = do_device_del,
765 STEXI
766 @item device_del @var{id}
767 @findex device_del
769 Remove device @var{id}.
770 ETEXI
771 SQMP
772 device_del
773 ----------
775 Remove a device.
777 Arguments:
779 - "id": the device's ID (json-string)
781 Example:
783 -> { "execute": "device_del", "arguments": { "id": "net1" } }
784 <- { "return": {} }
786 EQMP
789 .name = "cpu",
790 .args_type = "index:i",
791 .params = "index",
792 .help = "set the default CPU",
793 .user_print = monitor_user_noop,
794 .mhandler.cmd_new = do_cpu_set,
797 STEXI
798 @item cpu @var{index}
799 @findex cpu
800 Set the default CPU.
801 ETEXI
802 SQMP
806 Set the default CPU.
808 Arguments:
810 - "index": the CPU's index (json-int)
812 Example:
814 -> { "execute": "cpu", "arguments": { "index": 0 } }
815 <- { "return": {} }
817 Note: CPUs' indexes are obtained with the 'query-cpus' command.
819 EQMP
822 .name = "mouse_move",
823 .args_type = "dx_str:s,dy_str:s,dz_str:s?",
824 .params = "dx dy [dz]",
825 .help = "send mouse move events",
826 .mhandler.cmd = do_mouse_move,
829 STEXI
830 @item mouse_move @var{dx} @var{dy} [@var{dz}]
831 @findex mouse_move
832 Move the active mouse to the specified coordinates @var{dx} @var{dy}
833 with optional scroll axis @var{dz}.
834 ETEXI
837 .name = "mouse_button",
838 .args_type = "button_state:i",
839 .params = "state",
840 .help = "change mouse button state (1=L, 2=M, 4=R)",
841 .mhandler.cmd = do_mouse_button,
844 STEXI
845 @item mouse_button @var{val}
846 @findex mouse_button
847 Change the active mouse button state @var{val} (1=L, 2=M, 4=R).
848 ETEXI
851 .name = "mouse_set",
852 .args_type = "index:i",
853 .params = "index",
854 .help = "set which mouse device receives events",
855 .mhandler.cmd = do_mouse_set,
858 STEXI
859 @item mouse_set @var{index}
860 @findex mouse_set
861 Set which mouse device receives events at given @var{index}, index
862 can be obtained with
863 @example
864 info mice
865 @end example
866 ETEXI
868 #ifdef HAS_AUDIO
870 .name = "wavcapture",
871 .args_type = "path:F,freq:i?,bits:i?,nchannels:i?",
872 .params = "path [frequency [bits [channels]]]",
873 .help = "capture audio to a wave file (default frequency=44100 bits=16 channels=2)",
874 .mhandler.cmd = do_wav_capture,
876 #endif
877 STEXI
878 @item wavcapture @var{filename} [@var{frequency} [@var{bits} [@var{channels}]]]
879 @findex wavcapture
880 Capture audio into @var{filename}. Using sample rate @var{frequency}
881 bits per sample @var{bits} and number of channels @var{channels}.
883 Defaults:
884 @itemize @minus
885 @item Sample rate = 44100 Hz - CD quality
886 @item Bits = 16
887 @item Number of channels = 2 - Stereo
888 @end itemize
889 ETEXI
891 #ifdef HAS_AUDIO
893 .name = "stopcapture",
894 .args_type = "n:i",
895 .params = "capture index",
896 .help = "stop capture",
897 .mhandler.cmd = do_stop_capture,
899 #endif
900 STEXI
901 @item stopcapture @var{index}
902 @findex stopcapture
903 Stop capture with a given @var{index}, index can be obtained with
904 @example
905 info capture
906 @end example
907 ETEXI
910 .name = "memsave",
911 .args_type = "val:l,size:i,filename:s",
912 .params = "addr size file",
913 .help = "save to disk virtual memory dump starting at 'addr' of size 'size'",
914 .user_print = monitor_user_noop,
915 .mhandler.cmd_new = do_memory_save,
918 STEXI
919 @item memsave @var{addr} @var{size} @var{file}
920 @findex memsave
921 save to disk virtual memory dump starting at @var{addr} of size @var{size}.
922 ETEXI
923 SQMP
924 memsave
925 -------
927 Save to disk virtual memory dump starting at 'val' of size 'size'.
929 Arguments:
931 - "val": the starting address (json-int)
932 - "size": the memory size, in bytes (json-int)
933 - "filename": file path (json-string)
935 Example:
937 -> { "execute": "memsave",
938 "arguments": { "val": 10,
939 "size": 100,
940 "filename": "/tmp/virtual-mem-dump" } }
941 <- { "return": {} }
943 Note: Depends on the current CPU.
945 EQMP
948 .name = "pmemsave",
949 .args_type = "val:l,size:i,filename:s",
950 .params = "addr size file",
951 .help = "save to disk physical memory dump starting at 'addr' of size 'size'",
952 .user_print = monitor_user_noop,
953 .mhandler.cmd_new = do_physical_memory_save,
956 STEXI
957 @item pmemsave @var{addr} @var{size} @var{file}
958 @findex pmemsave
959 save to disk physical memory dump starting at @var{addr} of size @var{size}.
960 ETEXI
961 SQMP
962 pmemsave
963 --------
965 Save to disk physical memory dump starting at 'val' of size 'size'.
967 Arguments:
969 - "val": the starting address (json-int)
970 - "size": the memory size, in bytes (json-int)
971 - "filename": file path (json-string)
973 Example:
975 -> { "execute": "pmemsave",
976 "arguments": { "val": 10,
977 "size": 100,
978 "filename": "/tmp/physical-mem-dump" } }
979 <- { "return": {} }
981 EQMP
984 .name = "boot_set",
985 .args_type = "bootdevice:s",
986 .params = "bootdevice",
987 .help = "define new values for the boot device list",
988 .mhandler.cmd = do_boot_set,
991 STEXI
992 @item boot_set @var{bootdevicelist}
993 @findex boot_set
995 Define new values for the boot device list. Those values will override
996 the values specified on the command line through the @code{-boot} option.
998 The values that can be specified here depend on the machine type, but are
999 the same that can be specified in the @code{-boot} command line option.
1000 ETEXI
1002 #if defined(TARGET_I386)
1004 .name = "nmi",
1005 .args_type = "cpu_index:i",
1006 .params = "cpu",
1007 .help = "inject an NMI on the given CPU",
1008 .mhandler.cmd = do_inject_nmi,
1010 #endif
1011 STEXI
1012 @item nmi @var{cpu}
1013 @findex nmi
1014 Inject an NMI on the given CPU (x86 only).
1015 ETEXI
1018 .name = "migrate",
1019 .args_type = "detach:-d,blk:-b,inc:-i,uri:s",
1020 .params = "[-d] [-b] [-i] uri",
1021 .help = "migrate to URI (using -d to not wait for completion)"
1022 "\n\t\t\t -b for migration without shared storage with"
1023 " full copy of disk\n\t\t\t -i for migration without "
1024 "shared storage with incremental copy of disk "
1025 "(base image shared between src and destination)",
1026 .user_print = monitor_user_noop,
1027 .mhandler.cmd_new = do_migrate,
1031 STEXI
1032 @item migrate [-d] [-b] [-i] @var{uri}
1033 @findex migrate
1034 Migrate to @var{uri} (using -d to not wait for completion).
1035 -b for migration with full copy of disk
1036 -i for migration with incremental copy of disk (base image is shared)
1037 ETEXI
1038 SQMP
1039 migrate
1040 -------
1042 Migrate to URI.
1044 Arguments:
1046 - "blk": block migration, full disk copy (json-bool, optional)
1047 - "inc": incremental disk copy (json-bool, optional)
1048 - "uri": Destination URI (json-string)
1050 Example:
1052 -> { "execute": "migrate", "arguments": { "uri": "tcp:0:4446" } }
1053 <- { "return": {} }
1055 Notes:
1057 (1) The 'query-migrate' command should be used to check migration's progress
1058 and final result (this information is provided by the 'status' member)
1059 (2) All boolean arguments default to false
1060 (3) The user Monitor's "detach" argument is invalid in QMP and should not
1061 be used
1063 EQMP
1066 .name = "migrate_cancel",
1067 .args_type = "",
1068 .params = "",
1069 .help = "cancel the current VM migration",
1070 .user_print = monitor_user_noop,
1071 .mhandler.cmd_new = do_migrate_cancel,
1074 STEXI
1075 @item migrate_cancel
1076 @findex migrate_cancel
1077 Cancel the current VM migration.
1078 ETEXI
1079 SQMP
1080 migrate_cancel
1081 --------------
1083 Cancel the current migration.
1085 Arguments: None.
1087 Example:
1089 -> { "execute": "migrate_cancel" }
1090 <- { "return": {} }
1092 EQMP
1095 .name = "migrate_set_speed",
1096 .args_type = "value:f",
1097 .params = "value",
1098 .help = "set maximum speed (in bytes) for migrations",
1099 .user_print = monitor_user_noop,
1100 .mhandler.cmd_new = do_migrate_set_speed,
1103 STEXI
1104 @item migrate_set_speed @var{value}
1105 @findex migrate_set_speed
1106 Set maximum speed to @var{value} (in bytes) for migrations.
1107 ETEXI
1108 SQMP
1109 migrate_set_speed
1110 -----------------
1112 Set maximum speed for migrations.
1114 Arguments:
1116 - "value": maximum speed, in bytes per second (json-number)
1118 Example:
1120 -> { "execute": "migrate_set_speed", "arguments": { "value": 1024 } }
1121 <- { "return": {} }
1123 EQMP
1126 .name = "migrate_set_downtime",
1127 .args_type = "value:T",
1128 .params = "value",
1129 .help = "set maximum tolerated downtime (in seconds) for migrations",
1130 .user_print = monitor_user_noop,
1131 .mhandler.cmd_new = do_migrate_set_downtime,
1134 STEXI
1135 @item migrate_set_downtime @var{second}
1136 @findex migrate_set_downtime
1137 Set maximum tolerated downtime (in seconds) for migration.
1138 ETEXI
1139 SQMP
1140 migrate_set_downtime
1141 --------------------
1143 Set maximum tolerated downtime (in seconds) for migrations.
1145 Arguments:
1147 - "value": maximum downtime (json-number)
1149 Example:
1151 -> { "execute": "migrate_set_downtime", "arguments": { "value": 0.1 } }
1152 <- { "return": {} }
1154 EQMP
1156 #if defined(TARGET_I386)
1158 .name = "drive_add",
1159 .args_type = "pci_addr:s,opts:s",
1160 .params = "[[<domain>:]<bus>:]<slot>\n"
1161 "[file=file][,if=type][,bus=n]\n"
1162 "[,unit=m][,media=d][index=i]\n"
1163 "[,cyls=c,heads=h,secs=s[,trans=t]]\n"
1164 "[snapshot=on|off][,cache=on|off]",
1165 .help = "add drive to PCI storage controller",
1166 .mhandler.cmd = drive_hot_add,
1168 #endif
1170 STEXI
1171 @item drive_add
1172 @findex drive_add
1173 Add drive to PCI storage controller.
1174 ETEXI
1176 #if defined(TARGET_I386)
1178 .name = "pci_add",
1179 .args_type = "pci_addr:s,type:s,opts:s?",
1180 .params = "auto|[[<domain>:]<bus>:]<slot> nic|storage|host [[vlan=n][,macaddr=addr][,model=type]] [file=file][,if=type][,bus=nr]... [host=02:00.0[,name=string][,dma=none]",
1181 .help = "hot-add PCI device",
1182 .mhandler.cmd = pci_device_hot_add,
1184 #endif
1186 STEXI
1187 @item pci_add
1188 @findex pci_add
1189 Hot-add PCI device.
1190 ETEXI
1192 #if defined(TARGET_I386)
1194 .name = "pci_del",
1195 .args_type = "pci_addr:s",
1196 .params = "[[<domain>:]<bus>:]<slot>",
1197 .help = "hot remove PCI device",
1198 .mhandler.cmd = do_pci_device_hot_remove,
1200 #endif
1202 STEXI
1203 @item pci_del
1204 @findex pci_del
1205 Hot remove PCI device.
1206 ETEXI
1209 .name = "host_net_add",
1210 .args_type = "device:s,opts:s?",
1211 .params = "tap|user|socket|vde|dump [options]",
1212 .help = "add host VLAN client",
1213 .mhandler.cmd = net_host_device_add,
1216 STEXI
1217 @item host_net_add
1218 @findex host_net_add
1219 Add host VLAN client.
1220 ETEXI
1223 .name = "host_net_remove",
1224 .args_type = "vlan_id:i,device:s",
1225 .params = "vlan_id name",
1226 .help = "remove host VLAN client",
1227 .mhandler.cmd = net_host_device_remove,
1230 STEXI
1231 @item host_net_remove
1232 @findex host_net_remove
1233 Remove host VLAN client.
1234 ETEXI
1237 .name = "netdev_add",
1238 .args_type = "netdev:O",
1239 .params = "[user|tap|socket],id=str[,prop=value][,...]",
1240 .help = "add host network device",
1241 .user_print = monitor_user_noop,
1242 .mhandler.cmd_new = do_netdev_add,
1245 STEXI
1246 @item netdev_add
1247 @findex netdev_add
1248 Add host network device.
1249 ETEXI
1250 SQMP
1251 netdev_add
1252 ----------
1254 Add host network device.
1256 Arguments:
1258 - "type": the device type, "tap", "user", ... (json-string)
1259 - "id": the device's ID, must be unique (json-string)
1260 - device options
1262 Example:
1264 -> { "execute": "netdev_add", "arguments": { "type": "user", "id": "netdev1" } }
1265 <- { "return": {} }
1267 Note: The supported device options are the same ones supported by the '-net'
1268 command-line argument, which are listed in the '-help' output or QEMU's
1269 manual
1271 EQMP
1274 .name = "netdev_del",
1275 .args_type = "id:s",
1276 .params = "id",
1277 .help = "remove host network device",
1278 .user_print = monitor_user_noop,
1279 .mhandler.cmd_new = do_netdev_del,
1282 STEXI
1283 @item netdev_del
1284 @findex netdev_del
1285 Remove host network device.
1286 ETEXI
1287 SQMP
1288 netdev_del
1289 ----------
1291 Remove host network device.
1293 Arguments:
1295 - "id": the device's ID, must be unique (json-string)
1297 Example:
1299 -> { "execute": "netdev_del", "arguments": { "id": "netdev1" } }
1300 <- { "return": {} }
1302 EQMP
1304 #ifdef CONFIG_SLIRP
1306 .name = "hostfwd_add",
1307 .args_type = "arg1:s,arg2:s?,arg3:s?",
1308 .params = "[vlan_id name] [tcp|udp]:[hostaddr]:hostport-[guestaddr]:guestport",
1309 .help = "redirect TCP or UDP connections from host to guest (requires -net user)",
1310 .mhandler.cmd = net_slirp_hostfwd_add,
1312 #endif
1313 STEXI
1314 @item hostfwd_add
1315 @findex hostfwd_add
1316 Redirect TCP or UDP connections from host to guest (requires -net user).
1317 ETEXI
1319 #ifdef CONFIG_SLIRP
1321 .name = "hostfwd_remove",
1322 .args_type = "arg1:s,arg2:s?,arg3:s?",
1323 .params = "[vlan_id name] [tcp|udp]:[hostaddr]:hostport",
1324 .help = "remove host-to-guest TCP or UDP redirection",
1325 .mhandler.cmd = net_slirp_hostfwd_remove,
1328 #endif
1329 STEXI
1330 @item hostfwd_remove
1331 @findex hostfwd_remove
1332 Remove host-to-guest TCP or UDP redirection.
1333 ETEXI
1336 .name = "balloon",
1337 .args_type = "value:M",
1338 .params = "target",
1339 .help = "request VM to change its memory allocation (in MB)",
1340 .user_print = monitor_user_noop,
1341 .mhandler.cmd_async = do_balloon,
1342 .flags = MONITOR_CMD_ASYNC,
1345 STEXI
1346 @item balloon @var{value}
1347 @findex balloon
1348 Request VM to change its memory allocation to @var{value} (in MB).
1349 ETEXI
1350 SQMP
1351 balloon
1352 -------
1354 Request VM to change its memory allocation (in bytes).
1356 Arguments:
1358 - "value": New memory allocation (json-int)
1360 Example:
1362 -> { "execute": "balloon", "arguments": { "value": 536870912 } }
1363 <- { "return": {} }
1365 EQMP
1368 .name = "set_link",
1369 .args_type = "name:s,up:b",
1370 .params = "name on|off",
1371 .help = "change the link status of a network adapter",
1372 .user_print = monitor_user_noop,
1373 .mhandler.cmd_new = do_set_link,
1376 STEXI
1377 @item set_link @var{name} [on|off]
1378 @findex set_link
1379 Switch link @var{name} on (i.e. up) or off (i.e. down).
1380 ETEXI
1381 SQMP
1382 set_link
1383 --------
1385 Change the link status of a network adapter.
1387 Arguments:
1389 - "name": network device name (json-string)
1390 - "up": status is up (json-bool)
1392 Example:
1394 -> { "execute": "set_link", "arguments": { "name": "e1000.0", "up": false } }
1395 <- { "return": {} }
1397 EQMP
1400 .name = "watchdog_action",
1401 .args_type = "action:s",
1402 .params = "[reset|shutdown|poweroff|pause|debug|none]",
1403 .help = "change watchdog action",
1404 .mhandler.cmd = do_watchdog_action,
1407 STEXI
1408 @item watchdog_action
1409 @findex watchdog_action
1410 Change watchdog action.
1411 ETEXI
1414 .name = "acl_show",
1415 .args_type = "aclname:s",
1416 .params = "aclname",
1417 .help = "list rules in the access control list",
1418 .mhandler.cmd = do_acl_show,
1421 STEXI
1422 @item acl_show @var{aclname}
1423 @findex acl_show
1424 List all the matching rules in the access control list, and the default
1425 policy. There are currently two named access control lists,
1426 @var{vnc.x509dname} and @var{vnc.username} matching on the x509 client
1427 certificate distinguished name, and SASL username respectively.
1428 ETEXI
1431 .name = "acl_policy",
1432 .args_type = "aclname:s,policy:s",
1433 .params = "aclname allow|deny",
1434 .help = "set default access control list policy",
1435 .mhandler.cmd = do_acl_policy,
1438 STEXI
1439 @item acl_policy @var{aclname} @code{allow|deny}
1440 @findex acl_policy
1441 Set the default access control list policy, used in the event that
1442 none of the explicit rules match. The default policy at startup is
1443 always @code{deny}.
1444 ETEXI
1447 .name = "acl_add",
1448 .args_type = "aclname:s,match:s,policy:s,index:i?",
1449 .params = "aclname match allow|deny [index]",
1450 .help = "add a match rule to the access control list",
1451 .mhandler.cmd = do_acl_add,
1454 STEXI
1455 @item acl_add @var{aclname} @var{match} @code{allow|deny} [@var{index}]
1456 @findex acl_add
1457 Add a match rule to the access control list, allowing or denying access.
1458 The match will normally be an exact username or x509 distinguished name,
1459 but can optionally include wildcard globs. eg @code{*@@EXAMPLE.COM} to
1460 allow all users in the @code{EXAMPLE.COM} kerberos realm. The match will
1461 normally be appended to the end of the ACL, but can be inserted
1462 earlier in the list if the optional @var{index} parameter is supplied.
1463 ETEXI
1466 .name = "acl_remove",
1467 .args_type = "aclname:s,match:s",
1468 .params = "aclname match",
1469 .help = "remove a match rule from the access control list",
1470 .mhandler.cmd = do_acl_remove,
1473 STEXI
1474 @item acl_remove @var{aclname} @var{match}
1475 @findex acl_remove
1476 Remove the specified match rule from the access control list.
1477 ETEXI
1480 .name = "acl_reset",
1481 .args_type = "aclname:s",
1482 .params = "aclname",
1483 .help = "reset the access control list",
1484 .mhandler.cmd = do_acl_reset,
1487 STEXI
1488 @item acl_reset @var{aclname}
1489 @findex acl_reset
1490 Remove all matches from the access control list, and set the default
1491 policy back to @code{deny}.
1492 ETEXI
1494 #if defined(TARGET_I386)
1497 .name = "mce",
1498 .args_type = "cpu_index:i,bank:i,status:l,mcg_status:l,addr:l,misc:l",
1499 .params = "cpu bank status mcgstatus addr misc",
1500 .help = "inject a MCE on the given CPU",
1501 .mhandler.cmd = do_inject_mce,
1504 #endif
1505 STEXI
1506 @item mce @var{cpu} @var{bank} @var{status} @var{mcgstatus} @var{addr} @var{misc}
1507 @findex mce (x86)
1508 Inject an MCE on the given CPU (x86 only).
1509 ETEXI
1512 .name = "getfd",
1513 .args_type = "fdname:s",
1514 .params = "getfd name",
1515 .help = "receive a file descriptor via SCM rights and assign it a name",
1516 .user_print = monitor_user_noop,
1517 .mhandler.cmd_new = do_getfd,
1520 STEXI
1521 @item getfd @var{fdname}
1522 @findex getfd
1523 If a file descriptor is passed alongside this command using the SCM_RIGHTS
1524 mechanism on unix sockets, it is stored using the name @var{fdname} for
1525 later use by other monitor commands.
1526 ETEXI
1527 SQMP
1528 getfd
1529 -----
1531 Receive a file descriptor via SCM rights and assign it a name.
1533 Arguments:
1535 - "fdname": file descriptor name (json-string)
1537 Example:
1539 -> { "execute": "getfd", "arguments": { "fdname": "fd1" } }
1540 <- { "return": {} }
1542 EQMP
1545 .name = "closefd",
1546 .args_type = "fdname:s",
1547 .params = "closefd name",
1548 .help = "close a file descriptor previously passed via SCM rights",
1549 .user_print = monitor_user_noop,
1550 .mhandler.cmd_new = do_closefd,
1553 STEXI
1554 @item closefd @var{fdname}
1555 @findex closefd
1556 Close the file descriptor previously assigned to @var{fdname} using the
1557 @code{getfd} command. This is only needed if the file descriptor was never
1558 used by another monitor command.
1559 ETEXI
1560 SQMP
1561 closefd
1562 -------
1564 Close a file descriptor previously passed via SCM rights.
1566 Arguments:
1568 - "fdname": file descriptor name (json-string)
1570 Example:
1572 -> { "execute": "closefd", "arguments": { "fdname": "fd1" } }
1573 <- { "return": {} }
1575 EQMP
1578 .name = "block_passwd",
1579 .args_type = "device:B,password:s",
1580 .params = "block_passwd device password",
1581 .help = "set the password of encrypted block devices",
1582 .user_print = monitor_user_noop,
1583 .mhandler.cmd_new = do_block_set_passwd,
1586 STEXI
1587 @item block_passwd @var{device} @var{password}
1588 @findex block_passwd
1589 Set the encrypted device @var{device} password to @var{password}
1590 ETEXI
1591 SQMP
1592 block_passwd
1593 ------------
1595 Set the password of encrypted block devices.
1597 Arguments:
1599 - "device": device name (json-string)
1600 - "password": password (json-string)
1602 Example:
1604 -> { "execute": "block_passwd", "arguments": { "device": "ide0-hd0",
1605 "password": "12345" } }
1606 <- { "return": {} }
1608 EQMP
1611 .name = "cpu_set",
1612 .args_type = "cpu:i,state:s",
1613 .params = "cpu [online|offline]",
1614 .help = "change cpu state",
1615 .mhandler.cmd = do_cpu_set_nr,
1618 STEXI
1619 @item cpu_set @var{cpu} [online|offline]
1620 Set CPU @var{cpu} online or offline.
1621 ETEXI
1624 .name = "qmp_capabilities",
1625 .args_type = "",
1626 .params = "",
1627 .help = "enable QMP capabilities",
1628 .user_print = monitor_user_noop,
1629 .mhandler.cmd_new = do_qmp_capabilities,
1632 STEXI
1633 @item qmp_capabilities
1634 @findex qmp_capabilities
1635 Enable the specified QMP capabilities
1636 ETEXI
1637 SQMP
1638 qmp_capabilities
1639 ----------------
1641 Enable QMP capabilities.
1643 Arguments: None.
1645 Example:
1647 -> { "execute": "qmp_capabilities" }
1648 <- { "return": {} }
1650 Note: This command must be issued before issuing any other command.
1652 EQMP
1655 HXCOMM Keep the 'info' command at the end!
1656 HXCOMM This is required for the QMP documentation layout.
1658 SQMP
1660 3. Query Commands
1661 =================
1663 EQMP
1666 .name = "info",
1667 .args_type = "item:s?",
1668 .params = "[subcommand]",
1669 .help = "show various information about the system state",
1670 .user_print = monitor_user_noop,
1671 .mhandler.cmd_new = do_info,
1674 STEXI
1675 @item info @var{subcommand}
1676 @findex info
1677 Show various information about the system state.
1679 @table @option
1680 @item info version
1681 show the version of QEMU
1682 ETEXI
1683 SQMP
1684 query-version
1685 -------------
1687 Show QEMU version.
1689 Return a json-object with the following information:
1691 - "qemu": A json-object containing three integer values:
1692 - "major": QEMU's major version (json-int)
1693 - "minor": QEMU's minor version (json-int)
1694 - "micro": QEMU's micro version (json-int)
1695 - "package": package's version (json-string)
1697 Example:
1699 -> { "execute": "query-version" }
1700 <- {
1701 "return":{
1702 "qemu":{
1703 "major":0,
1704 "minor":11,
1705 "micro":5
1707 "package":""
1711 EQMP
1713 STEXI
1714 @item info commands
1715 list QMP available commands
1716 ETEXI
1717 SQMP
1718 query-commands
1719 --------------
1721 List QMP available commands.
1723 Each command is represented by a json-object, the returned value is a json-array
1724 of all commands.
1726 Each json-object contain:
1728 - "name": command's name (json-string)
1730 Example:
1732 -> { "execute": "query-commands" }
1733 <- {
1734 "return":[
1736 "name":"query-balloon"
1739 "name":"system_powerdown"
1744 Note: This example has been shortened as the real response is too long.
1746 EQMP
1748 STEXI
1749 @item info network
1750 show the various VLANs and the associated devices
1751 ETEXI
1753 STEXI
1754 @item info chardev
1755 show the character devices
1756 ETEXI
1757 SQMP
1758 query-chardev
1759 -------------
1761 Each device is represented by a json-object. The returned value is a json-array
1762 of all devices.
1764 Each json-object contain the following:
1766 - "label": device's label (json-string)
1767 - "filename": device's file (json-string)
1769 Example:
1771 -> { "execute": "query-chardev" }
1772 <- {
1773 "return":[
1775 "label":"monitor",
1776 "filename":"stdio"
1779 "label":"serial0",
1780 "filename":"vc"
1785 EQMP
1787 STEXI
1788 @item info block
1789 show the block devices
1790 ETEXI
1791 SQMP
1792 query-block
1793 -----------
1795 Show the block devices.
1797 Each block device information is stored in a json-object and the returned value
1798 is a json-array of all devices.
1800 Each json-object contain the following:
1802 - "device": device name (json-string)
1803 - "type": device type (json-string)
1804 - Possible values: "hd", "cdrom", "floppy", "unknown"
1805 - "removable": true if the device is removable, false otherwise (json-bool)
1806 - "locked": true if the device is locked, false otherwise (json-bool)
1807 - "inserted": only present if the device is inserted, it is a json-object
1808 containing the following:
1809 - "file": device file name (json-string)
1810 - "ro": true if read-only, false otherwise (json-bool)
1811 - "drv": driver format name (json-string)
1812 - Possible values: "blkdebug", "bochs", "cloop", "cow", "dmg",
1813 "file", "file", "ftp", "ftps", "host_cdrom",
1814 "host_device", "host_floppy", "http", "https",
1815 "nbd", "parallels", "qcow", "qcow2", "raw",
1816 "tftp", "vdi", "vmdk", "vpc", "vvfat"
1817 - "backing_file": backing file name (json-string, optional)
1818 - "encrypted": true if encrypted, false otherwise (json-bool)
1820 Example:
1822 -> { "execute": "query-block" }
1823 <- {
1824 "return":[
1826 "device":"ide0-hd0",
1827 "locked":false,
1828 "removable":false,
1829 "inserted":{
1830 "ro":false,
1831 "drv":"qcow2",
1832 "encrypted":false,
1833 "file":"disks/test.img"
1835 "type":"hd"
1838 "device":"ide1-cd0",
1839 "locked":false,
1840 "removable":true,
1841 "type":"cdrom"
1844 "device":"floppy0",
1845 "locked":false,
1846 "removable":true,
1847 "type": "floppy"
1850 "device":"sd0",
1851 "locked":false,
1852 "removable":true,
1853 "type":"floppy"
1858 EQMP
1860 STEXI
1861 @item info blockstats
1862 show block device statistics
1863 ETEXI
1864 SQMP
1865 query-blockstats
1866 ----------------
1868 Show block device statistics.
1870 Each device statistic information is stored in a json-object and the returned
1871 value is a json-array of all devices.
1873 Each json-object contain the following:
1875 - "device": device name (json-string)
1876 - "stats": A json-object with the statistics information, it contains:
1877 - "rd_bytes": bytes read (json-int)
1878 - "wr_bytes": bytes written (json-int)
1879 - "rd_operations": read operations (json-int)
1880 - "wr_operations": write operations (json-int)
1881 - "wr_highest_offset": Highest offset of a sector written since the
1882 BlockDriverState has been opened (json-int)
1883 - "parent": Contains recursively the statistics of the underlying
1884 protocol (e.g. the host file for a qcow2 image). If there is
1885 no underlying protocol, this field is omitted
1886 (json-object, optional)
1888 Example:
1890 -> { "execute": "query-blockstats" }
1891 <- {
1892 "return":[
1894 "device":"ide0-hd0",
1895 "parent":{
1896 "stats":{
1897 "wr_highest_offset":3686448128,
1898 "wr_bytes":9786368,
1899 "wr_operations":751,
1900 "rd_bytes":122567168,
1901 "rd_operations":36772
1904 "stats":{
1905 "wr_highest_offset":2821110784,
1906 "wr_bytes":9786368,
1907 "wr_operations":692,
1908 "rd_bytes":122739200,
1909 "rd_operations":36604
1913 "device":"ide1-cd0",
1914 "stats":{
1915 "wr_highest_offset":0,
1916 "wr_bytes":0,
1917 "wr_operations":0,
1918 "rd_bytes":0,
1919 "rd_operations":0
1923 "device":"floppy0",
1924 "stats":{
1925 "wr_highest_offset":0,
1926 "wr_bytes":0,
1927 "wr_operations":0,
1928 "rd_bytes":0,
1929 "rd_operations":0
1933 "device":"sd0",
1934 "stats":{
1935 "wr_highest_offset":0,
1936 "wr_bytes":0,
1937 "wr_operations":0,
1938 "rd_bytes":0,
1939 "rd_operations":0
1945 EQMP
1947 STEXI
1948 @item info registers
1949 show the cpu registers
1950 @item info cpus
1951 show infos for each CPU
1952 ETEXI
1953 SQMP
1954 query-cpus
1955 ----------
1957 Show CPU information.
1959 Return a json-array. Each CPU is represented by a json-object, which contains:
1961 - "CPU": CPU index (json-int)
1962 - "current": true if this is the current CPU, false otherwise (json-bool)
1963 - "halted": true if the cpu is halted, false otherwise (json-bool)
1964 - Current program counter. The key's name depends on the architecture:
1965 "pc": i386/x86_64 (json-int)
1966 "nip": PPC (json-int)
1967 "pc" and "npc": sparc (json-int)
1968 "PC": mips (json-int)
1970 Example:
1972 -> { "execute": "query-cpus" }
1973 <- {
1974 "return":[
1976 "CPU":0,
1977 "current":true,
1978 "halted":false,
1979 "pc":3227107138
1982 "CPU":1,
1983 "current":false,
1984 "halted":true,
1985 "pc":7108165
1990 EQMP
1992 STEXI
1993 @item info history
1994 show the command line history
1995 @item info irq
1996 show the interrupts statistics (if available)
1997 @item info pic
1998 show i8259 (PIC) state
1999 ETEXI
2001 STEXI
2002 @item info pci
2003 show emulated PCI device info
2004 ETEXI
2005 SQMP
2006 query-pci
2007 ---------
2009 PCI buses and devices information.
2011 The returned value is a json-array of all buses. Each bus is represented by
2012 a json-object, which has a key with a json-array of all PCI devices attached
2013 to it. Each device is represented by a json-object.
2015 The bus json-object contains the following:
2017 - "bus": bus number (json-int)
2018 - "devices": a json-array of json-objects, each json-object represents a
2019 PCI device
2021 The PCI device json-object contains the following:
2023 - "bus": identical to the parent's bus number (json-int)
2024 - "slot": slot number (json-int)
2025 - "function": function number (json-int)
2026 - "class_info": a json-object containing:
2027 - "desc": device class description (json-string, optional)
2028 - "class": device class number (json-int)
2029 - "id": a json-object containing:
2030 - "device": device ID (json-int)
2031 - "vendor": vendor ID (json-int)
2032 - "irq": device's IRQ if assigned (json-int, optional)
2033 - "qdev_id": qdev id string (json-string)
2034 - "pci_bridge": It's a json-object, only present if this device is a
2035 PCI bridge, contains:
2036 - "bus": bus number (json-int)
2037 - "secondary": secondary bus number (json-int)
2038 - "subordinate": subordinate bus number (json-int)
2039 - "io_range": I/O memory range information, a json-object with the
2040 following members:
2041 - "base": base address, in bytes (json-int)
2042 - "limit": limit address, in bytes (json-int)
2043 - "memory_range": memory range information, a json-object with the
2044 following members:
2045 - "base": base address, in bytes (json-int)
2046 - "limit": limit address, in bytes (json-int)
2047 - "prefetchable_range": Prefetchable memory range information, a
2048 json-object with the following members:
2049 - "base": base address, in bytes (json-int)
2050 - "limit": limit address, in bytes (json-int)
2051 - "devices": a json-array of PCI devices if there's any attached, each
2052 each element is represented by a json-object, which contains
2053 the same members of the 'PCI device json-object' described
2054 above (optional)
2055 - "regions": a json-array of json-objects, each json-object represents a
2056 memory region of this device
2058 The memory range json-object contains the following:
2060 - "base": base memory address (json-int)
2061 - "limit": limit value (json-int)
2063 The region json-object can be an I/O region or a memory region, an I/O region
2064 json-object contains the following:
2066 - "type": "io" (json-string, fixed)
2067 - "bar": BAR number (json-int)
2068 - "address": memory address (json-int)
2069 - "size": memory size (json-int)
2071 A memory region json-object contains the following:
2073 - "type": "memory" (json-string, fixed)
2074 - "bar": BAR number (json-int)
2075 - "address": memory address (json-int)
2076 - "size": memory size (json-int)
2077 - "mem_type_64": true or false (json-bool)
2078 - "prefetch": true or false (json-bool)
2080 Example:
2082 -> { "execute": "query-pci" }
2083 <- {
2084 "return":[
2086 "bus":0,
2087 "devices":[
2089 "bus":0,
2090 "qdev_id":"",
2091 "slot":0,
2092 "class_info":{
2093 "class":1536,
2094 "desc":"Host bridge"
2096 "id":{
2097 "device":32902,
2098 "vendor":4663
2100 "function":0,
2101 "regions":[
2106 "bus":0,
2107 "qdev_id":"",
2108 "slot":1,
2109 "class_info":{
2110 "class":1537,
2111 "desc":"ISA bridge"
2113 "id":{
2114 "device":32902,
2115 "vendor":28672
2117 "function":0,
2118 "regions":[
2123 "bus":0,
2124 "qdev_id":"",
2125 "slot":1,
2126 "class_info":{
2127 "class":257,
2128 "desc":"IDE controller"
2130 "id":{
2131 "device":32902,
2132 "vendor":28688
2134 "function":1,
2135 "regions":[
2137 "bar":4,
2138 "size":16,
2139 "address":49152,
2140 "type":"io"
2145 "bus":0,
2146 "qdev_id":"",
2147 "slot":2,
2148 "class_info":{
2149 "class":768,
2150 "desc":"VGA controller"
2152 "id":{
2153 "device":4115,
2154 "vendor":184
2156 "function":0,
2157 "regions":[
2159 "prefetch":true,
2160 "mem_type_64":false,
2161 "bar":0,
2162 "size":33554432,
2163 "address":4026531840,
2164 "type":"memory"
2167 "prefetch":false,
2168 "mem_type_64":false,
2169 "bar":1,
2170 "size":4096,
2171 "address":4060086272,
2172 "type":"memory"
2175 "prefetch":false,
2176 "mem_type_64":false,
2177 "bar":6,
2178 "size":65536,
2179 "address":-1,
2180 "type":"memory"
2185 "bus":0,
2186 "qdev_id":"",
2187 "irq":11,
2188 "slot":4,
2189 "class_info":{
2190 "class":1280,
2191 "desc":"RAM controller"
2193 "id":{
2194 "device":6900,
2195 "vendor":4098
2197 "function":0,
2198 "regions":[
2200 "bar":0,
2201 "size":32,
2202 "address":49280,
2203 "type":"io"
2212 Note: This example has been shortened as the real response is too long.
2214 EQMP
2216 STEXI
2217 @item info tlb
2218 show virtual to physical memory mappings (i386 only)
2219 @item info mem
2220 show the active virtual memory mappings (i386 only)
2221 ETEXI
2223 STEXI
2224 @item info jit
2225 show dynamic compiler info
2226 @item info kvm
2227 show KVM information
2228 @item info numa
2229 show NUMA information
2230 ETEXI
2232 STEXI
2233 @item info kvm
2234 show KVM information
2235 ETEXI
2236 SQMP
2237 query-kvm
2238 ---------
2240 Show KVM information.
2242 Return a json-object with the following information:
2244 - "enabled": true if KVM support is enabled, false otherwise (json-bool)
2245 - "present": true if QEMU has KVM support, false otherwise (json-bool)
2247 Example:
2249 -> { "execute": "query-kvm" }
2250 <- { "return": { "enabled": true, "present": true } }
2252 EQMP
2254 STEXI
2255 @item info usb
2256 show USB devices plugged on the virtual USB hub
2257 @item info usbhost
2258 show all USB host devices
2259 @item info profile
2260 show profiling information
2261 @item info capture
2262 show information about active capturing
2263 @item info snapshots
2264 show list of VM snapshots
2265 ETEXI
2267 STEXI
2268 @item info status
2269 show the current VM status (running|paused)
2270 ETEXI
2271 SQMP
2272 query-status
2273 ------------
2275 Return a json-object with the following information:
2277 - "running": true if the VM is running, or false if it is paused (json-bool)
2278 - "singlestep": true if the VM is in single step mode,
2279 false otherwise (json-bool)
2281 Example:
2283 -> { "execute": "query-status" }
2284 <- { "return": { "running": true, "singlestep": false } }
2286 EQMP
2288 STEXI
2289 @item info pcmcia
2290 show guest PCMCIA status
2291 ETEXI
2293 STEXI
2294 @item info mice
2295 show which guest mouse is receiving events
2296 ETEXI
2297 SQMP
2298 query-mice
2299 ----------
2301 Show VM mice information.
2303 Each mouse is represented by a json-object, the returned value is a json-array
2304 of all mice.
2306 The mouse json-object contains the following:
2308 - "name": mouse's name (json-string)
2309 - "index": mouse's index (json-int)
2310 - "current": true if this mouse is receiving events, false otherwise (json-bool)
2311 - "absolute": true if the mouse generates absolute input events (json-bool)
2313 Example:
2315 -> { "execute": "query-mice" }
2316 <- {
2317 "return":[
2319 "name":"QEMU Microsoft Mouse",
2320 "index":0,
2321 "current":false,
2322 "absolute":false
2325 "name":"QEMU PS/2 Mouse",
2326 "index":1,
2327 "current":true,
2328 "absolute":true
2333 EQMP
2335 STEXI
2336 @item info vnc
2337 show the vnc server status
2338 ETEXI
2339 SQMP
2340 query-vnc
2341 ---------
2343 Show VNC server information.
2345 Return a json-object with server information. Connected clients are returned
2346 as a json-array of json-objects.
2348 The main json-object contains the following:
2350 - "enabled": true or false (json-bool)
2351 - "host": server's IP address (json-string)
2352 - "family": address family (json-string)
2353 - Possible values: "ipv4", "ipv6", "unix", "unknown"
2354 - "service": server's port number (json-string)
2355 - "auth": authentication method (json-string)
2356 - Possible values: "invalid", "none", "ra2", "ra2ne", "sasl", "tight",
2357 "tls", "ultra", "unknown", "vencrypt", "vencrypt",
2358 "vencrypt+plain", "vencrypt+tls+none",
2359 "vencrypt+tls+plain", "vencrypt+tls+sasl",
2360 "vencrypt+tls+vnc", "vencrypt+x509+none",
2361 "vencrypt+x509+plain", "vencrypt+x509+sasl",
2362 "vencrypt+x509+vnc", "vnc"
2363 - "clients": a json-array of all connected clients
2365 Clients are described by a json-object, each one contain the following:
2367 - "host": client's IP address (json-string)
2368 - "family": address family (json-string)
2369 - Possible values: "ipv4", "ipv6", "unix", "unknown"
2370 - "service": client's port number (json-string)
2371 - "x509_dname": TLS dname (json-string, optional)
2372 - "sasl_username": SASL username (json-string, optional)
2374 Example:
2376 -> { "execute": "query-vnc" }
2377 <- {
2378 "return":{
2379 "enabled":true,
2380 "host":"0.0.0.0",
2381 "service":"50402",
2382 "auth":"vnc",
2383 "family":"ipv4",
2384 "clients":[
2386 "host":"127.0.0.1",
2387 "service":"50401",
2388 "family":"ipv4"
2394 EQMP
2396 STEXI
2397 @item info name
2398 show the current VM name
2399 ETEXI
2400 SQMP
2401 query-name
2402 ----------
2404 Show VM name.
2406 Return a json-object with the following information:
2408 - "name": VM's name (json-string, optional)
2410 Example:
2412 -> { "execute": "query-name" }
2413 <- { "return": { "name": "qemu-name" } }
2415 EQMP
2417 STEXI
2418 @item info uuid
2419 show the current VM UUID
2420 ETEXI
2421 SQMP
2422 query-uuid
2423 ----------
2425 Show VM UUID.
2427 Return a json-object with the following information:
2429 - "UUID": Universally Unique Identifier (json-string)
2431 Example:
2433 -> { "execute": "query-uuid" }
2434 <- { "return": { "UUID": "550e8400-e29b-41d4-a716-446655440000" } }
2436 EQMP
2438 STEXI
2439 @item info cpustats
2440 show CPU statistics
2441 @item info usernet
2442 show user network stack connection states
2443 ETEXI
2445 STEXI
2446 @item info migrate
2447 show migration status
2448 ETEXI
2449 SQMP
2450 query-migrate
2451 -------------
2453 Migration status.
2455 Return a json-object. If migration is active there will be another json-object
2456 with RAM migration status and if block migration is active another one with
2457 block migration status.
2459 The main json-object contains the following:
2461 - "status": migration status (json-string)
2462 - Possible values: "active", "completed", "failed", "cancelled"
2463 - "ram": only present if "status" is "active", it is a json-object with the
2464 following RAM information (in bytes):
2465 - "transferred": amount transferred (json-int)
2466 - "remaining": amount remaining (json-int)
2467 - "total": total (json-int)
2468 - "disk": only present if "status" is "active" and it is a block migration,
2469 it is a json-object with the following disk information (in bytes):
2470 - "transferred": amount transferred (json-int)
2471 - "remaining": amount remaining (json-int)
2472 - "total": total (json-int)
2474 Examples:
2476 1. Before the first migration
2478 -> { "execute": "query-migrate" }
2479 <- { "return": {} }
2481 2. Migration is done and has succeeded
2483 -> { "execute": "query-migrate" }
2484 <- { "return": { "status": "completed" } }
2486 3. Migration is done and has failed
2488 -> { "execute": "query-migrate" }
2489 <- { "return": { "status": "failed" } }
2491 4. Migration is being performed and is not a block migration:
2493 -> { "execute": "query-migrate" }
2494 <- {
2495 "return":{
2496 "status":"active",
2497 "ram":{
2498 "transferred":123,
2499 "remaining":123,
2500 "total":246
2505 5. Migration is being performed and is a block migration:
2507 -> { "execute": "query-migrate" }
2508 <- {
2509 "return":{
2510 "status":"active",
2511 "ram":{
2512 "total":1057024,
2513 "remaining":1053304,
2514 "transferred":3720
2516 "disk":{
2517 "total":20971520,
2518 "remaining":20880384,
2519 "transferred":91136
2524 EQMP
2526 STEXI
2527 @item info balloon
2528 show balloon information
2529 ETEXI
2530 SQMP
2531 query-balloon
2532 -------------
2534 Show balloon information.
2536 Make an asynchronous request for balloon info. When the request completes a
2537 json-object will be returned containing the following data:
2539 - "actual": current balloon value in bytes (json-int)
2540 - "mem_swapped_in": Amount of memory swapped in bytes (json-int, optional)
2541 - "mem_swapped_out": Amount of memory swapped out in bytes (json-int, optional)
2542 - "major_page_faults": Number of major faults (json-int, optional)
2543 - "minor_page_faults": Number of minor faults (json-int, optional)
2544 - "free_mem": Total amount of free and unused memory in
2545 bytes (json-int, optional)
2546 - "total_mem": Total amount of available memory in bytes (json-int, optional)
2548 Example:
2550 -> { "execute": "query-balloon" }
2551 <- {
2552 "return":{
2553 "actual":1073741824,
2554 "mem_swapped_in":0,
2555 "mem_swapped_out":0,
2556 "major_page_faults":142,
2557 "minor_page_faults":239245,
2558 "free_mem":1014185984,
2559 "total_mem":1044668416
2563 EQMP
2565 STEXI
2566 @item info qtree
2567 show device tree
2568 @item info qdm
2569 show qdev device model list
2570 @item info roms
2571 show roms
2572 @end table
2573 ETEXI
2575 #ifdef CONFIG_SIMPLE_TRACE
2576 STEXI
2577 @item info trace
2578 show contents of trace buffer
2579 @item info trace-events
2580 show available trace events and their state
2581 ETEXI
2582 #endif
2584 HXCOMM DO NOT add new commands after 'info', move your addition before it!
2586 STEXI
2587 @end table
2588 ETEXI