]> xenbits.xensource.com Git - libvirt.git/commitdiff
util: whitelist Oracle ACFS as a shared filesystem
authorDaniel P. Berrangé <berrange@redhat.com>
Tue, 26 Nov 2019 16:29:47 +0000 (16:29 +0000)
committerDaniel P. Berrangé <berrange@redhat.com>
Wed, 27 Nov 2019 14:19:57 +0000 (14:19 +0000)
The magic number is taken from the coreutils stat.c file since
there is no constant for it in normal system headers.

Reviewed-by: Daniel Henrique Barboza <danielhb413@gmail.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
src/util/virfile.c
src/util/virfile.h

index fca7ff9d35e3bdf5f8dabedcace9c62e192874d2..3dd2b1a52734fa43292f89630bba3a589520a59c 100644 (file)
@@ -3426,6 +3426,8 @@ int virFilePrintf(FILE *fp, const char *msg, ...)
 #  define QB_MAGIC 0x51626d6e
 # endif
 
+# define VIR_ACFS_MAGIC 0x61636673
+
 # define PROC_MOUNTS "/proc/mounts"
 
 static int
@@ -3578,6 +3580,9 @@ virFileIsSharedFSType(const char *path,
     if ((fstypes & VIR_FILE_SHFS_QB) &&
         (f_type == QB_MAGIC))
         return 1;
+    if ((fstypes & VIR_FILE_SHFS_ACFS) &&
+        (f_type == VIR_ACFS_MAGIC))
+        return 1;
 
     return 0;
 }
@@ -3765,7 +3770,8 @@ int virFileIsSharedFS(const char *path)
                                  VIR_FILE_SHFS_CIFS |
                                  VIR_FILE_SHFS_CEPH |
                                  VIR_FILE_SHFS_GPFS|
-                                 VIR_FILE_SHFS_QB);
+                                 VIR_FILE_SHFS_QB |
+                                 VIR_FILE_SHFS_ACFS);
 }
 
 
index 9a8709b52ca4974293be04336edba5266ca1ec40..bcae40ee06d66146835010e6341ea75e8e305405 100644 (file)
@@ -209,6 +209,7 @@ enum {
     VIR_FILE_SHFS_CEPH = (1 << 6),
     VIR_FILE_SHFS_GPFS = (1 << 7),
     VIR_FILE_SHFS_QB = (1 << 8),
+    VIR_FILE_SHFS_ACFS = (1 << 9),
 };
 
 int virFileIsSharedFSType(const char *path, int fstypes) ATTRIBUTE_NONNULL(1);