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

[Libguestfs] [PATCH] Lib.pm: unknown filesystem /dev/hd{x} (cdrom)



Hi,

This a purpose patch to avoid the message "unknown filesystem /dev/hdc".
Where /dev/hdc is an entry in fstab for CDROM.

Example of fstab:
/dev/hdc                /media/cdrom            auto
pamconsole,exec,noauto,managed 0 0

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

Signed-off-by: Douglas Schilling Landgraf <dougsland redhat com>

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
@@ -867,7 +867,7 @@ sub _assign_mount_points
         foreach (@fstab) {
             my ($spec, $file) = @$_;
 
-            my ($dev, $fs) = _find_filesystem ($g, $fses, $spec);
+            my ($dev, $fs) = _find_filesystem ($g, $fses, $spec, $file);
             if ($dev) {
                 $r->{mounts}->{$file} = $dev;
                 $r->{filesystems}->{$dev} = $fs;
@@ -888,6 +888,7 @@ sub _find_filesystem
     my $g = shift;
     my $fses = shift;
     local $_ = shift;
+    my $file = shift;
 
     if (/^LABEL=(.*)/) {
         my $label = $1;
@@ -928,6 +929,7 @@ sub _find_filesystem
             return ("/dev/$1/$2", $fses->{"/dev/$1/$2"});
         }
 
+	return () if $file =~ (/media\/cdrom/);
         return () if m{/dev/cdrom};
 
         warn __x("unknown filesystem {fs}\n", fs => $_);

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