X-Git-Url: http://git.annexia.org/?p=virt-mem.git;a=blobdiff_plain;f=virt-mem.pod;h=1eec316c76dfa2f0f8839b9807b307ecb480b216;hp=1c81e29831b5bff9dde8c3d570aa4d384f8d2323;hb=2e1de51e35bea53ebece1a6fd6d6970534f4cbe9;hpb=e4a9a58795f30b85fd965e6584ca73d7b0a812f8 diff --git a/virt-mem.pod b/virt-mem.pod index 1c81e29..1eec316 100644 --- a/virt-mem.pod +++ b/virt-mem.pod @@ -4,22 +4,65 @@ virt-uname - system information for virtual machines virt-dmesg - print kernel messages for virtual machines +virt-ps - list processes for virtual machines + +virt-mem - tool with additional information output + =head1 SUMMARY virt-uname [-options] [domains...] virt-dmesg [-options] [domains...] +virt-ps [-options] [domains...] + +virt-mem uname [...] + +virt-mem dmesg [...] + +virt-mem ps [...] + +virt-mem [-options] + =head1 DESCRIPTION -These virtualization tools allow you to inspect the status of -virtual machines running Linux. +These virtualization tools allow you to inspect the status of virtual +machines running Linux. + +These tools are designed to work like familiar Linux/Unix command line +tools. + +These tools all use libvirt so are capable of showing information +across a variety of different virtualization systems. -The tools all use libvirt so are capable of showing stats across a -variety of different virtualization systems. +The virt-mem tools do not work on domains which are not active +(running or paused). eg. They do not work on shut down domains. +However they can (usually) be used on domains which are active but +hanging or unresponsive. You also have the option of capturing a +memory image of a domain for post-mortem analysis, allowing you to +quickly reboot a failed domain and analyze it later at your leisure. =head1 COMMON OPTIONS +Each command obeys a common set of options. The general form is: + +virt-I [-options] [domains...] + +where I is a subtool such as C, C or C, and +I is a list of guest names to act on. If no domains are +specified then we act on all active domains by default. + +A I may be specified either by its name, by its ID or by its +UUID. Use I to get a list of active domain names and IDs. + +Equivalently you can use the C meta-tool with subcommands, +as in: + +virt-mem I [...] + +The C program offers additional features, such as the +ability to capture VM images for post-mortem analysis (see below). + =over 4 =item B<-c uri>, B<--connect uri> @@ -43,11 +86,20 @@ report a bug. Display usage summary. +=item B<--list-kernels> + +List which guest kernel versions are known/supported, then exit. + =item B<-t memoryimage> -Test mode. Instead of checking libvirt for domain information, this -runs the virt-mem tool directly on the memory image supplied. You may -specify the B<-t> option multiple times. +Post-mortem analysis mode. + +Instead of checking libvirt for domain information, this runs the tool +directly on the memory image supplied. You may specify the B<-t> +option multiple times. Use the C command to capture +images (see below). + +See also the section L below. =item B<--version> @@ -55,7 +107,7 @@ Display version and exit. =item B<-E auto|littleendian|bigendian> -=item B<-T auto|i386|x86-64|I
> +=item B<-T auto|i386|x86-64|I
|I> =item B<-W auto|32|64> @@ -69,13 +121,18 @@ to use these options if virt-mem tools get the automatic detection wrong. Endianness (I<-E>) sets the memory endianness, for data, pointers and -so on. +so on. I<-E littleendian> is the endianness used on Intel i386, +x86-64 and (usually) IA64. I<-E bigendian> is the endianness used on +many RISC chips such as SPARC and PowerPC. + +Text address (I<-T>) sets the base address and optionally min and max +addresses of the kernel image. I<-T i386> means to try some common +addresses for i386-based kernels. I<-T x86-64> means to try some +common addresses for x86-64-based kernels. -Text address (I<-T>) sets the base address of the kernel image. I<-T -i386> means to try some common addresses for i386-based kernels. I<-T -x86-64> means to try some common addresses for x86-64-based kernels. -I<-T I
> sets the address specifically (I<0x> prefix is -allowed to specify hex addresses). +I<-T address> sets the kernel base address specifically (I<0x> prefix +is used to specify hex addresses). I<-T address,min,max> sets the +kernel base address, minimum address and maximum address. Word size (I<-W>) sets the word size, 32 or 64 bits. @@ -87,6 +144,44 @@ one go, but not text address. =back +=head1 virt-dmesg + +This prints the latest kernel messages from the virtual machine, as if +you were logged into the machine and used L. + +=head1 virt-uname + +This prints the contents of the system C structure, similar +to what is printed by the L command. + +=head1 virt-mem + +C is a meta-tool which allows you to run all the commands +above, and provides some extra features. + +Instead of the preceeding commands such as C you can +write: + + virt-mem dmesg [...] + +Options and other command line arguments work the same. + +Additional C subcommands are listed below. + +=head2 virt-mem capture -o memoryimage [-options] [domains...] + +Capture the memory image of a virtual machine for later post-mortem +analysis. Use the I<-t memoryimage> option for any other virt-mem +tool to analyze the memory image later. + +The I<-o memoryimage> option is required, and is used to name the +output file. If a single guest is captured, then the output is saved +in the I file. However, if multiple guests are captured, +then their images are saved in I where I is +replaced with the domain ID. + +See also the section L below. + =head1 EXAMPLES # virt-uname @@ -105,28 +200,58 @@ one go, but not text address. <6>Bluetooth: RFCOMM ver 1.8 <7>eth0: no IPv6 routers present +=head1 MEMORY IMAGES + +All the tools can read dumped kernel images, using the common +I<-t memoryimage> option. In addition you can capture memory +images from domains for post-mortem analysis using the +C command (see above). + +The memory images which are saved by C contain a +header and some additional information about the kernel image, such as +architecture, original text address, and so forth. Thus these images +can be reanalysed just using the I<-t memoryimage> option. + +We also support analyzing raw kernel dumps, eg. produced using the +L monitor's C command. In this case however you +usually need to specify the original architecture, text address and +perhaps other details using the I<-A>, I<-T> and other command line +parameters. + =head1 SHORTCOMINGS The virt-mem tools spy on the guest's memory image. There are some shortcomings to this, described here. -(1) Only works on specific, tested releases of Linux kernels. Support +=over + +=item * + +Only works on specific, tested releases of Linux kernels. Support for arbitrary Linux kernel versions may be patchy because of changes in the internal structures used. Support for non-Linux kernels is currently non-existent, and probably impossible for Windows because of lack of an acceptable source license. -(2) Heuristics are used which may mean in the worst case that the +=item * + +Heuristics are used which may mean in the worst case that the output is wrong. -(3) Structures which are frequently modified may cause errors. This +=item * + +Structures which are frequently modified may cause errors. This could be a problem if, for example, the process table in the guest is being rapidly updated. -(4) We have to scan memory to find kernel symbols, etc., which can be +=item * + +We have to scan memory to find kernel symbols, etc., which can be quite slow. Optimizing the memory scanner would help, and caching the base address of the symbol table(s) would make it dramatically faster. +=back + =head1 SECURITY The current code tries hard to be secure against malicious guests, for @@ -134,9 +259,13 @@ example guests which set up malicious kernel memory. =head1 SEE ALSO -L,L, +L, +L, L, +L, +L, L, +L, L, L, L, @@ -184,7 +313,7 @@ have fixed it. Run - virt-[program] --debug > virt-mem.log 2>&1 +virt-I --debug > virt-mem.log 2>&1 and keep I. It contains error messages which you should submit with your bug report. @@ -193,7 +322,7 @@ submit with your bug report. Run - virt-[program] --version +virt-I --version =item 4. Submit a bug report.