-=head1 OUTPUT FORMAT
-
- Operating system(s)
- -------------------
- Linux (distro + version)
- Windows (version)
- |
- |
- +--- Filesystems ---------- Installed apps --- Kernel & drivers
- ----------- -------------- ----------------
- mount point => device List of apps Extra information
- mount point => device and versions about kernel(s)
- ... and drivers
- swap => swap device
- (plus lots of extra information
- about each filesystem)
-
-The output of virt-inspector is a complex two-level data structure.
-
-At the top level is a list of the operating systems installed on the
-guest. (For the vast majority of guests, only a single OS is
-installed.) The data returned for the OS includes the name (Linux,
-Windows), the distribution and version.
-
-The diagram above shows what we return for each OS.
-
-With the I<--xml> option the output is mapped into an XML document.
-Unfortunately there is no clear schema for this document
-(contributions welcome) but you can get an idea of the format by
-looking at other documents and as a last resort the source for this
-program.
-
-With the I<--fish> or I<--ro-fish> option the mount points are mapped to
-L<guestfish(1)> command line parameters, so that you can go in
-afterwards and inspect the guest with everything mounted in the
-right place. For example:
-
- guestfish $(virt-inspector --ro-fish guest.img)
- ==> guestfish --ro -a guest.img -m /dev/VG/LV:/ -m /dev/sda1:/boot
-
-=cut
-
-# List of possible filesystems.
-my @partitions = get_partitions ($g);
-
-# Now query each one to build up a picture of what's in it.
-my %fses =
- inspect_all_partitions ($g, \@partitions,
- use_windows_registry => $windows_registry);
-
-#print "fses -----------\n";
-#print Dumper(\%fses);
-
-my $oses = inspect_operating_systems ($g, \%fses);
-
-#print "oses -----------\n";
-#print Dumper($oses);
-
-# Mount up the disks so we can check for applications
-# and kernels. Skip this if the output is "*fish" because
-# we don't need to know.
-
-if ($output !~ /.*fish$/) {
- my $root_dev;
- foreach $root_dev (sort keys %$oses) {
- my $os = $oses->{$root_dev};
- mount_operating_system ($g, $os);
- inspect_in_detail ($g, $os);
- $g->umount_all ();
- }