]> git.proxmox.com Git - mirror_qemu.git/blame - hmp-commands.hx
monitor: Convert sendkey to use command_completion.
[mirror_qemu.git] / hmp-commands.hx
CommitLineData
2313086a
BS
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
d7f9b689
LC
12 {
13 .name = "help|?",
129be006 14 .args_type = "name:S?",
d7f9b689
LC
15 .params = "[cmd]",
16 .help = "show the help",
af4ce882 17 .mhandler.cmd = do_help_cmd,
d7f9b689
LC
18 },
19
2313086a
BS
20STEXI
21@item help or ? [@var{cmd}]
70fcbbe7 22@findex help
2313086a
BS
23Show the help for all commands or just for command @var{cmd}.
24ETEXI
25
d7f9b689
LC
26 {
27 .name = "commit",
28 .args_type = "device:B",
d7f9b689
LC
29 .params = "device|all",
30 .help = "commit changes to the disk images (if -snapshot is used) or backing files",
af4ce882 31 .mhandler.cmd = do_commit,
d7f9b689
LC
32 },
33
2313086a
BS
34STEXI
35@item commit
70fcbbe7 36@findex commit
2313086a 37Commit changes to the disk images (if -snapshot is used) or backing files.
37222900
JC
38If the backing file is smaller than the snapshot, then the backing file will be
39resized to be the same size as the snapshot. If the snapshot is smaller than
40the backing file, the backing file will not be truncated. If you want the
41backing file to match the size of the smaller snapshot, you can safely truncate
42it yourself once the commit operation successfully completes.
2313086a
BS
43ETEXI
44
d7f9b689
LC
45 {
46 .name = "q|quit",
47 .args_type = "",
d7f9b689
LC
48 .params = "",
49 .help = "quit the emulator",
b223f35f 50 .user_print = monitor_user_noop,
7a7f325e 51 .mhandler.cmd = hmp_quit,
d7f9b689
LC
52 },
53
2313086a
BS
54STEXI
55@item q or quit
70fcbbe7 56@findex quit
2313086a
BS
57Quit the emulator.
58ETEXI
59
6d4a2b3a
CH
60 {
61 .name = "block_resize",
62 .args_type = "device:B,size:o",
63 .params = "device size",
64 .help = "resize a block image",
5e7caacb 65 .mhandler.cmd = hmp_block_resize,
6d4a2b3a
CH
66 },
67
68STEXI
69@item block_resize
70@findex block_resize
71Resize a block image while a guest is running. Usually requires guest
72action to see the updated size. Resize to a lower size is supported,
73but should be used with extreme caution. Note that this command only
74resizes image files, it can not resize block devices like LVM volumes.
75ETEXI
76
12bd451f
SH
77 {
78 .name = "block_stream",
c83c66c3
SH
79 .args_type = "device:B,speed:o?,base:s?",
80 .params = "device [speed [base]]",
12bd451f
SH
81 .help = "copy data from a backing file into a block device",
82 .mhandler.cmd = hmp_block_stream,
83 },
84
85STEXI
86@item block_stream
87@findex block_stream
88Copy data from a backing file into a block device.
2d47c6e9
SH
89ETEXI
90
91 {
92 .name = "block_job_set_speed",
882ec7ce
SH
93 .args_type = "device:B,speed:o",
94 .params = "device speed",
2d47c6e9
SH
95 .help = "set maximum speed for a background block operation",
96 .mhandler.cmd = hmp_block_job_set_speed,
97 },
98
99STEXI
4451b799
PB
100@item block_job_set_speed
101@findex block_job_set_speed
2d47c6e9 102Set maximum speed for a background block operation.
370521a1
SH
103ETEXI
104
105 {
106 .name = "block_job_cancel",
6e37fb81
PB
107 .args_type = "force:-f,device:B",
108 .params = "[-f] device",
109 .help = "stop an active background block operation (use -f"
110 "\n\t\t\t if the operation is currently paused)",
370521a1
SH
111 .mhandler.cmd = hmp_block_job_cancel,
112 },
113
114STEXI
115@item block_job_cancel
116@findex block_job_cancel
aeae883b
PB
117Stop an active background block operation (streaming, mirroring).
118ETEXI
119
120 {
121 .name = "block_job_complete",
122 .args_type = "device:B",
123 .params = "device",
124 .help = "stop an active background block operation",
125 .mhandler.cmd = hmp_block_job_complete,
126 },
127
128STEXI
129@item block_job_complete
130@findex block_job_complete
131Manually trigger completion of an active background block operation.
132For mirroring, this will switch the device to the destination path.
6e37fb81
PB
133ETEXI
134
135 {
136 .name = "block_job_pause",
137 .args_type = "device:B",
138 .params = "device",
139 .help = "pause an active background block operation",
140 .mhandler.cmd = hmp_block_job_pause,
141 },
142
143STEXI
144@item block_job_pause
145@findex block_job_pause
146Pause an active block streaming operation.
147ETEXI
148
149 {
150 .name = "block_job_resume",
151 .args_type = "device:B",
152 .params = "device",
153 .help = "resume a paused background block operation",
154 .mhandler.cmd = hmp_block_job_resume,
155 },
156
157STEXI
158@item block_job_resume
159@findex block_job_resume
160Resume a paused block streaming operation.
12bd451f 161ETEXI
6d4a2b3a 162
d7f9b689
LC
163 {
164 .name = "eject",
78d714e0 165 .args_type = "force:-f,device:B",
d7f9b689
LC
166 .params = "[-f] device",
167 .help = "eject a removable medium (use -f to force it)",
c245b6a3 168 .mhandler.cmd = hmp_eject,
d7f9b689
LC
169 },
170
2313086a
BS
171STEXI
172@item eject [-f] @var{device}
70fcbbe7 173@findex eject
2313086a 174Eject a removable medium (use -f to force it).
9063f814
RH
175ETEXI
176
177 {
178 .name = "drive_del",
f7bdc41a 179 .args_type = "id:B",
9063f814
RH
180 .params = "device",
181 .help = "remove host block device",
182 .user_print = monitor_user_noop,
183 .mhandler.cmd_new = do_drive_del,
184 },
185
186STEXI
187@item drive_del @var{device}
188@findex drive_del
189Remove host block device. The result is that guest generated IO is no longer
190submitted against the host device underlying the disk. Once a drive has
191been deleted, the QEMU Block layer returns -EIO which results in IO
192errors in the guest for applications that are reading/writing to the device.
293c51a6
SH
193These errors are always reported to the guest, regardless of the drive's error
194actions (drive options rerror, werror).
2313086a
BS
195ETEXI
196
d7f9b689
LC
197 {
198 .name = "change",
199 .args_type = "device:B,target:F,arg:s?",
d7f9b689
LC
200 .params = "device filename [format]",
201 .help = "change a removable medium, optional format",
333a96ec 202 .mhandler.cmd = hmp_change,
d7f9b689
LC
203 },
204
2313086a
BS
205STEXI
206@item change @var{device} @var{setting}
70fcbbe7 207@findex change
2313086a
BS
208
209Change the configuration of a device.
210
211@table @option
212@item change @var{diskdevice} @var{filename} [@var{format}]
213Change the medium for a removable disk device to point to @var{filename}. eg
214
215@example
216(qemu) change ide1-cd0 /path/to/some.iso
217@end example
218
219@var{format} is optional.
220
221@item change vnc @var{display},@var{options}
222Change the configuration of the VNC server. The valid syntax for @var{display}
223and @var{options} are described at @ref{sec_invocation}. eg
224
225@example
226(qemu) change vnc localhost:1
227@end example
228
229@item change vnc password [@var{password}]
230
231Change the password associated with the VNC server. If the new password is not
232supplied, the monitor will prompt for it to be entered. VNC passwords are only
233significant up to 8 letters. eg
234
235@example
236(qemu) change vnc password
237Password: ********
238@end example
239
240@end table
241ETEXI
242
d7f9b689
LC
243 {
244 .name = "screendump",
245 .args_type = "filename:F",
d7f9b689
LC
246 .params = "filename",
247 .help = "save screen into PPM image 'filename'",
ad39cf6d 248 .mhandler.cmd = hmp_screen_dump,
d7f9b689
LC
249 },
250
2313086a
BS
251STEXI
252@item screendump @var{filename}
70fcbbe7 253@findex screendump
2313086a
BS
254Save screen into PPM image @var{filename}.
255ETEXI
256
d7f9b689
LC
257 {
258 .name = "logfile",
259 .args_type = "filename:F",
d7f9b689
LC
260 .params = "filename",
261 .help = "output logs to 'filename'",
af4ce882 262 .mhandler.cmd = do_logfile,
d7f9b689
LC
263 },
264
2313086a
BS
265STEXI
266@item logfile @var{filename}
70fcbbe7 267@findex logfile
2313086a
BS
268Output logs to @var{filename}.
269ETEXI
270
22890ab5
PS
271 {
272 .name = "trace-event",
273 .args_type = "name:s,option:b",
274 .params = "name on|off",
275 .help = "changes status of a specific trace event",
fc764105 276 .mhandler.cmd = do_trace_event_set_state,
22890ab5
PS
277 },
278
279STEXI
280@item trace-event
281@findex trace-event
282changes status of a trace event
c5ceb523
SH
283ETEXI
284
c45a8168 285#if defined(CONFIG_TRACE_SIMPLE)
c5ceb523
SH
286 {
287 .name = "trace-file",
288 .args_type = "op:s?,arg:F?",
289 .params = "on|off|flush|set [arg]",
290 .help = "open, close, or flush trace file, or set a new file name",
291 .mhandler.cmd = do_trace_file,
292 },
293
294STEXI
295@item trace-file on|off|flush
296@findex trace-file
297Open, close, or flush the trace file. If no argument is given, the status of the trace file is displayed.
22890ab5
PS
298ETEXI
299#endif
300
d7f9b689
LC
301 {
302 .name = "log",
303 .args_type = "items:s",
d7f9b689 304 .params = "item1[,...]",
989b697d 305 .help = "activate logging of the specified items",
af4ce882 306 .mhandler.cmd = do_log,
d7f9b689
LC
307 },
308
2313086a
BS
309STEXI
310@item log @var{item1}[,...]
70fcbbe7 311@findex log
989b697d 312Activate logging of the specified items.
2313086a
BS
313ETEXI
314
d7f9b689
LC
315 {
316 .name = "savevm",
317 .args_type = "name:s?",
d7f9b689
LC
318 .params = "[tag|id]",
319 .help = "save a VM snapshot. If no tag or id are provided, a new snapshot is created",
af4ce882 320 .mhandler.cmd = do_savevm,
d7f9b689
LC
321 },
322
2313086a
BS
323STEXI
324@item savevm [@var{tag}|@var{id}]
70fcbbe7 325@findex savevm
2313086a
BS
326Create a snapshot of the whole virtual machine. If @var{tag} is
327provided, it is used as human readable identifier. If there is already
328a snapshot with the same tag or ID, it is replaced. More info at
329@ref{vm_snapshots}.
330ETEXI
331
d7f9b689
LC
332 {
333 .name = "loadvm",
334 .args_type = "name:s",
d7f9b689
LC
335 .params = "tag|id",
336 .help = "restore a VM snapshot from its tag or id",
af4ce882 337 .mhandler.cmd = do_loadvm,
d7f9b689
LC
338 },
339
2313086a
BS
340STEXI
341@item loadvm @var{tag}|@var{id}
70fcbbe7 342@findex loadvm
2313086a
BS
343Set the whole virtual machine to the snapshot identified by the tag
344@var{tag} or the unique snapshot ID @var{id}.
345ETEXI
346
d7f9b689
LC
347 {
348 .name = "delvm",
349 .args_type = "name:s",
d7f9b689
LC
350 .params = "tag|id",
351 .help = "delete a VM snapshot from its tag or id",
af4ce882 352 .mhandler.cmd = do_delvm,
d7f9b689
LC
353 },
354
2313086a
BS
355STEXI
356@item delvm @var{tag}|@var{id}
70fcbbe7 357@findex delvm
2313086a
BS
358Delete the snapshot identified by @var{tag} or @var{id}.
359ETEXI
360
d7f9b689
LC
361 {
362 .name = "singlestep",
363 .args_type = "option:s?",
d7f9b689
LC
364 .params = "[on|off]",
365 .help = "run emulation in singlestep mode or switch to normal mode",
af4ce882 366 .mhandler.cmd = do_singlestep,
d7f9b689
LC
367 },
368
2313086a
BS
369STEXI
370@item singlestep [off]
70fcbbe7 371@findex singlestep
2313086a
BS
372Run the emulation in single step mode.
373If called with option off, the emulation returns to normal mode.
374ETEXI
375
d7f9b689
LC
376 {
377 .name = "stop",
378 .args_type = "",
d7f9b689
LC
379 .params = "",
380 .help = "stop emulation",
5f158f21 381 .mhandler.cmd = hmp_stop,
d7f9b689
LC
382 },
383
2313086a
BS
384STEXI
385@item stop
70fcbbe7 386@findex stop
2313086a
BS
387Stop emulation.
388ETEXI
389
d7f9b689
LC
390 {
391 .name = "c|cont",
392 .args_type = "",
d7f9b689
LC
393 .params = "",
394 .help = "resume emulation",
e42e818b 395 .mhandler.cmd = hmp_cont,
d7f9b689
LC
396 },
397
2313086a
BS
398STEXI
399@item c or cont
70fcbbe7 400@findex cont
2313086a 401Resume emulation.
9b9df25a
GH
402ETEXI
403
404 {
405 .name = "system_wakeup",
406 .args_type = "",
407 .params = "",
408 .help = "wakeup guest from suspend",
409 .mhandler.cmd = hmp_system_wakeup,
410 },
411
412STEXI
413@item system_wakeup
414@findex system_wakeup
415Wakeup guest from suspend.
2313086a
BS
416ETEXI
417
d7f9b689
LC
418 {
419 .name = "gdbserver",
420 .args_type = "device:s?",
d7f9b689
LC
421 .params = "[device]",
422 .help = "start gdbserver on given device (default 'tcp::1234'), stop with 'none'",
af4ce882 423 .mhandler.cmd = do_gdbserver,
d7f9b689
LC
424 },
425
2313086a
BS
426STEXI
427@item gdbserver [@var{port}]
70fcbbe7 428@findex gdbserver
2313086a
BS
429Start gdbserver session (default @var{port}=1234)
430ETEXI
431
d7f9b689
LC
432 {
433 .name = "x",
434 .args_type = "fmt:/,addr:l",
d7f9b689
LC
435 .params = "/fmt addr",
436 .help = "virtual memory dump starting at 'addr'",
af4ce882 437 .mhandler.cmd = do_memory_dump,
d7f9b689
LC
438 },
439
2313086a
BS
440STEXI
441@item x/fmt @var{addr}
70fcbbe7 442@findex x
2313086a
BS
443Virtual memory dump starting at @var{addr}.
444ETEXI
445
d7f9b689
LC
446 {
447 .name = "xp",
448 .args_type = "fmt:/,addr:l",
d7f9b689
LC
449 .params = "/fmt addr",
450 .help = "physical memory dump starting at 'addr'",
af4ce882 451 .mhandler.cmd = do_physical_memory_dump,
d7f9b689
LC
452 },
453
2313086a
BS
454STEXI
455@item xp /@var{fmt} @var{addr}
70fcbbe7 456@findex xp
2313086a
BS
457Physical memory dump starting at @var{addr}.
458
459@var{fmt} is a format which tells the command how to format the
460data. Its syntax is: @option{/@{count@}@{format@}@{size@}}
461
462@table @var
463@item count
464is the number of items to be dumped.
465
466@item format
467can be x (hex), d (signed decimal), u (unsigned decimal), o (octal),
468c (char) or i (asm instruction).
469
470@item size
471can be b (8 bits), h (16 bits), w (32 bits) or g (64 bits). On x86,
472@code{h} or @code{w} can be specified with the @code{i} format to
473respectively select 16 or 32 bit code instruction size.
474
475@end table
476
477Examples:
478@itemize
479@item
480Dump 10 instructions at the current instruction pointer:
481@example
482(qemu) x/10i $eip
4830x90107063: ret
4840x90107064: sti
4850x90107065: lea 0x0(%esi,1),%esi
4860x90107069: lea 0x0(%edi,1),%edi
4870x90107070: ret
4880x90107071: jmp 0x90107080
4890x90107073: nop
4900x90107074: nop
4910x90107075: nop
4920x90107076: nop
493@end example
494
495@item
496Dump 80 16 bit values at the start of the video memory.
497@smallexample
498(qemu) xp/80hx 0xb8000
4990x000b8000: 0x0b50 0x0b6c 0x0b65 0x0b78 0x0b38 0x0b36 0x0b2f 0x0b42
5000x000b8010: 0x0b6f 0x0b63 0x0b68 0x0b73 0x0b20 0x0b56 0x0b47 0x0b41
5010x000b8020: 0x0b42 0x0b69 0x0b6f 0x0b73 0x0b20 0x0b63 0x0b75 0x0b72
5020x000b8030: 0x0b72 0x0b65 0x0b6e 0x0b74 0x0b2d 0x0b63 0x0b76 0x0b73
5030x000b8040: 0x0b20 0x0b30 0x0b35 0x0b20 0x0b4e 0x0b6f 0x0b76 0x0b20
5040x000b8050: 0x0b32 0x0b30 0x0b30 0x0b33 0x0720 0x0720 0x0720 0x0720
5050x000b8060: 0x0720 0x0720 0x0720 0x0720 0x0720 0x0720 0x0720 0x0720
5060x000b8070: 0x0720 0x0720 0x0720 0x0720 0x0720 0x0720 0x0720 0x0720
5070x000b8080: 0x0720 0x0720 0x0720 0x0720 0x0720 0x0720 0x0720 0x0720
5080x000b8090: 0x0720 0x0720 0x0720 0x0720 0x0720 0x0720 0x0720 0x0720
509@end smallexample
510@end itemize
511ETEXI
512
d7f9b689
LC
513 {
514 .name = "p|print",
515 .args_type = "fmt:/,val:l",
d7f9b689
LC
516 .params = "/fmt expr",
517 .help = "print expression value (use $reg for CPU register access)",
af4ce882 518 .mhandler.cmd = do_print,
d7f9b689
LC
519 },
520
2313086a
BS
521STEXI
522@item p or print/@var{fmt} @var{expr}
70fcbbe7 523@findex print
2313086a
BS
524
525Print expression value. Only the @var{format} part of @var{fmt} is
526used.
527ETEXI
528
d7f9b689
LC
529 {
530 .name = "i",
531 .args_type = "fmt:/,addr:i,index:i.",
d7f9b689
LC
532 .params = "/fmt addr",
533 .help = "I/O port read",
af4ce882 534 .mhandler.cmd = do_ioport_read,
d7f9b689
LC
535 },
536
2313086a
BS
537STEXI
538Read I/O port.
539ETEXI
540
d7f9b689
LC
541 {
542 .name = "o",
543 .args_type = "fmt:/,addr:i,val:i",
d7f9b689
LC
544 .params = "/fmt addr value",
545 .help = "I/O port write",
af4ce882 546 .mhandler.cmd = do_ioport_write,
d7f9b689
LC
547 },
548
f114784f
JK
549STEXI
550Write to I/O port.
551ETEXI
2313086a 552
d7f9b689
LC
553 {
554 .name = "sendkey",
2ef20c15 555 .args_type = "keys:s,hold-time:i?",
d7f9b689
LC
556 .params = "keys [hold_ms]",
557 .help = "send keys to the VM (e.g. 'sendkey ctrl-alt-f1', default hold time=100 ms)",
e4c8f004 558 .mhandler.cmd = hmp_send_key,
29136cd8 559 .command_completion = sendkey_completion,
d7f9b689
LC
560 },
561
2313086a
BS
562STEXI
563@item sendkey @var{keys}
70fcbbe7 564@findex sendkey
2313086a 565
886cc706
AK
566Send @var{keys} to the guest. @var{keys} could be the name of the
567key or the raw value in hexadecimal format. Use @code{-} to press
568several keys simultaneously. Example:
2313086a
BS
569@example
570sendkey ctrl-alt-f1
571@end example
572
573This command is useful to send keys that your graphical user interface
574intercepts at low level, such as @code{ctrl-alt-f1} in X Window.
575ETEXI
576
d7f9b689
LC
577 {
578 .name = "system_reset",
579 .args_type = "",
d7f9b689
LC
580 .params = "",
581 .help = "reset the system",
38d22653 582 .mhandler.cmd = hmp_system_reset,
d7f9b689
LC
583 },
584
2313086a
BS
585STEXI
586@item system_reset
70fcbbe7 587@findex system_reset
2313086a
BS
588
589Reset the system.
590ETEXI
591
d7f9b689
LC
592 {
593 .name = "system_powerdown",
594 .args_type = "",
d7f9b689
LC
595 .params = "",
596 .help = "send system power down event",
5bc465e4 597 .mhandler.cmd = hmp_system_powerdown,
d7f9b689
LC
598 },
599
2313086a
BS
600STEXI
601@item system_powerdown
70fcbbe7 602@findex system_powerdown
2313086a
BS
603
604Power down the system (if supported).
605ETEXI
606
d7f9b689
LC
607 {
608 .name = "sum",
609 .args_type = "start:i,size:i",
d7f9b689
LC
610 .params = "addr size",
611 .help = "compute the checksum of a memory region",
af4ce882 612 .mhandler.cmd = do_sum,
d7f9b689
LC
613 },
614
2313086a
BS
615STEXI
616@item sum @var{addr} @var{size}
70fcbbe7 617@findex sum
2313086a
BS
618
619Compute the checksum of a memory region.
620ETEXI
621
d7f9b689
LC
622 {
623 .name = "usb_add",
624 .args_type = "devname:s",
d7f9b689
LC
625 .params = "device",
626 .help = "add USB device (e.g. 'host:bus.addr' or 'host:vendor_id:product_id')",
af4ce882 627 .mhandler.cmd = do_usb_add,
d7f9b689
LC
628 },
629
2313086a
BS
630STEXI
631@item usb_add @var{devname}
70fcbbe7 632@findex usb_add
2313086a
BS
633
634Add the USB device @var{devname}. For details of available devices see
635@ref{usb_devices}
636ETEXI
637
d7f9b689
LC
638 {
639 .name = "usb_del",
640 .args_type = "devname:s",
d7f9b689
LC
641 .params = "device",
642 .help = "remove USB device 'bus.addr'",
af4ce882 643 .mhandler.cmd = do_usb_del,
d7f9b689
LC
644 },
645
2313086a
BS
646STEXI
647@item usb_del @var{devname}
70fcbbe7 648@findex usb_del
2313086a
BS
649
650Remove the USB device @var{devname} from the QEMU virtual USB
651hub. @var{devname} has the syntax @code{bus.addr}. Use the monitor
652command @code{info usb} to see the devices you can remove.
653ETEXI
654
d7f9b689
LC
655 {
656 .name = "device_add",
c7e4e8ce
MA
657 .args_type = "device:O",
658 .params = "driver[,prop=value][,...]",
d7f9b689 659 .help = "add device, like -device on the command line",
8bc27249
MA
660 .user_print = monitor_user_noop,
661 .mhandler.cmd_new = do_device_add,
2da1b3ab 662 .command_completion = device_add_completion,
d7f9b689
LC
663 },
664
3418bd25
GH
665STEXI
666@item device_add @var{config}
70fcbbe7 667@findex device_add
3418bd25
GH
668
669Add device.
670ETEXI
671
d7f9b689
LC
672 {
673 .name = "device_del",
674 .args_type = "id:s",
d7f9b689
LC
675 .params = "device",
676 .help = "remove device",
a15fef21 677 .mhandler.cmd = hmp_device_del,
2da1b3ab 678 .command_completion = device_del_completion,
d7f9b689
LC
679 },
680
3418bd25
GH
681STEXI
682@item device_del @var{id}
70fcbbe7 683@findex device_del
3418bd25
GH
684
685Remove device @var{id}.
686ETEXI
687
d7f9b689
LC
688 {
689 .name = "cpu",
690 .args_type = "index:i",
d7f9b689
LC
691 .params = "index",
692 .help = "set the default CPU",
755f1968 693 .mhandler.cmd = hmp_cpu,
d7f9b689 694 },
3418bd25 695
2313086a 696STEXI
c427ea9c
MA
697@item cpu @var{index}
698@findex cpu
2313086a
BS
699Set the default CPU.
700ETEXI
701
d7f9b689
LC
702 {
703 .name = "mouse_move",
704 .args_type = "dx_str:s,dy_str:s,dz_str:s?",
d7f9b689
LC
705 .params = "dx dy [dz]",
706 .help = "send mouse move events",
af4ce882 707 .mhandler.cmd = do_mouse_move,
d7f9b689
LC
708 },
709
2313086a
BS
710STEXI
711@item mouse_move @var{dx} @var{dy} [@var{dz}]
70fcbbe7 712@findex mouse_move
2313086a
BS
713Move the active mouse to the specified coordinates @var{dx} @var{dy}
714with optional scroll axis @var{dz}.
715ETEXI
716
d7f9b689
LC
717 {
718 .name = "mouse_button",
719 .args_type = "button_state:i",
d7f9b689
LC
720 .params = "state",
721 .help = "change mouse button state (1=L, 2=M, 4=R)",
af4ce882 722 .mhandler.cmd = do_mouse_button,
d7f9b689
LC
723 },
724
2313086a
BS
725STEXI
726@item mouse_button @var{val}
70fcbbe7 727@findex mouse_button
2313086a
BS
728Change the active mouse button state @var{val} (1=L, 2=M, 4=R).
729ETEXI
730
d7f9b689
LC
731 {
732 .name = "mouse_set",
733 .args_type = "index:i",
d7f9b689
LC
734 .params = "index",
735 .help = "set which mouse device receives events",
af4ce882 736 .mhandler.cmd = do_mouse_set,
d7f9b689
LC
737 },
738
2313086a
BS
739STEXI
740@item mouse_set @var{index}
70fcbbe7 741@findex mouse_set
2313086a
BS
742Set which mouse device receives events at given @var{index}, index
743can be obtained with
744@example
745info mice
746@end example
747ETEXI
748
d7f9b689
LC
749 {
750 .name = "wavcapture",
751 .args_type = "path:F,freq:i?,bits:i?,nchannels:i?",
d7f9b689
LC
752 .params = "path [frequency [bits [channels]]]",
753 .help = "capture audio to a wave file (default frequency=44100 bits=16 channels=2)",
af4ce882 754 .mhandler.cmd = do_wav_capture,
d7f9b689 755 },
2313086a
BS
756STEXI
757@item wavcapture @var{filename} [@var{frequency} [@var{bits} [@var{channels}]]]
70fcbbe7 758@findex wavcapture
2313086a
BS
759Capture audio into @var{filename}. Using sample rate @var{frequency}
760bits per sample @var{bits} and number of channels @var{channels}.
761
762Defaults:
763@itemize @minus
764@item Sample rate = 44100 Hz - CD quality
765@item Bits = 16
766@item Number of channels = 2 - Stereo
767@end itemize
768ETEXI
769
d7f9b689
LC
770 {
771 .name = "stopcapture",
772 .args_type = "n:i",
d7f9b689
LC
773 .params = "capture index",
774 .help = "stop capture",
af4ce882 775 .mhandler.cmd = do_stop_capture,
d7f9b689 776 },
2313086a
BS
777STEXI
778@item stopcapture @var{index}
70fcbbe7 779@findex stopcapture
2313086a
BS
780Stop capture with a given @var{index}, index can be obtained with
781@example
782info capture
783@end example
784ETEXI
785
d7f9b689
LC
786 {
787 .name = "memsave",
788 .args_type = "val:l,size:i,filename:s",
d7f9b689
LC
789 .params = "addr size file",
790 .help = "save to disk virtual memory dump starting at 'addr' of size 'size'",
0cfd6a9a 791 .mhandler.cmd = hmp_memsave,
d7f9b689
LC
792 },
793
2313086a
BS
794STEXI
795@item memsave @var{addr} @var{size} @var{file}
70fcbbe7 796@findex memsave
2313086a
BS
797save to disk virtual memory dump starting at @var{addr} of size @var{size}.
798ETEXI
799
d7f9b689
LC
800 {
801 .name = "pmemsave",
802 .args_type = "val:l,size:i,filename:s",
d7f9b689
LC
803 .params = "addr size file",
804 .help = "save to disk physical memory dump starting at 'addr' of size 'size'",
6d3962bf 805 .mhandler.cmd = hmp_pmemsave,
d7f9b689
LC
806 },
807
2313086a
BS
808STEXI
809@item pmemsave @var{addr} @var{size} @var{file}
70fcbbe7 810@findex pmemsave
2313086a
BS
811save to disk physical memory dump starting at @var{addr} of size @var{size}.
812ETEXI
813
d7f9b689
LC
814 {
815 .name = "boot_set",
816 .args_type = "bootdevice:s",
d7f9b689
LC
817 .params = "bootdevice",
818 .help = "define new values for the boot device list",
af4ce882 819 .mhandler.cmd = do_boot_set,
d7f9b689
LC
820 },
821
2313086a
BS
822STEXI
823@item boot_set @var{bootdevicelist}
70fcbbe7 824@findex boot_set
2313086a
BS
825
826Define new values for the boot device list. Those values will override
827the values specified on the command line through the @code{-boot} option.
828
829The values that can be specified here depend on the machine type, but are
830the same that can be specified in the @code{-boot} command line option.
831ETEXI
832
7f7f9752 833#if defined(TARGET_I386) || defined(TARGET_S390X)
d7f9b689
LC
834 {
835 .name = "nmi",
e9b4b432
LC
836 .args_type = "",
837 .params = "",
838 .help = "inject an NMI on all guest's CPUs",
ab49ab5c 839 .mhandler.cmd = hmp_inject_nmi,
d7f9b689 840 },
2313086a
BS
841#endif
842STEXI
843@item nmi @var{cpu}
70fcbbe7 844@findex nmi
7f7f9752 845Inject an NMI (x86) or RESTART (s390x) on the given CPU.
1f590cf9
LL
846
847ETEXI
848
849 {
3949e594 850 .name = "ringbuf_write",
1f590cf9
LL
851 .args_type = "device:s,data:s",
852 .params = "device data",
3949e594
MA
853 .help = "Write to a ring buffer character device",
854 .mhandler.cmd = hmp_ringbuf_write,
1f590cf9
LL
855 },
856
857STEXI
3949e594
MA
858@item ringbuf_write @var{device} @var{data}
859@findex ringbuf_write
860Write @var{data} to ring buffer character device @var{device}.
861@var{data} must be a UTF-8 string.
1f590cf9 862
49b6d722
LL
863ETEXI
864
865 {
3949e594 866 .name = "ringbuf_read",
49b6d722
LL
867 .args_type = "device:s,size:i",
868 .params = "device size",
3949e594
MA
869 .help = "Read from a ring buffer character device",
870 .mhandler.cmd = hmp_ringbuf_read,
49b6d722
LL
871 },
872
873STEXI
3949e594
MA
874@item ringbuf_read @var{device}
875@findex ringbuf_read
876Read and print up to @var{size} bytes from ring buffer character
877device @var{device}.
543f3412
MA
878Certain non-printable characters are printed \uXXXX, where XXXX is the
879character code in hexadecimal. Character \ is printed \\.
3949e594
MA
880Bug: can screw up when the buffer contains invalid UTF-8 sequences,
881NUL characters, after the ring buffer lost data, and when reading
882stops because the size limit is reached.
49b6d722 883
2313086a
BS
884ETEXI
885
d7f9b689
LC
886 {
887 .name = "migrate",
fbc3d96c
LS
888 .args_type = "detach:-d,blk:-b,inc:-i,uri:s",
889 .params = "[-d] [-b] [-i] uri",
890 .help = "migrate to URI (using -d to not wait for completion)"
891 "\n\t\t\t -b for migration without shared storage with"
892 " full copy of disk\n\t\t\t -i for migration without "
893 "shared storage with incremental copy of disk "
894 "(base image shared between src and destination)",
e1c37d0e 895 .mhandler.cmd = hmp_migrate,
d7f9b689
LC
896 },
897
fbc3d96c 898
2313086a 899STEXI
fbc3d96c 900@item migrate [-d] [-b] [-i] @var{uri}
70fcbbe7 901@findex migrate
2313086a 902Migrate to @var{uri} (using -d to not wait for completion).
fbc3d96c
LS
903 -b for migration with full copy of disk
904 -i for migration with incremental copy of disk (base image is shared)
2313086a
BS
905ETEXI
906
d7f9b689
LC
907 {
908 .name = "migrate_cancel",
909 .args_type = "",
d7f9b689
LC
910 .params = "",
911 .help = "cancel the current VM migration",
6cdedb07 912 .mhandler.cmd = hmp_migrate_cancel,
d7f9b689
LC
913 },
914
2313086a
BS
915STEXI
916@item migrate_cancel
70fcbbe7 917@findex migrate_cancel
2313086a 918Cancel the current VM migration.
9e1ba4cc
OW
919
920ETEXI
921
922 {
923 .name = "migrate_set_cache_size",
924 .args_type = "value:o",
925 .params = "value",
926 .help = "set cache size (in bytes) for XBZRLE migrations,"
927 "the cache size will be rounded down to the nearest "
928 "power of 2.\n"
929 "The cache size affects the number of cache misses."
930 "In case of a high cache miss ratio you need to increase"
931 " the cache size",
932 .mhandler.cmd = hmp_migrate_set_cache_size,
933 },
934
935STEXI
936@item migrate_set_cache_size @var{value}
937@findex migrate_set_cache_size
938Set cache size to @var{value} (in bytes) for xbzrle migrations.
2313086a
BS
939ETEXI
940
d7f9b689
LC
941 {
942 .name = "migrate_set_speed",
ed3d4a80 943 .args_type = "value:o",
d7f9b689 944 .params = "value",
ed3d4a80
JS
945 .help = "set maximum speed (in bytes) for migrations. "
946 "Defaults to MB if no size suffix is specified, ie. B/K/M/G/T",
3dc85383 947 .mhandler.cmd = hmp_migrate_set_speed,
d7f9b689
LC
948 },
949
2313086a
BS
950STEXI
951@item migrate_set_speed @var{value}
70fcbbe7 952@findex migrate_set_speed
2313086a 953Set maximum speed to @var{value} (in bytes) for migrations.
2ea42952
GC
954ETEXI
955
d7f9b689
LC
956 {
957 .name = "migrate_set_downtime",
b0fbf7d3 958 .args_type = "value:T",
d7f9b689
LC
959 .params = "value",
960 .help = "set maximum tolerated downtime (in seconds) for migrations",
4f0a993b 961 .mhandler.cmd = hmp_migrate_set_downtime,
d7f9b689 962 },
2ea42952
GC
963
964STEXI
965@item migrate_set_downtime @var{second}
70fcbbe7 966@findex migrate_set_downtime
2ea42952 967Set maximum tolerated downtime (in seconds) for migration.
00458433
OW
968ETEXI
969
970 {
971 .name = "migrate_set_capability",
972 .args_type = "capability:s,state:b",
973 .params = "capability state",
974 .help = "Enable/Disable the usage of a capability for migration",
975 .mhandler.cmd = hmp_migrate_set_capability,
976 },
977
978STEXI
979@item migrate_set_capability @var{capability} @var{state}
980@findex migrate_set_capability
981Enable/Disable the usage of a capability @var{capability} for migration.
f8882568
JS
982ETEXI
983
984 {
2ea720db
JS
985 .name = "client_migrate_info",
986 .args_type = "protocol:s,hostname:s,port:i?,tls-port:i?,cert-subject:s?",
987 .params = "protocol hostname port tls-port cert-subject",
988 .help = "send migration info to spice/vnc client",
989 .user_print = monitor_user_noop,
edc5cb1a
YH
990 .mhandler.cmd_async = client_migrate_info,
991 .flags = MONITOR_CMD_ASYNC,
f8882568
JS
992 },
993
e866e239
GH
994STEXI
995@item client_migrate_info @var{protocol} @var{hostname} @var{port} @var{tls-port} @var{cert-subject}
996@findex client_migrate_info
997Set the spice/vnc connection info for the migration target. The spice/vnc
998server will ask the spice/vnc client to automatically reconnect using the
999new parameters (if specified) once the vm migration finished successfully.
1000ETEXI
1001
783e9b48
WC
1002 {
1003 .name = "dump-guest-memory",
1b7a0f75
QN
1004 .args_type = "paging:-p,zlib:-z,lzo:-l,snappy:-s,filename:F,begin:i?,length:i?",
1005 .params = "[-p] [-z|-l|-s] filename [begin length]",
c20499d9
QN
1006 .help = "dump guest memory into file 'filename'.\n\t\t\t"
1007 "-p: do paging to get guest's memory mapping.\n\t\t\t"
1b7a0f75
QN
1008 "-z: dump in kdump-compressed format, with zlib compression.\n\t\t\t"
1009 "-l: dump in kdump-compressed format, with lzo compression.\n\t\t\t"
1010 "-s: dump in kdump-compressed format, with snappy compression.\n\t\t\t"
c20499d9
QN
1011 "begin: the starting physical address.\n\t\t\t"
1012 "length: the memory size, in bytes.",
783e9b48
WC
1013 .mhandler.cmd = hmp_dump_guest_memory,
1014 },
1015
1016
1017STEXI
c20499d9 1018@item dump-guest-memory [-p] @var{filename} @var{begin} @var{length}
1b7a0f75 1019@item dump-guest-memory [-z|-l|-s] @var{filename}
783e9b48
WC
1020@findex dump-guest-memory
1021Dump guest memory to @var{protocol}. The file can be processed with crash or
1b7a0f75 1022gdb. Without -z|-l|-s, the dump format is ELF.
c20499d9 1023 -p: do paging to get guest's memory mapping.
1b7a0f75
QN
1024 -z: dump in kdump-compressed format, with zlib compression.
1025 -l: dump in kdump-compressed format, with lzo compression.
1026 -s: dump in kdump-compressed format, with snappy compression.
c20499d9 1027 filename: dump file name.
783e9b48 1028 begin: the starting physical address. It's optional, and should be
c20499d9 1029 specified together with length.
783e9b48 1030 length: the memory size, in bytes. It's optional, and should be specified
c20499d9 1031 together with begin.
783e9b48 1032ETEXI
783e9b48 1033
e866e239 1034 {
2ea720db 1035 .name = "snapshot_blkdev",
6cc2a415
PB
1036 .args_type = "reuse:-n,device:B,snapshot-file:s?,format:s?",
1037 .params = "[-n] device [new-image-file] [format]",
2ea720db
JS
1038 .help = "initiates a live snapshot\n\t\t\t"
1039 "of device. If a new image file is specified, the\n\t\t\t"
1040 "new image file will become the new root image.\n\t\t\t"
1041 "If format is specified, the snapshot file will\n\t\t\t"
775ca88e 1042 "be created in that format.\n\t\t\t"
6cc2a415
PB
1043 "The default format is qcow2. The -n flag requests QEMU\n\t\t\t"
1044 "to reuse the image found in new-image-file, instead of\n\t\t\t"
1045 "recreating it from scratch.",
6106e249 1046 .mhandler.cmd = hmp_snapshot_blkdev,
e866e239
GH
1047 },
1048
f8882568
JS
1049STEXI
1050@item snapshot_blkdev
1051@findex snapshot_blkdev
1052Snapshot device, using snapshot file as target if provided
775ca88e
WX
1053ETEXI
1054
1055 {
1056 .name = "snapshot_blkdev_internal",
1057 .args_type = "device:B,name:s",
1058 .params = "device name",
1059 .help = "take an internal snapshot of device.\n\t\t\t"
1060 "The format of the image used by device must\n\t\t\t"
1061 "support it, such as qcow2.\n\t\t\t",
1062 .mhandler.cmd = hmp_snapshot_blkdev_internal,
1063 },
1064
1065STEXI
1066@item snapshot_blkdev_internal
1067@findex snapshot_blkdev_internal
1068Take an internal snapshot on device if it support
7a4ed2ee
WX
1069ETEXI
1070
1071 {
1072 .name = "snapshot_delete_blkdev_internal",
1073 .args_type = "device:B,name:s,id:s?",
1074 .params = "device name [id]",
1075 .help = "delete an internal snapshot of device.\n\t\t\t"
1076 "If id is specified, qemu will try delete\n\t\t\t"
1077 "the snapshot matching both id and name.\n\t\t\t"
1078 "The format of the image used by device must\n\t\t\t"
1079 "support it, such as qcow2.\n\t\t\t",
1080 .mhandler.cmd = hmp_snapshot_delete_blkdev_internal,
1081 },
1082
1083STEXI
1084@item snapshot_delete_blkdev_internal
1085@findex snapshot_delete_blkdev_internal
1086Delete an internal snapshot on device if it support
d9b902db
PB
1087ETEXI
1088
1089 {
1090 .name = "drive_mirror",
1091 .args_type = "reuse:-n,full:-f,device:B,target:s,format:s?",
1092 .params = "[-n] [-f] device target [format]",
1093 .help = "initiates live storage\n\t\t\t"
1094 "migration for a device. The device's contents are\n\t\t\t"
1095 "copied to the new image file, including data that\n\t\t\t"
1096 "is written after the command is started.\n\t\t\t"
1097 "The -n flag requests QEMU to reuse the image found\n\t\t\t"
1098 "in new-image-file, instead of recreating it from scratch.\n\t\t\t"
1099 "The -f flag requests QEMU to copy the whole disk,\n\t\t\t"
1100 "so that the result does not need a backing file.\n\t\t\t",
1101 .mhandler.cmd = hmp_drive_mirror,
1102 },
1103STEXI
1104@item drive_mirror
1105@findex drive_mirror
1106Start mirroring a block device's writes to a new destination,
1107using the specified target.
de90930a
SH
1108ETEXI
1109
1110 {
1111 .name = "drive_backup",
1112 .args_type = "reuse:-n,full:-f,device:B,target:s,format:s?",
1113 .params = "[-n] [-f] device target [format]",
1114 .help = "initiates a point-in-time\n\t\t\t"
1115 "copy for a device. The device's contents are\n\t\t\t"
1116 "copied to the new image file, excluding data that\n\t\t\t"
1117 "is written after the command is started.\n\t\t\t"
1118 "The -n flag requests QEMU to reuse the image found\n\t\t\t"
1119 "in new-image-file, instead of recreating it from scratch.\n\t\t\t"
1120 "The -f flag requests QEMU to copy the whole disk,\n\t\t\t"
1121 "so that the result does not need a backing file.\n\t\t\t",
1122 .mhandler.cmd = hmp_drive_backup,
1123 },
1124STEXI
1125@item drive_backup
1126@findex drive_backup
1127Start a point-in-time copy of a block device to a specificed target.
2313086a
BS
1128ETEXI
1129
d7f9b689
LC
1130 {
1131 .name = "drive_add",
1132 .args_type = "pci_addr:s,opts:s",
d7f9b689
LC
1133 .params = "[[<domain>:]<bus>:]<slot>\n"
1134 "[file=file][,if=type][,bus=n]\n"
fb0490f6 1135 "[,unit=m][,media=d][,index=i]\n"
d7f9b689 1136 "[,cyls=c,heads=h,secs=s[,trans=t]]\n"
fb0490f6
SH
1137 "[,snapshot=on|off][,cache=on|off]\n"
1138 "[,readonly=on|off][,copy-on-read=on|off]",
d7f9b689 1139 .help = "add drive to PCI storage controller",
af4ce882 1140 .mhandler.cmd = drive_hot_add,
d7f9b689 1141 },
d7f9b689 1142
2313086a
BS
1143STEXI
1144@item drive_add
70fcbbe7 1145@findex drive_add
2313086a
BS
1146Add drive to PCI storage controller.
1147ETEXI
1148
79ca616f 1149#if defined(CONFIG_PCI_HOTPLUG_OLD)
d7f9b689
LC
1150 {
1151 .name = "pci_add",
1152 .args_type = "pci_addr:s,type:s,opts:s?",
d7f9b689
LC
1153 .params = "auto|[[<domain>:]<bus>:]<slot> nic|storage [[vlan=n][,macaddr=addr][,model=type]] [file=file][,if=type][,bus=nr]...",
1154 .help = "hot-add PCI device",
6c6a58ae 1155 .mhandler.cmd = pci_device_hot_add,
d7f9b689 1156 },
2313086a 1157#endif
d7f9b689 1158
2313086a
BS
1159STEXI
1160@item pci_add
70fcbbe7 1161@findex pci_add
2313086a
BS
1162Hot-add PCI device.
1163ETEXI
1164
79ca616f 1165#if defined(CONFIG_PCI_HOTPLUG_OLD)
d7f9b689
LC
1166 {
1167 .name = "pci_del",
1168 .args_type = "pci_addr:s",
d7f9b689
LC
1169 .params = "[[<domain>:]<bus>:]<slot>",
1170 .help = "hot remove PCI device",
b752daf0 1171 .mhandler.cmd = do_pci_device_hot_remove,
d7f9b689 1172 },
2313086a 1173#endif
d7f9b689 1174
2313086a
BS
1175STEXI
1176@item pci_del
70fcbbe7 1177@findex pci_del
2313086a 1178Hot remove PCI device.
2ae63bda
IY
1179ETEXI
1180
1181 {
1182 .name = "pcie_aer_inject_error",
1183 .args_type = "advisory_non_fatal:-a,correctable:-c,"
1184 "id:s,error_status:s,"
1185 "header0:i?,header1:i?,header2:i?,header3:i?,"
1186 "prefix0:i?,prefix1:i?,prefix2:i?,prefix3:i?",
1187 .params = "[-a] [-c] id "
1188 "<error_status> [<tlp header> [<tlp header prefix>]]",
1189 .help = "inject pcie aer error\n\t\t\t"
1190 " -a for advisory non fatal error\n\t\t\t"
1191 " -c for correctable error\n\t\t\t"
1192 "<id> = qdev device id\n\t\t\t"
1193 "<error_status> = error string or 32bit\n\t\t\t"
1194 "<tlb header> = 32bit x 4\n\t\t\t"
1195 "<tlb header prefix> = 32bit x 4",
1196 .user_print = pcie_aer_inject_error_print,
1f3392b7 1197 .mhandler.cmd_new = do_pcie_aer_inject_error,
2ae63bda
IY
1198 },
1199
1200STEXI
1201@item pcie_aer_inject_error
1202@findex pcie_aer_inject_error
1203Inject PCIe AER error
2313086a
BS
1204ETEXI
1205
d7f9b689
LC
1206 {
1207 .name = "host_net_add",
1208 .args_type = "device:s,opts:s?",
58952137 1209 .params = "tap|user|socket|vde|netmap|dump [options]",
d7f9b689 1210 .help = "add host VLAN client",
af4ce882 1211 .mhandler.cmd = net_host_device_add,
d7f9b689
LC
1212 },
1213
2313086a
BS
1214STEXI
1215@item host_net_add
70fcbbe7 1216@findex host_net_add
2313086a
BS
1217Add host VLAN client.
1218ETEXI
1219
d7f9b689
LC
1220 {
1221 .name = "host_net_remove",
1222 .args_type = "vlan_id:i,device:s",
d7f9b689
LC
1223 .params = "vlan_id name",
1224 .help = "remove host VLAN client",
af4ce882 1225 .mhandler.cmd = net_host_device_remove,
d7f9b689
LC
1226 },
1227
2313086a
BS
1228STEXI
1229@item host_net_remove
70fcbbe7 1230@findex host_net_remove
2313086a 1231Remove host VLAN client.
ae82d324
MA
1232ETEXI
1233
1234 {
1235 .name = "netdev_add",
1236 .args_type = "netdev:O",
58952137 1237 .params = "[user|tap|socket|hubport|netmap],id=str[,prop=value][,...]",
ae82d324 1238 .help = "add host network device",
928059a3 1239 .mhandler.cmd = hmp_netdev_add,
ae82d324
MA
1240 },
1241
1242STEXI
1243@item netdev_add
1244@findex netdev_add
1245Add host network device.
1246ETEXI
1247
1248 {
1249 .name = "netdev_del",
1250 .args_type = "id:s",
1251 .params = "id",
1252 .help = "remove host network device",
5f964155 1253 .mhandler.cmd = hmp_netdev_del,
ae82d324
MA
1254 },
1255
1256STEXI
1257@item netdev_del
1258@findex netdev_del
1259Remove host network device.
cff8b2c6
PB
1260ETEXI
1261
1262 {
1263 .name = "object_add",
1264 .args_type = "object:O",
1265 .params = "[qom-type=]type,id=str[,prop=value][,...]",
1266 .help = "create QOM object",
1267 .mhandler.cmd = hmp_object_add,
bfa40f77 1268 .command_completion = object_add_completion,
cff8b2c6
PB
1269 },
1270
1271STEXI
1272@item object_add
1273@findex object_add
1274Create QOM object.
ab2d0531
PB
1275ETEXI
1276
1277 {
1278 .name = "object_del",
1279 .args_type = "id:s",
1280 .params = "id",
1281 .help = "destroy QOM object",
1282 .mhandler.cmd = hmp_object_del,
bfa40f77 1283 .command_completion = object_del_completion,
ab2d0531
PB
1284 },
1285
1286STEXI
1287@item object_del
1288@findex object_del
1289Destroy QOM object.
2313086a
BS
1290ETEXI
1291
1292#ifdef CONFIG_SLIRP
d7f9b689
LC
1293 {
1294 .name = "hostfwd_add",
1295 .args_type = "arg1:s,arg2:s?,arg3:s?",
d7f9b689
LC
1296 .params = "[vlan_id name] [tcp|udp]:[hostaddr]:hostport-[guestaddr]:guestport",
1297 .help = "redirect TCP or UDP connections from host to guest (requires -net user)",
af4ce882 1298 .mhandler.cmd = net_slirp_hostfwd_add,
d7f9b689 1299 },
21413d68
MA
1300#endif
1301STEXI
1302@item hostfwd_add
1303@findex hostfwd_add
1304Redirect TCP or UDP connections from host to guest (requires -net user).
1305ETEXI
d7f9b689 1306
21413d68 1307#ifdef CONFIG_SLIRP
d7f9b689
LC
1308 {
1309 .name = "hostfwd_remove",
1310 .args_type = "arg1:s,arg2:s?,arg3:s?",
d7f9b689
LC
1311 .params = "[vlan_id name] [tcp|udp]:[hostaddr]:hostport",
1312 .help = "remove host-to-guest TCP or UDP redirection",
af4ce882 1313 .mhandler.cmd = net_slirp_hostfwd_remove,
d7f9b689
LC
1314 },
1315
2313086a
BS
1316#endif
1317STEXI
21413d68
MA
1318@item hostfwd_remove
1319@findex hostfwd_remove
1320Remove host-to-guest TCP or UDP redirection.
2313086a
BS
1321ETEXI
1322
d7f9b689
LC
1323 {
1324 .name = "balloon",
3b0bd6ec 1325 .args_type = "value:M",
d7f9b689 1326 .params = "target",
3c05613a 1327 .help = "request VM to change its memory allocation (in MB)",
d72f3264 1328 .mhandler.cmd = hmp_balloon,
d7f9b689
LC
1329 },
1330
2313086a
BS
1331STEXI
1332@item balloon @var{value}
70fcbbe7 1333@findex balloon
2313086a
BS
1334Request VM to change its memory allocation to @var{value} (in MB).
1335ETEXI
1336
d7f9b689
LC
1337 {
1338 .name = "set_link",
c9b26a4c
MA
1339 .args_type = "name:s,up:b",
1340 .params = "name on|off",
d7f9b689 1341 .help = "change the link status of a network adapter",
4b37156c 1342 .mhandler.cmd = hmp_set_link,
d7f9b689
LC
1343 },
1344
2313086a 1345STEXI
c9b26a4c 1346@item set_link @var{name} [on|off]
70fcbbe7 1347@findex set_link
c9b26a4c 1348Switch link @var{name} on (i.e. up) or off (i.e. down).
2313086a
BS
1349ETEXI
1350
d7f9b689
LC
1351 {
1352 .name = "watchdog_action",
1353 .args_type = "action:s",
d7f9b689
LC
1354 .params = "[reset|shutdown|poweroff|pause|debug|none]",
1355 .help = "change watchdog action",
af4ce882 1356 .mhandler.cmd = do_watchdog_action,
d7f9b689
LC
1357 },
1358
2313086a
BS
1359STEXI
1360@item watchdog_action
70fcbbe7 1361@findex watchdog_action
2313086a
BS
1362Change watchdog action.
1363ETEXI
1364
d7f9b689
LC
1365 {
1366 .name = "acl_show",
1367 .args_type = "aclname:s",
d7f9b689
LC
1368 .params = "aclname",
1369 .help = "list rules in the access control list",
af4ce882 1370 .mhandler.cmd = do_acl_show,
d7f9b689
LC
1371 },
1372
2313086a 1373STEXI
15dfcd45 1374@item acl_show @var{aclname}
70fcbbe7 1375@findex acl_show
15dfcd45
JK
1376List all the matching rules in the access control list, and the default
1377policy. There are currently two named access control lists,
1378@var{vnc.x509dname} and @var{vnc.username} matching on the x509 client
1379certificate distinguished name, and SASL username respectively.
1380ETEXI
2313086a 1381
d7f9b689
LC
1382 {
1383 .name = "acl_policy",
1384 .args_type = "aclname:s,policy:s",
d7f9b689
LC
1385 .params = "aclname allow|deny",
1386 .help = "set default access control list policy",
af4ce882 1387 .mhandler.cmd = do_acl_policy,
d7f9b689
LC
1388 },
1389
15dfcd45 1390STEXI
cbbfacc6 1391@item acl_policy @var{aclname} @code{allow|deny}
70fcbbe7 1392@findex acl_policy
15dfcd45 1393Set the default access control list policy, used in the event that
2313086a 1394none of the explicit rules match. The default policy at startup is
15dfcd45
JK
1395always @code{deny}.
1396ETEXI
1397
d7f9b689
LC
1398 {
1399 .name = "acl_add",
1400 .args_type = "aclname:s,match:s,policy:s,index:i?",
d7f9b689
LC
1401 .params = "aclname match allow|deny [index]",
1402 .help = "add a match rule to the access control list",
af4ce882 1403 .mhandler.cmd = do_acl_add,
d7f9b689
LC
1404 },
1405
15dfcd45 1406STEXI
0e4aec98
MA
1407@item acl_add @var{aclname} @var{match} @code{allow|deny} [@var{index}]
1408@findex acl_add
15dfcd45
JK
1409Add a match rule to the access control list, allowing or denying access.
1410The match will normally be an exact username or x509 distinguished name,
1411but can optionally include wildcard globs. eg @code{*@@EXAMPLE.COM} to
1412allow all users in the @code{EXAMPLE.COM} kerberos realm. The match will
2313086a 1413normally be appended to the end of the ACL, but can be inserted
15dfcd45
JK
1414earlier in the list if the optional @var{index} parameter is supplied.
1415ETEXI
1416
d7f9b689
LC
1417 {
1418 .name = "acl_remove",
1419 .args_type = "aclname:s,match:s",
d7f9b689
LC
1420 .params = "aclname match",
1421 .help = "remove a match rule from the access control list",
af4ce882 1422 .mhandler.cmd = do_acl_remove,
d7f9b689
LC
1423 },
1424
15dfcd45
JK
1425STEXI
1426@item acl_remove @var{aclname} @var{match}
70fcbbe7 1427@findex acl_remove
15dfcd45
JK
1428Remove the specified match rule from the access control list.
1429ETEXI
1430
d7f9b689
LC
1431 {
1432 .name = "acl_reset",
1433 .args_type = "aclname:s",
d7f9b689
LC
1434 .params = "aclname",
1435 .help = "reset the access control list",
af4ce882 1436 .mhandler.cmd = do_acl_reset,
d7f9b689
LC
1437 },
1438
15dfcd45 1439STEXI
0e4aec98
MA
1440@item acl_reset @var{aclname}
1441@findex acl_reset
15dfcd45 1442Remove all matches from the access control list, and set the default
2313086a 1443policy back to @code{deny}.
2313086a
BS
1444ETEXI
1445
4057725f
PB
1446 {
1447 .name = "nbd_server_start",
1448 .args_type = "all:-a,writable:-w,uri:s",
1449 .params = "nbd_server_start [-a] [-w] host:port",
1450 .help = "serve block devices on the given host and port",
1451 .mhandler.cmd = hmp_nbd_server_start,
1452 },
1453STEXI
1454@item nbd_server_start @var{host}:@var{port}
1455@findex nbd_server_start
1456Start an NBD server on the given host and/or port. If the @option{-a}
1457option is included, all of the virtual machine's block devices that
1458have an inserted media on them are automatically exported; in this case,
1459the @option{-w} option makes the devices writable too.
1460ETEXI
1461
1462 {
1463 .name = "nbd_server_add",
1464 .args_type = "writable:-w,device:B",
1465 .params = "nbd_server_add [-w] device",
1466 .help = "export a block device via NBD",
1467 .mhandler.cmd = hmp_nbd_server_add,
1468 },
1469STEXI
1470@item nbd_server_add @var{device}
1471@findex nbd_server_add
1472Export a block device through QEMU's NBD server, which must be started
1473beforehand with @command{nbd_server_start}. The @option{-w} option makes the
1474exported device writable too.
1475ETEXI
1476
1477 {
1478 .name = "nbd_server_stop",
1479 .args_type = "",
1480 .params = "nbd_server_stop",
1481 .help = "stop serving block devices using the NBD protocol",
1482 .mhandler.cmd = hmp_nbd_server_stop,
1483 },
1484STEXI
1485@item nbd_server_stop
1486@findex nbd_server_stop
1487Stop the QEMU embedded NBD server.
1488ETEXI
1489
1490
79c4f6b0 1491#if defined(TARGET_I386)
d7f9b689
LC
1492
1493 {
1494 .name = "mce",
31ce5e0c
JD
1495 .args_type = "broadcast:-b,cpu_index:i,bank:i,status:l,mcg_status:l,addr:l,misc:l",
1496 .params = "[-b] cpu bank status mcgstatus addr misc",
1497 .help = "inject a MCE on the given CPU [and broadcast to other CPUs with -b option]",
af4ce882 1498 .mhandler.cmd = do_inject_mce,
d7f9b689
LC
1499 },
1500
79c4f6b0
HY
1501#endif
1502STEXI
1503@item mce @var{cpu} @var{bank} @var{status} @var{mcgstatus} @var{addr} @var{misc}
70fcbbe7 1504@findex mce (x86)
79c4f6b0 1505Inject an MCE on the given CPU (x86 only).
f07918fd
MM
1506ETEXI
1507
d7f9b689
LC
1508 {
1509 .name = "getfd",
1510 .args_type = "fdname:s",
d7f9b689
LC
1511 .params = "getfd name",
1512 .help = "receive a file descriptor via SCM rights and assign it a name",
208c9d1b 1513 .mhandler.cmd = hmp_getfd,
d7f9b689
LC
1514 },
1515
f07918fd
MM
1516STEXI
1517@item getfd @var{fdname}
70fcbbe7 1518@findex getfd
f07918fd
MM
1519If a file descriptor is passed alongside this command using the SCM_RIGHTS
1520mechanism on unix sockets, it is stored using the name @var{fdname} for
1521later use by other monitor commands.
1522ETEXI
1523
d7f9b689
LC
1524 {
1525 .name = "closefd",
1526 .args_type = "fdname:s",
d7f9b689
LC
1527 .params = "closefd name",
1528 .help = "close a file descriptor previously passed via SCM rights",
208c9d1b 1529 .mhandler.cmd = hmp_closefd,
d7f9b689
LC
1530 },
1531
f07918fd
MM
1532STEXI
1533@item closefd @var{fdname}
70fcbbe7 1534@findex closefd
f07918fd
MM
1535Close the file descriptor previously assigned to @var{fdname} using the
1536@code{getfd} command. This is only needed if the file descriptor was never
1537used by another monitor command.
a3a55a2e
LC
1538ETEXI
1539
1540 {
1541 .name = "block_passwd",
1542 .args_type = "device:B,password:s",
1543 .params = "block_passwd device password",
1544 .help = "set the password of encrypted block devices",
a4dea8a9 1545 .mhandler.cmd = hmp_block_passwd,
a3a55a2e
LC
1546 },
1547
727f005e
ZYW
1548STEXI
1549@item block_set_io_throttle @var{device} @var{bps} @var{bps_rd} @var{bps_wr} @var{iops} @var{iops_rd} @var{iops_wr}
1550@findex block_set_io_throttle
1551Change 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}
1552ETEXI
1553
1554 {
1555 .name = "block_set_io_throttle",
1556 .args_type = "device:B,bps:l,bps_rd:l,bps_wr:l,iops:l,iops_rd:l,iops_wr:l",
1557 .params = "device bps bps_rd bps_wr iops iops_rd iops_wr",
1558 .help = "change I/O throttle limits for a block drive",
80047da5 1559 .mhandler.cmd = hmp_block_set_io_throttle,
727f005e
ZYW
1560 },
1561
a3a55a2e
LC
1562STEXI
1563@item block_passwd @var{device} @var{password}
70fcbbe7 1564@findex block_passwd
a3a55a2e 1565Set the encrypted device @var{device} password to @var{password}
7572150c
GH
1566ETEXI
1567
1568 {
1569 .name = "set_password",
1570 .args_type = "protocol:s,password:s,connected:s?",
1571 .params = "protocol password action-if-connected",
1572 .help = "set spice/vnc password",
fbf796fd 1573 .mhandler.cmd = hmp_set_password,
7572150c
GH
1574 },
1575
1576STEXI
1577@item set_password [ vnc | spice ] password [ action-if-connected ]
1578@findex set_password
1579
1580Change spice/vnc password. Use zero to make the password stay valid
1581forever. @var{action-if-connected} specifies what should happen in
1582case a connection is established: @var{fail} makes the password change
1583fail. @var{disconnect} changes the password and disconnects the
1584client. @var{keep} changes the password and keeps the connection up.
1585@var{keep} is the default.
1586ETEXI
1587
1588 {
1589 .name = "expire_password",
1590 .args_type = "protocol:s,time:s",
1591 .params = "protocol time",
1592 .help = "set spice/vnc password expire-time",
9ad5372d 1593 .mhandler.cmd = hmp_expire_password,
7572150c
GH
1594 },
1595
1596STEXI
1597@item expire_password [ vnc | spice ] expire-time
1598@findex expire_password
1599
1600Specify when a password for spice/vnc becomes
1601invalid. @var{expire-time} accepts:
1602
1603@table @var
1604@item now
1605Invalidate password instantly.
1606
1607@item never
1608Password stays valid forever.
1609
1610@item +nsec
1611Password stays valid for @var{nsec} seconds starting now.
1612
1613@item nsec
1614Password is invalidated at the given time. @var{nsec} are the seconds
1615passed since 1970, i.e. unix epoch.
1616
1617@end table
f1088908
GH
1618ETEXI
1619
46920825
GH
1620 {
1621 .name = "chardev-add",
1622 .args_type = "args:s",
1623 .params = "args",
1624 .help = "add chardev",
1625 .mhandler.cmd = hmp_chardev_add,
1626 },
1627
1628STEXI
1629@item chardev_add args
1630@findex chardev_add
1631
1632chardev_add accepts the same parameters as the -chardev command line switch.
1633
1634ETEXI
1635
1636 {
1637 .name = "chardev-remove",
1638 .args_type = "id:s",
1639 .params = "id",
1640 .help = "remove chardev",
1641 .mhandler.cmd = hmp_chardev_remove,
1642 },
1643
1644STEXI
1645@item chardev_remove id
1646@findex chardev_remove
1647
1648Removes the chardev @var{id}.
1649
587da2c3
KW
1650ETEXI
1651
1652 {
1653 .name = "qemu-io",
1654 .args_type = "device:B,command:s",
1655 .params = "[device] \"[command]\"",
1656 .help = "run a qemu-io command on a block device",
1657 .mhandler.cmd = hmp_qemu_io,
1658 },
1659
1660STEXI
1661@item qemu-io @var{device} @var{command}
1662@findex qemu-io
1663
1664Executes a qemu-io command on the given block device.
1665
abf23329
JH
1666ETEXI
1667
1668 {
1669 .name = "cpu-add",
1670 .args_type = "id:i",
1671 .params = "id",
1672 .help = "add cpu",
1673 .mhandler.cmd = hmp_cpu_add,
1674 },
1675
1676STEXI
1677@item cpu-add @var{id}
1678Add CPU with id @var{id}
46920825 1679ETEXI
b40292e7 1680
33572ece
JK
1681 {
1682 .name = "info",
1683 .args_type = "item:s?",
1684 .params = "[subcommand]",
1685 .help = "show various information about the system state",
84c44613
WX
1686 .mhandler.cmd = do_info_help,
1687 .sub_table = info_cmds,
33572ece
JK
1688 },
1689
1690STEXI
1691@item info @var{subcommand}
1692@findex info
1693Show various information about the system state.
1694
1695@table @option
1696@item info version
1697show the version of QEMU
33572ece
JK
1698@item info network
1699show the various VLANs and the associated devices
1700@item info chardev
1701show the character devices
1702@item info block
1703show the block devices
1704@item info blockstats
1705show block device statistics
1706@item info registers
1707show the cpu registers
1708@item info cpus
1709show infos for each CPU
1710@item info history
1711show the command line history
1712@item info irq
1713show the interrupts statistics (if available)
1714@item info pic
1715show i8259 (PIC) state
1716@item info pci
1717show emulated PCI device info
1718@item info tlb
692f737c 1719show virtual to physical memory mappings (i386, SH4, SPARC, PPC, and Xtensa only)
33572ece
JK
1720@item info mem
1721show the active virtual memory mappings (i386 only)
33572ece
JK
1722@item info jit
1723show dynamic compiler info
33572ece
JK
1724@item info numa
1725show NUMA information
b40292e7
JK
1726@item info kvm
1727show KVM information
33572ece
JK
1728@item info usb
1729show USB devices plugged on the virtual USB hub
1730@item info usbhost
1731show all USB host devices
1732@item info profile
1733show profiling information
1734@item info capture
1735show information about active capturing
1736@item info snapshots
1737show list of VM snapshots
1738@item info status
1739show the current VM status (running|paused)
1740@item info pcmcia
1741show guest PCMCIA status
1742@item info mice
1743show which guest mouse is receiving events
1744@item info vnc
1745show the vnc server status
1746@item info name
1747show the current VM name
1748@item info uuid
1749show the current VM UUID
1750@item info cpustats
1751show CPU statistics
1752@item info usernet
1753show user network stack connection states
1754@item info migrate
1755show migration status
bbf6da32
OW
1756@item info migrate_capabilities
1757show current migration capabilities
9e1ba4cc
OW
1758@item info migrate_cache_size
1759show current migration XBZRLE cache size
33572ece
JK
1760@item info balloon
1761show balloon information
1762@item info qtree
1763show device tree
1764@item info qdm
1765show qdev device model list
1766@item info roms
1767show roms
d1a0cf73
SB
1768@item info tpm
1769show the TPM device
33572ece
JK
1770@end table
1771ETEXI
1772
31965ae2 1773STEXI
22890ab5
PS
1774@item info trace-events
1775show available trace events and their state
1776ETEXI
22890ab5 1777
2313086a
BS
1778STEXI
1779@end table
1780ETEXI