hmp-commands.hx 55.5 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11
HXCOMM Use DEFHEADING() to define headings in both help text and texi
HXCOMM Text between STEXI and ETEXI are copied to texi version and
HXCOMM discarded from C version
HXCOMM DEF(command, args, callback, arg_string, help) is used to construct
HXCOMM monitor commands
HXCOMM HXCOMM can be used for comments, discarded from both texi and C

STEXI
@table @option
ETEXI

12 13
    {
        .name       = "help|?",
14
        .args_type  = "name:S?",
15 16
        .params     = "[cmd]",
        .help       = "show the help",
17
        .cmd        = do_help_cmd,
18
        .flags      = "p",
19 20
    },

21 22
STEXI
@item help or ? [@var{cmd}]
23
@findex help
24 25 26
Show the help for all commands or just for command @var{cmd}.
ETEXI

27 28 29 30 31
    {
        .name       = "commit",
        .args_type  = "device:B",
        .params     = "device|all",
        .help       = "commit changes to the disk images (if -snapshot is used) or backing files",
32
        .cmd        = hmp_commit,
33 34
    },

35 36
STEXI
@item commit
37
@findex commit
38
Commit changes to the disk images (if -snapshot is used) or backing files.
39 40 41 42 43
If the backing file is smaller than the snapshot, then the backing file will be
resized to be the same size as the snapshot.  If the snapshot is smaller than
the backing file, the backing file will not be truncated.  If you want the
backing file to match the size of the smaller snapshot, you can safely truncate
it yourself once the commit operation successfully completes.
44 45
ETEXI

46 47 48 49 50
    {
        .name       = "q|quit",
        .args_type  = "",
        .params     = "",
        .help       = "quit the emulator",
51
        .cmd        = hmp_quit,
52 53
    },

54 55
STEXI
@item q or quit
56
@findex quit
57
Quit the emulator.
D
Dr. David Alan Gilbert 已提交
58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76
ETEXI

    {
        .name       = "exit_preconfig",
        .args_type  = "",
        .params     = "",
        .help       = "exit the preconfig state",
        .cmd        = hmp_exit_preconfig,
        .flags      = "p",
    },

STEXI
@item exit_preconfig
@findex exit_preconfig
This command makes QEMU exit the preconfig state and proceed with
VM initialization using configuration data provided on the command line
and via the QMP monitor during the preconfig state. The command is only
available during the preconfig state (i.e. when the --preconfig command
line option was in use).
77 78
ETEXI

79 80 81 82 83
    {
        .name       = "block_resize",
        .args_type  = "device:B,size:o",
        .params     = "device size",
        .help       = "resize a block image",
84
        .cmd        = hmp_block_resize,
85 86 87 88 89 90 91 92 93 94 95
    },

STEXI
@item block_resize
@findex block_resize
Resize a block image while a guest is running.  Usually requires guest
action to see the updated size.  Resize to a lower size is supported,
but should be used with extreme caution.  Note that this command only
resizes image files, it can not resize block devices like LVM volumes.
ETEXI

S
Stefan Hajnoczi 已提交
96 97
    {
        .name       = "block_stream",
98 99
        .args_type  = "device:B,speed:o?,base:s?",
        .params     = "device [speed [base]]",
S
Stefan Hajnoczi 已提交
100
        .help       = "copy data from a backing file into a block device",
101
        .cmd        = hmp_block_stream,
S
Stefan Hajnoczi 已提交
102 103 104 105 106 107
    },

STEXI
@item block_stream
@findex block_stream
Copy data from a backing file into a block device.
108 109 110 111
ETEXI

    {
        .name       = "block_job_set_speed",
112 113
        .args_type  = "device:B,speed:o",
        .params     = "device speed",
114
        .help       = "set maximum speed for a background block operation",
115
        .cmd        = hmp_block_job_set_speed,
116 117 118
    },

STEXI
119 120
@item block_job_set_speed
@findex block_job_set_speed
121
Set maximum speed for a background block operation.
122 123 124 125
ETEXI

    {
        .name       = "block_job_cancel",
126 127 128
        .args_type  = "force:-f,device:B",
        .params     = "[-f] device",
        .help       = "stop an active background block operation (use -f"
129 130
                      "\n\t\t\t if you want to abort the operation immediately"
                      "\n\t\t\t instead of keep running until data is in sync)",
131
        .cmd        = hmp_block_job_cancel,
132 133 134 135 136
    },

STEXI
@item block_job_cancel
@findex block_job_cancel
P
Paolo Bonzini 已提交
137 138 139 140 141 142 143 144
Stop an active background block operation (streaming, mirroring).
ETEXI

    {
        .name       = "block_job_complete",
        .args_type  = "device:B",
        .params     = "device",
        .help       = "stop an active background block operation",
145
        .cmd        = hmp_block_job_complete,
P
Paolo Bonzini 已提交
146 147 148 149 150 151 152
    },

STEXI
@item block_job_complete
@findex block_job_complete
Manually trigger completion of an active background block operation.
For mirroring, this will switch the device to the destination path.
153 154 155 156 157 158 159
ETEXI

    {
        .name       = "block_job_pause",
        .args_type  = "device:B",
        .params     = "device",
        .help       = "pause an active background block operation",
160
        .cmd        = hmp_block_job_pause,
161 162 163 164 165 166 167 168 169 170 171 172 173
    },

STEXI
@item block_job_pause
@findex block_job_pause
Pause an active block streaming operation.
ETEXI

    {
        .name       = "block_job_resume",
        .args_type  = "device:B",
        .params     = "device",
        .help       = "resume a paused background block operation",
174
        .cmd        = hmp_block_job_resume,
175 176 177 178 179 180
    },

STEXI
@item block_job_resume
@findex block_job_resume
Resume a paused block streaming operation.
S
Stefan Hajnoczi 已提交
181
ETEXI
182

183 184
    {
        .name       = "eject",
L
Luiz Capitulino 已提交
185
        .args_type  = "force:-f,device:B",
186 187
        .params     = "[-f] device",
        .help       = "eject a removable medium (use -f to force it)",
188
        .cmd        = hmp_eject,
189 190
    },

191 192
STEXI
@item eject [-f] @var{device}
193
@findex eject
194
Eject a removable medium (use -f to force it).
195 196 197 198
ETEXI

    {
        .name       = "drive_del",
199
        .args_type  = "id:B",
200 201
        .params     = "device",
        .help       = "remove host block device",
202
        .cmd        = hmp_drive_del,
203 204 205 206 207 208 209 210 211
    },

STEXI
@item drive_del @var{device}
@findex drive_del
Remove host block device.  The result is that guest generated IO is no longer
submitted against the host device underlying the disk.  Once a drive has
been deleted, the QEMU Block layer returns -EIO which results in IO
errors in the guest for applications that are reading/writing to the device.
212 213
These errors are always reported to the guest, regardless of the drive's error
actions (drive options rerror, werror).
214 215
ETEXI

216 217
    {
        .name       = "change",
218 219
        .args_type  = "device:B,target:F,arg:s?,read-only-mode:s?",
        .params     = "device filename [format [read-only-mode]]",
220
        .help       = "change a removable medium, optional format",
221
        .cmd        = hmp_change,
222 223
    },

224 225
STEXI
@item change @var{device} @var{setting}
226
@findex change
227 228 229
Change the configuration of a device.

@table @option
230
@item change @var{diskdevice} @var{filename} [@var{format} [@var{read-only-mode}]]
231 232 233 234 235 236 237 238
Change the medium for a removable disk device to point to @var{filename}. eg

@example
(qemu) change ide1-cd0 /path/to/some.iso
@end example

@var{format} is optional.

239 240 241 242 243 244 245 246 247 248 249 250 251 252
@var{read-only-mode} may be used to change the read-only status of the device.
It accepts the following values:

@table @var
@item retain
Retains the current status; this is the default.

@item read-only
Makes the device read-only.

@item read-write
Makes the device writable.
@end table

253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274
@item change vnc @var{display},@var{options}
Change the configuration of the VNC server. The valid syntax for @var{display}
and @var{options} are described at @ref{sec_invocation}. eg

@example
(qemu) change vnc localhost:1
@end example

@item change vnc password [@var{password}]

Change the password associated with the VNC server. If the new password is not
supplied, the monitor will prompt for it to be entered. VNC passwords are only
significant up to 8 letters. eg

@example
(qemu) change vnc password
Password: ********
@end example

@end table
ETEXI

275 276
    {
        .name       = "screendump",
277 278 279 280
        .args_type  = "filename:F,device:s?,head:i?",
        .params     = "filename [device [head]]",
        .help       = "save screen from head 'head' of display device 'device' "
                      "into PPM image 'filename'",
281
        .cmd        = hmp_screendump,
282 283
    },

284 285
STEXI
@item screendump @var{filename}
286
@findex screendump
287 288 289
Save screen into PPM image @var{filename}.
ETEXI

290 291 292 293 294
    {
        .name       = "logfile",
        .args_type  = "filename:F",
        .params     = "filename",
        .help       = "output logs to 'filename'",
295
        .cmd        = hmp_logfile,
296 297
    },

298 299
STEXI
@item logfile @var{filename}
300
@findex logfile
301 302 303
Output logs to @var{filename}.
ETEXI

304 305
    {
        .name       = "trace-event",
306 307 308 309
        .args_type  = "name:s,option:b,vcpu:i?",
        .params     = "name on|off [vcpu]",
        .help       = "changes status of a specific trace event "
                      "(vcpu: vCPU to set, default is all)",
310
        .cmd = hmp_trace_event,
311
        .command_completion = trace_event_completion,
312 313 314 315 316 317
    },

STEXI
@item trace-event
@findex trace-event
changes status of a trace event
318 319
ETEXI

M
Michael Roth 已提交
320
#if defined(CONFIG_TRACE_SIMPLE)
321 322 323 324 325
    {
        .name       = "trace-file",
        .args_type  = "op:s?,arg:F?",
        .params     = "on|off|flush|set [arg]",
        .help       = "open, close, or flush trace file, or set a new file name",
326
        .cmd        = hmp_trace_file,
327 328 329 330 331 332
    },

STEXI
@item trace-file on|off|flush
@findex trace-file
Open, close, or flush the trace file.  If no argument is given, the status of the trace file is displayed.
333 334 335
ETEXI
#endif

336 337 338 339
    {
        .name       = "log",
        .args_type  = "items:s",
        .params     = "item1[,...]",
340
        .help       = "activate logging of the specified items",
341
        .cmd        = hmp_log,
342 343
    },

344 345
STEXI
@item log @var{item1}[,...]
346
@findex log
347
Activate logging of the specified items.
348 349
ETEXI

350 351 352
    {
        .name       = "savevm",
        .args_type  = "name:s?",
353 354
        .params     = "tag",
        .help       = "save a VM snapshot. If no tag is provided, a new snapshot is created",
355
        .cmd        = hmp_savevm,
356 357
    },

358
STEXI
359
@item savevm @var{tag}
360
@findex savevm
361 362
Create a snapshot of the whole virtual machine. If @var{tag} is
provided, it is used as human readable identifier. If there is already
363
a snapshot with the same tag, it is replaced. More info at
364
@ref{vm_snapshots}.
365 366 367

Since 4.0, savevm stopped allowing the snapshot id to be set, accepting
only @var{tag} as parameter.
368 369
ETEXI

370 371 372
    {
        .name       = "loadvm",
        .args_type  = "name:s",
373 374
        .params     = "tag",
        .help       = "restore a VM snapshot from its tag",
375
        .cmd        = hmp_loadvm,
376
        .command_completion = loadvm_completion,
377 378
    },

379
STEXI
380
@item loadvm @var{tag}
381
@findex loadvm
382
Set the whole virtual machine to the snapshot identified by the tag
383 384 385
@var{tag}.

Since 4.0, loadvm stopped accepting snapshot id as parameter.
386 387
ETEXI

388 389 390
    {
        .name       = "delvm",
        .args_type  = "name:s",
391 392
        .params     = "tag",
        .help       = "delete a VM snapshot from its tag",
393
        .cmd        = hmp_delvm,
394
        .command_completion = delvm_completion,
395 396
    },

397
STEXI
398
@item delvm @var{tag}
399
@findex delvm
400 401 402 403
Delete the snapshot identified by @var{tag}.

Since 4.0, delvm stopped deleting snapshots by snapshot id, accepting
only @var{tag} as parameter.
404 405
ETEXI

406 407 408 409 410
    {
        .name       = "singlestep",
        .args_type  = "option:s?",
        .params     = "[on|off]",
        .help       = "run emulation in singlestep mode or switch to normal mode",
411
        .cmd        = hmp_singlestep,
412 413
    },

414 415
STEXI
@item singlestep [off]
416
@findex singlestep
417 418 419 420
Run the emulation in single step mode.
If called with option off, the emulation returns to normal mode.
ETEXI

421 422 423 424 425
    {
        .name       = "stop",
        .args_type  = "",
        .params     = "",
        .help       = "stop emulation",
426
        .cmd        = hmp_stop,
427 428
    },

429 430
STEXI
@item stop
431
@findex stop
432 433 434
Stop emulation.
ETEXI

435 436 437 438 439
    {
        .name       = "c|cont",
        .args_type  = "",
        .params     = "",
        .help       = "resume emulation",
440
        .cmd        = hmp_cont,
441 442
    },

443 444
STEXI
@item c or cont
445
@findex cont
446
Resume emulation.
447 448 449 450 451 452 453
ETEXI

    {
        .name       = "system_wakeup",
        .args_type  = "",
        .params     = "",
        .help       = "wakeup guest from suspend",
454
        .cmd        = hmp_system_wakeup,
455 456 457 458 459 460
    },

STEXI
@item system_wakeup
@findex system_wakeup
Wakeup guest from suspend.
461 462
ETEXI

463 464 465 466 467
    {
        .name       = "gdbserver",
        .args_type  = "device:s?",
        .params     = "[device]",
        .help       = "start gdbserver on given device (default 'tcp::1234'), stop with 'none'",
468
        .cmd        = hmp_gdbserver,
469 470
    },

471 472
STEXI
@item gdbserver [@var{port}]
473
@findex gdbserver
474 475 476
Start gdbserver session (default @var{port}=1234)
ETEXI

477 478 479 480 481
    {
        .name       = "x",
        .args_type  = "fmt:/,addr:l",
        .params     = "/fmt addr",
        .help       = "virtual memory dump starting at 'addr'",
482
        .cmd        = hmp_memory_dump,
483 484
    },

485 486
STEXI
@item x/fmt @var{addr}
487
@findex x
488 489 490
Virtual memory dump starting at @var{addr}.
ETEXI

491 492 493 494 495
    {
        .name       = "xp",
        .args_type  = "fmt:/,addr:l",
        .params     = "/fmt addr",
        .help       = "physical memory dump starting at 'addr'",
496
        .cmd        = hmp_physical_memory_dump,
497 498
    },

499 500
STEXI
@item xp /@var{fmt} @var{addr}
501
@findex xp
502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555
Physical memory dump starting at @var{addr}.

@var{fmt} is a format which tells the command how to format the
data. Its syntax is: @option{/@{count@}@{format@}@{size@}}

@table @var
@item count
is the number of items to be dumped.

@item format
can be x (hex), d (signed decimal), u (unsigned decimal), o (octal),
c (char) or i (asm instruction).

@item size
can be b (8 bits), h (16 bits), w (32 bits) or g (64 bits). On x86,
@code{h} or @code{w} can be specified with the @code{i} format to
respectively select 16 or 32 bit code instruction size.

@end table

Examples:
@itemize
@item
Dump 10 instructions at the current instruction pointer:
@example
(qemu) x/10i $eip
0x90107063:  ret
0x90107064:  sti
0x90107065:  lea    0x0(%esi,1),%esi
0x90107069:  lea    0x0(%edi,1),%edi
0x90107070:  ret
0x90107071:  jmp    0x90107080
0x90107073:  nop
0x90107074:  nop
0x90107075:  nop
0x90107076:  nop
@end example

@item
Dump 80 16 bit values at the start of the video memory.
@smallexample
(qemu) xp/80hx 0xb8000
0x000b8000: 0x0b50 0x0b6c 0x0b65 0x0b78 0x0b38 0x0b36 0x0b2f 0x0b42
0x000b8010: 0x0b6f 0x0b63 0x0b68 0x0b73 0x0b20 0x0b56 0x0b47 0x0b41
0x000b8020: 0x0b42 0x0b69 0x0b6f 0x0b73 0x0b20 0x0b63 0x0b75 0x0b72
0x000b8030: 0x0b72 0x0b65 0x0b6e 0x0b74 0x0b2d 0x0b63 0x0b76 0x0b73
0x000b8040: 0x0b20 0x0b30 0x0b35 0x0b20 0x0b4e 0x0b6f 0x0b76 0x0b20
0x000b8050: 0x0b32 0x0b30 0x0b30 0x0b33 0x0720 0x0720 0x0720 0x0720
0x000b8060: 0x0720 0x0720 0x0720 0x0720 0x0720 0x0720 0x0720 0x0720
0x000b8070: 0x0720 0x0720 0x0720 0x0720 0x0720 0x0720 0x0720 0x0720
0x000b8080: 0x0720 0x0720 0x0720 0x0720 0x0720 0x0720 0x0720 0x0720
0x000b8090: 0x0720 0x0720 0x0720 0x0720 0x0720 0x0720 0x0720 0x0720
@end smallexample
@end itemize
556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587
ETEXI

    {
        .name       = "gpa2hva",
        .args_type  = "addr:l",
        .params     = "addr",
        .help       = "print the host virtual address corresponding to a guest physical address",
        .cmd        = hmp_gpa2hva,
    },

STEXI
@item gpa2hva @var{addr}
@findex gpa2hva
Print the host virtual address at which the guest's physical address @var{addr}
is mapped.
ETEXI

#ifdef CONFIG_LINUX
    {
        .name       = "gpa2hpa",
        .args_type  = "addr:l",
        .params     = "addr",
        .help       = "print the host physical address corresponding to a guest physical address",
        .cmd        = hmp_gpa2hpa,
    },
#endif

STEXI
@item gpa2hpa @var{addr}
@findex gpa2hpa
Print the host physical address at which the guest's physical address @var{addr}
is mapped.
588 589 590 591 592 593 594 595 596 597 598 599 600 601 602
ETEXI

    {
        .name       = "gva2gpa",
        .args_type  = "addr:l",
        .params     = "addr",
        .help       = "print the guest physical address corresponding to a guest virtual address",
        .cmd        = hmp_gva2gpa,
    },

STEXI
@item gva2gpa @var{addr}
@findex gva2gpa
Print the guest physical address at which the guest's virtual address @var{addr}
is mapped based on the mapping for the current CPU.
603 604
ETEXI

605 606 607 608 609
    {
        .name       = "p|print",
        .args_type  = "fmt:/,val:l",
        .params     = "/fmt expr",
        .help       = "print expression value (use $reg for CPU register access)",
610
        .cmd        = do_print,
611 612
    },

613 614
STEXI
@item p or print/@var{fmt} @var{expr}
615
@findex print
616 617 618 619
Print expression value. Only the @var{format} part of @var{fmt} is
used.
ETEXI

620 621 622 623 624
    {
        .name       = "i",
        .args_type  = "fmt:/,addr:i,index:i.",
        .params     = "/fmt addr",
        .help       = "I/O port read",
625
        .cmd        = hmp_ioport_read,
626 627
    },

628
STEXI
629 630
@item i/@var{fmt} @var{addr} [.@var{index}]
@findex i
631 632 633
Read I/O port.
ETEXI

634 635 636 637 638
    {
        .name       = "o",
        .args_type  = "fmt:/,addr:i,val:i",
        .params     = "/fmt addr value",
        .help       = "I/O port write",
639
        .cmd        = hmp_ioport_write,
640 641
    },

J
Jan Kiszka 已提交
642
STEXI
643 644
@item o/@var{fmt} @var{addr} @var{val}
@findex o
J
Jan Kiszka 已提交
645 646
Write to I/O port.
ETEXI
647

648 649
    {
        .name       = "sendkey",
A
Amos Kong 已提交
650
        .args_type  = "keys:s,hold-time:i?",
651 652
        .params     = "keys [hold_ms]",
        .help       = "send keys to the VM (e.g. 'sendkey ctrl-alt-f1', default hold time=100 ms)",
653
        .cmd        = hmp_sendkey,
654
        .command_completion = sendkey_completion,
655 656
    },

657 658
STEXI
@item sendkey @var{keys}
659
@findex sendkey
660 661 662
Send @var{keys} to the guest. @var{keys} could be the name of the
key or the raw value in hexadecimal format. Use @code{-} to press
several keys simultaneously. Example:
663 664 665 666 667 668
@example
sendkey ctrl-alt-f1
@end example

This command is useful to send keys that your graphical user interface
intercepts at low level, such as @code{ctrl-alt-f1} in X Window.
E
Emilio G. Cota 已提交
669 670 671 672 673 674 675 676 677 678 679 680 681 682 683
ETEXI
    {
        .name       = "sync-profile",
        .args_type  = "op:s?",
        .params     = "[on|off|reset]",
        .help       = "enable, disable or reset synchronization profiling. "
                      "With no arguments, prints whether profiling is on or off.",
        .cmd        = hmp_sync_profile,
    },

STEXI
@item sync-profile [on|off|reset]
@findex sync-profile
Enable, disable or reset synchronization profiling. With no arguments, prints
whether profiling is on or off.
684 685
ETEXI

686 687 688 689 690
    {
        .name       = "system_reset",
        .args_type  = "",
        .params     = "",
        .help       = "reset the system",
691
        .cmd        = hmp_system_reset,
692 693
    },

694 695
STEXI
@item system_reset
696
@findex system_reset
697 698 699
Reset the system.
ETEXI

700 701 702 703 704
    {
        .name       = "system_powerdown",
        .args_type  = "",
        .params     = "",
        .help       = "send system power down event",
705
        .cmd        = hmp_system_powerdown,
706 707
    },

708 709
STEXI
@item system_powerdown
710
@findex system_powerdown
711 712 713
Power down the system (if supported).
ETEXI

714 715 716 717 718
    {
        .name       = "sum",
        .args_type  = "start:i,size:i",
        .params     = "addr size",
        .help       = "compute the checksum of a memory region",
719
        .cmd        = hmp_sum,
720 721
    },

722 723
STEXI
@item sum @var{addr} @var{size}
724
@findex sum
725 726 727
Compute the checksum of a memory region.
ETEXI

728 729
    {
        .name       = "device_add",
730 731
        .args_type  = "device:O",
        .params     = "driver[,prop=value][,...]",
732
        .help       = "add device, like -device on the command line",
733
        .cmd        = hmp_device_add,
734
        .command_completion = device_add_completion,
735 736
    },

737 738
STEXI
@item device_add @var{config}
739
@findex device_add
740 741 742
Add device.
ETEXI

743 744 745 746 747
    {
        .name       = "device_del",
        .args_type  = "id:s",
        .params     = "device",
        .help       = "remove device",
748
        .cmd        = hmp_device_del,
749
        .command_completion = device_del_completion,
750 751
    },

752 753
STEXI
@item device_del @var{id}
754
@findex device_del
755 756
Remove device @var{id}. @var{id} may be a short ID
or a QOM object path.
757 758
ETEXI

759 760 761 762 763
    {
        .name       = "cpu",
        .args_type  = "index:i",
        .params     = "index",
        .help       = "set the default CPU",
764
        .cmd        = hmp_cpu,
765
    },
766

767
STEXI
768 769
@item cpu @var{index}
@findex cpu
770 771 772
Set the default CPU.
ETEXI

773 774 775 776 777
    {
        .name       = "mouse_move",
        .args_type  = "dx_str:s,dy_str:s,dz_str:s?",
        .params     = "dx dy [dz]",
        .help       = "send mouse move events",
778
        .cmd        = hmp_mouse_move,
779 780
    },

781 782
STEXI
@item mouse_move @var{dx} @var{dy} [@var{dz}]
783
@findex mouse_move
784 785 786 787
Move the active mouse to the specified coordinates @var{dx} @var{dy}
with optional scroll axis @var{dz}.
ETEXI

788 789 790 791 792
    {
        .name       = "mouse_button",
        .args_type  = "button_state:i",
        .params     = "state",
        .help       = "change mouse button state (1=L, 2=M, 4=R)",
793
        .cmd        = hmp_mouse_button,
794 795
    },

796 797
STEXI
@item mouse_button @var{val}
798
@findex mouse_button
799 800 801
Change the active mouse button state @var{val} (1=L, 2=M, 4=R).
ETEXI

802 803 804 805 806
    {
        .name       = "mouse_set",
        .args_type  = "index:i",
        .params     = "index",
        .help       = "set which mouse device receives events",
807
        .cmd        = hmp_mouse_set,
808 809
    },

810 811
STEXI
@item mouse_set @var{index}
812
@findex mouse_set
813 814 815 816 817 818 819
Set which mouse device receives events at given @var{index}, index
can be obtained with
@example
info mice
@end example
ETEXI

820 821 822 823 824
    {
        .name       = "wavcapture",
        .args_type  = "path:F,freq:i?,bits:i?,nchannels:i?",
        .params     = "path [frequency [bits [channels]]]",
        .help       = "capture audio to a wave file (default frequency=44100 bits=16 channels=2)",
825
        .cmd        = hmp_wavcapture,
826
    },
827 828
STEXI
@item wavcapture @var{filename} [@var{frequency} [@var{bits} [@var{channels}]]]
829
@findex wavcapture
830 831 832 833 834 835 836 837 838 839 840
Capture audio into @var{filename}. Using sample rate @var{frequency}
bits per sample @var{bits} and number of channels @var{channels}.

Defaults:
@itemize @minus
@item Sample rate = 44100 Hz - CD quality
@item Bits = 16
@item Number of channels = 2 - Stereo
@end itemize
ETEXI

841 842 843 844 845
    {
        .name       = "stopcapture",
        .args_type  = "n:i",
        .params     = "capture index",
        .help       = "stop capture",
846
        .cmd        = hmp_stopcapture,
847
    },
848 849
STEXI
@item stopcapture @var{index}
850
@findex stopcapture
851 852 853 854 855 856
Stop capture with a given @var{index}, index can be obtained with
@example
info capture
@end example
ETEXI

857 858 859 860 861
    {
        .name       = "memsave",
        .args_type  = "val:l,size:i,filename:s",
        .params     = "addr size file",
        .help       = "save to disk virtual memory dump starting at 'addr' of size 'size'",
862
        .cmd        = hmp_memsave,
863 864
    },

865 866
STEXI
@item memsave @var{addr} @var{size} @var{file}
867
@findex memsave
868 869 870
save to disk virtual memory dump starting at @var{addr} of size @var{size}.
ETEXI

871 872 873 874 875
    {
        .name       = "pmemsave",
        .args_type  = "val:l,size:i,filename:s",
        .params     = "addr size file",
        .help       = "save to disk physical memory dump starting at 'addr' of size 'size'",
876
        .cmd        = hmp_pmemsave,
877 878
    },

879 880
STEXI
@item pmemsave @var{addr} @var{size} @var{file}
881
@findex pmemsave
882 883 884
save to disk physical memory dump starting at @var{addr} of size @var{size}.
ETEXI

885 886 887 888 889
    {
        .name       = "boot_set",
        .args_type  = "bootdevice:s",
        .params     = "bootdevice",
        .help       = "define new values for the boot device list",
890
        .cmd        = hmp_boot_set,
891 892
    },

893 894
STEXI
@item boot_set @var{bootdevicelist}
895
@findex boot_set
896 897 898 899 900 901 902
Define new values for the boot device list. Those values will override
the values specified on the command line through the @code{-boot} option.

The values that can be specified here depend on the machine type, but are
the same that can be specified in the @code{-boot} command line option.
ETEXI

903 904
    {
        .name       = "nmi",
905 906
        .args_type  = "",
        .params     = "",
907
        .help       = "inject an NMI",
908
        .cmd        = hmp_nmi,
909
    },
910 911
STEXI
@item nmi @var{cpu}
912
@findex nmi
913
Inject an NMI on the default CPU (x86/s390) or all CPUs (ppc64).
914 915 916 917

ETEXI

    {
918
        .name       = "ringbuf_write",
919 920
        .args_type  = "device:s,data:s",
        .params     = "device data",
921
        .help       = "Write to a ring buffer character device",
922
        .cmd        = hmp_ringbuf_write,
923
        .command_completion = ringbuf_write_completion,
924 925 926
    },

STEXI
927 928 929 930
@item ringbuf_write @var{device} @var{data}
@findex ringbuf_write
Write @var{data} to ring buffer character device @var{device}.
@var{data} must be a UTF-8 string.
931

932 933 934
ETEXI

    {
935
        .name       = "ringbuf_read",
936 937
        .args_type  = "device:s,size:i",
        .params     = "device size",
938
        .help       = "Read from a ring buffer character device",
939
        .cmd        = hmp_ringbuf_read,
940
        .command_completion = ringbuf_write_completion,
941 942 943
    },

STEXI
944 945 946 947
@item ringbuf_read @var{device}
@findex ringbuf_read
Read and print up to @var{size} bytes from ring buffer character
device @var{device}.
948 949
Certain non-printable characters are printed \uXXXX, where XXXX is the
character code in hexadecimal.  Character \ is printed \\.
950 951 952
Bug: can screw up when the buffer contains invalid UTF-8 sequences,
NUL characters, after the ring buffer lost data, and when reading
stops because the size limit is reached.
953

954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969
ETEXI

    {
        .name       = "announce_self",
        .args_type  = "",
        .params     = "",
        .help       = "Trigger GARP/RARP announcements",
        .cmd        = hmp_announce_self,
    },

STEXI
@item announce_self
@findex announce_self
Trigger a round of GARP/RARP broadcasts; this is useful for explicitly updating the
network infrastructure after a reconfiguration or some forms of migration.
The timings of the round are set by the migration announce parameters.
970 971
ETEXI

972 973
    {
        .name       = "migrate",
P
Peter Xu 已提交
974 975
        .args_type  = "detach:-d,blk:-b,inc:-i,resume:-r,uri:s",
        .params     = "[-d] [-b] [-i] [-r] uri",
976 977 978 979
        .help       = "migrate to URI (using -d to not wait for completion)"
		      "\n\t\t\t -b for migration without shared storage with"
		      " full copy of disk\n\t\t\t -i for migration without "
		      "shared storage with incremental copy of disk "
P
Peter Xu 已提交
980 981
		      "(base image shared between src and destination)"
                      "\n\t\t\t -r to resume a paused migration",
982
        .cmd        = hmp_migrate,
983 984
    },

985

986
STEXI
987
@item migrate [-d] [-b] [-i] @var{uri}
988
@findex migrate
989
Migrate to @var{uri} (using -d to not wait for completion).
990 991
	-b for migration with full copy of disk
	-i for migration with incremental copy of disk (base image is shared)
992 993
ETEXI

994 995 996 997 998
    {
        .name       = "migrate_cancel",
        .args_type  = "",
        .params     = "",
        .help       = "cancel the current VM migration",
999
        .cmd        = hmp_migrate_cancel,
1000 1001
    },

1002 1003
STEXI
@item migrate_cancel
1004
@findex migrate_cancel
1005
Cancel the current VM migration.
1006
ETEXI
1007

1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018
    {
        .name       = "migrate_continue",
        .args_type  = "state:s",
        .params     = "state",
        .help       = "Continue migration from the given paused state",
        .cmd        = hmp_migrate_continue,
    },
STEXI
@item migrate_continue @var{state}
@findex migrate_continue
Continue migration from the paused state @var{state}
D
Dr. David Alan Gilbert 已提交
1019 1020 1021 1022 1023 1024 1025
ETEXI

    {
        .name       = "migrate_incoming",
        .args_type  = "uri:s",
        .params     = "uri",
        .help       = "Continue an incoming migration from an -incoming defer",
1026
        .cmd        = hmp_migrate_incoming,
D
Dr. David Alan Gilbert 已提交
1027 1028 1029 1030 1031 1032 1033
    },

STEXI
@item migrate_incoming @var{uri}
@findex migrate_incoming
Continue an incoming migration using the @var{uri} (that has the same syntax
as the -incoming option).
1034
ETEXI
D
Dr. David Alan Gilbert 已提交
1035

1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047
    {
        .name       = "migrate_recover",
        .args_type  = "uri:s",
        .params     = "uri",
        .help       = "Continue a paused incoming postcopy migration",
        .cmd        = hmp_migrate_recover,
    },

STEXI
@item migrate_recover @var{uri}
@findex migrate_recover
Continue a paused incoming postcopy migration using the @var{uri}.
1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061
ETEXI

    {
        .name       = "migrate_pause",
        .args_type  = "",
        .params     = "",
        .help       = "Pause an ongoing migration (postcopy-only)",
        .cmd        = hmp_migrate_pause,
    },

STEXI
@item migrate_pause
@findex migrate_pause
Pause an ongoing migration.  Currently it only supports postcopy.
1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073
ETEXI

    {
        .name       = "migrate_set_cache_size",
        .args_type  = "value:o",
        .params     = "value",
        .help       = "set cache size (in bytes) for XBZRLE migrations,"
                      "the cache size will be rounded down to the nearest "
                      "power of 2.\n"
                      "The cache size affects the number of cache misses."
                      "In case of a high cache miss ratio you need to increase"
                      " the cache size",
1074
        .cmd        = hmp_migrate_set_cache_size,
1075 1076 1077 1078 1079 1080
    },

STEXI
@item migrate_set_cache_size @var{value}
@findex migrate_set_cache_size
Set cache size to @var{value} (in bytes) for xbzrle migrations.
1081 1082
ETEXI

1083 1084
    {
        .name       = "migrate_set_speed",
1085
        .args_type  = "value:o",
1086
        .params     = "value",
1087 1088
        .help       = "set maximum speed (in bytes) for migrations. "
	"Defaults to MB if no size suffix is specified, ie. B/K/M/G/T",
1089
        .cmd        = hmp_migrate_set_speed,
1090 1091
    },

1092 1093
STEXI
@item migrate_set_speed @var{value}
1094
@findex migrate_set_speed
1095
Set maximum speed to @var{value} (in bytes) for migrations.
G
Glauber Costa 已提交
1096 1097
ETEXI

1098 1099
    {
        .name       = "migrate_set_downtime",
1100
        .args_type  = "value:T",
1101 1102
        .params     = "value",
        .help       = "set maximum tolerated downtime (in seconds) for migrations",
1103
        .cmd        = hmp_migrate_set_downtime,
1104
    },
G
Glauber Costa 已提交
1105 1106 1107

STEXI
@item migrate_set_downtime @var{second}
1108
@findex migrate_set_downtime
G
Glauber Costa 已提交
1109
Set maximum tolerated downtime (in seconds) for migration.
O
Orit Wasserman 已提交
1110 1111 1112 1113 1114 1115 1116
ETEXI

    {
        .name       = "migrate_set_capability",
        .args_type  = "capability:s,state:b",
        .params     = "capability state",
        .help       = "Enable/Disable the usage of a capability for migration",
1117
        .cmd        = hmp_migrate_set_capability,
1118
        .command_completion = migrate_set_capability_completion,
O
Orit Wasserman 已提交
1119 1120 1121 1122 1123 1124
    },

STEXI
@item migrate_set_capability @var{capability} @var{state}
@findex migrate_set_capability
Enable/Disable the usage of a capability @var{capability} for migration.
1125 1126 1127 1128
ETEXI

    {
        .name       = "migrate_set_parameter",
1129
        .args_type  = "parameter:s,value:s",
1130 1131
        .params     = "parameter value",
        .help       = "Set the parameter for migration",
1132
        .cmd        = hmp_migrate_set_parameter,
1133 1134 1135 1136 1137 1138 1139
        .command_completion = migrate_set_parameter_completion,
    },

STEXI
@item migrate_set_parameter @var{parameter} @var{value}
@findex migrate_set_parameter
Set the parameter @var{parameter} for migration.
1140 1141 1142 1143 1144 1145
ETEXI

    {
        .name       = "migrate_start_postcopy",
        .args_type  = "",
        .params     = "",
1146
        .help       = "Followup to a migration command to switch the migration"
D
Dr. David Alan Gilbert 已提交
1147
                      " to postcopy mode. The postcopy-ram capability must "
1148 1149
                      "be set on both source and destination before the "
                      "original migration command .",
1150
        .cmd        = hmp_migrate_start_postcopy,
1151 1152 1153 1154 1155 1156 1157
    },

STEXI
@item migrate_start_postcopy
@findex migrate_start_postcopy
Switch in-progress migration to postcopy mode. Ignored after the end of
migration (or once already in postcopy).
1158 1159 1160 1161 1162 1163 1164 1165 1166 1167 1168 1169 1170 1171 1172
ETEXI

    {
        .name       = "x_colo_lost_heartbeat",
        .args_type  = "",
        .params     = "",
        .help       = "Tell COLO that heartbeat is lost,\n\t\t\t"
                      "a failover or takeover is needed.",
        .cmd = hmp_x_colo_lost_heartbeat,
    },

STEXI
@item x_colo_lost_heartbeat
@findex x_colo_lost_heartbeat
Tell COLO that heartbeat is lost, a failover or takeover is needed.
1173 1174 1175
ETEXI

    {
1176 1177 1178
        .name       = "client_migrate_info",
        .args_type  = "protocol:s,hostname:s,port:i?,tls-port:i?,cert-subject:s?",
        .params     = "protocol hostname port tls-port cert-subject",
1179
        .help       = "set migration information for remote display",
1180
        .cmd        = hmp_client_migrate_info,
1181 1182
    },

G
Gerd Hoffmann 已提交
1183 1184 1185
STEXI
@item client_migrate_info @var{protocol} @var{hostname} @var{port} @var{tls-port} @var{cert-subject}
@findex client_migrate_info
1186 1187 1188
Set migration information for remote display.  This makes the server
ask the client to automatically reconnect using the new parameters
once migration finished successfully.  Only implemented for SPICE.
G
Gerd Hoffmann 已提交
1189 1190
ETEXI

1191 1192
    {
        .name       = "dump-guest-memory",
1193 1194
        .args_type  = "paging:-p,detach:-d,windmp:-w,zlib:-z,lzo:-l,snappy:-s,filename:F,begin:l?,length:l?",
        .params     = "[-p] [-d] [-z|-l|-s|-w] filename [begin length]",
Q
Qiao Nuohan 已提交
1195 1196
        .help       = "dump guest memory into file 'filename'.\n\t\t\t"
                      "-p: do paging to get guest's memory mapping.\n\t\t\t"
1197
                      "-d: return immediately (do not wait for completion).\n\t\t\t"
1198 1199 1200
                      "-z: dump in kdump-compressed format, with zlib compression.\n\t\t\t"
                      "-l: dump in kdump-compressed format, with lzo compression.\n\t\t\t"
                      "-s: dump in kdump-compressed format, with snappy compression.\n\t\t\t"
1201 1202
                      "-w: dump in Windows crashdump format (can be used instead of ELF-dump converting),\n\t\t\t"
                      "    for Windows x64 guests with vmcoreinfo driver only.\n\t\t\t"
Q
Qiao Nuohan 已提交
1203 1204
                      "begin: the starting physical address.\n\t\t\t"
                      "length: the memory size, in bytes.",
1205
        .cmd        = hmp_dump_guest_memory,
1206 1207 1208
    },

STEXI
Q
Qiao Nuohan 已提交
1209
@item dump-guest-memory [-p] @var{filename} @var{begin} @var{length}
1210
@item dump-guest-memory [-z|-l|-s|-w] @var{filename}
1211 1212
@findex dump-guest-memory
Dump guest memory to @var{protocol}. The file can be processed with crash or
1213
gdb. Without -z|-l|-s|-w, the dump format is ELF.
Q
Qiao Nuohan 已提交
1214
        -p: do paging to get guest's memory mapping.
1215 1216 1217
        -z: dump in kdump-compressed format, with zlib compression.
        -l: dump in kdump-compressed format, with lzo compression.
        -s: dump in kdump-compressed format, with snappy compression.
1218 1219
        -w: dump in Windows crashdump format (can be used instead of ELF-dump converting),
            for Windows x64 guests with vmcoreinfo driver only
Q
Qiao Nuohan 已提交
1220
  filename: dump file name.
1221
     begin: the starting physical address. It's optional, and should be
Q
Qiao Nuohan 已提交
1222
            specified together with length.
1223
    length: the memory size, in bytes. It's optional, and should be specified
Q
Qiao Nuohan 已提交
1224
            together with begin.
1225 1226
ETEXI

J
Jason J. Herne 已提交
1227 1228 1229 1230 1231 1232
#if defined(TARGET_S390X)
    {
        .name       = "dump-skeys",
        .args_type  = "filename:F",
        .params     = "",
        .help       = "Save guest storage keys into file 'filename'.\n",
1233
        .cmd        = hmp_dump_skeys,
J
Jason J. Herne 已提交
1234 1235 1236 1237 1238 1239 1240
    },
#endif

STEXI
@item dump-skeys @var{filename}
@findex dump-skeys
Save guest storage keys to a file.
1241 1242 1243 1244 1245 1246 1247 1248 1249 1250 1251 1252 1253 1254 1255 1256
ETEXI

#if defined(TARGET_S390X)
    {
        .name       = "migration_mode",
        .args_type  = "mode:i",
        .params     = "mode",
        .help       = "Enables or disables migration mode\n",
        .cmd        = hmp_migrationmode,
    },
#endif

STEXI
@item migration_mode @var{mode}
@findex migration_mode
Enables or disables migration mode.
J
Jason J. Herne 已提交
1257 1258
ETEXI

G
Gerd Hoffmann 已提交
1259
    {
1260
        .name       = "snapshot_blkdev",
1261 1262
        .args_type  = "reuse:-n,device:B,snapshot-file:s?,format:s?",
        .params     = "[-n] device [new-image-file] [format]",
1263 1264 1265 1266
        .help       = "initiates a live snapshot\n\t\t\t"
                      "of device. If a new image file is specified, the\n\t\t\t"
                      "new image file will become the new root image.\n\t\t\t"
                      "If format is specified, the snapshot file will\n\t\t\t"
1267
                      "be created in that format.\n\t\t\t"
1268 1269 1270
                      "The default format is qcow2.  The -n flag requests QEMU\n\t\t\t"
                      "to reuse the image found in new-image-file, instead of\n\t\t\t"
                      "recreating it from scratch.",
1271
        .cmd        = hmp_snapshot_blkdev,
G
Gerd Hoffmann 已提交
1272 1273
    },

1274 1275 1276 1277
STEXI
@item snapshot_blkdev
@findex snapshot_blkdev
Snapshot device, using snapshot file as target if provided
1278 1279 1280 1281 1282 1283 1284 1285 1286
ETEXI

    {
        .name       = "snapshot_blkdev_internal",
        .args_type  = "device:B,name:s",
        .params     = "device name",
        .help       = "take an internal snapshot of device.\n\t\t\t"
                      "The format of the image used by device must\n\t\t\t"
                      "support it, such as qcow2.\n\t\t\t",
1287
        .cmd        = hmp_snapshot_blkdev_internal,
1288 1289 1290 1291 1292 1293
    },

STEXI
@item snapshot_blkdev_internal
@findex snapshot_blkdev_internal
Take an internal snapshot on device if it support
1294 1295 1296 1297 1298 1299 1300 1301 1302 1303 1304
ETEXI

    {
        .name       = "snapshot_delete_blkdev_internal",
        .args_type  = "device:B,name:s,id:s?",
        .params     = "device name [id]",
        .help       = "delete an internal snapshot of device.\n\t\t\t"
                      "If id is specified, qemu will try delete\n\t\t\t"
                      "the snapshot matching both id and name.\n\t\t\t"
                      "The format of the image used by device must\n\t\t\t"
                      "support it, such as qcow2.\n\t\t\t",
1305
        .cmd        = hmp_snapshot_delete_blkdev_internal,
1306 1307 1308 1309 1310 1311
    },

STEXI
@item snapshot_delete_blkdev_internal
@findex snapshot_delete_blkdev_internal
Delete an internal snapshot on device if it support
P
Paolo Bonzini 已提交
1312 1313 1314 1315 1316 1317 1318 1319 1320 1321 1322 1323 1324 1325
ETEXI

    {
        .name       = "drive_mirror",
        .args_type  = "reuse:-n,full:-f,device:B,target:s,format:s?",
        .params     = "[-n] [-f] device target [format]",
        .help       = "initiates live storage\n\t\t\t"
                      "migration for a device. The device's contents are\n\t\t\t"
                      "copied to the new image file, including data that\n\t\t\t"
                      "is written after the command is started.\n\t\t\t"
                      "The -n flag requests QEMU to reuse the image found\n\t\t\t"
                      "in new-image-file, instead of recreating it from scratch.\n\t\t\t"
                      "The -f flag requests QEMU to copy the whole disk,\n\t\t\t"
                      "so that the result does not need a backing file.\n\t\t\t",
1326
        .cmd        = hmp_drive_mirror,
P
Paolo Bonzini 已提交
1327 1328 1329 1330 1331 1332
    },
STEXI
@item drive_mirror
@findex drive_mirror
Start mirroring a block device's writes to a new destination,
using the specified target.
1333 1334 1335 1336
ETEXI

    {
        .name       = "drive_backup",
1337 1338
        .args_type  = "reuse:-n,full:-f,compress:-c,device:B,target:s,format:s?",
        .params     = "[-n] [-f] [-c] device target [format]",
1339 1340 1341 1342 1343 1344 1345
        .help       = "initiates a point-in-time\n\t\t\t"
                      "copy for a device. The device's contents are\n\t\t\t"
                      "copied to the new image file, excluding data that\n\t\t\t"
                      "is written after the command is started.\n\t\t\t"
                      "The -n flag requests QEMU to reuse the image found\n\t\t\t"
                      "in new-image-file, instead of recreating it from scratch.\n\t\t\t"
                      "The -f flag requests QEMU to copy the whole disk,\n\t\t\t"
1346 1347 1348
                      "so that the result does not need a backing file.\n\t\t\t"
                      "The -c flag requests QEMU to compress backup data\n\t\t\t"
                      "(if the target format supports it).\n\t\t\t",
1349
        .cmd        = hmp_drive_backup,
1350 1351 1352 1353 1354
    },
STEXI
@item drive_backup
@findex drive_backup
Start a point-in-time copy of a block device to a specificed target.
1355 1356
ETEXI

1357 1358
    {
        .name       = "drive_add",
1359 1360
        .args_type  = "node:-n,pci_addr:s,opts:s",
        .params     = "[-n] [[<domain>:]<bus>:]<slot>\n"
1361
                      "[file=file][,if=type][,bus=n]\n"
1362 1363 1364
                      "[,unit=m][,media=d][,index=i]\n"
                      "[,snapshot=on|off][,cache=on|off]\n"
                      "[,readonly=on|off][,copy-on-read=on|off]",
1365
        .help       = "add drive to PCI storage controller",
1366
        .cmd        = hmp_drive_add,
1367 1368
    },

1369 1370
STEXI
@item drive_add
1371
@findex drive_add
1372
Add drive to PCI storage controller.
1373 1374 1375 1376 1377 1378 1379 1380 1381 1382 1383 1384 1385 1386 1387 1388 1389
ETEXI

    {
        .name       = "pcie_aer_inject_error",
        .args_type  = "advisory_non_fatal:-a,correctable:-c,"
	              "id:s,error_status:s,"
	              "header0:i?,header1:i?,header2:i?,header3:i?,"
	              "prefix0:i?,prefix1:i?,prefix2:i?,prefix3:i?",
        .params     = "[-a] [-c] id "
                      "<error_status> [<tlp header> [<tlp header prefix>]]",
        .help       = "inject pcie aer error\n\t\t\t"
	              " -a for advisory non fatal error\n\t\t\t"
	              " -c for correctable error\n\t\t\t"
                      "<id> = qdev device id\n\t\t\t"
                      "<error_status> = error string or 32bit\n\t\t\t"
                      "<tlb header> = 32bit x 4\n\t\t\t"
                      "<tlb header prefix> = 32bit x 4",
1390
        .cmd        = hmp_pcie_aer_inject_error,
1391 1392 1393 1394 1395 1396
    },

STEXI
@item pcie_aer_inject_error
@findex pcie_aer_inject_error
Inject PCIe AER error
1397 1398 1399 1400 1401
ETEXI

    {
        .name       = "netdev_add",
        .args_type  = "netdev:O",
1402
        .params     = "[user|tap|socket|vde|bridge|hubport|netmap|vhost-user],id=str[,prop=value][,...]",
1403
        .help       = "add host network device",
1404
        .cmd        = hmp_netdev_add,
1405
        .command_completion = netdev_add_completion,
1406 1407 1408 1409 1410 1411 1412 1413 1414 1415 1416 1417 1418
    },

STEXI
@item netdev_add
@findex netdev_add
Add host network device.
ETEXI

    {
        .name       = "netdev_del",
        .args_type  = "id:s",
        .params     = "id",
        .help       = "remove host network device",
1419
        .cmd        = hmp_netdev_del,
1420
        .command_completion = netdev_del_completion,
1421 1422 1423 1424 1425 1426
    },

STEXI
@item netdev_del
@findex netdev_del
Remove host network device.
1427 1428 1429 1430 1431 1432 1433
ETEXI

    {
        .name       = "object_add",
        .args_type  = "object:O",
        .params     = "[qom-type=]type,id=str[,prop=value][,...]",
        .help       = "create QOM object",
1434
        .cmd        = hmp_object_add,
1435
        .command_completion = object_add_completion,
1436 1437 1438 1439 1440 1441
    },

STEXI
@item object_add
@findex object_add
Create QOM object.
1442 1443 1444 1445 1446 1447 1448
ETEXI

    {
        .name       = "object_del",
        .args_type  = "id:s",
        .params     = "id",
        .help       = "destroy QOM object",
1449
        .cmd        = hmp_object_del,
1450
        .command_completion = object_del_completion,
1451 1452 1453 1454 1455 1456
    },

STEXI
@item object_del
@findex object_del
Destroy QOM object.
1457 1458 1459
ETEXI

#ifdef CONFIG_SLIRP
1460 1461 1462
    {
        .name       = "hostfwd_add",
        .args_type  = "arg1:s,arg2:s?,arg3:s?",
1463
        .params     = "[hub_id name]|[netdev_id] [tcp|udp]:[hostaddr]:hostport-[guestaddr]:guestport",
1464
        .help       = "redirect TCP or UDP connections from host to guest (requires -net user)",
1465
        .cmd        = hmp_hostfwd_add,
1466
    },
1467 1468 1469 1470 1471 1472
#endif
STEXI
@item hostfwd_add
@findex hostfwd_add
Redirect TCP or UDP connections from host to guest (requires -net user).
ETEXI
1473

1474
#ifdef CONFIG_SLIRP
1475 1476 1477
    {
        .name       = "hostfwd_remove",
        .args_type  = "arg1:s,arg2:s?,arg3:s?",
1478
        .params     = "[hub_id name]|[netdev_id] [tcp|udp]:[hostaddr]:hostport",
1479
        .help       = "remove host-to-guest TCP or UDP redirection",
1480
        .cmd        = hmp_hostfwd_remove,
1481 1482
    },

1483 1484
#endif
STEXI
1485 1486 1487
@item hostfwd_remove
@findex hostfwd_remove
Remove host-to-guest TCP or UDP redirection.
1488 1489
ETEXI

1490 1491
    {
        .name       = "balloon",
1492
        .args_type  = "value:M",
1493
        .params     = "target",
1494
        .help       = "request VM to change its memory allocation (in MB)",
1495
        .cmd        = hmp_balloon,
1496 1497
    },

1498 1499
STEXI
@item balloon @var{value}
1500
@findex balloon
1501 1502 1503
Request VM to change its memory allocation to @var{value} (in MB).
ETEXI

1504 1505
    {
        .name       = "set_link",
1506 1507
        .args_type  = "name:s,up:b",
        .params     = "name on|off",
1508
        .help       = "change the link status of a network adapter",
1509
        .cmd        = hmp_set_link,
1510
        .command_completion = set_link_completion,
1511 1512
    },

1513
STEXI
1514
@item set_link @var{name} [on|off]
1515
@findex set_link
1516
Switch link @var{name} on (i.e. up) or off (i.e. down).
1517 1518
ETEXI

1519 1520 1521 1522 1523
    {
        .name       = "watchdog_action",
        .args_type  = "action:s",
        .params     = "[reset|shutdown|poweroff|pause|debug|none]",
        .help       = "change watchdog action",
1524
        .cmd        = hmp_watchdog_action,
1525
        .command_completion = watchdog_action_completion,
1526 1527
    },

1528 1529
STEXI
@item watchdog_action
1530
@findex watchdog_action
1531 1532 1533
Change watchdog action.
ETEXI

1534 1535 1536 1537 1538
    {
        .name       = "acl_show",
        .args_type  = "aclname:s",
        .params     = "aclname",
        .help       = "list rules in the access control list",
1539
        .cmd        = hmp_acl_show,
1540 1541
    },

1542
STEXI
J
Jan Kiszka 已提交
1543
@item acl_show @var{aclname}
1544
@findex acl_show
J
Jan Kiszka 已提交
1545 1546 1547 1548 1549
List all the matching rules in the access control list, and the default
policy. There are currently two named access control lists,
@var{vnc.x509dname} and @var{vnc.username} matching on the x509 client
certificate distinguished name, and SASL username respectively.
ETEXI
1550

1551 1552 1553 1554 1555
    {
        .name       = "acl_policy",
        .args_type  = "aclname:s,policy:s",
        .params     = "aclname allow|deny",
        .help       = "set default access control list policy",
1556
        .cmd        = hmp_acl_policy,
1557 1558
    },

J
Jan Kiszka 已提交
1559
STEXI
J
Jan Kiszka 已提交
1560
@item acl_policy @var{aclname} @code{allow|deny}
1561
@findex acl_policy
J
Jan Kiszka 已提交
1562
Set the default access control list policy, used in the event that
1563
none of the explicit rules match. The default policy at startup is
J
Jan Kiszka 已提交
1564 1565 1566
always @code{deny}.
ETEXI

1567 1568 1569 1570 1571
    {
        .name       = "acl_add",
        .args_type  = "aclname:s,match:s,policy:s,index:i?",
        .params     = "aclname match allow|deny [index]",
        .help       = "add a match rule to the access control list",
1572
        .cmd        = hmp_acl_add,
1573 1574
    },

J
Jan Kiszka 已提交
1575
STEXI
1576 1577
@item acl_add @var{aclname} @var{match} @code{allow|deny} [@var{index}]
@findex acl_add
J
Jan Kiszka 已提交
1578 1579 1580 1581
Add a match rule to the access control list, allowing or denying access.
The match will normally be an exact username or x509 distinguished name,
but can optionally include wildcard globs. eg @code{*@@EXAMPLE.COM} to
allow all users in the @code{EXAMPLE.COM} kerberos realm. The match will
1582
normally be appended to the end of the ACL, but can be inserted
J
Jan Kiszka 已提交
1583 1584 1585
earlier in the list if the optional @var{index} parameter is supplied.
ETEXI

1586 1587 1588 1589 1590
    {
        .name       = "acl_remove",
        .args_type  = "aclname:s,match:s",
        .params     = "aclname match",
        .help       = "remove a match rule from the access control list",
1591
        .cmd        = hmp_acl_remove,
1592 1593
    },

J
Jan Kiszka 已提交
1594 1595
STEXI
@item acl_remove @var{aclname} @var{match}
1596
@findex acl_remove
J
Jan Kiszka 已提交
1597 1598 1599
Remove the specified match rule from the access control list.
ETEXI

1600 1601 1602 1603 1604
    {
        .name       = "acl_reset",
        .args_type  = "aclname:s",
        .params     = "aclname",
        .help       = "reset the access control list",
1605
        .cmd        = hmp_acl_reset,
1606 1607
    },

J
Jan Kiszka 已提交
1608
STEXI
1609 1610
@item acl_reset @var{aclname}
@findex acl_reset
J
Jan Kiszka 已提交
1611
Remove all matches from the access control list, and set the default
1612 1613 1614
policy back to @code{deny}.
ETEXI

P
Paolo Bonzini 已提交
1615 1616 1617 1618 1619
    {
        .name       = "nbd_server_start",
        .args_type  = "all:-a,writable:-w,uri:s",
        .params     = "nbd_server_start [-a] [-w] host:port",
        .help       = "serve block devices on the given host and port",
1620
        .cmd        = hmp_nbd_server_start,
P
Paolo Bonzini 已提交
1621 1622 1623 1624 1625 1626 1627 1628 1629 1630 1631 1632
    },
STEXI
@item nbd_server_start @var{host}:@var{port}
@findex nbd_server_start
Start an NBD server on the given host and/or port.  If the @option{-a}
option is included, all of the virtual machine's block devices that
have an inserted media on them are automatically exported; in this case,
the @option{-w} option makes the devices writable too.
ETEXI

    {
        .name       = "nbd_server_add",
1633 1634
        .args_type  = "writable:-w,device:B,name:s?",
        .params     = "nbd_server_add [-w] device [name]",
P
Paolo Bonzini 已提交
1635
        .help       = "export a block device via NBD",
1636
        .cmd        = hmp_nbd_server_add,
P
Paolo Bonzini 已提交
1637 1638
    },
STEXI
1639
@item nbd_server_add @var{device} [ @var{name} ]
P
Paolo Bonzini 已提交
1640 1641 1642
@findex nbd_server_add
Export a block device through QEMU's NBD server, which must be started
beforehand with @command{nbd_server_start}.  The @option{-w} option makes the
1643 1644
exported device writable too.  The export name is controlled by @var{name},
defaulting to @var{device}.
1645 1646 1647 1648 1649 1650 1651 1652 1653 1654 1655 1656 1657 1658 1659 1660 1661
ETEXI

    {
        .name       = "nbd_server_remove",
        .args_type  = "force:-f,name:s",
        .params     = "nbd_server_remove [-f] name",
        .help       = "remove an export previously exposed via NBD",
        .cmd        = hmp_nbd_server_remove,
    },
STEXI
@item nbd_server_remove [-f] @var{name}
@findex nbd_server_remove
Stop exporting a block device through QEMU's NBD server, which was
previously started with @command{nbd_server_add}.  The @option{-f}
option forces the server to drop the export immediately even if
clients are connected; otherwise the command fails unless there are no
clients.
P
Paolo Bonzini 已提交
1662 1663 1664 1665 1666 1667 1668
ETEXI

    {
        .name       = "nbd_server_stop",
        .args_type  = "",
        .params     = "nbd_server_stop",
        .help       = "stop serving block devices using the NBD protocol",
1669
        .cmd        = hmp_nbd_server_stop,
P
Paolo Bonzini 已提交
1670 1671 1672 1673 1674 1675 1676 1677
    },
STEXI
@item nbd_server_stop
@findex nbd_server_stop
Stop the QEMU embedded NBD server.
ETEXI


1678
#if defined(TARGET_I386)
1679 1680 1681

    {
        .name       = "mce",
1682 1683 1684
        .args_type  = "broadcast:-b,cpu_index:i,bank:i,status:l,mcg_status:l,addr:l,misc:l",
        .params     = "[-b] cpu bank status mcgstatus addr misc",
        .help       = "inject a MCE on the given CPU [and broadcast to other CPUs with -b option]",
1685
        .cmd        = hmp_mce,
1686 1687
    },

1688 1689 1690
#endif
STEXI
@item mce @var{cpu} @var{bank} @var{status} @var{mcgstatus} @var{addr} @var{misc}
1691
@findex mce (x86)
1692
Inject an MCE on the given CPU (x86 only).
1693 1694
ETEXI

1695 1696 1697 1698 1699
    {
        .name       = "getfd",
        .args_type  = "fdname:s",
        .params     = "getfd name",
        .help       = "receive a file descriptor via SCM rights and assign it a name",
1700
        .cmd        = hmp_getfd,
1701 1702
    },

1703 1704
STEXI
@item getfd @var{fdname}
1705
@findex getfd
1706 1707 1708 1709 1710
If a file descriptor is passed alongside this command using the SCM_RIGHTS
mechanism on unix sockets, it is stored using the name @var{fdname} for
later use by other monitor commands.
ETEXI

1711 1712 1713 1714 1715
    {
        .name       = "closefd",
        .args_type  = "fdname:s",
        .params     = "closefd name",
        .help       = "close a file descriptor previously passed via SCM rights",
1716
        .cmd        = hmp_closefd,
1717 1718
    },

1719 1720
STEXI
@item closefd @var{fdname}
1721
@findex closefd
1722 1723 1724
Close the file descriptor previously assigned to @var{fdname} using the
@code{getfd} command. This is only needed if the file descriptor was never
used by another monitor command.
1725 1726 1727 1728 1729 1730 1731
ETEXI

    {
        .name       = "block_passwd",
        .args_type  = "device:B,password:s",
        .params     = "block_passwd device password",
        .help       = "set the password of encrypted block devices",
1732
        .cmd        = hmp_block_passwd,
1733 1734
    },

Z
Zhi Yong Wu 已提交
1735
STEXI
1736 1737 1738
@item block_passwd @var{device} @var{password}
@findex block_passwd
Set the encrypted device @var{device} password to @var{password}
1739 1740

This command is now obsolete and will always return an error since 2.10
Z
Zhi Yong Wu 已提交
1741 1742 1743 1744 1745 1746 1747
ETEXI

    {
        .name       = "block_set_io_throttle",
        .args_type  = "device:B,bps:l,bps_rd:l,bps_wr:l,iops:l,iops_rd:l,iops_wr:l",
        .params     = "device bps bps_rd bps_wr iops iops_rd iops_wr",
        .help       = "change I/O throttle limits for a block drive",
1748
        .cmd        = hmp_block_set_io_throttle,
Z
Zhi Yong Wu 已提交
1749 1750
    },

1751
STEXI
1752 1753
@item block_set_io_throttle @var{device} @var{bps} @var{bps_rd} @var{bps_wr} @var{iops} @var{iops_rd} @var{iops_wr}
@findex block_set_io_throttle
1754 1755
Change I/O throttle limits for a block drive to @var{bps} @var{bps_rd} @var{bps_wr} @var{iops} @var{iops_rd} @var{iops_wr}.
@var{device} can be a block device name, a qdev ID or a QOM path.
1756 1757 1758 1759 1760 1761 1762
ETEXI

    {
        .name       = "set_password",
        .args_type  = "protocol:s,password:s,connected:s?",
        .params     = "protocol password action-if-connected",
        .help       = "set spice/vnc password",
1763
        .cmd        = hmp_set_password,
1764 1765 1766 1767 1768 1769 1770 1771 1772 1773 1774 1775 1776 1777 1778 1779 1780 1781
    },

STEXI
@item set_password [ vnc | spice ] password [ action-if-connected ]
@findex set_password
Change spice/vnc password.  Use zero to make the password stay valid
forever.  @var{action-if-connected} specifies what should happen in
case a connection is established: @var{fail} makes the password change
fail.  @var{disconnect} changes the password and disconnects the
client.  @var{keep} changes the password and keeps the connection up.
@var{keep} is the default.
ETEXI

    {
        .name       = "expire_password",
        .args_type  = "protocol:s,time:s",
        .params     = "protocol time",
        .help       = "set spice/vnc password expire-time",
1782
        .cmd        = hmp_expire_password,
1783 1784 1785 1786 1787 1788 1789 1790 1791 1792 1793 1794 1795 1796 1797 1798 1799 1800 1801 1802 1803 1804 1805
    },

STEXI
@item expire_password [ vnc | spice ] expire-time
@findex expire_password
Specify when a password for spice/vnc becomes
invalid. @var{expire-time} accepts:

@table @var
@item now
Invalidate password instantly.

@item never
Password stays valid forever.

@item +nsec
Password stays valid for @var{nsec} seconds starting now.

@item nsec
Password is invalidated at the given time.  @var{nsec} are the seconds
passed since 1970, i.e. unix epoch.

@end table
1806 1807
ETEXI

1808 1809 1810 1811 1812
    {
        .name       = "chardev-add",
        .args_type  = "args:s",
        .params     = "args",
        .help       = "add chardev",
1813
        .cmd        = hmp_chardev_add,
1814
        .command_completion = chardev_add_completion,
1815 1816 1817
    },

STEXI
1818 1819
@item chardev-add args
@findex chardev-add
1820 1821 1822 1823 1824 1825 1826 1827 1828 1829 1830 1831 1832 1833 1834 1835 1836
chardev-add accepts the same parameters as the -chardev command line switch.

ETEXI

    {
        .name       = "chardev-change",
        .args_type  = "id:s,args:s",
        .params     = "id args",
        .help       = "change chardev",
        .cmd        = hmp_chardev_change,
    },

STEXI
@item chardev-change args
@findex chardev-change
chardev-change accepts existing chardev @var{id} and then the same arguments
as the -chardev command line switch (except for "id").
1837 1838 1839 1840 1841 1842 1843 1844

ETEXI

    {
        .name       = "chardev-remove",
        .args_type  = "id:s",
        .params     = "id",
        .help       = "remove chardev",
1845
        .cmd        = hmp_chardev_remove,
1846
        .command_completion = chardev_remove_completion,
1847 1848 1849
    },

STEXI
1850 1851
@item chardev-remove id
@findex chardev-remove
1852 1853
Removes the chardev @var{id}.

1854 1855 1856 1857 1858 1859 1860 1861 1862 1863 1864 1865 1866 1867 1868 1869
ETEXI

    {
        .name       = "chardev-send-break",
        .args_type  = "id:s",
        .params     = "id",
        .help       = "send a break on chardev",
        .cmd        = hmp_chardev_send_break,
        .command_completion = chardev_remove_completion,
    },

STEXI
@item chardev-send-break id
@findex chardev-send-break
Send a break on the chardev @var{id}.

1870 1871 1872 1873 1874 1875 1876
ETEXI

    {
        .name       = "qemu-io",
        .args_type  = "device:B,command:s",
        .params     = "[device] \"[command]\"",
        .help       = "run a qemu-io command on a block device",
1877
        .cmd        = hmp_qemu_io,
1878 1879 1880 1881 1882 1883 1884
    },

STEXI
@item qemu-io @var{device} @var{command}
@findex qemu-io
Executes a qemu-io command on the given block device.

1885 1886 1887 1888 1889 1890
ETEXI

    {
        .name       = "cpu-add",
        .args_type  = "id:i",
        .params     = "id",
K
Kashyap Chamarthy 已提交
1891
        .help       = "add cpu (deprecated, use device_add instead)",
1892
        .cmd        = hmp_cpu_add,
1893 1894 1895 1896
    },

STEXI
@item cpu-add @var{id}
1897
@findex cpu-add
K
Kashyap Chamarthy 已提交
1898 1899 1900
Add CPU with id @var{id}.  This command is deprecated, please
+use @code{device_add} instead. For details, refer to
'docs/cpu-hotplug.rst'.
1901 1902 1903 1904 1905 1906 1907
ETEXI

    {
        .name       = "qom-list",
        .args_type  = "path:s?",
        .params     = "path",
        .help       = "list QOM properties",
1908
        .cmd        = hmp_qom_list,
1909
        .flags      = "p",
1910 1911 1912 1913 1914
    },

STEXI
@item qom-list [@var{path}]
Print QOM properties of object at location @var{path}
1915 1916 1917 1918 1919 1920 1921
ETEXI

    {
        .name       = "qom-set",
        .args_type  = "path:s,property:s,value:s",
        .params     = "path property value",
        .help       = "set QOM property",
1922
        .cmd        = hmp_qom_set,
1923
        .flags      = "p",
1924 1925 1926 1927 1928
    },

STEXI
@item qom-set @var{path} @var{property} @var{value}
Set QOM property @var{property} of object at location @var{path} to value @var{value}
1929
ETEXI
1930

J
Jan Kiszka 已提交
1931 1932 1933 1934 1935
    {
        .name       = "info",
        .args_type  = "item:s?",
        .params     = "[subcommand]",
        .help       = "show various information about the system state",
1936 1937
        .cmd        = hmp_info_help,
        .sub_table  = info_cmds,
1938
        .flags      = "p",
J
Jan Kiszka 已提交
1939 1940
    },

1941 1942 1943
STEXI
@end table
ETEXI