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@xxxxxxxxxx> >> --- >> 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. -- Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org
Attachment:
signature.asc
Description: OpenPGP digital signature
-- libvir-list mailing list libvir-list@xxxxxxxxxx https://www.redhat.com/mailman/listinfo/libvir-list