On 5/28/19 2:55 PM, Silvan Kaiser wrote:
Adds detection of a Quobyte shared file system for
live migration.
Signed-off-by: Silvan Kaiser <silvan(a)quobyte.com>
---
src/util/virfile.c | 13 ++++++++++++-
src/util/virfile.h | 1 +
tests/virfiledata/mounts3.txt | 1 +
tests/virfilemock.c | 3 +++
tests/virfiletest.c | 1 +
5 files changed, 18 insertions(+), 1 deletion(-)
diff --git a/src/util/virfile.c b/src/util/virfile.c
index f7415cf633..a46b8792f6 100644
--- a/src/util/virfile.c
+++ b/src/util/virfile.c
@@ -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);
}
diff --git a/src/util/virfile.h b/src/util/virfile.h
index 641960e2ca..e06855ea86 100644
--- a/src/util/virfile.h
+++ b/src/util/virfile.h
@@ -212,6 +212,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);
diff --git a/tests/virfiledata/mounts3.txt b/tests/virfiledata/mounts3.txt
index 4377e5d471..b91804a4e4 100644
--- a/tests/virfiledata/mounts3.txt
+++ b/tests/virfiledata/mounts3.txt
@@ -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(a)192.168.0.1/data /quobyte fuse.quobyte
rw,nosuid,nodev,noatime,user_id=0,group_id=0,allow_other 0 0
diff --git a/tests/virfilemock.c b/tests/virfilemock.c
index 106032f857..54c57d417b 100644
--- a/tests/virfilemock.c
+++ b/tests/virfilemock.c
@@ -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
Misaligned lines. I'll fix that before push.
But before ACK and push this, is there some place I can verify this
magic number? Also, just to make sure we are on the same page here, a
sole fact that a FS is distributed does not qualify it for being
detected as shared FS by libvirt. Because of how qemu handles migration,
libvirt can allow only those shared FS which are also cache coherent. I
have no experience with quobyte and it looks like a proprietary
solution. Wasn't it formerly known as XtreemFS?
Michal