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

Eric Blake eblake at redhat.com
Mon Jul 21 16:07:48 UTC 2014


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.

-- 
Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 604 bytes
Desc: OpenPGP digital signature
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20140721/db0d3bb8/attachment-0001.sig>


More information about the libvir-list mailing list