File remove-duplicate-btrfs-roots.patch of Package virt-v2v

When the guest is using btrfs on the root filesystem, duplicate root devices
can be detected. If this happens, remove the standard parition entry, and
use the 'btrfsvol' version.

Index: virt-v2v-0.9.1/v2v/virt-v2v.pl
===================================================================
--- virt-v2v-0.9.1.orig/v2v/virt-v2v.pl
+++ virt-v2v-0.9.1/v2v/virt-v2v.pl
@@ -693,6 +693,14 @@ sub inspect_guest
 
     @roots = sort @roots;
 
+    # If using btrfs, it is possible to have the same partition listed using
+    # two different names (e.g. '/dev/sda2' and 'btrfsvol:/dev/sda2/@').
+    # In this case, remove the device entry, and use the 'btrfsvol' version.
+    if ((@roots == 2) && ("btrfsvol:$roots[0]/@" eq "$roots[1]")) {
+        @roots = grep(/^btrfsvol/, @roots);
+    }
+
+
     my $root_dev;
 
     if(@roots == 0) {