From nobody Sun May 19 02:26:37 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 15510964765392.36979637550769; Mon, 25 Feb 2019 04:07:56 -0800 (PST) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id C23745944B; Mon, 25 Feb 2019 12:07:54 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 977C35C22D; Mon, 25 Feb 2019 12:07:54 +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 502AD1819AFA; Mon, 25 Feb 2019 12:07:54 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id x1P8cI83022240 for ; Mon, 25 Feb 2019 03:38:19 -0500 Received: by smtp.corp.redhat.com (Postfix) id E53095D71C; Mon, 25 Feb 2019 08:38:18 +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 DF7585D71A for ; Mon, 25 Feb 2019 08:38:16 +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 1FE3786674 for ; Mon, 25 Feb 2019 08:38: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 x1P8XhNR026351 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Mon, 25 Feb 2019 09:34:00 +0100 From: dmichelotto To: libvir-list@redhat.com Date: Mon, 25 Feb 2019 09:37:55 +0100 Message-Id: <20190225083755.2911-2-diego.michelotto@cnaf.infn.it> In-Reply-To: <20190225083755.2911-1-diego.michelotto@cnaf.infn.it> References: <20190225083755.2911-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 08:38:15 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.26]); Mon, 25 Feb 2019 08:38:15 +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.15 X-loop: libvir-list@redhat.com X-Mailman-Approved-At: Mon, 25 Feb 2019 06:57:24 -0500 Cc: dmichelotto Subject: [libvirt] [PATCH 1/1] 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.16 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.39]); Mon, 25 Feb 2019 12:07:55 +0000 (UTC) Content-Type: text/plain; charset="utf-8" Added GPFS as shared file system recognized during live migration security checks. This patch is based on libvirt-4.5.0 distributed by CentOS 7.6.1810 via source rpm. The rpms builded fix our bug with GPFS. BUG: https://bugzilla.redhat.com/show_bug.cgi?id=3D1679528 --- 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 716b55d..59bf619 100644 --- a/src/util/virfile.c +++ b/src/util/virfile.c @@ -3537,6 +3537,9 @@ int virFilePrintf(FILE *fp, const char *msg, ...) # ifndef FUSE_SUPER_MAGIC # define FUSE_SUPER_MAGIC 0x65735546 # endif +# ifndef GPFS_SUPER_MAGIC +# define GPFS_SUPER_MAGIC 0x47504653 +# endif =20 # define PROC_MOUNTS "/proc/mounts" =20 @@ -3682,6 +3685,9 @@ virFileIsSharedFSType(const char *path, if ((fstypes & VIR_FILE_SHFS_CIFS) && (f_type =3D=3D CIFS_SUPER_MAGIC)) return 1; + if ((fstypes & VIR_FILE_SHFS_GPFS) && + (f_type =3D=3D GPFS_SUPER_MAGIC)) + return 1; =20 return 0; } @@ -3845,7 +3851,8 @@ int virFileIsSharedFS(const char *path) VIR_FILE_SHFS_OCFS | VIR_FILE_SHFS_AFS | VIR_FILE_SHFS_SMB | - VIR_FILE_SHFS_CIFS); + VIR_FILE_SHFS_CIFS | + VIR_FILE_SHFS_GPFS); } =20 =20 diff --git a/src/util/virfile.h b/src/util/virfile.h index 6f1e802..a26be1e 100644 --- a/src/util/virfile.h +++ b/src/util/virfile.h @@ -205,6 +205,7 @@ enum { VIR_FILE_SHFS_AFS =3D (1 << 3), VIR_FILE_SHFS_SMB =3D (1 << 4), VIR_FILE_SHFS_CIFS =3D (1 << 5), + 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 134c6e8..a6cea9d 100644 --- a/tests/virfiledata/mounts3.txt +++ b/tests/virfiledata/mounts3.txt @@ -33,3 +33,4 @@ host:/nfs /nfs nfs4 rw,relatime,vers=3D4.1,rsize=3D104857= 6,wsize=3D1048576,namlen=3D255, dev /nfs/blah devtmpfs rw,nosuid,relatime,size=3D10240k,nr_inodes=3D409306= 0,mode=3D755 0 0 host:/gv0 /gluster fuse.glusterfs rw 0 0 root@host:/tmp/mkdir /gluster/sshfs fuse.sshfs rw 0 0 +gpfs_data /gpfs/data gpfs rw,relatime 0 0 diff --git a/tests/virfilemock.c b/tests/virfilemock.c index ae5c8d0..bf721cf 100644 --- a/tests/virfilemock.c +++ b/tests/virfilemock.c @@ -88,6 +88,9 @@ setmntent(const char *filename, const char *type) #ifndef FUSE_SUPER_MAGIC # define FUSE_SUPER_MAGIC 0x65735546 #endif +#ifndef GPFS_SUPER_MAGIC +# define GPFS_SUPER_MAGIC 0x47504653 +#endif =20 =20 static int @@ -134,6 +137,8 @@ statfs_mock(const char *mtab, ftype =3D CIFS_SUPER_MAGIC; } else if (STRPREFIX(mb.mnt_type, "fuse")) { ftype =3D FUSE_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 a246d60..9d9ab2f 100644 --- a/tests/virfiletest.c +++ b/tests/virfiletest.c @@ -458,6 +458,7 @@ mymain(void) DO_TEST_FILE_IS_SHARED_FS_TYPE("mounts3.txt", "/gluster/file", true); DO_TEST_FILE_IS_SHARED_FS_TYPE("mounts3.txt", "/gluster/sshfs/file", f= alse); DO_TEST_FILE_IS_SHARED_FS_TYPE("mounts3.txt", "/some/symlink/file", tr= ue); + 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