X-Git-Url: http://git.annexia.org/?a=blobdiff_plain;f=v2v%2Fvirt-v2v.pl;h=11d7cfd23710e9557d7741fc81e927be7ebc45d6;hb=febff9d2a35c4f40abbaf8943146476bdeac671e;hp=87da66bec9e9460cbff0442eafadc0b58bf69310;hpb=3f2ba6fdfbb82234e8a546dc54d568f49cd2e56b;p=libguestfs.git diff --git a/v2v/virt-v2v.pl b/v2v/virt-v2v.pl index 87da66b..11d7cfd 100755 --- a/v2v/virt-v2v.pl +++ b/v2v/virt-v2v.pl @@ -28,6 +28,7 @@ use Getopt::Long; use Data::Dumper; use File::Temp qw/tempdir/; use XML::Writer; +use Locale::TextDomain 'libguestfs'; =encoding utf8 @@ -159,9 +160,9 @@ Set the output guest name. =cut GetOptions ("help|?" => \$help, - "version" => \$version, - "connect|c=s" => \$uri, - "output|o=s" => \$output, + "version" => \$version, + "connect|c=s" => \$uri, + "output|o=s" => \$output, ) or pod2usage (2); pod2usage (1) if $help; if ($version) { @@ -170,7 +171,7 @@ if ($version) { print "$h{major}.$h{minor}.$h{release}$h{extra}\n"; exit } -pod2usage ("$0: no image or VM names given") if @ARGV == 0; +pod2usage (__"virt-v2v: no image or VM names given") if @ARGV == 0; # XXX This should be an option. Disable for now until we get # downloads working reliably. @@ -191,7 +192,7 @@ 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); + use_windows_registry => $use_windows_registry); #print "fses -----------\n"; #print Dumper(\%fses); @@ -201,18 +202,22 @@ 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) +# Only work on single-root operating systems. +my $root_dev; +my @roots = keys %$oses; +die __"no root device found in this operating system image" if @roots == 0; +die __"multiboot operating systems are not supported by v2v" if @roots > 1; +$root_dev = $roots[0]; # 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 (); -} +my $os = $oses->{$root_dev}; +mount_operating_system ($g, $os); +inspect_in_detail ($g, $os); +$g->umount_all (); + + +