]> xenbits.xensource.com Git - libvirt.git/commitdiff
virfile: Add Quobyte as a shared fs
authorSilvan Kaiser <silvan@quobyte.com>
Tue, 28 May 2019 12:55:29 +0000 (14:55 +0200)
committerMichal Privoznik <mprivozn@redhat.com>
Fri, 19 Jul 2019 08:52:06 +0000 (10:52 +0200)
This adds detection of a Quobyte as a shared file system for live
migration.

Signed-off-by: Silvan Kaiser <silvan@quobyte.com>
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
src/util/virfile.c
src/util/virfile.h
tests/virfiledata/mounts3.txt
tests/virfilemock.c
tests/virfiletest.c

index b351f72bef8cd7187758d567eaf132c80d51eebe..082aac12c8bce75f1a5eeb93ec8a01d877895a14 100644 (file)
@@ -3434,6 +3434,9 @@ int virFilePrintf(FILE *fp, const char *msg, ...)
 # ifndef GPFS_SUPER_MAGIC
 #  define GPFS_SUPER_MAGIC 0x47504653
 # endif
+# ifndef QB_MAGIC
+#  define QB_MAGIC 0x51626d6e
+# endif
 
 # define PROC_MOUNTS "/proc/mounts"
 
@@ -3490,6 +3493,10 @@ virFileIsSharedFixFUSE(const char *path,
         VIR_DEBUG("Found gluster FUSE mountpoint=%s for path=%s. "
                   "Fixing shared FS type", mntDir, canonPath);
         *f_type = GFS2_MAGIC;
+    } else if (STREQ_NULLABLE(mntType, "fuse.quobyte")) {
+        VIR_DEBUG("Found Quobyte FUSE mountpoint=%s for path=%s. "
+                  "Fixing shared FS type", mntDir, canonPath);
+        *f_type = QB_MAGIC;
     }
 
     ret = 0;
@@ -3582,6 +3589,9 @@ virFileIsSharedFSType(const char *path,
     if ((fstypes & VIR_FILE_SHFS_GPFS) &&
         (f_type == GPFS_SUPER_MAGIC))
         return 1;
+    if ((fstypes & VIR_FILE_SHFS_QB) &&
+        (f_type == QB_MAGIC))
+        return 1;
 
     return 0;
 }
@@ -3771,7 +3781,8 @@ int virFileIsSharedFS(const char *path)
                                  VIR_FILE_SHFS_SMB |
                                  VIR_FILE_SHFS_CIFS |
                                  VIR_FILE_SHFS_CEPH |
-                                 VIR_FILE_SHFS_GPFS);
+                                 VIR_FILE_SHFS_GPFS|
+                                 VIR_FILE_SHFS_QB);
 }
 
 
index c2d1b36c85c58a552a6ce871368f0c2f7c150d05..a8a5dd8074048f184270c1fd724caf85386b3261 100644 (file)
@@ -211,6 +211,7 @@ enum {
     VIR_FILE_SHFS_CIFS = (1 << 5),
     VIR_FILE_SHFS_CEPH = (1 << 6),
     VIR_FILE_SHFS_GPFS = (1 << 7),
+    VIR_FILE_SHFS_QB = (1 << 8),
 };
 
 int virFileIsSharedFSType(const char *path, int fstypes) ATTRIBUTE_NONNULL(1);
index 4377e5d471041a8625f51f641b11bd9965e198d6..b91804a4e4b6455480e167e154ad955a543c4e9c 100644 (file)
@@ -36,3 +36,4 @@ 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
+quobyte@192.168.0.1/data /quobyte fuse.quobyte rw,nosuid,nodev,noatime,user_id=0,group_id=0,allow_other 0 0
index 106032f857c2e2b76bac05908a3218332de18b31..6d1153dd9f4229e11665c95b19ba9e374cfb53f4 100644 (file)
@@ -92,6 +92,9 @@ setmntent(const char *filename, const char *type)
 #ifndef GPFS_SUPER_MAGIC
 # define GPFS_SUPER_MAGIC 0x47504653
 #endif
+#ifndef QB_MAGIC
+# define QB_MAGIC 0x51626d6e
+#endif
 
 
 static int
index e2bd4953ede8c2c733504b2050d0957d71d3a012..aa4c3435e5313a9841eca5483c397231437dfe83 100644 (file)
@@ -458,6 +458,7 @@ mymain(void)
     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);
+    DO_TEST_FILE_IS_SHARED_FS_TYPE("mounts3.txt", "/quobyte", true);
 
     return ret != 0 ? EXIT_FAILURE : EXIT_SUCCESS;
 }