libvirt/src/storage
Eric Blake 51c8216594 build: fix build on RHEL 5
On RHEL 5, compilation fails with:

storage/storage_backend.c: In function 'createRawFile':
storage/storage_backend.c:339: warning: implicit declaration of function 'fallocate'
storage/storage_backend.c:339: warning: nested extern declaration of 'fallocate' [-Wnested-externs]

But:

$ grep HAVE_FALLOCATE config.h
/* #undef HAVE_FALLOCATE */

Huh? It turns out that in kernels that old, fallocate() is not
implemented (config.h is correct), but <linux/fs.h> defines
HAVE_FALLOCATE as an empty witness macro for a completely
different purpose.  Since storage_backend.c is including
<linux/fs.h> on RHEL 5, we are hosed by the kernel definition.
Newer kernels no longer pollute the namespace, and it's fairly
easy to convert to an expression that works with both the old
kernel witness and the new-style config.h (undefined or 1).

Problem introduced in commit 532fef3.

* src/storage/storage_backend.c (createRawFile): Avoid namespace
pollution from kernel, by checking HAVE_FALLOCATE for a value.

Signed-off-by: Eric Blake <eblake@redhat.com>
2013-10-04 17:33:37 -06:00
..
parthelper.c util: move virFile* functions from virutil.c to virfile.c 2013-05-10 13:09:30 -04:00
storage_backend_disk.c Convert 'int i' to 'size_t i' in src/storage/ files 2013-07-10 17:40:13 +01:00
storage_backend_disk.h maint: fix up copyright notice inconsistencies 2012-09-20 16:30:55 -06:00
storage_backend_fs.c cleanup: Kill usage of access(PATH, F_OK) in favor of virFileExists() 2013-09-16 10:37:39 +02:00
storage_backend_fs.h maint: fix up copyright notice inconsistencies 2012-09-20 16:30:55 -06:00
storage_backend_iscsi.c Report secret usage error message similarly 2013-08-20 13:27:44 -04:00
storage_backend_iscsi.h maint: fix up copyright notice inconsistencies 2012-09-20 16:30:55 -06:00
storage_backend_logical.c cleanup: Kill usage of access(PATH, F_OK) in favor of virFileExists() 2013-09-16 10:37:39 +02:00
storage_backend_logical.h maint: fix up copyright notice inconsistencies 2012-09-20 16:30:55 -06:00
storage_backend_mpath.c cleanup: Kill usage of access(PATH, F_OK) in favor of virFileExists() 2013-09-16 10:37:39 +02:00
storage_backend_mpath.h maint: fix up copyright notice inconsistencies 2012-09-20 16:30:55 -06:00
storage_backend_rbd.c Report secret usage error message similarly 2013-08-20 13:27:44 -04:00
storage_backend_rbd.h maint: fix up copyright notice inconsistencies 2012-09-20 16:30:55 -06:00
storage_backend_scsi.c cleanup: Kill usage of access(PATH, F_OK) in favor of virFileExists() 2013-09-16 10:37:39 +02:00
storage_backend_scsi.h storage: Move virStorageBackendSCSIGetHostNumber into iscsi backend 2013-04-08 18:41:06 +08:00
storage_backend_sheepdog.c Adapt to VIR_ALLOC and virAsprintf in src/storage/* 2013-07-10 11:07:32 +02:00
storage_backend_sheepdog.h maint: fix up copyright notice inconsistencies 2012-09-20 16:30:55 -06:00
storage_backend.c build: fix build on RHEL 5 2013-10-04 17:33:37 -06:00
storage_backend.h storage: separate qemu-img command generation and execution 2013-02-24 18:11:40 +01:00
storage_driver.c Stop free'ing 'const char *' strings 2013-09-05 11:28:01 +01:00
storage_driver.h maint: fix up copyright notice inconsistencies 2012-09-20 16:30:55 -06:00