[Libguestfs] [PATCH] v2v: More accurately match root choice specified as a specific device

Matthew Booth mbooth at redhat.com
Thu Apr 21 16:28:08 UTC 2011


We could potentially have matched a logical volume /dev/ddd/lv_root as a
physical block device, and tried to do fuzzy matching on its interface.
---
 v2v/virt-v2v.pl |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/v2v/virt-v2v.pl b/v2v/virt-v2v.pl
index 7c0d7d6..fe07ae9 100755
--- a/v2v/virt-v2v.pl
+++ b/v2v/virt-v2v.pl
@@ -604,7 +604,7 @@ sub inspect_guest
             # Choose the first one.
             $root_dev = $roots[0];
         }
-        elsif ($root_choice =~ m|^/dev/[hsv]d(.*)|) {
+        elsif ($root_choice =~ m|^/dev/[hsv]d([a-z]+[0-9]*)$|) {
             # Choose the named root.
             my $partnum = $1;
             foreach (@roots) {
-- 
1.7.4.4




More information about the Libguestfs mailing list