]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
virfile: added GPFS as shared fs
authorDiego Michelotto <diego.michelotto@cnaf.infn.it>
Mon, 25 Feb 2019 18:19:03 +0000 (19:19 +0100)
committerPeter Krempa <pkrempa@redhat.com>
Tue, 26 Feb 2019 10:41:18 +0000 (11:41 +0100)
Added GPFS as shared file system recognized during live migration
security checks.

GPFS is 'IBM General Parallel File System' also called
'IBM Spectrum Scale'

BUG: https://bugzilla.redhat.com/show_bug.cgi?id=1679528

Signed-off-by: Diego Michelotto <diego.michelotto@cnaf.infn.it>
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
src/util/virfile.c
src/util/virfile.h
tests/virfiledata/mounts3.txt
tests/virfilemock.c
tests/virfiletest.c

index 31030c7b34903872d32f7c96361af169b95b08dc..9208523c471deffa2b833cd291cb9d0dfdf518ef 100644 (file)
@@ -3478,6 +3478,9 @@ int virFilePrintf(FILE *fp, const char *msg, ...)
 # ifndef CEPH_SUPER_MAGIC
 #  define CEPH_SUPER_MAGIC 0x00C36400
 # endif
+# ifndef GPFS_SUPER_MAGIC
+#  define GPFS_SUPER_MAGIC 0x47504653
+# endif
 
 # define PROC_MOUNTS "/proc/mounts"
 
@@ -3623,6 +3626,9 @@ virFileIsSharedFSType(const char *path,
     if ((fstypes & VIR_FILE_SHFS_CEPH) &&
         (f_type == CEPH_SUPER_MAGIC))
         return 1;
+    if ((fstypes & VIR_FILE_SHFS_GPFS) &&
+        (f_type == GPFS_SUPER_MAGIC))
+        return 1;
 
     return 0;
 }
@@ -3786,7 +3792,8 @@ int virFileIsSharedFS(const char *path)
                                  VIR_FILE_SHFS_AFS |
                                  VIR_FILE_SHFS_SMB |
                                  VIR_FILE_SHFS_CIFS |
-                                 VIR_FILE_SHFS_CEPH);
+                                 VIR_FILE_SHFS_CEPH |
+                                 VIR_FILE_SHFS_GPFS);
 }
 
 
index be612af77085bfdc4d90af81d94251eee5d64e88..0b946fe1ca0d3eb4475741e696c8cfda0913a8b1 100644 (file)
@@ -221,6 +221,7 @@ enum {
     VIR_FILE_SHFS_SMB = (1 << 4),
     VIR_FILE_SHFS_CIFS = (1 << 5),
     VIR_FILE_SHFS_CEPH = (1 << 6),
+    VIR_FILE_SHFS_GPFS = (1 << 7),
 };
 
 int virFileIsSharedFSType(const char *path, int fstypes) ATTRIBUTE_NONNULL(1);
index 68eded048c83a4a197a210f7a5627ac62442e2da..4377e5d471041a8625f51f641b11bd9965e198d6 100644 (file)
@@ -35,3 +35,4 @@ host:/gv0 /gluster fuse.glusterfs rw 0 0
 root@host:/tmp/mkdir /gluster/sshfs fuse.sshfs rw 0 0
 192.168.0.1:/ceph/data /ceph ceph rw,noatime,name=cephfs,secret=<hidden>,acl,wsize=16777216 0 0
 192.168.0.1,192.168.0.2,192.168.0.3:/ceph/data2 /ceph/multi ceph rw,noatime,name=cephfs,secret=<hidden>,acl,wsize=16777216 0 0
+gpfs_data /gpfs/data gpfs rw,relatime 0 0
index 499135d7734c3d58766a6478fb539f5a26a4d653..89e14c5b67b44e81f2709cdf1984bcad3dfceac2 100644 (file)
@@ -89,6 +89,9 @@ setmntent(const char *filename, const char *type)
 #ifndef CEPH_SUPER_MAGIC
 # define CEPH_SUPER_MAGIC 0x00c36400
 #endif
+#ifndef GPFS_SUPER_MAGIC
+# define GPFS_SUPER_MAGIC 0x47504653
+#endif
 
 
 static int
@@ -137,6 +140,8 @@ statfs_mock(const char *mtab,
             ftype = FUSE_SUPER_MAGIC;
         } else if (STRPREFIX(mb.mnt_type, "ceph")) {
             ftype = CEPH_SUPER_MAGIC;
+        } else if (STRPREFIX(mb.mnt_type, "gpfs")) {
+            ftype = GPFS_SUPER_MAGIC;
         } else {
             /* Everything else is EXT4. We don't care really for other paths. */
             ftype = EXT4_SUPER_MAGIC;
index f90c611ac49398abd828bb07f1384cc8c929bd9a..e2bd4953ede8c2c733504b2050d0957d71d3a012 100644 (file)
@@ -457,6 +457,7 @@ mymain(void)
     DO_TEST_FILE_IS_SHARED_FS_TYPE("mounts3.txt", "/some/symlink/file", true);
     DO_TEST_FILE_IS_SHARED_FS_TYPE("mounts3.txt", "/ceph/file", true);
     DO_TEST_FILE_IS_SHARED_FS_TYPE("mounts3.txt", "/ceph/multi/file", true);
+    DO_TEST_FILE_IS_SHARED_FS_TYPE("mounts3.txt", "/gpfs/data", true);
 
     return ret != 0 ? EXIT_FAILURE : EXIT_SUCCESS;
 }