[libvirt] [PATCH 0/1] virfile: added GPFS as shared fs

Added GPFS as shared file system recognized during live migration security checks. This becomes from upstream code on https://libvirt.org/git from master branch BUG: https://bugzilla.redhat.com/show_bug.cgi?id=1679528 dmichelotto (1): virfile: added GPFS as shared fs src/util/virfile.c | 9 ++++++++- src/util/virfile.h | 1 + tests/virfiledata/mounts3.txt | 1 + tests/virfilemock.c | 5 +++++ tests/virfiletest.c | 1 + 5 files changed, 16 insertions(+), 1 deletion(-) -- 2.20.1

Added GPFS as shared file system recognized during live migration security checks. This becomes from upstream code on https://libvirt.org/git from master branch BUG: https://bugzilla.redhat.com/show_bug.cgi?id=1679528 --- src/util/virfile.c | 9 ++++++++- src/util/virfile.h | 1 + tests/virfiledata/mounts3.txt | 1 + tests/virfilemock.c | 5 +++++ tests/virfiletest.c | 1 + 5 files changed, 16 insertions(+), 1 deletion(-) diff --git a/src/util/virfile.c b/src/util/virfile.c index 271bf5e796..615c287104 100644 --- a/src/util/virfile.c +++ b/src/util/virfile.c @@ -3468,6 +3468,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" @@ -3613,6 +3616,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; } @@ -3776,7 +3782,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); } diff --git a/src/util/virfile.h b/src/util/virfile.h index be612af770..0b946fe1ca 100644 --- a/src/util/virfile.h +++ b/src/util/virfile.h @@ -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); diff --git a/tests/virfiledata/mounts3.txt b/tests/virfiledata/mounts3.txt index 68eded048c..4377e5d471 100644 --- a/tests/virfiledata/mounts3.txt +++ b/tests/virfiledata/mounts3.txt @@ -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 diff --git a/tests/virfilemock.c b/tests/virfilemock.c index 499135d773..89e14c5b67 100644 --- a/tests/virfilemock.c +++ b/tests/virfilemock.c @@ -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; diff --git a/tests/virfiletest.c b/tests/virfiletest.c index f90c611ac4..e2bd4953ed 100644 --- a/tests/virfiletest.c +++ b/tests/virfiletest.c @@ -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; } -- 2.20.1

On Mon, Feb 25, 2019 at 09:39:39 +0100, dmichelotto wrote:
Added GPFS as shared file system recognized during live migration security checks.
You could mention that GPFS stands for 'IBM General Parallel File System (GPFS)'.
This becomes from upstream code on https://libvirt.org/git from master branch
This should not be part of the commit message.
BUG: https://bugzilla.redhat.com/show_bug.cgi?id=1679528 ---
Please note that the libvirt project requires that you comply with the developer certificate of origin. See https://libvirt.org/hacking.html#patches part 6 and https://developercertificate.org/. Also we prefer if you use full name as the author when sending the patch.
src/util/virfile.c | 9 ++++++++- src/util/virfile.h | 1 + tests/virfiledata/mounts3.txt | 1 + tests/virfilemock.c | 5 +++++ tests/virfiletest.c | 1 + 5 files changed, 16 insertions(+), 1 deletion(-)
The changes look good to me but I'd prefer if you send the patch again including the sign-off and proper name.

Hi Peter
Il giorno 25 feb 2019, alle ore 13:28, Peter Krempa <pkrempa@redhat.com> ha scritto:
On Mon, Feb 25, 2019 at 09:39:39 +0100, dmichelotto wrote: Added GPFS as shared file system recognized during live migration security checks.
You could mention that GPFS stands for 'IBM General Parallel File System (GPFS)'.
OK, I’ll change it.
This becomes from upstream code on https://libvirt.org/git from master branch
This should not be part of the commit message.
Ok, I’ll remove it.
BUG: https://bugzilla.redhat.com/show_bug.cgi?id=1679528 ---
Please note that the libvirt project requires that you comply with the developer certificate of origin. See https://libvirt.org/hacking.html#patches part 6 and https://developercertificate.org/.
Is it enough if I add --signoff option and my full name at the last commit?
Also we prefer if you use full name as the author when sending the patch.
src/util/virfile.c | 9 ++++++++- src/util/virfile.h | 1 + tests/virfiledata/mounts3.txt | 1 + tests/virfilemock.c | 5 +++++ tests/virfiletest.c | 1 + 5 files changed, 16 insertions(+), 1 deletion(-)
The changes look good to me but I'd prefer if you send the patch again including the sign-off and proper name.
I’m very sorry for my mistakes, it’s the first libvirt patch for me. I’ll summit the new patch soon. All the best Diego

On Mon, Feb 25, 2019 at 17:39:46 +0100, Diego Michelotto wrote:
Hi Peter
Il giorno 25 feb 2019, alle ore 13:28, Peter Krempa <pkrempa@redhat.com> ha scritto:
On Mon, Feb 25, 2019 at 09:39:39 +0100, dmichelotto wrote: Added GPFS as shared file system recognized during live migration security checks.
You could mention that GPFS stands for 'IBM General Parallel File System (GPFS)'.
OK, I’ll change it.
This becomes from upstream code on https://libvirt.org/git from master branch
This should not be part of the commit message.
Ok, I’ll remove it.
BUG: https://bugzilla.redhat.com/show_bug.cgi?id=1679528 ---
Please note that the libvirt project requires that you comply with the developer certificate of origin. See https://libvirt.org/hacking.html#patches part 6 and https://developercertificate.org/.
Is it enough if I add --signoff option and my full name at the last commit?
Yes, that's exactly what we require. I just prefer wording it carefully so that I don't say "you need to add a Signed-off-by: ... line" where it might not be clear that it has a formal meaning.
Also we prefer if you use full name as the author when sending the patch.
src/util/virfile.c | 9 ++++++++- src/util/virfile.h | 1 + tests/virfiledata/mounts3.txt | 1 + tests/virfilemock.c | 5 +++++ tests/virfiletest.c | 1 + 5 files changed, 16 insertions(+), 1 deletion(-)
The changes look good to me but I'd prefer if you send the patch again including the sign-off and proper name.
I’m very sorry for my mistakes, it’s the first libvirt patch for me.
That's all right, you did good in the code department, just a few formal improvements needed.
participants (3)
-
Diego Michelotto
-
dmichelotto
-
Peter Krempa