git.annexia.org
/
libguestfs.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
4e444d5
)
Only allow virt-v2v to be run on single root guests (ie. no multi-boot).
author
Richard Jones
<rjones@trick.home.annexia.org>
Mon, 13 Jul 2009 17:28:45 +0000
(18:28 +0100)
committer
Richard Jones
<rjones@trick.home.annexia.org>
Mon, 13 Jul 2009 17:28:45 +0000
(18:28 +0100)
v2v/virt-v2v.pl
patch
|
blob
|
history
diff --git
a/v2v/virt-v2v.pl
b/v2v/virt-v2v.pl
index
87da66b
..
d3fa647
100755
(executable)
--- 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);
#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.
# 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 (
);
+
+
+