From: Richard Jones Date: Sat, 11 Jul 2009 10:20:46 +0000 (+0100) Subject: V2V outline program. X-Git-Tag: 1.0.59~28 X-Git-Url: http://git.annexia.org/?p=libguestfs.git;a=commitdiff_plain;h=ce315bba284b40c2a729fce1ed2e3d7a746173f8 V2V outline program. --- diff --git a/v2v/virt-v2v.pl b/v2v/virt-v2v.pl index 5895eaa..92b5329 100755 --- a/v2v/virt-v2v.pl +++ b/v2v/virt-v2v.pl @@ -96,41 +96,66 @@ if ($version) { } pod2usage ("$0: no image or VM names given") if @ARGV == 0; -# my $g; -# if ($uri) { -# $g = open_guest (\@ARGV, rw => $rw, address => $uri); -# } else { -# $g = open_guest (\@ARGV, rw => $rw); -# } +# XXX This should be an option. Disable for now until we get +# downloads working reliably. +my $use_windows_registry = 0; + +my @params = (\@ARGV); +if ($uri) { + push @params, address => $uri; +} +my ($g, $conn, $dom) = open_guest (@params); + +$g->launch (); +$g->wait_ready (); + +# 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 => $use_windows_registry); + +#print "fses -----------\n"; +#print Dumper(\%fses); + +my $oses = inspect_operating_systems ($g, \%fses); + +#print "oses -----------\n"; +#print Dumper($oses); + +# We should probably refuse to do anything with those rare +# multiboot VMs at this point ... (XXX) + +# Mount up the disks and check for applications. + +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 (); +} + + + + + + + + + + + -# $g->launch (); -# $g->wait_ready (); -# # 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 and check for applications. -# 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 (); -# } =head1 SEE ALSO