From: Douglas Schilling Landgraf Date: Sun, 2 Jan 2011 18:55:12 +0000 (+0000) Subject: Lib.pm: unknown filesystem /dev/hd{x} (cdrom) (RHBZ#666577) X-Git-Tag: 1.9.2~8 X-Git-Url: http://git.annexia.org/?a=commitdiff_plain;h=f07a0b6f1e01f12db0286ae49744deee0efcb5b9;p=libguestfs.git Lib.pm: unknown filesystem /dev/hd{x} (cdrom) (RHBZ#666577) 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 --- diff --git a/perl/lib/Sys/Guestfs/Lib.pm b/perl/lib/Sys/Guestfs/Lib.pm index 5265500..393eb8a 100644 --- a/perl/lib/Sys/Guestfs/Lib.pm +++ b/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}; return () if m{/dev/fd0};