Pino Toscano
2017-Feb-22 17:37 UTC
[Libguestfs] [PATCH] inspect: ignore /dev/cdN devices in /etc/fstab
Non-Linux Unix guests may have static devices for CDs, so make sure to skip them when reading /etc/fstab. This is the same as done for /dev/fdN devices, i.e. floppy devices. --- lib/inspect-fs-unix.c | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/inspect-fs-unix.c b/lib/inspect-fs-unix.c index 7e940d6..9b6bfbf 100644 --- a/lib/inspect-fs-unix.c +++ b/lib/inspect-fs-unix.c @@ -1305,6 +1305,7 @@ check_fstab (guestfs_h *g, struct inspect_fs *fs) * discs. */ if ((STRPREFIX (spec, "/dev/fd") && c_isdigit (spec[7])) || + (STRPREFIX (spec, "/dev/cd") && c_isdigit (spec[7])) || STREQ (spec, "/dev/floppy") || STREQ (spec, "/dev/cdrom") || STRPREFIX (spec, "/dev/iso9660/")) -- 2.9.3
Richard W.M. Jones
2017-Feb-22 17:55 UTC
Re: [Libguestfs] [PATCH] inspect: ignore /dev/cdN devices in /etc/fstab
On Wed, Feb 22, 2017 at 06:37:46PM +0100, Pino Toscano wrote:> Non-Linux Unix guests may have static devices for CDs, so make sure to > skip them when reading /etc/fstab. This is the same as done for > /dev/fdN devices, i.e. floppy devices. > --- > lib/inspect-fs-unix.c | 1 + > 1 file changed, 1 insertion(+) > > diff --git a/lib/inspect-fs-unix.c b/lib/inspect-fs-unix.c > index 7e940d6..9b6bfbf 100644 > --- a/lib/inspect-fs-unix.c > +++ b/lib/inspect-fs-unix.c > @@ -1305,6 +1305,7 @@ check_fstab (guestfs_h *g, struct inspect_fs *fs) > * discs. > */ > if ((STRPREFIX (spec, "/dev/fd") && c_isdigit (spec[7])) || > + (STRPREFIX (spec, "/dev/cd") && c_isdigit (spec[7])) || > STREQ (spec, "/dev/floppy") || > STREQ (spec, "/dev/cdrom") || > STRPREFIX (spec, "/dev/iso9660/")) > --Seems reasonable, ACK. Rich. -- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones Read my programming and virtualization blog: http://rwmj.wordpress.com virt-df lists disk usage of guests without needing to install any software inside the virtual machine. Supports Linux and Windows. http://people.redhat.com/~rjones/virt-df/
Possibly Parallel Threads
- [PATCH] inspection: add support for systemd .mount files
- [PATCH] RFE: Inspection should support systemd mount units
- [PATCH 1/2] inspect: fstab: Canonicalize paths appearing in fstab.
- [PATCH 1/3] inspect: recognise Debian live images as such
- Re: [PATCH 1/2] inspect: fstab: Canonicalize paths appearing in fstab.