From nobody Fri Apr 26 20:44:42 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; dmarc=fail(p=none dis=none) header.from=linux.ibm.com Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1539158662463501.1066087911396; Wed, 10 Oct 2018 01:04:22 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id CFD7637E74; Wed, 10 Oct 2018 08:04:20 +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 3383B80F95; Wed, 10 Oct 2018 08:04:20 +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 3B92F4BB79; Wed, 10 Oct 2018 08:04:19 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id w9A84HkW001787 for ; Wed, 10 Oct 2018 04:04:17 -0400 Received: by smtp.corp.redhat.com (Postfix) id C359C183D1; Wed, 10 Oct 2018 08:04:17 +0000 (UTC) Received: from mx1.redhat.com (ext-mx07.extmail.prod.ext.phx2.redhat.com [10.5.110.31]) by smtp.corp.redhat.com (Postfix) with ESMTPS id B8818608E8 for ; Wed, 10 Oct 2018 08:04:14 +0000 (UTC) Received: from mx0a-001b2d01.pphosted.com (mx0b-001b2d01.pphosted.com [148.163.158.5]) (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 D8289C04F4D6 for ; Wed, 10 Oct 2018 08:04:13 +0000 (UTC) Received: from pps.filterd (m0098419.ppops.net [127.0.0.1]) by mx0b-001b2d01.pphosted.com (8.16.0.22/8.16.0.22) with SMTP id w9A7xfIj112394 for ; Wed, 10 Oct 2018 04:04:13 -0400 Received: from e06smtp03.uk.ibm.com (e06smtp03.uk.ibm.com [195.75.94.99]) by mx0b-001b2d01.pphosted.com with ESMTP id 2n1bxpc5y1-1 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=NOT) for ; Wed, 10 Oct 2018 04:04:13 -0400 Received: from localhost by e06smtp03.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Wed, 10 Oct 2018 09:04:11 +0100 Received: from b06cxnps4074.portsmouth.uk.ibm.com (9.149.109.196) by e06smtp03.uk.ibm.com (192.168.101.133) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; (version=TLSv1/SSLv3 cipher=AES256-GCM-SHA384 bits=256/256) Wed, 10 Oct 2018 09:04:09 +0100 Received: from d06av24.portsmouth.uk.ibm.com (d06av24.portsmouth.uk.ibm.com [9.149.105.60]) by b06cxnps4074.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id w9A847Zg57737366 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Wed, 10 Oct 2018 08:04:08 GMT Received: from d06av24.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 6C52B42042; Wed, 10 Oct 2018 11:03:44 +0100 (BST) Received: from d06av24.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 471E94204D; Wed, 10 Oct 2018 11:03:44 +0100 (BST) Received: from m46lp64.lnxne.boe (unknown [9.152.108.100]) by d06av24.portsmouth.uk.ibm.com (Postfix) with ESMTP; Wed, 10 Oct 2018 11:03:44 +0100 (BST) From: Bjoern Walk To: libvir-list@redhat.com Date: Wed, 10 Oct 2018 10:04:04 +0200 X-TM-AS-GCONF: 00 x-cbid: 18101008-0012-0000-0000-000002B50432 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 18101008-0013-0000-0000-000020E95B50 Message-Id: <20181010080404.169159-1-bwalk@linux.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:, , definitions=2018-10-10_06:, , signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 malwarescore=0 suspectscore=1 phishscore=0 bulkscore=0 spamscore=0 clxscore=1015 lowpriorityscore=0 mlxscore=0 impostorscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1807170000 definitions=main-1810100082 X-Greylist: Sender passed SPF test, Sender IP whitelisted by DNSRBL, ACL 214 matched, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.31]); Wed, 10 Oct 2018 08:04:14 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.31]); Wed, 10 Oct 2018 08:04:14 +0000 (UTC) for IP:'148.163.158.5' DOMAIN:'mx0b-001b2d01.pphosted.com' HELO:'mx0a-001b2d01.pphosted.com' FROM:'bwalk@linux.ibm.com' RCPT:'' X-RedHat-Spam-Score: -0.701 (RCVD_IN_DNSWL_LOW, SPF_PASS) 148.163.158.5 mx0b-001b2d01.pphosted.com 148.163.158.5 mx0b-001b2d01.pphosted.com X-Scanned-By: MIMEDefang 2.78 on 10.5.110.31 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-loop: libvir-list@redhat.com Cc: Bjoern Walk , Marc Hartmayer Subject: [libvirt] [PATCH v3] virfile: fix cast-align error 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: , MIME-Version: 1.0 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.12 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.29]); Wed, 10 Oct 2018 08:04:21 +0000 (UTC) X-ZohoMail: RDMRC_1 RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" From: Marc Hartmayer On s390x the struct member f_type of statsfs is hard coded to 'unsigned int'. Change virFileIsSharedFixFUSE() to take a 'long long int' and use a temporary to avoid pointer-casting. This fixes the following error: ../../src/util/virfile.c:3578:38: error: cast increases required alignment = of target type [-Werror=3Dcast-align] virFileIsSharedFixFUSE(path, (long *) &sb.f_type); Signed-off-by: Marc Hartmayer Signed-off-by: Bjoern Walk --- src/util/virfile.c | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/src/util/virfile.c b/src/util/virfile.c index 2a7e8710..067ca569 100644 --- a/src/util/virfile.c +++ b/src/util/virfile.c @@ -3466,7 +3466,7 @@ int virFilePrintf(FILE *fp, const char *msg, ...) =20 static int virFileIsSharedFixFUSE(const char *path, - long *f_type) + long long *f_type) { char *dirpath =3D NULL; const char **mounts =3D NULL; @@ -3537,6 +3537,7 @@ virFileIsSharedFSType(const char *path, char *p; struct statfs sb; int statfs_ret; + long long f_type =3D 0; =20 if (VIR_STRDUP(dirpath, path) < 0) return -1; @@ -3573,32 +3574,34 @@ virFileIsSharedFSType(const char *path, return -1; } =20 - if (sb.f_type =3D=3D FUSE_SUPER_MAGIC) { + f_type =3D sb.f_type; + + if (f_type =3D=3D FUSE_SUPER_MAGIC) { VIR_DEBUG("Found FUSE mount for path=3D%s. Trying to fix it", path= ); - virFileIsSharedFixFUSE(path, (long *) &sb.f_type); + virFileIsSharedFixFUSE(path, &f_type); } =20 VIR_DEBUG("Check if path %s with FS magic %lld is shared", - path, (long long int)sb.f_type); + path, f_type); =20 if ((fstypes & VIR_FILE_SHFS_NFS) && - (sb.f_type =3D=3D NFS_SUPER_MAGIC)) + (f_type =3D=3D NFS_SUPER_MAGIC)) return 1; =20 if ((fstypes & VIR_FILE_SHFS_GFS2) && - (sb.f_type =3D=3D GFS2_MAGIC)) + (f_type =3D=3D GFS2_MAGIC)) return 1; if ((fstypes & VIR_FILE_SHFS_OCFS) && - (sb.f_type =3D=3D OCFS2_SUPER_MAGIC)) + (f_type =3D=3D OCFS2_SUPER_MAGIC)) return 1; if ((fstypes & VIR_FILE_SHFS_AFS) && - (sb.f_type =3D=3D AFS_FS_MAGIC)) + (f_type =3D=3D AFS_FS_MAGIC)) return 1; if ((fstypes & VIR_FILE_SHFS_SMB) && - (sb.f_type =3D=3D SMB_SUPER_MAGIC)) + (f_type =3D=3D SMB_SUPER_MAGIC)) return 1; if ((fstypes & VIR_FILE_SHFS_CIFS) && - (sb.f_type =3D=3D CIFS_SUPER_MAGIC)) + (f_type =3D=3D CIFS_SUPER_MAGIC)) return 1; =20 return 0; --=20 2.17.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list