summaryrefslogtreecommitdiffstats
path: root/v2v
diff options
context:
space:
mode:
authorRichard Jones <rjones@trick.home.annexia.org>2009-07-13 18:28:45 +0100
committerRichard Jones <rjones@trick.home.annexia.org>2009-07-13 18:28:45 +0100
commitc7845fb23e1353ae0331d8300271f813b637628c (patch)
tree59fb6a973f5be9e10bb1c8e66eb963870b761540 /v2v
parent4e444d5c09d78b0d292d95d1f97de12f26cc139d (diff)
downloadlibguestfs-c7845fb23e1353ae0331d8300271f813b637628c.tar.gz
libguestfs-c7845fb23e1353ae0331d8300271f813b637628c.tar.xz
libguestfs-c7845fb23e1353ae0331d8300271f813b637628c.zip
Only allow virt-v2v to be run on single root guests (ie. no multi-boot).
Diffstat (limited to 'v2v')
-rwxr-xr-xv2v/virt-v2v.pl22
1 files changed, 13 insertions, 9 deletions
diff --git a/v2v/virt-v2v.pl b/v2v/virt-v2v.pl
index 87da66be..d3fa647d 100755
--- a/v2v/virt-v2v.pl
+++ b/v2v/virt-v2v.pl
@@ -201,18 +201,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 ();
+
+
+