X-Git-Url: http://git.annexia.org/?a=blobdiff_plain;f=inspector%2Fvirt-inspector.pod;h=df9dfdad0ed1815f1518c12389ecb78047fde648;hb=42f3abe42d601c5d0a1521a36db54dea705a03c7;hp=26c61263fd769a820845a594ff8d8a1ee58a4187;hpb=3f1e3223c491aa057d02c1da418ed896d09fff7c;p=libguestfs.git diff --git a/inspector/virt-inspector.pod b/inspector/virt-inspector.pod index 26c6126..df9dfda 100755 --- a/inspector/virt-inspector.pod +++ b/inspector/virt-inspector.pod @@ -45,6 +45,13 @@ for-loop). Because virt-inspector needs direct access to guest images, it won't normally work over remote libvirt connections. +All of the information available from virt-inspector is also available +through the core libguestfs inspection API (see +L). The same information can also be fetched +using guestfish or via libguestfs bindings in many programming +languages +(see L). + =head1 OPTIONS =over 4 @@ -79,7 +86,8 @@ then libvirt is not used at all. =item B<--domain> guest -Add all the disks from the named libvirt guest. +Add all the disks from the named libvirt guest. Domain UUIDs can be +used instead of names. =item B<--echo-keys> @@ -145,7 +153,8 @@ For compatibility the old style is still supported. =head1 XML FORMAT The virt-inspector XML is described precisely in a RELAX NG schema -which is supplied with libguestfs. This section is just an overview. +file C which is supplied with libguestfs. This +section is just an overview. The top-level element is EoperatingsystemsE, and it contains one or more EoperatingsystemE elements. You would only see @@ -171,8 +180,13 @@ describe the operating system, its architecture, the descriptive /Windows installed -These fields are derived from the libguestfs inspection API, and -you can find more details in L. +In brief, EnameE is the class of operating system (something +like C or C), EdistroE is the distribution +(eg. C but many other distros are recognized) and +EarchE is the guest architecture. The other fields are fairly +self-explanatory, but because these fields are taken directly from the +libguestfs inspection API you can find precise information from +L. The ErootE element is the root filesystem device, but from the point of view of libguestfs (block devices may have completely @@ -202,7 +216,8 @@ devices. EfilesystemsE is like EmountpointsE but covers I filesystems belonging to the guest, including swap and empty partitions. (In the rare case of a multi-boot guest, it covers -filesystems belonging to this OS or shared by this OS and other OSes). +filesystems belonging to this OS or shared with this OS and other +OSes). You might see something like this: @@ -248,6 +263,49 @@ The version and release fields may not be available for some types guests. Other fields are possible, see L. +=head2 Edrive_mappingsE + +For operating systems like Windows which use drive letters, +virt-inspector is able to find out how drive letters map to +filesystems. + + + + ... + + /dev/sda2 + /dev/sdb1 + + +In the example above, drive C maps to the filesystem on the second +partition on the first disk, and drive E maps to the filesystem on the +first partition on the second disk. + +Note that this only covers permanent local filesystem mappings, not +things like network shares. Furthermore NTFS volume mount points may +not be listed here. + +=head2 EiconE + +Virt-inspector is sometimes able to extract an icon or logo for the +guest. The icon is returned as base64-encoded PNG data. Note that +the icon can be very large and high quality. + + + + ... + + iVBORw0KGgoAAAANSUhEUgAAAGAAAABg[.......] + [... many lines of base64 data ...] + + +To display the icon, you have to extract it and convert the base64 +data back to a binary file. Use an XPath query or simply an editor to +extract the data, then use the coreutils L program to do +the conversion back to a PNG file: + + base64 -i -d < icon.data > icon.png + =head2 INSPECTING INSTALL DISKS, LIVE CDs Virt-inspector can detect some operating system installers on @@ -271,22 +329,25 @@ installer, or one part of a multipart CD. For example: =head1 USING XPATH -You can use the XPath query language, and/or the xpath tool, in order -to select parts of the XML. +You can use the XPath query language to select parts of the XML. We +recommend using C to perform XPath queries from the +command line. For example: - $ virt-inspector -d Guest | xpath //filesystems - Found 1 nodes: - -- NODE -- + $ virt-inspector -d Guest | xmlstarlet sel -t -c '//filesystems' ext4 - [etc] + [...] $ virt-inspector -d Guest | \ - xpath "string(//filesystem[@dev='/dev/sda1']/type)" - Query didn't return a nodeset. Value: ext4 + xmlstarlet sel -t -c "string(//filesystem[@dev='/dev/sda1']/type)" + ext4 + + $ virt-inspector -d Guest | \ + xmlstarlet sel -t -v '//icon' | base64 -i -d | display - + [displays the guest icon, if there is one] =head1 SHELL QUOTING @@ -295,11 +356,34 @@ have meaning to the shell such as C<#> and space. You may need to quote or escape these characters on the command line. See the shell manual page L for details. +=head1 OLD VERSIONS OF VIRT-INSPECTOR + +Early versions of libguestfs shipped with a different virt-inspector +program written in Perl (the current version is written in C). The +XML output of the Perl virt-inspector was different and it could also +output in other formats like text. + +The old virt-inspector is no longer supported or shipped with +libguestfs. + +To confuse matters further, in Red Hat Enterprise Linux 6 we ship two +versions of virt-inspector with different names: + + virt-inspector Old Perl version. + virt-inspector2 New C version. + +=head1 EXIT STATUS + +This program returns 0 if successful, or non-zero if there was an +error. + =head1 SEE ALSO L, L, L, +L, +L, L. =head1 AUTHORS