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