]> git.proxmox.com Git - qemu.git/blame - qemu-monitor.hx
Fix VM state change handlers running out of order
[qemu.git] / qemu-monitor.hx
CommitLineData
2313086a
BS
1HXCOMM Use DEFHEADING() to define headings in both help text and texi
2HXCOMM Text between STEXI and ETEXI are copied to texi version and
3HXCOMM discarded from C version
4HXCOMM DEF(command, args, callback, arg_string, help) is used to construct
5HXCOMM monitor commands
6HXCOMM HXCOMM can be used for comments, discarded from both texi and C
7
8STEXI
9@table @option
10ETEXI
11
12 { "help|?", "s?", help_cmd, "[cmd]", "show the help" },
13STEXI
14@item help or ? [@var{cmd}]
15Show the help for all commands or just for command @var{cmd}.
16ETEXI
17
18 { "commit", "s", do_commit,
19 "device|all", "commit changes to the disk images (if -snapshot is used) or backing files" },
20STEXI
21@item commit
22Commit changes to the disk images (if -snapshot is used) or backing files.
23ETEXI
24
25 { "info", "s?", do_info,
26 "[subcommand]", "show various information about the system state" },
27STEXI
28@item info @var{subcommand}
29Show various information about the system state.
30
31@table @option
32@item info version
33show the version of QEMU
34@item info network
35show the various VLANs and the associated devices
36@item info chardev
37show the character devices
38@item info block
39show the block devices
40@item info block
41show block device statistics
42@item info registers
43show the cpu registers
44@item info cpus
45show infos for each CPU
46@item info history
47show the command line history
48@item info irq
49show the interrupts statistics (if available)
50@item info pic
51show i8259 (PIC) state
52@item info pci
53show emulated PCI device info
54@item info tlb
55show virtual to physical memory mappings (i386 only)
56@item info mem
57show the active virtual memory mappings (i386 only)
58@item info hpet
59show state of HPET (i386 only)
60@item info kqemu
61show KQEMU information
62@item info kvm
63show KVM information
64@item info usb
65show USB devices plugged on the virtual USB hub
66@item info usbhost
67show all USB host devices
68@item info profile
69show profiling information
70@item info capture
71show information about active capturing
72@item info snapshots
73show list of VM snapshots
74@item info status
75show the current VM status (running|paused)
76@item info pcmcia
77show guest PCMCIA status
78@item info mice
79show which guest mouse is receiving events
80@item info vnc
81show the vnc server status
82@item info name
83show the current VM name
84@item info uuid
85show the current VM UUID
86@item info cpustats
87show CPU statistics
6dbe553f
JK
88@item info usernet
89show user network stack connection states
2313086a
BS
90@item info migrate
91show migration status
92@item info balloon
93show balloon information
94@item info qtree
95show device tree
96@end table
97ETEXI
98
99 { "q|quit", "", do_quit,
100 "", "quit the emulator" },
101STEXI
102@item q or quit
103Quit the emulator.
104ETEXI
105
106 { "eject", "-fB", do_eject,
107 "[-f] device", "eject a removable medium (use -f to force it)" },
108STEXI
109@item eject [-f] @var{device}
110Eject a removable medium (use -f to force it).
111ETEXI
112
113 { "change", "BFs?", do_change,
114 "device filename [format]", "change a removable medium, optional format" },
115STEXI
116@item change @var{device} @var{setting}
117
118Change the configuration of a device.
119
120@table @option
121@item change @var{diskdevice} @var{filename} [@var{format}]
122Change the medium for a removable disk device to point to @var{filename}. eg
123
124@example
125(qemu) change ide1-cd0 /path/to/some.iso
126@end example
127
128@var{format} is optional.
129
130@item change vnc @var{display},@var{options}
131Change the configuration of the VNC server. The valid syntax for @var{display}
132and @var{options} are described at @ref{sec_invocation}. eg
133
134@example
135(qemu) change vnc localhost:1
136@end example
137
138@item change vnc password [@var{password}]
139
140Change the password associated with the VNC server. If the new password is not
141supplied, the monitor will prompt for it to be entered. VNC passwords are only
142significant up to 8 letters. eg
143
144@example
145(qemu) change vnc password
146Password: ********
147@end example
148
149@end table
150ETEXI
151
152 { "screendump", "F", do_screen_dump,
153 "filename", "save screen into PPM image 'filename'" },
154STEXI
155@item screendump @var{filename}
156Save screen into PPM image @var{filename}.
157ETEXI
158
159 { "logfile", "F", do_logfile,
160 "filename", "output logs to 'filename'" },
161STEXI
162@item logfile @var{filename}
163Output logs to @var{filename}.
164ETEXI
165
166 { "log", "s", do_log,
167 "item1[,...]", "activate logging of the specified items to '/tmp/qemu.log'" },
168STEXI
169@item log @var{item1}[,...]
170Activate logging of the specified items to @file{/tmp/qemu.log}.
171ETEXI
172
173 { "savevm", "s?", do_savevm,
174 "[tag|id]", "save a VM snapshot. If no tag or id are provided, a new snapshot is created" },
175STEXI
176@item savevm [@var{tag}|@var{id}]
177Create a snapshot of the whole virtual machine. If @var{tag} is
178provided, it is used as human readable identifier. If there is already
179a snapshot with the same tag or ID, it is replaced. More info at
180@ref{vm_snapshots}.
181ETEXI
182
183 { "loadvm", "s", do_loadvm,
184 "tag|id", "restore a VM snapshot from its tag or id" },
185STEXI
186@item loadvm @var{tag}|@var{id}
187Set the whole virtual machine to the snapshot identified by the tag
188@var{tag} or the unique snapshot ID @var{id}.
189ETEXI
190
191 { "delvm", "s", do_delvm,
192 "tag|id", "delete a VM snapshot from its tag or id" },
193STEXI
194@item delvm @var{tag}|@var{id}
195Delete the snapshot identified by @var{tag} or @var{id}.
196ETEXI
197
198 { "singlestep", "s?", do_singlestep,
199 "[on|off]", "run emulation in singlestep mode or switch to normal mode", },
200STEXI
201@item singlestep [off]
202Run the emulation in single step mode.
203If called with option off, the emulation returns to normal mode.
204ETEXI
205
206 { "stop", "", do_stop,
207 "", "stop emulation", },
208STEXI
209@item stop
210Stop emulation.
211ETEXI
212
213 { "c|cont", "", do_cont,
214 "", "resume emulation", },
215STEXI
216@item c or cont
217Resume emulation.
218ETEXI
219
220 { "gdbserver", "s?", do_gdbserver,
221 "[device]", "start gdbserver on given device (default 'tcp::1234'), stop with 'none'", },
222STEXI
223@item gdbserver [@var{port}]
224Start gdbserver session (default @var{port}=1234)
225ETEXI
226
227 { "x", "/l", do_memory_dump,
228 "/fmt addr", "virtual memory dump starting at 'addr'", },
229STEXI
230@item x/fmt @var{addr}
231Virtual memory dump starting at @var{addr}.
232ETEXI
233
234 { "xp", "/l", do_physical_memory_dump,
235 "/fmt addr", "physical memory dump starting at 'addr'", },
236STEXI
237@item xp /@var{fmt} @var{addr}
238Physical memory dump starting at @var{addr}.
239
240@var{fmt} is a format which tells the command how to format the
241data. Its syntax is: @option{/@{count@}@{format@}@{size@}}
242
243@table @var
244@item count
245is the number of items to be dumped.
246
247@item format
248can be x (hex), d (signed decimal), u (unsigned decimal), o (octal),
249c (char) or i (asm instruction).
250
251@item size
252can be b (8 bits), h (16 bits), w (32 bits) or g (64 bits). On x86,
253@code{h} or @code{w} can be specified with the @code{i} format to
254respectively select 16 or 32 bit code instruction size.
255
256@end table
257
258Examples:
259@itemize
260@item
261Dump 10 instructions at the current instruction pointer:
262@example
263(qemu) x/10i $eip
2640x90107063: ret
2650x90107064: sti
2660x90107065: lea 0x0(%esi,1),%esi
2670x90107069: lea 0x0(%edi,1),%edi
2680x90107070: ret
2690x90107071: jmp 0x90107080
2700x90107073: nop
2710x90107074: nop
2720x90107075: nop
2730x90107076: nop
274@end example
275
276@item
277Dump 80 16 bit values at the start of the video memory.
278@smallexample
279(qemu) xp/80hx 0xb8000
2800x000b8000: 0x0b50 0x0b6c 0x0b65 0x0b78 0x0b38 0x0b36 0x0b2f 0x0b42
2810x000b8010: 0x0b6f 0x0b63 0x0b68 0x0b73 0x0b20 0x0b56 0x0b47 0x0b41
2820x000b8020: 0x0b42 0x0b69 0x0b6f 0x0b73 0x0b20 0x0b63 0x0b75 0x0b72
2830x000b8030: 0x0b72 0x0b65 0x0b6e 0x0b74 0x0b2d 0x0b63 0x0b76 0x0b73
2840x000b8040: 0x0b20 0x0b30 0x0b35 0x0b20 0x0b4e 0x0b6f 0x0b76 0x0b20
2850x000b8050: 0x0b32 0x0b30 0x0b30 0x0b33 0x0720 0x0720 0x0720 0x0720
2860x000b8060: 0x0720 0x0720 0x0720 0x0720 0x0720 0x0720 0x0720 0x0720
2870x000b8070: 0x0720 0x0720 0x0720 0x0720 0x0720 0x0720 0x0720 0x0720
2880x000b8080: 0x0720 0x0720 0x0720 0x0720 0x0720 0x0720 0x0720 0x0720
2890x000b8090: 0x0720 0x0720 0x0720 0x0720 0x0720 0x0720 0x0720 0x0720
290@end smallexample
291@end itemize
292ETEXI
293
294 { "p|print", "/l", do_print,
295 "/fmt expr", "print expression value (use $reg for CPU register access)", },
296STEXI
297@item p or print/@var{fmt} @var{expr}
298
299Print expression value. Only the @var{format} part of @var{fmt} is
300used.
301ETEXI
302
303 { "i", "/ii.", do_ioport_read,
304 "/fmt addr", "I/O port read" },
305STEXI
306Read I/O port.
307ETEXI
308
f114784f
JK
309 { "o", "/ii", do_ioport_write,
310 "/fmt addr value", "I/O port write" },
311STEXI
312Write to I/O port.
313ETEXI
2313086a
BS
314
315 { "sendkey", "si?", do_sendkey,
316 "keys [hold_ms]", "send keys to the VM (e.g. 'sendkey ctrl-alt-f1', default hold time=100 ms)" },
317STEXI
318@item sendkey @var{keys}
319
320Send @var{keys} to the emulator. @var{keys} could be the name of the
321key or @code{#} followed by the raw value in either decimal or hexadecimal
322format. Use @code{-} to press several keys simultaneously. Example:
323@example
324sendkey ctrl-alt-f1
325@end example
326
327This command is useful to send keys that your graphical user interface
328intercepts at low level, such as @code{ctrl-alt-f1} in X Window.
329ETEXI
330
331 { "system_reset", "", do_system_reset,
332 "", "reset the system" },
333STEXI
334@item system_reset
335
336Reset the system.
337ETEXI
338
339 { "system_powerdown", "", do_system_powerdown,
340 "", "send system power down event" },
341STEXI
342@item system_powerdown
343
344Power down the system (if supported).
345ETEXI
346
347 { "sum", "ii", do_sum,
348 "addr size", "compute the checksum of a memory region" },
349STEXI
350@item sum @var{addr} @var{size}
351
352Compute the checksum of a memory region.
353ETEXI
354
355 { "usb_add", "s", do_usb_add,
356 "device", "add USB device (e.g. 'host:bus.addr' or 'host:vendor_id:product_id')" },
357STEXI
358@item usb_add @var{devname}
359
360Add the USB device @var{devname}. For details of available devices see
361@ref{usb_devices}
362ETEXI
363
364 { "usb_del", "s", do_usb_del,
365 "device", "remove USB device 'bus.addr'" },
366STEXI
367@item usb_del @var{devname}
368
369Remove the USB device @var{devname} from the QEMU virtual USB
370hub. @var{devname} has the syntax @code{bus.addr}. Use the monitor
371command @code{info usb} to see the devices you can remove.
372ETEXI
373
374 { "cpu", "i", do_cpu_set,
375 "index", "set the default CPU" },
376STEXI
377Set the default CPU.
378ETEXI
379
380 { "mouse_move", "sss?", do_mouse_move,
381 "dx dy [dz]", "send mouse move events" },
382STEXI
383@item mouse_move @var{dx} @var{dy} [@var{dz}]
384Move the active mouse to the specified coordinates @var{dx} @var{dy}
385with optional scroll axis @var{dz}.
386ETEXI
387
388 { "mouse_button", "i", do_mouse_button,
389 "state", "change mouse button state (1=L, 2=M, 4=R)" },
390STEXI
391@item mouse_button @var{val}
392Change the active mouse button state @var{val} (1=L, 2=M, 4=R).
393ETEXI
394
395 { "mouse_set", "i", do_mouse_set,
396 "index", "set which mouse device receives events" },
397STEXI
398@item mouse_set @var{index}
399Set which mouse device receives events at given @var{index}, index
400can be obtained with
401@example
402info mice
403@end example
404ETEXI
405
406#ifdef HAS_AUDIO
407 { "wavcapture", "si?i?i?", do_wav_capture,
408 "path [frequency [bits [channels]]]",
409 "capture audio to a wave file (default frequency=44100 bits=16 channels=2)" },
410#endif
411STEXI
412@item wavcapture @var{filename} [@var{frequency} [@var{bits} [@var{channels}]]]
413Capture audio into @var{filename}. Using sample rate @var{frequency}
414bits per sample @var{bits} and number of channels @var{channels}.
415
416Defaults:
417@itemize @minus
418@item Sample rate = 44100 Hz - CD quality
419@item Bits = 16
420@item Number of channels = 2 - Stereo
421@end itemize
422ETEXI
423
424#ifdef HAS_AUDIO
425 { "stopcapture", "i", do_stop_capture,
426 "capture index", "stop capture" },
427#endif
428STEXI
429@item stopcapture @var{index}
430Stop capture with a given @var{index}, index can be obtained with
431@example
432info capture
433@end example
434ETEXI
435
436 { "memsave", "lis", do_memory_save,
437 "addr size file", "save to disk virtual memory dump starting at 'addr' of size 'size'", },
438STEXI
439@item memsave @var{addr} @var{size} @var{file}
440save to disk virtual memory dump starting at @var{addr} of size @var{size}.
441ETEXI
442
443 { "pmemsave", "lis", do_physical_memory_save,
444 "addr size file", "save to disk physical memory dump starting at 'addr' of size 'size'", },
445STEXI
446@item pmemsave @var{addr} @var{size} @var{file}
447save to disk physical memory dump starting at @var{addr} of size @var{size}.
448ETEXI
449
450 { "boot_set", "s", do_boot_set,
451 "bootdevice", "define new values for the boot device list" },
452STEXI
453@item boot_set @var{bootdevicelist}
454
455Define new values for the boot device list. Those values will override
456the values specified on the command line through the @code{-boot} option.
457
458The values that can be specified here depend on the machine type, but are
459the same that can be specified in the @code{-boot} command line option.
460ETEXI
461
462#if defined(TARGET_I386)
463 { "nmi", "i", do_inject_nmi,
464 "cpu", "inject an NMI on the given CPU", },
465#endif
466STEXI
467@item nmi @var{cpu}
468Inject an NMI on the given CPU (x86 only).
469ETEXI
470
471 { "migrate", "-ds", do_migrate,
472 "[-d] uri", "migrate to URI (using -d to not wait for completion)" },
473STEXI
474@item migrate [-d] @var{uri}
475Migrate to @var{uri} (using -d to not wait for completion).
476ETEXI
477
478 { "migrate_cancel", "", do_migrate_cancel,
479 "", "cancel the current VM migration" },
480STEXI
481@item migrate_cancel
482Cancel the current VM migration.
483ETEXI
484
485 { "migrate_set_speed", "s", do_migrate_set_speed,
486 "value", "set maximum speed (in bytes) for migrations" },
487STEXI
488@item migrate_set_speed @var{value}
489Set maximum speed to @var{value} (in bytes) for migrations.
2ea42952
GC
490ETEXI
491
492 { "migrate_set_downtime", "s", do_migrate_set_downtime,
493 "value", "set maximum tolerated downtime (in seconds) for migrations" },
494
495STEXI
496@item migrate_set_downtime @var{second}
497Set maximum tolerated downtime (in seconds) for migration.
2313086a
BS
498ETEXI
499
500#if defined(TARGET_I386)
e9283f8b 501 { "drive_add", "ss", drive_hot_add, "[[<domain>:]<bus>:]<slot>\n"
2313086a
BS
502 "[file=file][,if=type][,bus=n]\n"
503 "[,unit=m][,media=d][index=i]\n"
504 "[,cyls=c,heads=h,secs=s[,trans=t]]\n"
505 "[snapshot=on|off][,cache=on|off]",
506 "add drive to PCI storage controller" },
507#endif
508STEXI
509@item drive_add
510Add drive to PCI storage controller.
511ETEXI
512
513#if defined(TARGET_I386)
a62acdc0 514 { "pci_add", "sss?", pci_device_hot_add, "auto|[[<domain>:]<bus>:]<slot> nic|storage [[vlan=n][,macaddr=addr][,model=type]] [file=file][,if=type][,bus=nr]...", "hot-add PCI device" },
2313086a
BS
515#endif
516STEXI
517@item pci_add
518Hot-add PCI device.
519ETEXI
520
521#if defined(TARGET_I386)
e9283f8b 522 { "pci_del", "s", pci_device_hot_remove, "[[<domain>:]<bus>:]<slot>", "hot remove PCI device" },
2313086a
BS
523#endif
524STEXI
525@item pci_del
526Hot remove PCI device.
527ETEXI
528
529 { "host_net_add", "ss?", net_host_device_add,
530 "tap|user|socket|vde|dump [options]", "add host VLAN client" },
531STEXI
532@item host_net_add
533Add host VLAN client.
534ETEXI
535
536 { "host_net_remove", "is", net_host_device_remove,
537 "vlan_id name", "remove host VLAN client" },
538STEXI
539@item host_net_remove
540Remove host VLAN client.
541ETEXI
542
543#ifdef CONFIG_SLIRP
f13b572c
JK
544 { "hostfwd_add", "ss?s?", net_slirp_hostfwd_add,
545 "[vlan_id name] [tcp|udp]:[hostaddr]:hostport-[guestaddr]:guestport",
f3546deb 546 "redirect TCP or UDP connections from host to guest (requires -net user)" },
f13b572c
JK
547 { "hostfwd_remove", "ss?s?", net_slirp_hostfwd_remove,
548 "[vlan_id name] [tcp|udp]:[hostaddr]:hostport",
3c6a0580 549 "remove host-to-guest TCP or UDP redirection" },
2313086a
BS
550#endif
551STEXI
552@item host_net_redir
553Redirect TCP or UDP connections from host to guest (requires -net user).
554ETEXI
555
556 { "balloon", "i", do_balloon,
557 "target", "request VM to change it's memory allocation (in MB)" },
558STEXI
559@item balloon @var{value}
560Request VM to change its memory allocation to @var{value} (in MB).
561ETEXI
562
563 { "set_link", "ss", do_set_link,
564 "name up|down", "change the link status of a network adapter" },
565STEXI
566@item set_link @var{name} [up|down]
567Set link @var{name} up or down.
568ETEXI
569
570 { "watchdog_action", "s", do_watchdog_action,
571 "[reset|shutdown|poweroff|pause|debug|none]", "change watchdog action" },
572STEXI
573@item watchdog_action
574Change watchdog action.
575ETEXI
576
15dfcd45
JK
577 { "acl_show", "s", do_acl_show, "aclname",
578 "list rules in the access control list" },
2313086a 579STEXI
15dfcd45
JK
580@item acl_show @var{aclname}
581List all the matching rules in the access control list, and the default
582policy. There are currently two named access control lists,
583@var{vnc.x509dname} and @var{vnc.username} matching on the x509 client
584certificate distinguished name, and SASL username respectively.
585ETEXI
2313086a 586
15dfcd45
JK
587 { "acl_policy", "ss", do_acl_policy, "aclname allow|deny",
588 "set default access control list policy" },
589STEXI
cbbfacc6 590@item acl_policy @var{aclname} @code{allow|deny}
15dfcd45 591Set the default access control list policy, used in the event that
2313086a 592none of the explicit rules match. The default policy at startup is
15dfcd45
JK
593always @code{deny}.
594ETEXI
595
596 { "acl_add", "sssi?", do_acl_add, "aclname match allow|deny [index]",
597 "add a match rule to the access control list" },
598STEXI
599@item acl_allow @var{aclname} @var{match} @code{allow|deny} [@var{index}]
600Add a match rule to the access control list, allowing or denying access.
601The match will normally be an exact username or x509 distinguished name,
602but can optionally include wildcard globs. eg @code{*@@EXAMPLE.COM} to
603allow all users in the @code{EXAMPLE.COM} kerberos realm. The match will
2313086a 604normally be appended to the end of the ACL, but can be inserted
15dfcd45
JK
605earlier in the list if the optional @var{index} parameter is supplied.
606ETEXI
607
608 { "acl_remove", "ss", do_acl_remove, "aclname match",
609 "remove a match rule from the access control list" },
610STEXI
611@item acl_remove @var{aclname} @var{match}
612Remove the specified match rule from the access control list.
613ETEXI
614
615 { "acl_reset", "s", do_acl_reset, "aclname",
616 "reset the access control list" },
617STEXI
618@item acl_remove @var{aclname} @var{match}
619Remove all matches from the access control list, and set the default
2313086a 620policy back to @code{deny}.
2313086a
BS
621ETEXI
622
79c4f6b0
HY
623#if defined(TARGET_I386)
624 { "mce", "iillll", do_inject_mce, "cpu bank status mcgstatus addr misc", "inject a MCE on the given CPU"},
625#endif
626STEXI
627@item mce @var{cpu} @var{bank} @var{status} @var{mcgstatus} @var{addr} @var{misc}
628Inject an MCE on the given CPU (x86 only).
dedd9eca
MM
629ETEXI
630
631 { "getfd", "s", do_getfd, "getfd name",
632 "receive a file descriptor via SCM rights and assign it a name" },
633STEXI
634@item getfd @var{fdname}
635If a file descriptor is passed alongside this command using the SCM_RIGHTS
636mechanism on unix sockets, it is stored using the name @var{fdname} for
637later use by other monitor commands.
638ETEXI
639
640 { "closefd", "s", do_closefd, "closefd name",
641 "close a file descriptor previously passed via SCM rights" },
642STEXI
643@item closefd @var{fdname}
644Close the file descriptor previously assigned to @var{fdname} using the
645@code{getfd} command. This is only needed if the file descriptor was never
646used by another monitor command.
79c4f6b0
HY
647ETEXI
648
2313086a
BS
649STEXI
650@end table
651ETEXI