[libvirt] [PATCH 3/5] util: Introduce virFileMoveMount

Michal Privoznik mprivozn at redhat.com
Tue Jan 31 12:09:54 UTC 2017


On 01/31/2017 11:33 AM, Olaf Hering wrote:
> On Tue, Jan 31, Michal Privoznik wrote:
> 
>>> This fails to compile on systems without MS_MOVE, like openSUSE 11.4.
>> $ grep -r MS_MOVE /usr/include/
> 
> At that point glibc did not provide MS_MOVE.
> 
> /usr/include/sys/mount.h:  MS_MOVE = 8192,
> /usr/include/sys/mount.h:#define MS_MOVE                MS_MOVE
> /usr/include/linux/fs.h:#define MS_MOVE         8192
> /WD20_11.4/usr/include/linux/fs.h:#define MS_MOVE               8192
> /WD20_13.1/usr/include/sys/mount.h:  MS_MOVE = 8192,
> /WD20_13.1/usr/include/sys/mount.h:#define MS_MOVE              MS_MOVE
> /WD20_13.1/usr/include/linux/fs.h:#define MS_MOVE               8192
> 
> So what should be done?

so sys/mount.h is present and does provide the symbol. And yet, compiler
does not see it. Anything suspicious on sys/mount.h that would make the
compiler not see it (e.g. #ifdef). Meanwhile, does this help?

diff --git i/src/util/virfile.c w/src/util/virfile.c
index bf8099e34..a900bd405 100644
--- i/src/util/virfile.c
+++ w/src/util/virfile.c
@@ -34,6 +34,9 @@
 #include <sys/wait.h>
 #if defined(HAVE_SYS_MOUNT_H)
 # include <sys/mount.h>
+# if defined(__linux__)
+#  include <linux/fs.h>
+# endif
 #endif
 #include <unistd.h>
 #include <dirent.h>

Michal




More information about the libvir-list mailing list