1 HXCOMM Use
DEFHEADING() to define headings
in both help text and texi
2 HXCOMM Text between STEXI and ETEXI are copied to texi version and
3 HXCOMM discarded from C version
4 HXCOMM
DEF(command
, args
, callback, arg_string
, help
) is used to construct
5 HXCOMM monitor commands
6 HXCOMM HXCOMM can be used
for comments
, discarded from both texi and C
14 .args_type
= "name:s?",
16 .help
= "show the help",
17 .mhandler
.cmd
= do_help_cmd
,
21 @item help or ?
[@
var{cmd
}]
22 Show the help
for all commands or just
for command @
var{cmd
}.
27 .args_type
= "device:B",
28 .params
= "device|all",
29 .help
= "commit changes to the disk images (if -snapshot is used) or backing files",
30 .mhandler
.cmd
= do_commit
,
35 Commit changes to the disk
images (if -snapshot is used
) or backing files
.
40 .args_type
= "item:s?",
41 .params
= "[subcommand]",
42 .help
= "show various information about the system state",
43 .user_print
= monitor_user_noop
,
44 .mhandler
.cmd_new
= do_info
,
48 @item info @
var{subcommand
}
49 Show various information about the system state
.
53 show the version of QEMU
55 show the various VLANs and the associated devices
57 show the character devices
59 show the block devices
61 show block device statistics
63 show the cpu registers
65 show infos
for each CPU
67 show the command line history
69 show the interrupts
statistics (if available
)
71 show
i8259 (PIC
) state
73 show emulated PCI device info
75 show virtual to physical memory
mappings (i386 only
)
77 show the active virtual memory
mappings (i386 only
)
79 show state of
HPET (i386 only
)
83 show USB devices plugged on the virtual USB hub
85 show all USB host devices
87 show profiling information
89 show information about active capturing
91 show list of VM snapshots
93 show the current VM
status (running|paused
)
95 show guest PCMCIA status
97 show which guest mouse is receiving events
99 show the vnc server status
101 show the current VM name
103 show the current VM UUID
107 show user network stack connection states
109 show migration status
111 show balloon information
121 .help
= "quit the emulator",
122 .user_print
= monitor_user_noop
,
123 .mhandler
.cmd_new
= do_quit
,
133 .args_type
= "force:-f,filename:B",
134 .params
= "[-f] device",
135 .help
= "eject a removable medium (use -f to force it)",
136 .mhandler
.cmd
= do_eject
,
140 @item eject
[-f
] @
var{device
}
141 Eject a removable
medium (use
-f to force it
).
146 .args_type
= "device:B,target:F,arg:s?",
147 .params
= "device filename [format]",
148 .help
= "change a removable medium, optional format",
149 .mhandler
.cmd
= do_change
,
153 @item change @
var{device
} @
var{setting
}
155 Change the configuration of a device
.
158 @item change @
var{diskdevice
} @
var{filename
} [@
var{format
}]
159 Change the medium
for a removable disk device to point to @
var{filename
}. eg
162 (qemu
) change ide1
-cd0
/path
/to
/some
.iso
165 @
var{format
} is optional
.
167 @item change vnc @
var{display
},@
var{options
}
168 Change the configuration of the VNC server
. The valid syntax
for @
var{display
}
169 and @
var{options
} are described at @ref
{sec_invocation
}. eg
172 (qemu
) change vnc localhost
:1
175 @item change vnc password
[@
var{password
}]
177 Change the password associated with the VNC server
. If the
new password is not
178 supplied
, the monitor will prompt
for it to be entered
. VNC passwords are only
179 significant up to
8 letters
. eg
182 (qemu
) change vnc password
190 .name
= "screendump",
191 .args_type
= "filename:F",
192 .params
= "filename",
193 .help
= "save screen into PPM image 'filename'",
194 .mhandler
.cmd
= do_screen_dump
,
198 @item screendump @
var{filename
}
199 Save screen into PPM image @
var{filename
}.
204 .args_type
= "filename:F",
205 .params
= "filename",
206 .help
= "output logs to 'filename'",
207 .mhandler
.cmd
= do_logfile
,
211 @item logfile @
var{filename
}
212 Output logs to @
var{filename
}.
217 .args_type
= "items:s",
218 .params
= "item1[,...]",
219 .help
= "activate logging of the specified items to '/tmp/qemu.log'",
220 .mhandler
.cmd
= do_log
,
224 @item log @
var{item1
}[,...]
225 Activate logging of the specified items to @file
{/tmp
/qemu
.log
}.
230 .args_type
= "name:s?",
231 .params
= "[tag|id]",
232 .help
= "save a VM snapshot. If no tag or id are provided, a new snapshot is created",
233 .mhandler
.cmd
= do_savevm
,
237 @item savevm
[@
var{tag
}|@
var{id
}]
238 Create a snapshot of the whole virtual machine
. If @
var{tag
} is
239 provided
, it is used as human readable identifier
. If there is already
240 a snapshot with the same tag or ID
, it is replaced
. More info at
246 .args_type
= "name:s",
248 .help
= "restore a VM snapshot from its tag or id",
249 .mhandler
.cmd
= do_loadvm
,
253 @item loadvm @
var{tag
}|@
var{id
}
254 Set the whole virtual machine to the snapshot identified by the tag
255 @
var{tag
} or the unique snapshot ID @
var{id
}.
260 .args_type
= "name:s",
262 .help
= "delete a VM snapshot from its tag or id",
263 .mhandler
.cmd
= do_delvm
,
267 @item delvm @
var{tag
}|@
var{id
}
268 Delete the snapshot identified by @
var{tag
} or @
var{id
}.
272 .name
= "singlestep",
273 .args_type
= "option:s?",
274 .params
= "[on|off]",
275 .help
= "run emulation in singlestep mode or switch to normal mode",
276 .mhandler
.cmd
= do_singlestep
,
280 @item singlestep
[off
]
281 Run the emulation
in single step mode
.
282 If called with option off
, the emulation returns to normal mode
.
289 .help
= "stop emulation",
290 .user_print
= monitor_user_noop
,
291 .mhandler
.cmd_new
= do_stop
,
303 .help
= "resume emulation",
304 .user_print
= monitor_user_noop
,
305 .mhandler
.cmd_new
= do_cont
,
315 .args_type
= "device:s?",
316 .params
= "[device]",
317 .help
= "start gdbserver on given device (default 'tcp::1234'), stop with 'none'",
318 .mhandler
.cmd
= do_gdbserver
,
322 @item gdbserver
[@
var{port
}]
323 Start gdbserver
session (default @
var{port
}=1234)
328 .args_type
= "fmt:/,addr:l",
329 .params
= "/fmt addr",
330 .help
= "virtual memory dump starting at 'addr'",
331 .mhandler
.cmd
= do_memory_dump
,
335 @item x
/fmt @
var{addr
}
336 Virtual memory dump starting at @
var{addr
}.
341 .args_type
= "fmt:/,addr:l",
342 .params
= "/fmt addr",
343 .help
= "physical memory dump starting at 'addr'",
344 .mhandler
.cmd
= do_physical_memory_dump
,
348 @item xp
/@
var{fmt
} @
var{addr
}
349 Physical memory dump starting at @
var{addr
}.
351 @
var{fmt
} is a format which tells the command how to format the
352 data
. Its syntax is
: @option
{/@
{count@
}@
{format@
}@
{size@
}}
356 is the number of items to be dumped
.
359 can be
x (hex
), d (signed decimal
), u (unsigned decimal
), o (octal
),
360 c (char
) or
i (asm instruction
).
363 can be
b (8 bits
), h (16 bits
), w (32 bits
) or
g (64 bits
). On x86
,
364 @code
{h
} or @code
{w
} can be specified with the @code
{i
} format to
365 respectively select
16 or
32 bit code instruction size
.
372 Dump
10 instructions at the current instruction pointer
:
377 0x90107065: lea
0x0(%esi
,1),%esi
378 0x90107069: lea
0x0(%edi
,1),%edi
380 0x90107071: jmp
0x90107080
388 Dump
80 16 bit values at the start of the video memory
.
390 (qemu
) xp
/80hx
0xb8000
391 0x000b8000: 0x0b50 0x0b6c 0x0b65 0x0b78 0x0b38 0x0b36 0x0b2f 0x0b42
392 0x000b8010: 0x0b6f 0x0b63 0x0b68 0x0b73 0x0b20 0x0b56 0x0b47 0x0b41
393 0x000b8020: 0x0b42 0x0b69 0x0b6f 0x0b73 0x0b20 0x0b63 0x0b75 0x0b72
394 0x000b8030: 0x0b72 0x0b65 0x0b6e 0x0b74 0x0b2d 0x0b63 0x0b76 0x0b73
395 0x000b8040: 0x0b20 0x0b30 0x0b35 0x0b20 0x0b4e 0x0b6f 0x0b76 0x0b20
396 0x000b8050: 0x0b32 0x0b30 0x0b30 0x0b33 0x0720 0x0720 0x0720 0x0720
397 0x000b8060: 0x0720 0x0720 0x0720 0x0720 0x0720 0x0720 0x0720 0x0720
398 0x000b8070: 0x0720 0x0720 0x0720 0x0720 0x0720 0x0720 0x0720 0x0720
399 0x000b8080: 0x0720 0x0720 0x0720 0x0720 0x0720 0x0720 0x0720 0x0720
400 0x000b8090: 0x0720 0x0720 0x0720 0x0720 0x0720 0x0720 0x0720 0x0720
407 .args_type
= "fmt:/,val:l",
408 .params
= "/fmt expr",
409 .help
= "print expression value (use $reg for CPU register access)",
410 .mhandler
.cmd
= do_print
,
414 @item p or print
/@
var{fmt
} @
var{expr
}
416 Print expression value
. Only the @
var{format
} part of @
var{fmt
} is
422 .args_type
= "fmt:/,addr:i,index:i.",
423 .params
= "/fmt addr",
424 .help
= "I/O port read",
425 .mhandler
.cmd
= do_ioport_read
,
434 .args_type
= "fmt:/,addr:i,val:i",
435 .params
= "/fmt addr value",
436 .help
= "I/O port write",
437 .mhandler
.cmd
= do_ioport_write
,
446 .args_type
= "string:s,hold_time:i?",
447 .params
= "keys [hold_ms]",
448 .help
= "send keys to the VM (e.g. 'sendkey ctrl-alt-f1', default hold time=100 ms)",
449 .mhandler
.cmd
= do_sendkey
,
453 @item sendkey @
var{keys
}
455 Send @
var{keys
} to the emulator
. @
var{keys
} could be the name of the
456 key or @code
{#
} followed by the raw value
in either decimal or hexadecimal
457 format
. Use @code
{-} to press several keys simultaneously
. Example
:
462 This command is useful to send keys that your graphical user
interface
463 intercepts at low level
, such as @code
{ctrl
-alt
-f1
} in X Window
.
467 .name
= "system_reset",
470 .help
= "reset the system",
471 .user_print
= monitor_user_noop
,
472 .mhandler
.cmd_new
= do_system_reset
,
482 .name
= "system_powerdown",
485 .help
= "send system power down event",
486 .user_print
= monitor_user_noop
,
487 .mhandler
.cmd_new
= do_system_powerdown
,
491 @item system_powerdown
493 Power down the
system (if supported
).
498 .args_type
= "start:i,size:i",
499 .params
= "addr size",
500 .help
= "compute the checksum of a memory region",
501 .mhandler
.cmd
= do_sum
,
505 @item sum @
var{addr
} @
var{size
}
507 Compute the checksum of a memory region
.
512 .args_type
= "devname:s",
514 .help
= "add USB device (e.g. 'host:bus.addr' or 'host:vendor_id:product_id')",
515 .mhandler
.cmd
= do_usb_add
,
519 @item usb_add @
var{devname
}
521 Add the USB device @
var{devname
}. For details of available devices see
527 .args_type
= "devname:s",
529 .help
= "remove USB device 'bus.addr'",
530 .mhandler
.cmd
= do_usb_del
,
534 @item usb_del @
var{devname
}
536 Remove the USB device @
var{devname
} from the QEMU virtual USB
537 hub
. @
var{devname
} has the syntax @code
{bus
.addr
}. Use the monitor
538 command @code
{info usb
} to see the devices you can remove
.
542 .name
= "device_add",
543 .args_type
= "config:s",
545 .help
= "add device, like -device on the command line",
546 .mhandler
.cmd
= do_device_add
,
550 @item device_add @
var{config
}
556 .name
= "device_del",
559 .help
= "remove device",
560 .mhandler
.cmd
= do_device_del
,
564 @item device_del @
var{id
}
566 Remove device @
var{id
}.
571 .args_type
= "index:i",
573 .help
= "set the default CPU",
574 .mhandler
.cmd
= do_cpu_set
,
582 .name
= "mouse_move",
583 .args_type
= "dx_str:s,dy_str:s,dz_str:s?",
584 .params
= "dx dy [dz]",
585 .help
= "send mouse move events",
586 .mhandler
.cmd
= do_mouse_move
,
590 @item mouse_move @
var{dx
} @
var{dy
} [@
var{dz
}]
591 Move the active mouse to the specified coordinates @
var{dx
} @
var{dy
}
592 with optional scroll axis @
var{dz
}.
596 .name
= "mouse_button",
597 .args_type
= "button_state:i",
599 .help
= "change mouse button state (1=L, 2=M, 4=R)",
600 .mhandler
.cmd
= do_mouse_button
,
604 @item mouse_button @
var{val
}
605 Change the active mouse button state @
var{val
} (1=L
, 2=M
, 4=R
).
610 .args_type
= "index:i",
612 .help
= "set which mouse device receives events",
613 .mhandler
.cmd
= do_mouse_set
,
617 @item mouse_set @
var{index
}
618 Set which mouse device receives events at given @
var{index
}, index
627 .name
= "wavcapture",
628 .args_type
= "path:F,freq:i?,bits:i?,nchannels:i?",
629 .params
= "path [frequency [bits [channels]]]",
630 .help
= "capture audio to a wave file (default frequency=44100 bits=16 channels=2)",
631 .mhandler
.cmd
= do_wav_capture
,
635 @item wavcapture @
var{filename
} [@
var{frequency
} [@
var{bits
} [@
var{channels
}]]]
636 Capture audio into @
var{filename
}. Using sample rate @
var{frequency
}
637 bits per sample @
var{bits
} and number of channels @
var{channels
}.
641 @item Sample rate
= 44100 Hz
- CD quality
643 @item Number of channels
= 2 - Stereo
649 .name
= "stopcapture",
651 .params
= "capture index",
652 .help
= "stop capture",
653 .mhandler
.cmd
= do_stop_capture
,
657 @item stopcapture @
var{index
}
658 Stop capture with a given @
var{index
}, index can be obtained with
666 .args_type
= "val:l,size:i,filename:s",
667 .params
= "addr size file",
668 .help
= "save to disk virtual memory dump starting at 'addr' of size 'size'",
669 .user_print
= monitor_user_noop
,
670 .mhandler
.cmd_new
= do_memory_save
,
674 @item memsave @
var{addr
} @
var{size
} @
var{file
}
675 save to disk virtual memory dump starting at @
var{addr
} of size @
var{size
}.
680 .args_type
= "val:l,size:i,filename:s",
681 .params
= "addr size file",
682 .help
= "save to disk physical memory dump starting at 'addr' of size 'size'",
683 .mhandler
.cmd
= do_physical_memory_save
,
687 @item pmemsave @
var{addr
} @
var{size
} @
var{file
}
688 save to disk physical memory dump starting at @
var{addr
} of size @
var{size
}.
693 .args_type
= "bootdevice:s",
694 .params
= "bootdevice",
695 .help
= "define new values for the boot device list",
696 .mhandler
.cmd
= do_boot_set
,
700 @item boot_set @
var{bootdevicelist
}
702 Define
new values
for the boot device list
. Those values will
override
703 the values specified on the command line through the @code
{-boot
} option
.
705 The values that can be specified
here depend on the machine type
, but are
706 the same that can be specified
in the @code
{-boot
} command line option
.
709 #
if defined(TARGET_I386
)
712 .args_type
= "cpu_index:i",
714 .help
= "inject an NMI on the given CPU",
715 .mhandler
.cmd
= do_inject_nmi
,
720 Inject an NMI on the given
CPU (x86 only
).
725 .args_type
= "detach:-d,uri:s",
726 .params
= "[-d] uri",
727 .help
= "migrate to URI (using -d to not wait for completion)",
728 .mhandler
.cmd
= do_migrate
,
732 @item migrate
[-d
] @
var{uri
}
733 Migrate to @
var{uri
} (using -d to not wait
for completion
).
737 .name
= "migrate_cancel",
740 .help
= "cancel the current VM migration",
741 .mhandler
.cmd
= do_migrate_cancel
,
746 Cancel the current VM migration
.
750 .name
= "migrate_set_speed",
751 .args_type
= "value:s",
753 .help
= "set maximum speed (in bytes) for migrations",
754 .mhandler
.cmd
= do_migrate_set_speed
,
758 @item migrate_set_speed @
var{value
}
759 Set maximum speed to @
var{value
} (in bytes
) for migrations
.
763 .name
= "migrate_set_downtime",
764 .args_type
= "value:s",
766 .help
= "set maximum tolerated downtime (in seconds) for migrations",
767 .mhandler
.cmd
= do_migrate_set_downtime
,
771 @item migrate_set_downtime @
var{second
}
772 Set maximum tolerated
downtime (in seconds
) for migration
.
775 #
if defined(TARGET_I386
)
778 .args_type
= "pci_addr:s,opts:s",
779 .params
= "[[<domain>:]<bus>:]<slot>\n"
780 "[file=file][,if=type][,bus=n]\n"
781 "[,unit=m][,media=d][index=i]\n"
782 "[,cyls=c,heads=h,secs=s[,trans=t]]\n"
783 "[snapshot=on|off][,cache=on|off]",
784 .help
= "add drive to PCI storage controller",
785 .mhandler
.cmd
= drive_hot_add
,
791 Add drive to PCI storage controller
.
794 #
if defined(TARGET_I386
)
797 .args_type
= "pci_addr:s,type:s,opts:s?",
798 .params
= "auto|[[<domain>:]<bus>:]<slot> nic|storage [[vlan=n][,macaddr=addr][,model=type]] [file=file][,if=type][,bus=nr]...",
799 .help
= "hot-add PCI device",
800 .mhandler
.cmd
= pci_device_hot_add
,
809 #
if defined(TARGET_I386
)
812 .args_type
= "pci_addr:s",
813 .params
= "[[<domain>:]<bus>:]<slot>",
814 .help
= "hot remove PCI device",
815 .mhandler
.cmd
= do_pci_device_hot_remove
,
821 Hot remove PCI device
.
825 .name
= "host_net_add",
826 .args_type
= "device:s,opts:s?",
827 .params
= "tap|user|socket|vde|dump [options]",
828 .help
= "add host VLAN client",
829 .mhandler
.cmd
= net_host_device_add
,
834 Add host VLAN client
.
838 .name
= "host_net_remove",
839 .args_type
= "vlan_id:i,device:s",
840 .params
= "vlan_id name",
841 .help
= "remove host VLAN client",
842 .mhandler
.cmd
= net_host_device_remove
,
846 @item host_net_remove
847 Remove host VLAN client
.
852 .name
= "hostfwd_add",
853 .args_type
= "arg1:s,arg2:s?,arg3:s?",
854 .params
= "[vlan_id name] [tcp|udp]:[hostaddr]:hostport-[guestaddr]:guestport",
855 .help
= "redirect TCP or UDP connections from host to guest (requires -net user)",
856 .mhandler
.cmd
= net_slirp_hostfwd_add
,
860 .name
= "hostfwd_remove",
861 .args_type
= "arg1:s,arg2:s?,arg3:s?",
862 .params
= "[vlan_id name] [tcp|udp]:[hostaddr]:hostport",
863 .help
= "remove host-to-guest TCP or UDP redirection",
864 .mhandler
.cmd
= net_slirp_hostfwd_remove
,
870 Redirect TCP or UDP connections from host to
guest (requires
-net user
).
875 .args_type
= "value:i",
877 .help
= "request VM to change it's memory allocation (in MB)",
878 .user_print
= monitor_user_noop
,
879 .mhandler
.cmd_new
= do_balloon
,
883 @item balloon @
var{value
}
884 Request VM to change its memory allocation to @
var{value
} (in MB
).
889 .args_type
= "name:s,up_or_down:s",
890 .params
= "name up|down",
891 .help
= "change the link status of a network adapter",
892 .mhandler
.cmd
= do_set_link
,
896 @item set_link @
var{name
} [up|down
]
897 Set link @
var{name
} up or down
.
901 .name
= "watchdog_action",
902 .args_type
= "action:s",
903 .params
= "[reset|shutdown|poweroff|pause|debug|none]",
904 .help
= "change watchdog action",
905 .mhandler
.cmd
= do_watchdog_action
,
909 @item watchdog_action
910 Change watchdog action
.
915 .args_type
= "aclname:s",
917 .help
= "list rules in the access control list",
918 .mhandler
.cmd
= do_acl_show
,
922 @item acl_show @
var{aclname
}
923 List all the matching rules
in the access control list
, and the
default
924 policy
. There are currently two named access control lists
,
925 @
var{vnc
.x509dname
} and @
var{vnc
.username
} matching on the x509 client
926 certificate distinguished name
, and SASL username respectively
.
930 .name
= "acl_policy",
931 .args_type
= "aclname:s,policy:s",
932 .params
= "aclname allow|deny",
933 .help
= "set default access control list policy",
934 .mhandler
.cmd
= do_acl_policy
,
938 @item acl_policy @
var{aclname
} @code
{allow|deny
}
939 Set the
default access control list policy
, used
in the event that
940 none of the explicit rules match
. The
default policy at startup is
946 .args_type
= "aclname:s,match:s,policy:s,index:i?",
947 .params
= "aclname match allow|deny [index]",
948 .help
= "add a match rule to the access control list",
949 .mhandler
.cmd
= do_acl_add
,
953 @item acl_allow @
var{aclname
} @
var{match
} @code
{allow|deny
} [@
var{index
}]
954 Add a match rule to the access control list
, allowing or denying access
.
955 The match will normally be an exact username or x509 distinguished name
,
956 but can optionally include wildcard globs
. eg @code
{*@@EXAMPLE
.COM
} to
957 allow all users
in the @code
{EXAMPLE
.COM
} kerberos realm
. The match will
958 normally be appended to the end of the ACL
, but can be inserted
959 earlier
in the list
if the optional @
var{index
} parameter is supplied
.
963 .name
= "acl_remove",
964 .args_type
= "aclname:s,match:s",
965 .params
= "aclname match",
966 .help
= "remove a match rule from the access control list",
967 .mhandler
.cmd
= do_acl_remove
,
971 @item acl_remove @
var{aclname
} @
var{match
}
972 Remove the specified match rule from the access control list
.
977 .args_type
= "aclname:s",
979 .help
= "reset the access control list",
980 .mhandler
.cmd
= do_acl_reset
,
984 @item acl_remove @
var{aclname
} @
var{match
}
985 Remove all matches from the access control list
, and set the
default
986 policy back to @code
{deny
}.
989 #
if defined(TARGET_I386
)
993 .args_type
= "cpu_index:i,bank:i,status:l,mcg_status:l,addr:l,misc:l",
994 .params
= "cpu bank status mcgstatus addr misc",
995 .help
= "inject a MCE on the given CPU",
996 .mhandler
.cmd
= do_inject_mce
,
1001 @item mce @
var{cpu
} @
var{bank
} @
var{status
} @
var{mcgstatus
} @
var{addr
} @
var{misc
}
1002 Inject an MCE on the given
CPU (x86 only
).
1007 .args_type
= "fdname:s",
1008 .params
= "getfd name",
1009 .help
= "receive a file descriptor via SCM rights and assign it a name",
1010 .mhandler
.cmd
= do_getfd
,
1014 @item getfd @
var{fdname
}
1015 If a file descriptor is passed alongside
this command
using the SCM_RIGHTS
1016 mechanism on unix sockets
, it is stored
using the name @
var{fdname
} for
1017 later use by other monitor commands
.
1022 .args_type
= "fdname:s",
1023 .params
= "closefd name",
1024 .help
= "close a file descriptor previously passed via SCM rights",
1025 .mhandler
.cmd
= do_closefd
,
1029 @item closefd @
var{fdname
}
1030 Close the file descriptor previously assigned to @
var{fdname
} using the
1031 @code
{getfd
} command
. This is only needed
if the file descriptor was
never
1032 used by another monitor command
.