[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

[Libguestfs] [PATCH] Lib.pm: unknown filesystem label SWAP-sda2



Hi,

This is a purpose patch to avoid the message: unknown filesystem label SWAP-sda2.

Instead of validate the label with 'eq', use '=~' and /$label/i.

https://bugzilla.redhat.com/show_bug.cgi?id=666578

Thanks
Douglas
Index: libguestfs-1.8.0/perl/lib/Sys/Guestfs/Lib.pm
===================================================================
--- libguestfs-1.8.0.orig/perl/lib/Sys/Guestfs/Lib.pm
+++ libguestfs-1.8.0/perl/lib/Sys/Guestfs/Lib.pm
@@ -893,7 +893,7 @@ sub _find_filesystem
         my $label = $1;
         foreach (sort keys %$fses) {
             if (exists $fses->{$_}->{label} &&
-                $fses->{$_}->{label} eq $label) {
+                $fses->{$_}->{label} =~ /$label/i) {
                 return ($_, $fses->{$_});
             }
         }

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]