[libvirt] [PATCH v1 1/7] configure: Check for statfs

Daniel P. Berrange berrange at redhat.com
Tue Jul 22 08:52:27 UTC 2014


On Mon, Jul 21, 2014 at 10:07:48AM -0600, Eric Blake wrote:
> On 07/21/2014 08:54 AM, Daniel P. Berrange wrote:
> > On Thu, Jul 17, 2014 at 06:12:42PM +0200, Michal Privoznik wrote:
> >> The statfs(2) gets filesystem statistics. Currently, we use it only on
> >> linux, and leave stub to implement on other platforms. But hey, other
> >> platforms (like FreeBSD) have statfs() too. If we check it in
> >> configure we can wider platforms supported. Speaking of FreeBSD, the
> >> headers to include are of course different: sys/param.h and
> >> sys/mount.h on the FreeBSD and sys/statfs.h on the Linux. The header
> >> files are checked too.
> >>
> >> Signed-off-by: Michal Privoznik <mprivozn at redhat.com>
> >> ---
> >>  configure.ac       |  4 ++--
> >>  src/util/virfile.c | 21 ++++++++++++++-------
> >>  2 files changed, 16 insertions(+), 9 deletions(-)
> >>
> 
> >>  
> >>  
> >> -#ifdef __linux__
> >> +#ifdef HAVE_STATFS
> >>  
> >>  # ifndef NFS_SUPER_MAGIC
> >>  #  define NFS_SUPER_MAGIC 0x6969
> > 
> > I'm fairly sure these constants are entirely Linux specific, so
> > although you got it to compile on BSD, I don't think it'll be
> > returning sensible results.
> 
> Correct. FS Magic numbers are specific to Linux.  Gnulib has a
> 'mountlist' module that coreutils and findutils share to try and
> portably get at file system names for non-Linux systems, but right now
> it is GPL, so we'd have to ask gnulib folks if it can be relaxed before
> libvirt could benefit from it.  Sadly, mounting of file systems is still
> an area of widely varying implementation-specific quirks, where there
> are no standard practices between systems.

I think I'd just suggest dropping this patch - it shouldn't hold up the
rest of the huge page series which we only really care about for Linux.


Regards,
Daniel
-- 
|: http://berrange.com      -o-    http://www.flickr.com/photos/dberrange/ :|
|: http://libvirt.org              -o-             http://virt-manager.org :|
|: http://autobuild.org       -o-         http://search.cpan.org/~danberr/ :|
|: http://entangle-photo.org       -o-       http://live.gnome.org/gtk-vnc :|




More information about the libvir-list mailing list