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