From nobody Thu May 2 21:59:54 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; envelope-from=libvir-list-bounces@redhat.com; helo=mx1.redhat.com; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1551118769946808.5584264964056; Mon, 25 Feb 2019 10:19:29 -0800 (PST) Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 5EE2A5D671; Mon, 25 Feb 2019 18:19:26 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id F1FC65D9CC; Mon, 25 Feb 2019 18:19:24 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id 908973FB11; Mon, 25 Feb 2019 18:19:20 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id x1PIJJQc029820 for ; Mon, 25 Feb 2019 13:19:19 -0500 Received: by smtp.corp.redhat.com (Postfix) id 933B05D9D6; Mon, 25 Feb 2019 18:19:19 +0000 (UTC) Received: from mx1.redhat.com (ext-mx02.extmail.prod.ext.phx2.redhat.com [10.5.110.26]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 8EC285D9D1 for ; Mon, 25 Feb 2019 18:19:17 +0000 (UTC) Received: from smtpauth1.cnaf.infn.it (smtpauth1.cnaf.infn.it [131.154.3.55]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 46F3781F19 for ; Mon, 25 Feb 2019 18:19:15 +0000 (UTC) Received: from pcdmichelotto.cnaf.infn.it (pcdmichelotto.cnaf.infn.it [172.16.10.50]) (authenticated bits=0) by smtpauth1.cnaf.infn.it (8.14.5/8.14.5) with ESMTP id x1PIErRh003744 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Mon, 25 Feb 2019 19:14:56 +0100 From: Diego Michelotto To: libvir-list@redhat.com Date: Mon, 25 Feb 2019 19:19:03 +0100 Message-Id: <20190225181903.24442-1-diego.michelotto@cnaf.infn.it> MIME-Version: 1.0 X-Greylist: Sender passed SPF test, Sender IP whitelisted by DNSRBL, ACL 216 matched, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.26]); Mon, 25 Feb 2019 18:19:16 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.26]); Mon, 25 Feb 2019 18:19:16 +0000 (UTC) for IP:'131.154.3.55' DOMAIN:'smtpauth1.cnaf.infn.it' HELO:'smtpauth1.cnaf.infn.it' FROM:'diego.michelotto@cnaf.infn.it' RCPT:'' X-RedHat-Spam-Score: -2.3 (RCVD_IN_DNSWL_MED) 131.154.3.55 smtpauth1.cnaf.infn.it 131.154.3.55 smtpauth1.cnaf.infn.it X-Scanned-By: MIMEDefang 2.78 on 10.5.110.26 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-loop: libvir-list@redhat.com Cc: dmichelotto Subject: [libvirt] [PATCH] virfile: added GPFS as shared fs X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.39]); Mon, 25 Feb 2019 18:19:28 +0000 (UTC) Content-Type: text/plain; charset="utf-8" From: dmichelotto 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=3D1679528 Signed-off-by: Diego Michelotto --- 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 =20 # define PROC_MOUNTS "/proc/mounts" =20 @@ -3613,6 +3616,9 @@ virFileIsSharedFSType(const char *path, if ((fstypes & VIR_FILE_SHFS_CEPH) && (f_type =3D=3D CEPH_SUPER_MAGIC)) return 1; + if ((fstypes & VIR_FILE_SHFS_GPFS) && + (f_type =3D=3D GPFS_SUPER_MAGIC)) + return 1; =20 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); } =20 =20 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 =3D (1 << 4), VIR_FILE_SHFS_CIFS =3D (1 << 5), VIR_FILE_SHFS_CEPH =3D (1 << 6), + VIR_FILE_SHFS_GPFS =3D (1 << 7), }; =20 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=3Dcephfs,secret=3D,acl,wsize=3D16777216 0 0 192.168.0.1,192.168.0.2,192.168.0.3:/ceph/data2 /ceph/multi ceph rw,noatim= e,name=3Dcephfs,secret=3D,acl,wsize=3D16777216 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 =20 =20 static int @@ -137,6 +140,8 @@ statfs_mock(const char *mtab, ftype =3D FUSE_SUPER_MAGIC; } else if (STRPREFIX(mb.mnt_type, "ceph")) { ftype =3D CEPH_SUPER_MAGIC; + } else if (STRPREFIX(mb.mnt_type, "gpfs")) { + ftype =3D GPFS_SUPER_MAGIC; } else { /* Everything else is EXT4. We don't care really for other pat= hs. */ ftype =3D 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", tr= ue); 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); =20 return ret !=3D 0 ? EXIT_FAILURE : EXIT_SUCCESS; } --=20 2.20.1 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list