[PATCH] util: file: Mark 'BeeGFS' as shared filesystem

Peter Krempa posted 1 patch 9 months, 2 weeks ago
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/libvirt tags/patchew/0a2abb99d09a2fb7ea5f179e9d50c941270755c4.1690282628.git.pkrempa@redhat.com
src/util/virfile.c | 6 +++++-
src/util/virfile.h | 1 +
2 files changed, 6 insertions(+), 1 deletion(-)
[PATCH] util: file: Mark 'BeeGFS' as shared filesystem
Posted by Peter Krempa 9 months, 2 weeks ago
BeeGFS is a shared/distributed filesystem:

https://doc.beegfs.io/latest/overview/overview.html

Mark it as shared based on it's magic number:

https://git.beegfs.io/pub/v7/-/blob/master/client_module/source/filesystem/FhgfsOpsSuper.h#L14

Closes: https://gitlab.com/libvirt/libvirt/-/issues/508
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
---
 src/util/virfile.c | 6 +++++-
 src/util/virfile.h | 1 +
 2 files changed, 6 insertions(+), 1 deletion(-)

diff --git a/src/util/virfile.c b/src/util/virfile.c
index 7c44a2a963..2984e2ead2 100644
--- a/src/util/virfile.c
+++ b/src/util/virfile.c
@@ -3382,6 +3382,8 @@ virFileRemoveLastComponent(char *path)
 # endif

 # define VIR_ACFS_MAGIC 0x61636673
+/* https://git.beegfs.io/pub/v7/-/blob/master/client_module/source/filesystem/FhgfsOpsSuper.h#L14 */
+# define VIR_BEEGFS_MAGIC 0x19830326 /* formerly fhgfs */

 # define PROC_MOUNTS "/proc/mounts"

@@ -3469,6 +3471,7 @@ static const struct virFileSharedFsData virFileSharedFs[] = {
     { .fstype = VIR_FILE_SHFS_CEPH, .magic = CEPH_SUPER_MAGIC },
     { .fstype = VIR_FILE_SHFS_GPFS, .magic = GPFS_SUPER_MAGIC },
     { .fstype = VIR_FILE_SHFS_ACFS, .magic = VIR_ACFS_MAGIC },
+    { .fstype = VIR_FILE_SHFS_BEEGFS, .magic = VIR_BEEGFS_MAGIC },
 };


@@ -3719,7 +3722,8 @@ int virFileIsSharedFS(const char *path)
                                  VIR_FILE_SHFS_GPFS|
                                  VIR_FILE_SHFS_QB |
                                  VIR_FILE_SHFS_ACFS |
-                                 VIR_FILE_SHFS_GLUSTERFS);
+                                 VIR_FILE_SHFS_GLUSTERFS |
+                                 VIR_FILE_SHFS_BEEGFS);
 }


diff --git a/src/util/virfile.h b/src/util/virfile.h
index b75a7cc53b..60bb1d64e7 100644
--- a/src/util/virfile.h
+++ b/src/util/virfile.h
@@ -226,6 +226,7 @@ enum {
     VIR_FILE_SHFS_QB = (1 << 8), /* Quobyte shared filesystem */
     VIR_FILE_SHFS_ACFS = (1 << 9), /* Oracle ASM Cluster File System */
     VIR_FILE_SHFS_GLUSTERFS = (1 << 10), /* gluster's FUSE-based client */
+    VIR_FILE_SHFS_BEEGFS = (1 << 11), /* BeeGFS/fhGFS */
 };

 int virFileIsSharedFSType(const char *path, unsigned int fstypes) ATTRIBUTE_NONNULL(1);
-- 
2.41.0
Re: [PATCH] util: file: Mark 'BeeGFS' as shared filesystem
Posted by Daniel P. Berrangé 9 months, 2 weeks ago
On Tue, Jul 25, 2023 at 12:57:08PM +0200, Peter Krempa wrote:
> BeeGFS is a shared/distributed filesystem:
> 
> https://doc.beegfs.io/latest/overview/overview.html
> 
> Mark it as shared based on it's magic number:
> 
> https://git.beegfs.io/pub/v7/-/blob/master/client_module/source/filesystem/FhgfsOpsSuper.h#L14
> 
> Closes: https://gitlab.com/libvirt/libvirt/-/issues/508
> Signed-off-by: Peter Krempa <pkrempa@redhat.com>
> ---
>  src/util/virfile.c | 6 +++++-
>  src/util/virfile.h | 1 +
>  2 files changed, 6 insertions(+), 1 deletion(-)

Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>



With regards,
Daniel
-- 
|: https://berrange.com      -o-    https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org         -o-            https://fstop138.berrange.com :|
|: https://entangle-photo.org    -o-    https://www.instagram.com/dberrange :|