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