xref: /qemu/hmp-commands.hx (revision 6c1fdcf9)
1HXCOMM Use DEFHEADING() to define headings in both help text and texi
2HXCOMM Text between STEXI and ETEXI are copied to texi version and
3HXCOMM discarded from C version
4HXCOMM DEF(command, args, callback, arg_string, help) is used to construct
5HXCOMM monitor commands
6HXCOMM HXCOMM can be used for comments, discarded from both texi and C
7
8STEXI
9@table @option
10ETEXI
11
12    {
13        .name       = "help|?",
14        .args_type  = "name:s?",
15        .params     = "[cmd]",
16        .help       = "show the help",
17        .mhandler.cmd = do_help_cmd,
18    },
19
20STEXI
21@item help or ? [@var{cmd}]
22@findex help
23Show the help for all commands or just for command @var{cmd}.
24ETEXI
25
26    {
27        .name       = "commit",
28        .args_type  = "device:B",
29        .params     = "device|all",
30        .help       = "commit changes to the disk images (if -snapshot is used) or backing files",
31        .mhandler.cmd = do_commit,
32    },
33
34STEXI
35@item commit
36@findex commit
37Commit changes to the disk images (if -snapshot is used) or backing files.
38ETEXI
39
40    {
41        .name       = "q|quit",
42        .args_type  = "",
43        .params     = "",
44        .help       = "quit the emulator",
45        .user_print = monitor_user_noop,
46        .mhandler.cmd = hmp_quit,
47    },
48
49STEXI
50@item q or quit
51@findex quit
52Quit the emulator.
53ETEXI
54
55    {
56        .name       = "block_resize",
57        .args_type  = "device:B,size:o",
58        .params     = "device size",
59        .help       = "resize a block image",
60        .mhandler.cmd = hmp_block_resize,
61    },
62
63STEXI
64@item block_resize
65@findex block_resize
66Resize a block image while a guest is running.  Usually requires guest
67action to see the updated size.  Resize to a lower size is supported,
68but should be used with extreme caution.  Note that this command only
69resizes image files, it can not resize block devices like LVM volumes.
70ETEXI
71
72    {
73        .name       = "block_stream",
74        .args_type  = "device:B,base:s?",
75        .params     = "device [base]",
76        .help       = "copy data from a backing file into a block device",
77        .mhandler.cmd = hmp_block_stream,
78    },
79
80STEXI
81@item block_stream
82@findex block_stream
83Copy data from a backing file into a block device.
84ETEXI
85
86    {
87        .name       = "block_job_set_speed",
88        .args_type  = "device:B,value:o",
89        .params     = "device value",
90        .help       = "set maximum speed for a background block operation",
91        .mhandler.cmd = hmp_block_job_set_speed,
92    },
93
94STEXI
95@item block_job_set_stream
96@findex block_job_set_stream
97Set maximum speed for a background block operation.
98ETEXI
99
100    {
101        .name       = "block_job_cancel",
102        .args_type  = "device:B",
103        .params     = "device",
104        .help       = "stop an active block streaming operation",
105        .mhandler.cmd = hmp_block_job_cancel,
106    },
107
108STEXI
109@item block_job_cancel
110@findex block_job_cancel
111Stop an active block streaming operation.
112ETEXI
113
114    {
115        .name       = "eject",
116        .args_type  = "force:-f,device:B",
117        .params     = "[-f] device",
118        .help       = "eject a removable medium (use -f to force it)",
119        .mhandler.cmd = hmp_eject,
120    },
121
122STEXI
123@item eject [-f] @var{device}
124@findex eject
125Eject a removable medium (use -f to force it).
126ETEXI
127
128    {
129        .name       = "drive_del",
130        .args_type  = "id:s",
131        .params     = "device",
132        .help       = "remove host block device",
133        .user_print = monitor_user_noop,
134        .mhandler.cmd_new = do_drive_del,
135    },
136
137STEXI
138@item drive_del @var{device}
139@findex drive_del
140Remove host block device.  The result is that guest generated IO is no longer
141submitted against the host device underlying the disk.  Once a drive has
142been deleted, the QEMU Block layer returns -EIO which results in IO
143errors in the guest for applications that are reading/writing to the device.
144ETEXI
145
146    {
147        .name       = "change",
148        .args_type  = "device:B,target:F,arg:s?",
149        .params     = "device filename [format]",
150        .help       = "change a removable medium, optional format",
151        .mhandler.cmd = hmp_change,
152    },
153
154STEXI
155@item change @var{device} @var{setting}
156@findex change
157
158Change the configuration of a device.
159
160@table @option
161@item change @var{diskdevice} @var{filename} [@var{format}]
162Change the medium for a removable disk device to point to @var{filename}. eg
163
164@example
165(qemu) change ide1-cd0 /path/to/some.iso
166@end example
167
168@var{format} is optional.
169
170@item change vnc @var{display},@var{options}
171Change the configuration of the VNC server. The valid syntax for @var{display}
172and @var{options} are described at @ref{sec_invocation}. eg
173
174@example
175(qemu) change vnc localhost:1
176@end example
177
178@item change vnc password [@var{password}]
179
180Change the password associated with the VNC server. If the new password is not
181supplied, the monitor will prompt for it to be entered. VNC passwords are only
182significant up to 8 letters. eg
183
184@example
185(qemu) change vnc password
186Password: ********
187@end example
188
189@end table
190ETEXI
191
192    {
193        .name       = "screendump",
194        .args_type  = "filename:F",
195        .params     = "filename",
196        .help       = "save screen into PPM image 'filename'",
197        .user_print = monitor_user_noop,
198        .mhandler.cmd_new = do_screen_dump,
199    },
200
201STEXI
202@item screendump @var{filename}
203@findex screendump
204Save screen into PPM image @var{filename}.
205ETEXI
206
207    {
208        .name       = "logfile",
209        .args_type  = "filename:F",
210        .params     = "filename",
211        .help       = "output logs to 'filename'",
212        .mhandler.cmd = do_logfile,
213    },
214
215STEXI
216@item logfile @var{filename}
217@findex logfile
218Output logs to @var{filename}.
219ETEXI
220
221    {
222        .name       = "trace-event",
223        .args_type  = "name:s,option:b",
224        .params     = "name on|off",
225        .help       = "changes status of a specific trace event",
226        .mhandler.cmd = do_trace_event_set_state,
227    },
228
229STEXI
230@item trace-event
231@findex trace-event
232changes status of a trace event
233ETEXI
234
235#if defined(CONFIG_TRACE_SIMPLE)
236    {
237        .name       = "trace-file",
238        .args_type  = "op:s?,arg:F?",
239        .params     = "on|off|flush|set [arg]",
240        .help       = "open, close, or flush trace file, or set a new file name",
241        .mhandler.cmd = do_trace_file,
242    },
243
244STEXI
245@item trace-file on|off|flush
246@findex trace-file
247Open, close, or flush the trace file.  If no argument is given, the status of the trace file is displayed.
248ETEXI
249#endif
250
251    {
252        .name       = "log",
253        .args_type  = "items:s",
254        .params     = "item1[,...]",
255        .help       = "activate logging of the specified items to '/tmp/qemu.log'",
256        .mhandler.cmd = do_log,
257    },
258
259STEXI
260@item log @var{item1}[,...]
261@findex log
262Activate logging of the specified items to @file{/tmp/qemu.log}.
263ETEXI
264
265    {
266        .name       = "savevm",
267        .args_type  = "name:s?",
268        .params     = "[tag|id]",
269        .help       = "save a VM snapshot. If no tag or id are provided, a new snapshot is created",
270        .mhandler.cmd = do_savevm,
271    },
272
273STEXI
274@item savevm [@var{tag}|@var{id}]
275@findex savevm
276Create a snapshot of the whole virtual machine. If @var{tag} is
277provided, it is used as human readable identifier. If there is already
278a snapshot with the same tag or ID, it is replaced. More info at
279@ref{vm_snapshots}.
280ETEXI
281
282    {
283        .name       = "loadvm",
284        .args_type  = "name:s",
285        .params     = "tag|id",
286        .help       = "restore a VM snapshot from its tag or id",
287        .mhandler.cmd = do_loadvm,
288    },
289
290STEXI
291@item loadvm @var{tag}|@var{id}
292@findex loadvm
293Set the whole virtual machine to the snapshot identified by the tag
294@var{tag} or the unique snapshot ID @var{id}.
295ETEXI
296
297    {
298        .name       = "delvm",
299        .args_type  = "name:s",
300        .params     = "tag|id",
301        .help       = "delete a VM snapshot from its tag or id",
302        .mhandler.cmd = do_delvm,
303    },
304
305STEXI
306@item delvm @var{tag}|@var{id}
307@findex delvm
308Delete the snapshot identified by @var{tag} or @var{id}.
309ETEXI
310
311    {
312        .name       = "singlestep",
313        .args_type  = "option:s?",
314        .params     = "[on|off]",
315        .help       = "run emulation in singlestep mode or switch to normal mode",
316        .mhandler.cmd = do_singlestep,
317    },
318
319STEXI
320@item singlestep [off]
321@findex singlestep
322Run the emulation in single step mode.
323If called with option off, the emulation returns to normal mode.
324ETEXI
325
326    {
327        .name       = "stop",
328        .args_type  = "",
329        .params     = "",
330        .help       = "stop emulation",
331        .mhandler.cmd = hmp_stop,
332    },
333
334STEXI
335@item stop
336@findex stop
337Stop emulation.
338ETEXI
339
340    {
341        .name       = "c|cont",
342        .args_type  = "",
343        .params     = "",
344        .help       = "resume emulation",
345        .mhandler.cmd = hmp_cont,
346    },
347
348STEXI
349@item c or cont
350@findex cont
351Resume emulation.
352ETEXI
353
354    {
355        .name       = "system_wakeup",
356        .args_type  = "",
357        .params     = "",
358        .help       = "wakeup guest from suspend",
359        .mhandler.cmd = hmp_system_wakeup,
360    },
361
362STEXI
363@item system_wakeup
364@findex system_wakeup
365Wakeup guest from suspend.
366ETEXI
367
368    {
369        .name       = "gdbserver",
370        .args_type  = "device:s?",
371        .params     = "[device]",
372        .help       = "start gdbserver on given device (default 'tcp::1234'), stop with 'none'",
373        .mhandler.cmd = do_gdbserver,
374    },
375
376STEXI
377@item gdbserver [@var{port}]
378@findex gdbserver
379Start gdbserver session (default @var{port}=1234)
380ETEXI
381
382    {
383        .name       = "x",
384        .args_type  = "fmt:/,addr:l",
385        .params     = "/fmt addr",
386        .help       = "virtual memory dump starting at 'addr'",
387        .mhandler.cmd = do_memory_dump,
388    },
389
390STEXI
391@item x/fmt @var{addr}
392@findex x
393Virtual memory dump starting at @var{addr}.
394ETEXI
395
396    {
397        .name       = "xp",
398        .args_type  = "fmt:/,addr:l",
399        .params     = "/fmt addr",
400        .help       = "physical memory dump starting at 'addr'",
401        .mhandler.cmd = do_physical_memory_dump,
402    },
403
404STEXI
405@item xp /@var{fmt} @var{addr}
406@findex xp
407Physical memory dump starting at @var{addr}.
408
409@var{fmt} is a format which tells the command how to format the
410data. Its syntax is: @option{/@{count@}@{format@}@{size@}}
411
412@table @var
413@item count
414is the number of items to be dumped.
415
416@item format
417can be x (hex), d (signed decimal), u (unsigned decimal), o (octal),
418c (char) or i (asm instruction).
419
420@item size
421can be b (8 bits), h (16 bits), w (32 bits) or g (64 bits). On x86,
422@code{h} or @code{w} can be specified with the @code{i} format to
423respectively select 16 or 32 bit code instruction size.
424
425@end table
426
427Examples:
428@itemize
429@item
430Dump 10 instructions at the current instruction pointer:
431@example
432(qemu) x/10i $eip
4330x90107063:  ret
4340x90107064:  sti
4350x90107065:  lea    0x0(%esi,1),%esi
4360x90107069:  lea    0x0(%edi,1),%edi
4370x90107070:  ret
4380x90107071:  jmp    0x90107080
4390x90107073:  nop
4400x90107074:  nop
4410x90107075:  nop
4420x90107076:  nop
443@end example
444
445@item
446Dump 80 16 bit values at the start of the video memory.
447@smallexample
448(qemu) xp/80hx 0xb8000
4490x000b8000: 0x0b50 0x0b6c 0x0b65 0x0b78 0x0b38 0x0b36 0x0b2f 0x0b42
4500x000b8010: 0x0b6f 0x0b63 0x0b68 0x0b73 0x0b20 0x0b56 0x0b47 0x0b41
4510x000b8020: 0x0b42 0x0b69 0x0b6f 0x0b73 0x0b20 0x0b63 0x0b75 0x0b72
4520x000b8030: 0x0b72 0x0b65 0x0b6e 0x0b74 0x0b2d 0x0b63 0x0b76 0x0b73
4530x000b8040: 0x0b20 0x0b30 0x0b35 0x0b20 0x0b4e 0x0b6f 0x0b76 0x0b20
4540x000b8050: 0x0b32 0x0b30 0x0b30 0x0b33 0x0720 0x0720 0x0720 0x0720
4550x000b8060: 0x0720 0x0720 0x0720 0x0720 0x0720 0x0720 0x0720 0x0720
4560x000b8070: 0x0720 0x0720 0x0720 0x0720 0x0720 0x0720 0x0720 0x0720
4570x000b8080: 0x0720 0x0720 0x0720 0x0720 0x0720 0x0720 0x0720 0x0720
4580x000b8090: 0x0720 0x0720 0x0720 0x0720 0x0720 0x0720 0x0720 0x0720
459@end smallexample
460@end itemize
461ETEXI
462
463    {
464        .name       = "p|print",
465        .args_type  = "fmt:/,val:l",
466        .params     = "/fmt expr",
467        .help       = "print expression value (use $reg for CPU register access)",
468        .mhandler.cmd = do_print,
469    },
470
471STEXI
472@item p or print/@var{fmt} @var{expr}
473@findex print
474
475Print expression value. Only the @var{format} part of @var{fmt} is
476used.
477ETEXI
478
479    {
480        .name       = "i",
481        .args_type  = "fmt:/,addr:i,index:i.",
482        .params     = "/fmt addr",
483        .help       = "I/O port read",
484        .mhandler.cmd = do_ioport_read,
485    },
486
487STEXI
488Read I/O port.
489ETEXI
490
491    {
492        .name       = "o",
493        .args_type  = "fmt:/,addr:i,val:i",
494        .params     = "/fmt addr value",
495        .help       = "I/O port write",
496        .mhandler.cmd = do_ioport_write,
497    },
498
499STEXI
500Write to I/O port.
501ETEXI
502
503    {
504        .name       = "sendkey",
505        .args_type  = "string:s,hold_time:i?",
506        .params     = "keys [hold_ms]",
507        .help       = "send keys to the VM (e.g. 'sendkey ctrl-alt-f1', default hold time=100 ms)",
508        .mhandler.cmd = do_sendkey,
509    },
510
511STEXI
512@item sendkey @var{keys}
513@findex sendkey
514
515Send @var{keys} to the emulator. @var{keys} could be the name of the
516key or @code{#} followed by the raw value in either decimal or hexadecimal
517format. Use @code{-} to press several keys simultaneously. Example:
518@example
519sendkey ctrl-alt-f1
520@end example
521
522This command is useful to send keys that your graphical user interface
523intercepts at low level, such as @code{ctrl-alt-f1} in X Window.
524ETEXI
525
526    {
527        .name       = "system_reset",
528        .args_type  = "",
529        .params     = "",
530        .help       = "reset the system",
531        .mhandler.cmd = hmp_system_reset,
532    },
533
534STEXI
535@item system_reset
536@findex system_reset
537
538Reset the system.
539ETEXI
540
541    {
542        .name       = "system_powerdown",
543        .args_type  = "",
544        .params     = "",
545        .help       = "send system power down event",
546        .mhandler.cmd = hmp_system_powerdown,
547    },
548
549STEXI
550@item system_powerdown
551@findex system_powerdown
552
553Power down the system (if supported).
554ETEXI
555
556    {
557        .name       = "sum",
558        .args_type  = "start:i,size:i",
559        .params     = "addr size",
560        .help       = "compute the checksum of a memory region",
561        .mhandler.cmd = do_sum,
562    },
563
564STEXI
565@item sum @var{addr} @var{size}
566@findex sum
567
568Compute the checksum of a memory region.
569ETEXI
570
571    {
572        .name       = "usb_add",
573        .args_type  = "devname:s",
574        .params     = "device",
575        .help       = "add USB device (e.g. 'host:bus.addr' or 'host:vendor_id:product_id')",
576        .mhandler.cmd = do_usb_add,
577    },
578
579STEXI
580@item usb_add @var{devname}
581@findex usb_add
582
583Add the USB device @var{devname}.  For details of available devices see
584@ref{usb_devices}
585ETEXI
586
587    {
588        .name       = "usb_del",
589        .args_type  = "devname:s",
590        .params     = "device",
591        .help       = "remove USB device 'bus.addr'",
592        .mhandler.cmd = do_usb_del,
593    },
594
595STEXI
596@item usb_del @var{devname}
597@findex usb_del
598
599Remove the USB device @var{devname} from the QEMU virtual USB
600hub. @var{devname} has the syntax @code{bus.addr}. Use the monitor
601command @code{info usb} to see the devices you can remove.
602ETEXI
603
604    {
605        .name       = "device_add",
606        .args_type  = "device:O",
607        .params     = "driver[,prop=value][,...]",
608        .help       = "add device, like -device on the command line",
609        .user_print = monitor_user_noop,
610        .mhandler.cmd_new = do_device_add,
611    },
612
613STEXI
614@item device_add @var{config}
615@findex device_add
616
617Add device.
618ETEXI
619
620    {
621        .name       = "device_del",
622        .args_type  = "id:s",
623        .params     = "device",
624        .help       = "remove device",
625        .user_print = monitor_user_noop,
626        .mhandler.cmd_new = do_device_del,
627    },
628
629STEXI
630@item device_del @var{id}
631@findex device_del
632
633Remove device @var{id}.
634ETEXI
635
636    {
637        .name       = "cpu",
638        .args_type  = "index:i",
639        .params     = "index",
640        .help       = "set the default CPU",
641        .mhandler.cmd = hmp_cpu,
642    },
643
644STEXI
645@item cpu @var{index}
646@findex cpu
647Set the default CPU.
648ETEXI
649
650    {
651        .name       = "mouse_move",
652        .args_type  = "dx_str:s,dy_str:s,dz_str:s?",
653        .params     = "dx dy [dz]",
654        .help       = "send mouse move events",
655        .mhandler.cmd = do_mouse_move,
656    },
657
658STEXI
659@item mouse_move @var{dx} @var{dy} [@var{dz}]
660@findex mouse_move
661Move the active mouse to the specified coordinates @var{dx} @var{dy}
662with optional scroll axis @var{dz}.
663ETEXI
664
665    {
666        .name       = "mouse_button",
667        .args_type  = "button_state:i",
668        .params     = "state",
669        .help       = "change mouse button state (1=L, 2=M, 4=R)",
670        .mhandler.cmd = do_mouse_button,
671    },
672
673STEXI
674@item mouse_button @var{val}
675@findex mouse_button
676Change the active mouse button state @var{val} (1=L, 2=M, 4=R).
677ETEXI
678
679    {
680        .name       = "mouse_set",
681        .args_type  = "index:i",
682        .params     = "index",
683        .help       = "set which mouse device receives events",
684        .mhandler.cmd = do_mouse_set,
685    },
686
687STEXI
688@item mouse_set @var{index}
689@findex mouse_set
690Set which mouse device receives events at given @var{index}, index
691can be obtained with
692@example
693info mice
694@end example
695ETEXI
696
697#ifdef HAS_AUDIO
698    {
699        .name       = "wavcapture",
700        .args_type  = "path:F,freq:i?,bits:i?,nchannels:i?",
701        .params     = "path [frequency [bits [channels]]]",
702        .help       = "capture audio to a wave file (default frequency=44100 bits=16 channels=2)",
703        .mhandler.cmd = do_wav_capture,
704    },
705#endif
706STEXI
707@item wavcapture @var{filename} [@var{frequency} [@var{bits} [@var{channels}]]]
708@findex wavcapture
709Capture audio into @var{filename}. Using sample rate @var{frequency}
710bits per sample @var{bits} and number of channels @var{channels}.
711
712Defaults:
713@itemize @minus
714@item Sample rate = 44100 Hz - CD quality
715@item Bits = 16
716@item Number of channels = 2 - Stereo
717@end itemize
718ETEXI
719
720#ifdef HAS_AUDIO
721    {
722        .name       = "stopcapture",
723        .args_type  = "n:i",
724        .params     = "capture index",
725        .help       = "stop capture",
726        .mhandler.cmd = do_stop_capture,
727    },
728#endif
729STEXI
730@item stopcapture @var{index}
731@findex stopcapture
732Stop capture with a given @var{index}, index can be obtained with
733@example
734info capture
735@end example
736ETEXI
737
738    {
739        .name       = "memsave",
740        .args_type  = "val:l,size:i,filename:s",
741        .params     = "addr size file",
742        .help       = "save to disk virtual memory dump starting at 'addr' of size 'size'",
743        .mhandler.cmd = hmp_memsave,
744    },
745
746STEXI
747@item memsave @var{addr} @var{size} @var{file}
748@findex memsave
749save to disk virtual memory dump starting at @var{addr} of size @var{size}.
750ETEXI
751
752    {
753        .name       = "pmemsave",
754        .args_type  = "val:l,size:i,filename:s",
755        .params     = "addr size file",
756        .help       = "save to disk physical memory dump starting at 'addr' of size 'size'",
757        .mhandler.cmd = hmp_pmemsave,
758    },
759
760STEXI
761@item pmemsave @var{addr} @var{size} @var{file}
762@findex pmemsave
763save to disk physical memory dump starting at @var{addr} of size @var{size}.
764ETEXI
765
766    {
767        .name       = "boot_set",
768        .args_type  = "bootdevice:s",
769        .params     = "bootdevice",
770        .help       = "define new values for the boot device list",
771        .mhandler.cmd = do_boot_set,
772    },
773
774STEXI
775@item boot_set @var{bootdevicelist}
776@findex boot_set
777
778Define new values for the boot device list. Those values will override
779the values specified on the command line through the @code{-boot} option.
780
781The values that can be specified here depend on the machine type, but are
782the same that can be specified in the @code{-boot} command line option.
783ETEXI
784
785#if defined(TARGET_I386)
786    {
787        .name       = "nmi",
788        .args_type  = "",
789        .params     = "",
790        .help       = "inject an NMI on all guest's CPUs",
791        .mhandler.cmd = hmp_inject_nmi,
792    },
793#endif
794STEXI
795@item nmi @var{cpu}
796@findex nmi
797Inject an NMI on the given CPU (x86 only).
798ETEXI
799
800    {
801        .name       = "migrate",
802        .args_type  = "detach:-d,blk:-b,inc:-i,uri:s",
803        .params     = "[-d] [-b] [-i] uri",
804        .help       = "migrate to URI (using -d to not wait for completion)"
805		      "\n\t\t\t -b for migration without shared storage with"
806		      " full copy of disk\n\t\t\t -i for migration without "
807		      "shared storage with incremental copy of disk "
808		      "(base image shared between src and destination)",
809        .user_print = monitor_user_noop,
810	.mhandler.cmd_new = do_migrate,
811    },
812
813
814STEXI
815@item migrate [-d] [-b] [-i] @var{uri}
816@findex migrate
817Migrate to @var{uri} (using -d to not wait for completion).
818	-b for migration with full copy of disk
819	-i for migration with incremental copy of disk (base image is shared)
820ETEXI
821
822    {
823        .name       = "migrate_cancel",
824        .args_type  = "",
825        .params     = "",
826        .help       = "cancel the current VM migration",
827        .mhandler.cmd = hmp_migrate_cancel,
828    },
829
830STEXI
831@item migrate_cancel
832@findex migrate_cancel
833Cancel the current VM migration.
834ETEXI
835
836    {
837        .name       = "migrate_set_speed",
838        .args_type  = "value:o",
839        .params     = "value",
840        .help       = "set maximum speed (in bytes) for migrations. "
841	"Defaults to MB if no size suffix is specified, ie. B/K/M/G/T",
842        .mhandler.cmd = hmp_migrate_set_speed,
843    },
844
845STEXI
846@item migrate_set_speed @var{value}
847@findex migrate_set_speed
848Set maximum speed to @var{value} (in bytes) for migrations.
849ETEXI
850
851    {
852        .name       = "migrate_set_downtime",
853        .args_type  = "value:T",
854        .params     = "value",
855        .help       = "set maximum tolerated downtime (in seconds) for migrations",
856        .mhandler.cmd = hmp_migrate_set_downtime,
857    },
858
859STEXI
860@item migrate_set_downtime @var{second}
861@findex migrate_set_downtime
862Set maximum tolerated downtime (in seconds) for migration.
863ETEXI
864
865    {
866        .name       = "client_migrate_info",
867        .args_type  = "protocol:s,hostname:s,port:i?,tls-port:i?,cert-subject:s?",
868        .params     = "protocol hostname port tls-port cert-subject",
869        .help       = "send migration info to spice/vnc client",
870        .user_print = monitor_user_noop,
871        .mhandler.cmd_async = client_migrate_info,
872        .flags      = MONITOR_CMD_ASYNC,
873    },
874
875STEXI
876@item client_migrate_info @var{protocol} @var{hostname} @var{port} @var{tls-port} @var{cert-subject}
877@findex client_migrate_info
878Set the spice/vnc connection info for the migration target.  The spice/vnc
879server will ask the spice/vnc client to automatically reconnect using the
880new parameters (if specified) once the vm migration finished successfully.
881ETEXI
882
883    {
884        .name       = "snapshot_blkdev",
885        .args_type  = "device:B,snapshot-file:s?,format:s?",
886        .params     = "device [new-image-file] [format]",
887        .help       = "initiates a live snapshot\n\t\t\t"
888                      "of device. If a new image file is specified, the\n\t\t\t"
889                      "new image file will become the new root image.\n\t\t\t"
890                      "If format is specified, the snapshot file will\n\t\t\t"
891                      "be created in that format. Otherwise the\n\t\t\t"
892                      "snapshot will be internal! (currently unsupported)",
893        .mhandler.cmd = hmp_snapshot_blkdev,
894    },
895
896STEXI
897@item snapshot_blkdev
898@findex snapshot_blkdev
899Snapshot device, using snapshot file as target if provided
900ETEXI
901
902    {
903        .name       = "drive_add",
904        .args_type  = "pci_addr:s,opts:s",
905        .params     = "[[<domain>:]<bus>:]<slot>\n"
906                      "[file=file][,if=type][,bus=n]\n"
907                      "[,unit=m][,media=d][,index=i]\n"
908                      "[,cyls=c,heads=h,secs=s[,trans=t]]\n"
909                      "[,snapshot=on|off][,cache=on|off]\n"
910                      "[,readonly=on|off][,copy-on-read=on|off]",
911        .help       = "add drive to PCI storage controller",
912        .mhandler.cmd = drive_hot_add,
913    },
914
915STEXI
916@item drive_add
917@findex drive_add
918Add drive to PCI storage controller.
919ETEXI
920
921#if defined(TARGET_I386)
922    {
923        .name       = "pci_add",
924        .args_type  = "pci_addr:s,type:s,opts:s?",
925        .params     = "auto|[[<domain>:]<bus>:]<slot> nic|storage [[vlan=n][,macaddr=addr][,model=type]] [file=file][,if=type][,bus=nr]...",
926        .help       = "hot-add PCI device",
927        .mhandler.cmd = pci_device_hot_add,
928    },
929#endif
930
931STEXI
932@item pci_add
933@findex pci_add
934Hot-add PCI device.
935ETEXI
936
937#if defined(TARGET_I386)
938    {
939        .name       = "pci_del",
940        .args_type  = "pci_addr:s",
941        .params     = "[[<domain>:]<bus>:]<slot>",
942        .help       = "hot remove PCI device",
943        .mhandler.cmd = do_pci_device_hot_remove,
944    },
945#endif
946
947STEXI
948@item pci_del
949@findex pci_del
950Hot remove PCI device.
951ETEXI
952
953    {
954        .name       = "pcie_aer_inject_error",
955        .args_type  = "advisory_non_fatal:-a,correctable:-c,"
956	              "id:s,error_status:s,"
957	              "header0:i?,header1:i?,header2:i?,header3:i?,"
958	              "prefix0:i?,prefix1:i?,prefix2:i?,prefix3:i?",
959        .params     = "[-a] [-c] id "
960                      "<error_status> [<tlp header> [<tlp header prefix>]]",
961        .help       = "inject pcie aer error\n\t\t\t"
962	              " -a for advisory non fatal error\n\t\t\t"
963	              " -c for correctable error\n\t\t\t"
964                      "<id> = qdev device id\n\t\t\t"
965                      "<error_status> = error string or 32bit\n\t\t\t"
966                      "<tlb header> = 32bit x 4\n\t\t\t"
967                      "<tlb header prefix> = 32bit x 4",
968        .user_print  = pcie_aer_inject_error_print,
969        .mhandler.cmd_new = do_pcie_aer_inject_error,
970    },
971
972STEXI
973@item pcie_aer_inject_error
974@findex pcie_aer_inject_error
975Inject PCIe AER error
976ETEXI
977
978    {
979        .name       = "host_net_add",
980        .args_type  = "device:s,opts:s?",
981        .params     = "tap|user|socket|vde|dump [options]",
982        .help       = "add host VLAN client",
983        .mhandler.cmd = net_host_device_add,
984    },
985
986STEXI
987@item host_net_add
988@findex host_net_add
989Add host VLAN client.
990ETEXI
991
992    {
993        .name       = "host_net_remove",
994        .args_type  = "vlan_id:i,device:s",
995        .params     = "vlan_id name",
996        .help       = "remove host VLAN client",
997        .mhandler.cmd = net_host_device_remove,
998    },
999
1000STEXI
1001@item host_net_remove
1002@findex host_net_remove
1003Remove host VLAN client.
1004ETEXI
1005
1006    {
1007        .name       = "netdev_add",
1008        .args_type  = "netdev:O",
1009        .params     = "[user|tap|socket],id=str[,prop=value][,...]",
1010        .help       = "add host network device",
1011        .user_print = monitor_user_noop,
1012        .mhandler.cmd_new = do_netdev_add,
1013    },
1014
1015STEXI
1016@item netdev_add
1017@findex netdev_add
1018Add host network device.
1019ETEXI
1020
1021    {
1022        .name       = "netdev_del",
1023        .args_type  = "id:s",
1024        .params     = "id",
1025        .help       = "remove host network device",
1026        .user_print = monitor_user_noop,
1027        .mhandler.cmd_new = do_netdev_del,
1028    },
1029
1030STEXI
1031@item netdev_del
1032@findex netdev_del
1033Remove host network device.
1034ETEXI
1035
1036#ifdef CONFIG_SLIRP
1037    {
1038        .name       = "hostfwd_add",
1039        .args_type  = "arg1:s,arg2:s?,arg3:s?",
1040        .params     = "[vlan_id name] [tcp|udp]:[hostaddr]:hostport-[guestaddr]:guestport",
1041        .help       = "redirect TCP or UDP connections from host to guest (requires -net user)",
1042        .mhandler.cmd = net_slirp_hostfwd_add,
1043    },
1044#endif
1045STEXI
1046@item hostfwd_add
1047@findex hostfwd_add
1048Redirect TCP or UDP connections from host to guest (requires -net user).
1049ETEXI
1050
1051#ifdef CONFIG_SLIRP
1052    {
1053        .name       = "hostfwd_remove",
1054        .args_type  = "arg1:s,arg2:s?,arg3:s?",
1055        .params     = "[vlan_id name] [tcp|udp]:[hostaddr]:hostport",
1056        .help       = "remove host-to-guest TCP or UDP redirection",
1057        .mhandler.cmd = net_slirp_hostfwd_remove,
1058    },
1059
1060#endif
1061STEXI
1062@item hostfwd_remove
1063@findex hostfwd_remove
1064Remove host-to-guest TCP or UDP redirection.
1065ETEXI
1066
1067    {
1068        .name       = "balloon",
1069        .args_type  = "value:M",
1070        .params     = "target",
1071        .help       = "request VM to change its memory allocation (in MB)",
1072        .mhandler.cmd = hmp_balloon,
1073    },
1074
1075STEXI
1076@item balloon @var{value}
1077@findex balloon
1078Request VM to change its memory allocation to @var{value} (in MB).
1079ETEXI
1080
1081    {
1082        .name       = "set_link",
1083        .args_type  = "name:s,up:b",
1084        .params     = "name on|off",
1085        .help       = "change the link status of a network adapter",
1086        .mhandler.cmd = hmp_set_link,
1087    },
1088
1089STEXI
1090@item set_link @var{name} [on|off]
1091@findex set_link
1092Switch link @var{name} on (i.e. up) or off (i.e. down).
1093ETEXI
1094
1095    {
1096        .name       = "watchdog_action",
1097        .args_type  = "action:s",
1098        .params     = "[reset|shutdown|poweroff|pause|debug|none]",
1099        .help       = "change watchdog action",
1100        .mhandler.cmd = do_watchdog_action,
1101    },
1102
1103STEXI
1104@item watchdog_action
1105@findex watchdog_action
1106Change watchdog action.
1107ETEXI
1108
1109    {
1110        .name       = "acl_show",
1111        .args_type  = "aclname:s",
1112        .params     = "aclname",
1113        .help       = "list rules in the access control list",
1114        .mhandler.cmd = do_acl_show,
1115    },
1116
1117STEXI
1118@item acl_show @var{aclname}
1119@findex acl_show
1120List all the matching rules in the access control list, and the default
1121policy. There are currently two named access control lists,
1122@var{vnc.x509dname} and @var{vnc.username} matching on the x509 client
1123certificate distinguished name, and SASL username respectively.
1124ETEXI
1125
1126    {
1127        .name       = "acl_policy",
1128        .args_type  = "aclname:s,policy:s",
1129        .params     = "aclname allow|deny",
1130        .help       = "set default access control list policy",
1131        .mhandler.cmd = do_acl_policy,
1132    },
1133
1134STEXI
1135@item acl_policy @var{aclname} @code{allow|deny}
1136@findex acl_policy
1137Set the default access control list policy, used in the event that
1138none of the explicit rules match. The default policy at startup is
1139always @code{deny}.
1140ETEXI
1141
1142    {
1143        .name       = "acl_add",
1144        .args_type  = "aclname:s,match:s,policy:s,index:i?",
1145        .params     = "aclname match allow|deny [index]",
1146        .help       = "add a match rule to the access control list",
1147        .mhandler.cmd = do_acl_add,
1148    },
1149
1150STEXI
1151@item acl_add @var{aclname} @var{match} @code{allow|deny} [@var{index}]
1152@findex acl_add
1153Add a match rule to the access control list, allowing or denying access.
1154The match will normally be an exact username or x509 distinguished name,
1155but can optionally include wildcard globs. eg @code{*@@EXAMPLE.COM} to
1156allow all users in the @code{EXAMPLE.COM} kerberos realm. The match will
1157normally be appended to the end of the ACL, but can be inserted
1158earlier in the list if the optional @var{index} parameter is supplied.
1159ETEXI
1160
1161    {
1162        .name       = "acl_remove",
1163        .args_type  = "aclname:s,match:s",
1164        .params     = "aclname match",
1165        .help       = "remove a match rule from the access control list",
1166        .mhandler.cmd = do_acl_remove,
1167    },
1168
1169STEXI
1170@item acl_remove @var{aclname} @var{match}
1171@findex acl_remove
1172Remove the specified match rule from the access control list.
1173ETEXI
1174
1175    {
1176        .name       = "acl_reset",
1177        .args_type  = "aclname:s",
1178        .params     = "aclname",
1179        .help       = "reset the access control list",
1180        .mhandler.cmd = do_acl_reset,
1181    },
1182
1183STEXI
1184@item acl_reset @var{aclname}
1185@findex acl_reset
1186Remove all matches from the access control list, and set the default
1187policy back to @code{deny}.
1188ETEXI
1189
1190#if defined(TARGET_I386)
1191
1192    {
1193        .name       = "mce",
1194        .args_type  = "broadcast:-b,cpu_index:i,bank:i,status:l,mcg_status:l,addr:l,misc:l",
1195        .params     = "[-b] cpu bank status mcgstatus addr misc",
1196        .help       = "inject a MCE on the given CPU [and broadcast to other CPUs with -b option]",
1197        .mhandler.cmd = do_inject_mce,
1198    },
1199
1200#endif
1201STEXI
1202@item mce @var{cpu} @var{bank} @var{status} @var{mcgstatus} @var{addr} @var{misc}
1203@findex mce (x86)
1204Inject an MCE on the given CPU (x86 only).
1205ETEXI
1206
1207    {
1208        .name       = "getfd",
1209        .args_type  = "fdname:s",
1210        .params     = "getfd name",
1211        .help       = "receive a file descriptor via SCM rights and assign it a name",
1212        .user_print = monitor_user_noop,
1213        .mhandler.cmd_new = do_getfd,
1214    },
1215
1216STEXI
1217@item getfd @var{fdname}
1218@findex getfd
1219If a file descriptor is passed alongside this command using the SCM_RIGHTS
1220mechanism on unix sockets, it is stored using the name @var{fdname} for
1221later use by other monitor commands.
1222ETEXI
1223
1224    {
1225        .name       = "closefd",
1226        .args_type  = "fdname:s",
1227        .params     = "closefd name",
1228        .help       = "close a file descriptor previously passed via SCM rights",
1229        .user_print = monitor_user_noop,
1230        .mhandler.cmd_new = do_closefd,
1231    },
1232
1233STEXI
1234@item closefd @var{fdname}
1235@findex closefd
1236Close the file descriptor previously assigned to @var{fdname} using the
1237@code{getfd} command. This is only needed if the file descriptor was never
1238used by another monitor command.
1239ETEXI
1240
1241    {
1242        .name       = "block_passwd",
1243        .args_type  = "device:B,password:s",
1244        .params     = "block_passwd device password",
1245        .help       = "set the password of encrypted block devices",
1246        .mhandler.cmd = hmp_block_passwd,
1247    },
1248
1249STEXI
1250@item block_set_io_throttle @var{device} @var{bps} @var{bps_rd} @var{bps_wr} @var{iops} @var{iops_rd} @var{iops_wr}
1251@findex block_set_io_throttle
1252Change I/O throttle limits for a block drive to @var{bps} @var{bps_rd} @var{bps_wr} @var{iops} @var{iops_rd} @var{iops_wr}
1253ETEXI
1254
1255    {
1256        .name       = "block_set_io_throttle",
1257        .args_type  = "device:B,bps:l,bps_rd:l,bps_wr:l,iops:l,iops_rd:l,iops_wr:l",
1258        .params     = "device bps bps_rd bps_wr iops iops_rd iops_wr",
1259        .help       = "change I/O throttle limits for a block drive",
1260        .mhandler.cmd = hmp_block_set_io_throttle,
1261    },
1262
1263STEXI
1264@item block_passwd @var{device} @var{password}
1265@findex block_passwd
1266Set the encrypted device @var{device} password to @var{password}
1267ETEXI
1268
1269    {
1270        .name       = "set_password",
1271        .args_type  = "protocol:s,password:s,connected:s?",
1272        .params     = "protocol password action-if-connected",
1273        .help       = "set spice/vnc password",
1274        .mhandler.cmd = hmp_set_password,
1275    },
1276
1277STEXI
1278@item set_password [ vnc | spice ] password [ action-if-connected ]
1279@findex set_password
1280
1281Change spice/vnc password.  Use zero to make the password stay valid
1282forever.  @var{action-if-connected} specifies what should happen in
1283case a connection is established: @var{fail} makes the password change
1284fail.  @var{disconnect} changes the password and disconnects the
1285client.  @var{keep} changes the password and keeps the connection up.
1286@var{keep} is the default.
1287ETEXI
1288
1289    {
1290        .name       = "expire_password",
1291        .args_type  = "protocol:s,time:s",
1292        .params     = "protocol time",
1293        .help       = "set spice/vnc password expire-time",
1294        .mhandler.cmd = hmp_expire_password,
1295    },
1296
1297STEXI
1298@item expire_password [ vnc | spice ] expire-time
1299@findex expire_password
1300
1301Specify when a password for spice/vnc becomes
1302invalid. @var{expire-time} accepts:
1303
1304@table @var
1305@item now
1306Invalidate password instantly.
1307
1308@item never
1309Password stays valid forever.
1310
1311@item +nsec
1312Password stays valid for @var{nsec} seconds starting now.
1313
1314@item nsec
1315Password is invalidated at the given time.  @var{nsec} are the seconds
1316passed since 1970, i.e. unix epoch.
1317
1318@end table
1319ETEXI
1320
1321    {
1322        .name       = "info",
1323        .args_type  = "item:s?",
1324        .params     = "[subcommand]",
1325        .help       = "show various information about the system state",
1326        .mhandler.cmd = do_info,
1327    },
1328
1329STEXI
1330@item info @var{subcommand}
1331@findex info
1332Show various information about the system state.
1333
1334@table @option
1335@item info version
1336show the version of QEMU
1337@item info network
1338show the various VLANs and the associated devices
1339@item info chardev
1340show the character devices
1341@item info block
1342show the block devices
1343@item info blockstats
1344show block device statistics
1345@item info registers
1346show the cpu registers
1347@item info cpus
1348show infos for each CPU
1349@item info history
1350show the command line history
1351@item info irq
1352show the interrupts statistics (if available)
1353@item info pic
1354show i8259 (PIC) state
1355@item info pci
1356show emulated PCI device info
1357@item info tlb
1358show virtual to physical memory mappings (i386, SH4, SPARC, PPC, and Xtensa only)
1359@item info mem
1360show the active virtual memory mappings (i386 only)
1361@item info jit
1362show dynamic compiler info
1363@item info numa
1364show NUMA information
1365@item info kvm
1366show KVM information
1367@item info usb
1368show USB devices plugged on the virtual USB hub
1369@item info usbhost
1370show all USB host devices
1371@item info profile
1372show profiling information
1373@item info capture
1374show information about active capturing
1375@item info snapshots
1376show list of VM snapshots
1377@item info status
1378show the current VM status (running|paused)
1379@item info pcmcia
1380show guest PCMCIA status
1381@item info mice
1382show which guest mouse is receiving events
1383@item info vnc
1384show the vnc server status
1385@item info name
1386show the current VM name
1387@item info uuid
1388show the current VM UUID
1389@item info cpustats
1390show CPU statistics
1391@item info usernet
1392show user network stack connection states
1393@item info migrate
1394show migration status
1395@item info balloon
1396show balloon information
1397@item info qtree
1398show device tree
1399@item info qdm
1400show qdev device model list
1401@item info roms
1402show roms
1403@end table
1404ETEXI
1405
1406#ifdef CONFIG_TRACE_SIMPLE
1407STEXI
1408@item info trace
1409show contents of trace buffer
1410ETEXI
1411#endif
1412
1413STEXI
1414@item info trace-events
1415show available trace events and their state
1416ETEXI
1417
1418STEXI
1419@end table
1420ETEXI
1421