File catch_invalid_initrd_path.patch of Package virt-v2v

In some cases (specifically, SUSE grub2 environments) it is possible to
fail to update the block entries in In turn, this causes an
invalid path to be returned in perl-Bootloader code, which causes the
conversion to fail with the following message:

is_file_opts: is_file: is_file_stub: path must start with a / character

This patch prevents the problem by adding (for /boot/grub and
/boot/grub2) to the list of configurations to remap, then adds a check
to ensure invalid paths are not passed to is_file_opts.

Index: virt-v2v-0.9.1/lib/Sys/VirtConvert/Converter/
--- virt-v2v-0.9.1.orig/lib/Sys/VirtConvert/Converter/
+++ virt-v2v-0.9.1/lib/Sys/VirtConvert/Converter/
@@ -56,7 +56,10 @@ sub get_initrd
         if (defined($initrd)) {
             # If the initrd starts with (hdX,X), remove it.
             $initrd =~ s/^\(hd.*\)//;
-            return $initrd if ($g->is_file_opts($initrd, followsymlinks=>1));
+            # Catch invalid paths by ensuring first character is '/'
+            if ($initrd =~ /^\//) {
+                return $initrd if $g->is_file_opts($initrd, followsymlinks=>1);
+            }
@@ -2672,13 +2675,13 @@ sub _remap_block_devices
         # Add standard configuration files to the checklist
         push (@checklist, '/files/etc/fstab/*/spec');
+        push (@checklist, '/files/boot/*/*'.
+                          '[label() != "#comment"]');
         # Add grub or grub2 files to the checklist
         if (defined($grub->{grub_conf})) {
             push (@checklist, "/files$grub->{grub_conf}/*/kernel/root");
             push (@checklist, "/files$grub->{grub_conf}/*/kernel/resume");
-            push (@checklist, '/files/boot/grub/*'.
-                              '[label() != "#comment"]');
         elsif (defined($grub->{cfg})) {
             push (@checklist, '/files/etc/sysconfig/grub/GRUB_CMDLINE_LINUX');