From nobody Sun May 5 18:54:49 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 1503574483657382.1522504754429; Thu, 24 Aug 2017 04:34:43 -0700 (PDT) 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 EA8144ACA5; Thu, 24 Aug 2017 11:34:41 +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 CC5F17B5EB; Thu, 24 Aug 2017 11:34:41 +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 6B4203FACE; Thu, 24 Aug 2017 11:34:41 +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 v7OBYd3a012398 for ; Thu, 24 Aug 2017 07:34:39 -0400 Received: by smtp.corp.redhat.com (Postfix) id 9260C7F1AE; Thu, 24 Aug 2017 11:34:39 +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 C03D76F107; Thu, 24 Aug 2017 11:34:37 +0000 (UTC) Received: from SMTP02.CITRIX.COM (smtp02.citrix.com [66.165.176.63]) (using TLSv1.2 with cipher RC4-SHA (112/128 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 6B971C04B930; Thu, 24 Aug 2017 11:34:36 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com EA8144ACA5 Authentication-Results: ext-mx09.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=citrix.com Authentication-Results: ext-mx09.extmail.prod.ext.phx2.redhat.com; spf=fail smtp.mailfrom=libvir-list-bounces@redhat.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com EA8144ACA5 DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 6B971C04B930 Authentication-Results: ext-mx07.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=citrix.com Authentication-Results: ext-mx07.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=prvs=4025baddc=George.Dunlap@citrix.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com 6B971C04B930 X-IronPort-AV: E=Sophos;i="5.41,421,1498521600"; d="scan'208";a="444968116" From: George Dunlap To: Date: Thu, 24 Aug 2017 12:34:13 +0100 Message-ID: <20170824113413.28884-1-george.dunlap@citrix.com> MIME-Version: 1.0 X-Greylist: Sender passed SPF test, Sender IP whitelisted by DNSRBL, ACL 205 matched, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.31]); Thu, 24 Aug 2017 11:34:37 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.31]); Thu, 24 Aug 2017 11:34:37 +0000 (UTC) for IP:'66.165.176.63' DOMAIN:'smtp02.citrix.com' HELO:'SMTP02.CITRIX.COM' FROM:'George.Dunlap@citrix.com' RCPT:'' X-RedHat-Spam-Score: -2.323 (RCVD_IN_DNSWL_MED, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, RP_MATCHES_RCVD, SPF_HELO_PASS, SPF_PASS) 66.165.176.63 smtp02.citrix.com 66.165.176.63 smtp02.citrix.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: xen-devel@xenproject.org, George Dunlap Subject: [libvirt] [PATCH] libxl: Avoid a variable named 'stat' 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.38]); Thu, 24 Aug 2017 11:34:42 +0000 (UTC) X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" Using a variable named 'stat' clashes with the system function 'stat()' causing compiler warnings on some platforms: libxl/libxl_driver.c: In function 'libxlDomainBlockStatsVBD': libxl/libxl_driver.c:5387: error: declaration of 'stat' shadows a global de= claration [-Wshadow] /usr/include/sys/stat.h:455: error: shadowed declaration is here [-Wshadow] Signed-off-by: George Dunlap Reviewed-by: Andrea Bolognani --- CC: Daniel P. Berrange CC: Jim Fehlig CC: xen-devel@xenproject.org CC: libvir-list@redhat.com --- src/libxl/libxl_driver.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/libxl/libxl_driver.c b/src/libxl/libxl_driver.c index c261e2155..4c7775358 100644 --- a/src/libxl/libxl_driver.c +++ b/src/libxl/libxl_driver.c @@ -5374,7 +5374,7 @@ libxlDomainBlockStatsVBD(virDomainObjPtr vm, int devno =3D libxlDiskPathToID(dev); int size; char *path, *name, *val; - unsigned long long stat; + unsigned long long status; =20 path =3D name =3D val =3D NULL; if (devno < 0) { @@ -5401,12 +5401,12 @@ libxlDomainBlockStatsVBD(virDomainObjPtr vm, # define LIBXL_SET_VBDSTAT(FIELD, VAR, MUL) \ if ((virAsprintf(&name, "%s/"FIELD, path) < 0) || \ (virFileReadAll(name, 256, &val) < 0) || \ - (sscanf(val, "%llu", &stat) !=3D 1)) { \ + (sscanf(val, "%llu", &status) !=3D 1)) { \ virReportError(VIR_ERR_OPERATION_FAILED, \ _("cannot read %s"), name); \ goto cleanup; \ } \ - VAR +=3D (stat * MUL); \ + VAR +=3D (status * MUL); \ VIR_FREE(name); \ VIR_FREE(val); =20 --=20 2.14.1 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list