]> xenbits.xensource.com Git - libvirt.git/commitdiff
virfile: Support bind mount only on linux
authorMichal Privoznik <mprivozn@redhat.com>
Thu, 15 Dec 2016 15:06:15 +0000 (16:06 +0100)
committerDaniel P. Berrange <berrange@redhat.com>
Fri, 16 Dec 2016 11:51:06 +0000 (11:51 +0000)
Other systems (despite having sys/mount.h) do not support bind
mounts.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
src/util/virfile.c

index 7c1e4357df7bc0d2cdd3545bf8cbddfa34734ed9..718dcc4a98a6f1712504832d3127390bddbe303c 100644 (file)
@@ -3565,7 +3565,7 @@ int virFileIsSharedFS(const char *path)
 }
 
 
-#if defined(HAVE_SYS_MOUNT_H)
+#if defined(__linux__) && defined(HAVE_SYS_MOUNT_H)
 int
 virFileSetupDev(const char *path,
                 const char *mount_options)
@@ -3611,7 +3611,7 @@ virFileBindMountDevice(const char *src,
     return 0;
 }
 
-#else /* !defined(HAVE_SYS_MOUNT_H) */
+#else /* !defined(__linux__) || !defined(HAVE_SYS_MOUNT_H) */
 
 int
 virFileSetupDev(const char *path ATTRIBUTE_UNUSED,
@@ -3631,7 +3631,7 @@ virFileBindMountDevice(const char *src ATTRIBUTE_UNUSED,
                          _("mount is not supported on this platform."));
     return -1;
 }
-#endif /* !defined(HAVE_SYS_MOUNT_H) */
+#endif /* !defined(__linux__) || !defined(HAVE_SYS_MOUNT_H) */
 
 
 #if defined(HAVE_SYS_ACL_H)