From nobody Fri Apr 26 20:41:45 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 1538727144732333.3666591059207; Fri, 5 Oct 2018 01:12:24 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 9E42A307D922; Fri, 5 Oct 2018 08:12:22 +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 53AFE16D31; Fri, 5 Oct 2018 08:12:22 +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 F25483D387; Fri, 5 Oct 2018 08:12:21 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id w958C8Fe009411 for ; Fri, 5 Oct 2018 04:12:08 -0400 Received: by smtp.corp.redhat.com (Postfix) id 497B92E020; Fri, 5 Oct 2018 08:12:08 +0000 (UTC) Received: from mx1.redhat.com (ext-mx15.extmail.prod.ext.phx2.redhat.com [10.5.110.44]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 3F8A116D31 for ; Fri, 5 Oct 2018 08:12:07 +0000 (UTC) Received: from m97138.mail.qiye.163.com (m97138.mail.qiye.163.com [220.181.97.138]) by mx1.redhat.com (Postfix) with ESMTP id 7904330833AF for ; Fri, 5 Oct 2018 08:12:02 +0000 (UTC) Received: from localhost.localdomain (unknown [58.56.27.130]) by smtp9 (Coremail) with SMTP id u+CowAB3p3_PHLdb0blTAg--.62652S3; Fri, 05 Oct 2018 16:12:00 +0800 (CST) From: Shi Lei To: libvir-list@redhat.com Date: Fri, 5 Oct 2018 16:11:24 +0800 Message-Id: <20181005081145.29901-2-shi_lei@massclouds.com> In-Reply-To: <20181005081145.29901-1-shi_lei@massclouds.com> References: <20181005081145.29901-1-shi_lei@massclouds.com> X-CM-TRANSID: u+CowAB3p3_PHLdb0blTAg--.62652S3 X-Coremail-Antispam: 1Uf129KBjDUn29KB7ZKAUJUUUUU529EdanIXcx71UUUUU7v73 VFW2AGmfu7bjvjm3AaLaJ3UbIYCTnIWIevJa73UjIFyTuYvjTRMksgUUUUU X-Originating-IP: [58.56.27.130] X-CM-SenderInfo: pvklsz1hl6ztxvvfz0xxgvhudrp/1tbigRDWT1sfmGbD6QAAsY 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.44]); Fri, 05 Oct 2018 08:12:05 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.44]); Fri, 05 Oct 2018 08:12:05 +0000 (UTC) for IP:'220.181.97.138' DOMAIN:'m97138.mail.qiye.163.com' HELO:'m97138.mail.qiye.163.com' FROM:'shi_lei@massclouds.com' RCPT:'' X-RedHat-Spam-Score: -0.01 (RCVD_IN_DNSWL_NONE) 220.181.97.138 m97138.mail.qiye.163.com 220.181.97.138 m97138.mail.qiye.163.com X-Scanned-By: MIMEDefang 2.84 on 10.5.110.44 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 01/22] access: Fix misaligned arguments 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.84 on 10.5.11.23 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.48]); Fri, 05 Oct 2018 08:12:23 +0000 (UTC) X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" This patch fixes misaligned arguments. Signed-off-by: Shi Lei --- src/access/viraccessdriverpolkit.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/access/viraccessdriverpolkit.c b/src/access/viraccessdrive= rpolkit.c index 6954d74..46d7835 100644 --- a/src/access/viraccessdriverpolkit.c +++ b/src/access/viraccessdriverpolkit.c @@ -367,9 +367,9 @@ virAccessDriverPolkitCheckSecret(virAccessManagerPtr ma= nager, }; =20 return virAccessDriverPolkitCheck(manager, - "secret", - virAccessPermSecretTypeToString(p= erm), - attrs); + "secret", + virAccessPermSecretTypeToString(= perm), + attrs); } break; } } --=20 2.17.1 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Fri Apr 26 20:41:45 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 15387271492232.971775579616974; Fri, 5 Oct 2018 01:12:29 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 0DA46300295F; Fri, 5 Oct 2018 08:12:27 +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 C263669FC3; Fri, 5 Oct 2018 08:12:26 +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 6F5103D38A; Fri, 5 Oct 2018 08:12:26 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.25]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id w958C8ON009418 for ; Fri, 5 Oct 2018 04:12:08 -0400 Received: by smtp.corp.redhat.com (Postfix) id E3162200824A; Fri, 5 Oct 2018 08:12:08 +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 D8FDF20155EC for ; Fri, 5 Oct 2018 08:12:07 +0000 (UTC) Received: from m97138.mail.qiye.163.com (m97138.mail.qiye.163.com [220.181.97.138]) by mx1.redhat.com (Postfix) with ESMTP id DF1538666B for ; Fri, 5 Oct 2018 08:12:04 +0000 (UTC) Received: from localhost.localdomain (unknown [58.56.27.130]) by smtp9 (Coremail) with SMTP id u+CowAB3p3_PHLdb0blTAg--.62652S4; Fri, 05 Oct 2018 16:12:00 +0800 (CST) From: Shi Lei To: libvir-list@redhat.com Date: Fri, 5 Oct 2018 16:11:25 +0800 Message-Id: <20181005081145.29901-3-shi_lei@massclouds.com> In-Reply-To: <20181005081145.29901-1-shi_lei@massclouds.com> References: <20181005081145.29901-1-shi_lei@massclouds.com> X-CM-TRANSID: u+CowAB3p3_PHLdb0blTAg--.62652S4 X-Coremail-Antispam: 1Uf129KBjDUn29KB7ZKAUJUUUUU529EdanIXcx71UUUUU7v73 VFW2AGmfu7bjvjm3AaLaJ3UbIYCTnIWIevJa73UjIFyTuYvjTRNHUDUUUUU X-Originating-IP: [58.56.27.130] X-CM-SenderInfo: pvklsz1hl6ztxvvfz0xxgvhudrp/1tbifBDWT1rpNuEgugAAsL 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.26]); Fri, 05 Oct 2018 08:12:06 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.26]); Fri, 05 Oct 2018 08:12:06 +0000 (UTC) for IP:'220.181.97.138' DOMAIN:'m97138.mail.qiye.163.com' HELO:'m97138.mail.qiye.163.com' FROM:'shi_lei@massclouds.com' RCPT:'' X-RedHat-Spam-Score: -0.01 (RCVD_IN_DNSWL_NONE) 220.181.97.138 m97138.mail.qiye.163.com 220.181.97.138 m97138.mail.qiye.163.com X-Scanned-By: MIMEDefang 2.78 on 10.5.110.26 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.25 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 02/22] admin: Fix misaligned arguments 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.11 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.43]); Fri, 05 Oct 2018 08:12:27 +0000 (UTC) X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" This patch fixes misaligned arguments. Signed-off-by: Shi Lei --- src/admin/admin_server.c | 2 +- src/admin/admin_server_dispatch.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/admin/admin_server.c b/src/admin/admin_server.c index f2c1a8f..f1e9667 100644 --- a/src/admin/admin_server.c +++ b/src/admin/admin_server.c @@ -291,7 +291,7 @@ adminClientGetInfo(virNetServerClientPtr client, if (virIdentityGetSELinuxContext(identity, &attr) < 0 || (attr && virTypedParamsAddString(&tmpparams, nparams, &maxparams, - VIR_CLIENT_INFO_SELINUX_CONTEXT, attr) < 0= )) + VIR_CLIENT_INFO_SELINUX_CONTEXT, attr) < = 0)) goto cleanup; =20 *params =3D tmpparams; diff --git a/src/admin/admin_server_dispatch.c b/src/admin/admin_server_dis= patch.c index b78ff90..83e5953 100644 --- a/src/admin/admin_server_dispatch.c +++ b/src/admin/admin_server_dispatch.c @@ -396,8 +396,8 @@ adminDispatchServerSetClientLimits(virNetServerPtr serv= er ATTRIBUTE_UNUSED, } =20 if (virTypedParamsDeserialize((virTypedParameterRemotePtr) args->param= s.params_val, - args->params.params_len, - ADMIN_SERVER_CLIENT_LIMITS_MAX, ¶ms, &nparams) < 0) + args->params.params_len, + ADMIN_SERVER_CLIENT_LIMITS_MAX, ¶ms,= &nparams) < 0) goto cleanup; =20 if (adminServerSetClientLimits(srv, params, nparams, args->flags) < 0) --=20 2.17.1 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Fri Apr 26 20:41:45 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 1538727132326416.37745273490725; Fri, 5 Oct 2018 01:12:12 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id E7D0A88303; Fri, 5 Oct 2018 08:12:09 +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 999A0104C53C; Fri, 5 Oct 2018 08:12:09 +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 CA27A3D381; Fri, 5 Oct 2018 08:12:08 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id w958C7V0009394 for ; Fri, 5 Oct 2018 04:12:07 -0400 Received: by smtp.corp.redhat.com (Postfix) id B0DD016D31; Fri, 5 Oct 2018 08:12:07 +0000 (UTC) Received: from mx1.redhat.com (ext-mx03.extmail.prod.ext.phx2.redhat.com [10.5.110.27]) by smtp.corp.redhat.com (Postfix) with ESMTPS id A532F2E020 for ; Fri, 5 Oct 2018 08:12:05 +0000 (UTC) Received: from m97138.mail.qiye.163.com (m97138.mail.qiye.163.com [220.181.97.138]) by mx1.redhat.com (Postfix) with ESMTP id 42F8883F51 for ; Fri, 5 Oct 2018 08:12:02 +0000 (UTC) Received: from localhost.localdomain (unknown [58.56.27.130]) by smtp9 (Coremail) with SMTP id u+CowAB3p3_PHLdb0blTAg--.62652S5; Fri, 05 Oct 2018 16:12:00 +0800 (CST) From: Shi Lei To: libvir-list@redhat.com Date: Fri, 5 Oct 2018 16:11:26 +0800 Message-Id: <20181005081145.29901-4-shi_lei@massclouds.com> In-Reply-To: <20181005081145.29901-1-shi_lei@massclouds.com> References: <20181005081145.29901-1-shi_lei@massclouds.com> X-CM-TRANSID: u+CowAB3p3_PHLdb0blTAg--.62652S5 X-Coremail-Antispam: 1Uf129KBjvJXoW3GFyrZF1ktw1rKryrWFW8Crg_yoWxJr4rpF 48JFn3JrWkKF45ZFZxAa1UuF1DXr90gFyrGrWF939aqa17Ww1DJF43tFW5u345Zr4kJa13 tF9xtFZ5ua1UGaDanT9S1TB71UUUUUUqnTZGkaVYY2UrUUUUjbIjqfuFe4nvWSU5nxnvy2 9KBjDUYxBIdaVFxhVjvjDU0xZFpf9x0pRQdbUUUUUU= X-Originating-IP: [58.56.27.130] X-CM-SenderInfo: pvklsz1hl6ztxvvfz0xxgvhudrp/1tbifBDWT1rpNuEgugABsK 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.27]); Fri, 05 Oct 2018 08:12:04 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.27]); Fri, 05 Oct 2018 08:12:04 +0000 (UTC) for IP:'220.181.97.138' DOMAIN:'m97138.mail.qiye.163.com' HELO:'m97138.mail.qiye.163.com' FROM:'shi_lei@massclouds.com' RCPT:'' X-RedHat-Spam-Score: -0.01 (RCVD_IN_DNSWL_NONE) 220.181.97.138 m97138.mail.qiye.163.com 220.181.97.138 m97138.mail.qiye.163.com X-Scanned-By: MIMEDefang 2.78 on 10.5.110.27 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 03/22] bhyve: Fix misaligned arguments and misaligned conditions 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.84 on 10.5.11.22 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.28]); Fri, 05 Oct 2018 08:12:10 +0000 (UTC) X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" This patch fixes misaligned arguments and misaligned conditions. Signed-off-by: Shi Lei --- src/bhyve/bhyve_capabilities.c | 7 +++---- src/bhyve/bhyve_command.c | 6 +++--- src/bhyve/bhyve_driver.c | 10 +++++----- src/bhyve/bhyve_monitor.c | 4 ++-- src/bhyve/bhyve_parse_command.c | 16 ++++++++-------- src/bhyve/bhyve_process.c | 6 +++--- 6 files changed, 24 insertions(+), 25 deletions(-) diff --git a/src/bhyve/bhyve_capabilities.c b/src/bhyve/bhyve_capabilities.c index 6feaded..1984c85 100644 --- a/src/bhyve/bhyve_capabilities.c +++ b/src/bhyve/bhyve_capabilities.c @@ -139,12 +139,11 @@ virBhyveDomainCapsBuild(bhyveConnPtr conn, if (virDirOpenIfExists(&dir, firmware_dir) > 0) { while ((virDirRead(dir, &entry, firmware_dir)) > 0) { if (VIR_RESIZE_N(firmwares->values, - firmwares_alloc, firmwares->nvalues, 1) < 0) + firmwares_alloc, firmwares->nvalues, 1) < 0) goto cleanup; =20 - if (virAsprintf( - &firmwares->values[firmwares->nvalues], - "%s/%s", firmware_dir, entry->d_name) < 0) + if (virAsprintf(&firmwares->values[firmwares->nvalues], + "%s/%s", firmware_dir, entry->d_name) < 0) goto cleanup; =20 firmwares->nvalues++; diff --git a/src/bhyve/bhyve_command.c b/src/bhyve/bhyve_command.c index 6149c93..7f2d2f5 100644 --- a/src/bhyve/bhyve_command.c +++ b/src/bhyve/bhyve_command.c @@ -293,8 +293,8 @@ bhyveBuildUSBControllerArgStr(const virDomainDef *def, =20 static int bhyveBuildVirtIODiskArgStr(const virDomainDef *def ATTRIBUTE_UNUSED, - virDomainDiskDefPtr disk, - virCommandPtr cmd) + virDomainDiskDefPtr disk, + virCommandPtr cmd) { const char *disk_source; =20 @@ -516,7 +516,7 @@ virBhyveProcessBuildBhyveCmd(virConnectPtr conn, } else { virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", _("Installed bhyve binary does not support " - "UTC clock")); + "UTC clock")); goto error; } break; diff --git a/src/bhyve/bhyve_driver.c b/src/bhyve/bhyve_driver.c index 4d4f85f..06c7012 100644 --- a/src/bhyve/bhyve_driver.c +++ b/src/bhyve/bhyve_driver.c @@ -727,12 +727,12 @@ bhyveConnectDomainXMLToNative(virConnectPtr conn, if ((bhyveDriverGetCaps(conn) & BHYVE_CAP_LPC_BOOTROM) =3D=3D 0) { virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", _("Installed bhyve binary does not support " - "bootrom")); + "bootrom")); goto cleanup; } } else { if (!(loadcmd =3D virBhyveProcessBuildLoadCmd(conn, def, "", - NULL))) + NULL))) goto cleanup; =20 virBufferAdd(&buf, virCommandToString(loadcmd), -1); @@ -1107,9 +1107,9 @@ bhyveDomainSetMetadata(virDomainPtr dom, =20 static char * bhyveDomainGetMetadata(virDomainPtr dom, - int type, - const char *uri, - unsigned int flags) + int type, + const char *uri, + unsigned int flags) { virDomainObjPtr vm; char *ret =3D NULL; diff --git a/src/bhyve/bhyve_monitor.c b/src/bhyve/bhyve_monitor.c index 4d5262c..ba1879d 100644 --- a/src/bhyve/bhyve_monitor.c +++ b/src/bhyve/bhyve_monitor.c @@ -79,8 +79,8 @@ bhyveMonitorIO(int watch, int kq, int events ATTRIBUTE_UN= USED, void *opaque) if (kev.filter =3D=3D EVFILT_PROC && (kev.fflags & NOTE_EXIT) !=3D 0) { if ((pid_t)kev.ident !=3D vm->pid) { virReportError(VIR_ERR_INTERNAL_ERROR, - _("event from unexpected proc %ju!=3D%ju"), - (uintmax_t)vm->pid, (uintmax_t)kev.ident); + _("event from unexpected proc %ju!=3D%ju"), + (uintmax_t)vm->pid, (uintmax_t)kev.ident); return; } =20 diff --git a/src/bhyve/bhyve_parse_command.c b/src/bhyve/bhyve_parse_comman= d.c index 14137d1..5424d97 100644 --- a/src/bhyve/bhyve_parse_command.c +++ b/src/bhyve/bhyve_parse_command.c @@ -63,7 +63,7 @@ bhyveParseCommandLineUnescape(const char *command) /* Iterate over characters in the command, skipping "\\\n", "\\\r" as = well * as "\\\r\n". */ for (curr_src =3D (char*) command, curr_dst =3D unescaped; *curr_src != =3D '\0'; - curr_src++, curr_dst++) { + curr_src++, curr_dst++) { if (*curr_src =3D=3D '\\') { switch (*(curr_src + 1)) { case '\n': /* \LF */ @@ -122,10 +122,10 @@ bhyveParseMemsize(const char *arg, size_t *ret_memsiz= e) */ static int bhyveCommandLineToArgv(const char *nativeConfig, - int *loader_argc, - char ***loader_argv, - int *bhyve_argc, - char ***bhyve_argv) + int *loader_argc, + char ***loader_argv, + int *bhyve_argc, + char ***bhyve_argv) { const char *curr =3D NULL; char *nativeConfig_unescaped =3D NULL; @@ -663,7 +663,7 @@ bhyveParseBhyveCommandLine(virDomainDefPtr def, goto error; =20 while ((c =3D _getopt_internal_r(argc, argv, optstr, - NULL, NULL, 0, parser, 0)) !=3D -1) { + NULL, NULL, 0, parser, 0)) !=3D -1) { switch (c) { case 'A': def->features[VIR_DOMAIN_FEATURE_ACPI] =3D VIR_TRISTATE_SWITCH= _ON; @@ -700,7 +700,7 @@ bhyveParseBhyveCommandLine(virDomainDefPtr def, } if (def->mem.cur_balloon !=3D 0 && def->mem.cur_balloon !=3D m= emory) { virReportError(VIR_ERR_OPERATION_FAILED, "%s", - _("Failed to parse memory: size mismatch")); + _("Failed to parse memory: size mismatch")); goto error; } def->mem.cur_balloon =3D memory; @@ -778,7 +778,7 @@ bhyveParseBhyveLoadCommandLine(virDomainDefPtr def, goto error; =20 while ((c =3D _getopt_internal_r(argc, argv, optstr, - NULL, NULL, 0, parser, 0)) !=3D -1) { + NULL, NULL, 0, parser, 0)) !=3D -1) { switch (c) { case 'd': arguments |=3D 1; diff --git a/src/bhyve/bhyve_process.c b/src/bhyve/bhyve_process.c index 4dab6e5..089f4ae 100644 --- a/src/bhyve/bhyve_process.c +++ b/src/bhyve/bhyve_process.c @@ -77,9 +77,9 @@ bhyveNetCleanup(virDomainObjPtr vm) =20 if (actualType =3D=3D VIR_DOMAIN_NET_TYPE_BRIDGE) { if (net->ifname) { - ignore_value(virNetDevBridgeRemovePort( - virDomainNetGetActualBridgeName(net), - net->ifname)); + const char *brname =3D virDomainNetGetActualBridgeName(net= ); + ignore_value(virNetDevBridgeRemovePort(brname, + net->ifname)); ignore_value(virNetDevTapDelete(net->ifname, NULL)); } } --=20 2.17.1 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Fri Apr 26 20:41:45 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 1538727157647704.873143283334; Fri, 5 Oct 2018 01:12:37 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 04E02307CF58; Fri, 5 Oct 2018 08:12:36 +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 C3E23100194A; Fri, 5 Oct 2018 08:12:35 +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 75B75180BAE1; Fri, 5 Oct 2018 08:12:35 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id w958C9Lm009446 for ; Fri, 5 Oct 2018 04:12:09 -0400 Received: by smtp.corp.redhat.com (Postfix) id 95673105704B; Fri, 5 Oct 2018 08:12:09 +0000 (UTC) Received: from mx1.redhat.com (ext-mx01.extmail.prod.ext.phx2.redhat.com [10.5.110.25]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 8E38A104C53C for ; Fri, 5 Oct 2018 08:12:07 +0000 (UTC) Received: from m97138.mail.qiye.163.com (m97138.mail.qiye.163.com [220.181.97.138]) by mx1.redhat.com (Postfix) with ESMTP id 3D15481DEC for ; Fri, 5 Oct 2018 08:12:04 +0000 (UTC) Received: from localhost.localdomain (unknown [58.56.27.130]) by smtp9 (Coremail) with SMTP id u+CowAB3p3_PHLdb0blTAg--.62652S6; Fri, 05 Oct 2018 16:12:00 +0800 (CST) From: Shi Lei To: libvir-list@redhat.com Date: Fri, 5 Oct 2018 16:11:27 +0800 Message-Id: <20181005081145.29901-5-shi_lei@massclouds.com> In-Reply-To: <20181005081145.29901-1-shi_lei@massclouds.com> References: <20181005081145.29901-1-shi_lei@massclouds.com> X-CM-TRANSID: u+CowAB3p3_PHLdb0blTAg--.62652S6 X-Coremail-Antispam: 1Uf129KBjDUn29KB7ZKAUJUUUUU529EdanIXcx71UUUUU7v73 VFW2AGmfu7bjvjm3AaLaJ3UbIYCTnIWIevJa73UjIFyTuYvjTRNHUDUUUUU X-Originating-IP: [58.56.27.130] X-CM-SenderInfo: pvklsz1hl6ztxvvfz0xxgvhudrp/1tbigRDWT1sfmGbD8gAAsD 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.25]); Fri, 05 Oct 2018 08:12:06 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.25]); Fri, 05 Oct 2018 08:12:06 +0000 (UTC) for IP:'220.181.97.138' DOMAIN:'m97138.mail.qiye.163.com' HELO:'m97138.mail.qiye.163.com' FROM:'shi_lei@massclouds.com' RCPT:'' X-RedHat-Spam-Score: -0.01 (RCVD_IN_DNSWL_NONE) 220.181.97.138 m97138.mail.qiye.163.com 220.181.97.138 m97138.mail.qiye.163.com X-Scanned-By: MIMEDefang 2.83 on 10.5.110.25 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 04/22] cpu: Fix misaligned arguments 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.84 on 10.5.11.22 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.44]); Fri, 05 Oct 2018 08:12:36 +0000 (UTC) X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" This patch fixes misaligned arguments. Signed-off-by: Shi Lei --- src/cpu/cpu_ppc64.c | 4 ++-- src/cpu/cpu_x86.c | 16 ++++------------ 2 files changed, 6 insertions(+), 14 deletions(-) diff --git a/src/cpu/cpu_ppc64.c b/src/cpu/cpu_ppc64.c index 858f40e..96f9df1 100644 --- a/src/cpu/cpu_ppc64.c +++ b/src/cpu/cpu_ppc64.c @@ -488,7 +488,7 @@ ppc64Compute(virCPUDefPtr host, if (message && virAsprintf(message, _("host CPU vendor does not match required " - "CPU vendor %s"), + "CPU vendor %s"), cpu->vendor) < 0) goto cleanup; =20 @@ -543,7 +543,7 @@ ppc64Compute(virCPUDefPtr host, if (message && virAsprintf(message, _("host CPU model does not match required " - "CPU model %s"), + "CPU model %s"), guest_model->name) < 0) goto cleanup; =20 diff --git a/src/cpu/cpu_x86.c b/src/cpu/cpu_x86.c index 69a0c8d..e978cf0 100644 --- a/src/cpu/cpu_x86.c +++ b/src/cpu/cpu_x86.c @@ -2040,12 +2040,8 @@ cpuidCall(virCPUx86CPUID *cpuid) asm("xor %%ebx, %%ebx;" /* clear the other registers as some cpuid */ "xor %%edx, %%edx;" /* functions may use them as additional argume= nts */ "cpuid;" - : "=3Da" (cpuid->eax), - "=3Db" (cpuid->ebx), - "=3Dc" (cpuid->ecx), - "=3Dd" (cpuid->edx) - : "a" (cpuid->eax_in), - "c" (cpuid->ecx_in)); + : "=3Da" (cpuid->eax), "=3Db" (cpuid->ebx), "=3Dc" (cpuid->ecx), "= =3Dd" (cpuid->edx) + : "a" (cpuid->eax_in), "c" (cpuid->ecx_in)); # else /* we need to avoid direct use of ebx for CPUID output as it is used * for global offset table on i386 with -fPIC @@ -2056,12 +2052,8 @@ cpuidCall(virCPUx86CPUID *cpuid) "cpuid;" "mov %%ebx, %1;" "pop %%ebx;" - : "=3Da" (cpuid->eax), - "=3Dr" (cpuid->ebx), - "=3Dc" (cpuid->ecx), - "=3Dd" (cpuid->edx) - : "a" (cpuid->eax_in), - "c" (cpuid->ecx_in) + : "=3Da" (cpuid->eax), "=3Dr" (cpuid->ebx), "=3Dc" (cpuid->ecx), "= =3Dd" (cpuid->edx) + : "a" (cpuid->eax_in), "c" (cpuid->ecx_in) : "cc"); # endif } --=20 2.17.1 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Fri Apr 26 20:41:45 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 1538727159513987.0776318575319; Fri, 5 Oct 2018 01:12:39 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id A2B9A307D930; Fri, 5 Oct 2018 08:12:37 +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 6595C60922; Fri, 5 Oct 2018 08:12:37 +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 16B861804750; Fri, 5 Oct 2018 08:12:37 +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 w958CNh9009611 for ; Fri, 5 Oct 2018 04:12:23 -0400 Received: by smtp.corp.redhat.com (Postfix) id 738635D9CB; Fri, 5 Oct 2018 08:12:23 +0000 (UTC) Received: from mx1.redhat.com (ext-mx20.extmail.prod.ext.phx2.redhat.com [10.5.110.49]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 68E175D9CA for ; Fri, 5 Oct 2018 08:12:23 +0000 (UTC) Received: from m97138.mail.qiye.163.com (m97138.mail.qiye.163.com [220.181.97.138]) by mx1.redhat.com (Postfix) with ESMTP id 4B380308FF22 for ; Fri, 5 Oct 2018 08:12:02 +0000 (UTC) Received: from localhost.localdomain (unknown [58.56.27.130]) by smtp9 (Coremail) with SMTP id u+CowAB3p3_PHLdb0blTAg--.62652S7; Fri, 05 Oct 2018 16:12:00 +0800 (CST) From: Shi Lei To: libvir-list@redhat.com Date: Fri, 5 Oct 2018 16:11:28 +0800 Message-Id: <20181005081145.29901-6-shi_lei@massclouds.com> In-Reply-To: <20181005081145.29901-1-shi_lei@massclouds.com> References: <20181005081145.29901-1-shi_lei@massclouds.com> X-CM-TRANSID: u+CowAB3p3_PHLdb0blTAg--.62652S7 X-Coremail-Antispam: 1Uf129KBjvJXoW3ZrykurWUWF4UXFW5ZF4UXFb_yoWDAF4kpa yxG3s7GFnrXr48Xr9rA3y5W3Z5Ww4kKFyjkrWrKan2yr4kX34fuF4jvry3A3y0ka4UJr1f t3ZxWw4Fg3s5Zr7anT9S1TB71UUUUUUqnTZGkaVYY2UrUUUUjbIjqfuFe4nvWSU5nxnvy2 9KBjDUYxBIdaVFxhVjvjDU0xZFpf9x0pR8-B_UUUUU= X-Originating-IP: [58.56.27.130] X-CM-SenderInfo: pvklsz1hl6ztxvvfz0xxgvhudrp/1tbigRDWT1sfmGbD8gABsC 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.49]); Fri, 05 Oct 2018 08:12:22 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.49]); Fri, 05 Oct 2018 08:12:22 +0000 (UTC) for IP:'220.181.97.138' DOMAIN:'m97138.mail.qiye.163.com' HELO:'m97138.mail.qiye.163.com' FROM:'shi_lei@massclouds.com' RCPT:'' X-RedHat-Spam-Score: -0.01 (RCVD_IN_DNSWL_NONE) 220.181.97.138 m97138.mail.qiye.163.com 220.181.97.138 m97138.mail.qiye.163.com X-Scanned-By: MIMEDefang 2.84 on 10.5.110.49 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 05/22] interface: Fix misaligned arguments 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.13 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.48]); Fri, 05 Oct 2018 08:12:38 +0000 (UTC) X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" This patch fixes misaligned arguments. Signed-off-by: Shi Lei --- src/interface/interface_backend_udev.c | 102 ++++++++++++++----------- 1 file changed, 57 insertions(+), 45 deletions(-) diff --git a/src/interface/interface_backend_udev.c b/src/interface/interfa= ce_backend_udev.c index 1373356..64ed2e3 100644 --- a/src/interface/interface_backend_udev.c +++ b/src/interface/interface_backend_udev.c @@ -602,13 +602,14 @@ udevGetIfaceDefBond(struct udev *udev, tmp_str =3D udev_device_get_sysattr_value(dev, "bonding/downdelay"); if (!tmp_str) { virReportError(VIR_ERR_INTERNAL_ERROR, - _("Could not retrieve 'bonding/downdelay' for '%s'"), name= ); + _("Could not retrieve 'bonding/downdelay' for '%s'"= ), + name); goto error; } if (virStrToLong_i(tmp_str, NULL, 10, &tmp_int) < 0) { virReportError(VIR_ERR_INTERNAL_ERROR, - _("Could not parse 'bonding/downdelay' '%s' for '%s'"), - tmp_str, name); + _("Could not parse 'bonding/downdelay' '%s' for '%s= '"), + tmp_str, name); goto error; } ifacedef->data.bond.downdelay =3D tmp_int; @@ -616,13 +617,14 @@ udevGetIfaceDefBond(struct udev *udev, tmp_str =3D udev_device_get_sysattr_value(dev, "bonding/updelay"); if (!tmp_str) { virReportError(VIR_ERR_INTERNAL_ERROR, - _("Could not retrieve 'bonding/updelay' for '%s'"), name); + _("Could not retrieve 'bonding/updelay' for '%s'"), + name); goto error; } if (virStrToLong_i(tmp_str, NULL, 10, &tmp_int) < 0) { virReportError(VIR_ERR_INTERNAL_ERROR, - _("Could not parse 'bonding/updelay' '%s' for '%s'"), - tmp_str, name); + _("Could not parse 'bonding/updelay' '%s' for '%s'"= ), + tmp_str, name); goto error; } ifacedef->data.bond.updelay =3D tmp_int; @@ -630,13 +632,14 @@ udevGetIfaceDefBond(struct udev *udev, tmp_str =3D udev_device_get_sysattr_value(dev, "bonding/miimon"); if (!tmp_str) { virReportError(VIR_ERR_INTERNAL_ERROR, - _("Could not retrieve 'bonding/miimon' for '%s'"), name); + _("Could not retrieve 'bonding/miimon' for '%s'"), + name); goto error; } if (virStrToLong_i(tmp_str, NULL, 10, &tmp_int) < 0) { virReportError(VIR_ERR_INTERNAL_ERROR, - _("Could not parse 'bonding/miimon' '%s' for '%s'"), - tmp_str, name); + _("Could not parse 'bonding/miimon' '%s' for '%s'"), + tmp_str, name); goto error; } ifacedef->data.bond.frequency =3D tmp_int; @@ -644,13 +647,14 @@ udevGetIfaceDefBond(struct udev *udev, tmp_str =3D udev_device_get_sysattr_value(dev, "bonding/arp_interval"); if (!tmp_str) { virReportError(VIR_ERR_INTERNAL_ERROR, - _("Could not retrieve 'bonding/arp_interval' for '%s'"), n= ame); + _("Could not retrieve 'bonding/arp_interval' for '%= s'"), + name); goto error; } if (virStrToLong_i(tmp_str, NULL, 10, &tmp_int) < 0) { virReportError(VIR_ERR_INTERNAL_ERROR, - _("Could not parse 'bonding/arp_interval' '%s' for '%s'"), - tmp_str, name); + _("Could not parse 'bonding/arp_interval' '%s' for = '%s'"), + tmp_str, name); goto error; } ifacedef->data.bond.interval =3D tmp_int; @@ -663,25 +667,25 @@ udevGetIfaceDefBond(struct udev *udev, tmp_str =3D udev_device_get_sysattr_value(dev, "bonding/mode"); if (!tmp_str) { virReportError(VIR_ERR_INTERNAL_ERROR, - _("Could not retrieve 'bonding/mode' for '%s'"), name); + _("Could not retrieve 'bonding/mode' for '%s'"), na= me); goto error; } tmp_str =3D strchr(tmp_str, ' '); if (!tmp_str) { virReportError(VIR_ERR_INTERNAL_ERROR, - _("Invalid format for 'bonding/mode' for '%s'"), name); + _("Invalid format for 'bonding/mode' for '%s'"), na= me); goto error; } if (strlen(tmp_str) < 2) { virReportError(VIR_ERR_INTERNAL_ERROR, - _("Unable to find correct value in 'bonding/mode' for '%s'= "), - name); + _("Unable to find correct value in 'bonding/mode' f= or '%s'"), + name); goto error; } if (virStrToLong_i(tmp_str + 1, NULL, 10, &tmp_int) < 0) { virReportError(VIR_ERR_INTERNAL_ERROR, - _("Could not parse 'bonding/mode' '%s' for '%s'"), - tmp_str, name); + _("Could not parse 'bonding/mode' '%s' for '%s'"), + tmp_str, name); goto error; } ifacedef->data.bond.mode =3D tmp_int + 1; @@ -693,25 +697,27 @@ udevGetIfaceDefBond(struct udev *udev, tmp_str =3D udev_device_get_sysattr_value(dev, "bonding/arp_validate"); if (!tmp_str) { virReportError(VIR_ERR_INTERNAL_ERROR, - _("Could not retrieve 'bonding/arp_validate' for '%s'"), n= ame); + _("Could not retrieve 'bonding/arp_validate' for '%= s'"), + name); goto error; } tmp_str =3D strchr(tmp_str, ' '); if (!tmp_str) { virReportError(VIR_ERR_INTERNAL_ERROR, - _("Invalid format for 'bonding/arp_validate' for '%s'"), n= ame); + _("Invalid format for 'bonding/arp_validate' for '%= s'"), + name); goto error; } if (strlen(tmp_str) < 2) { virReportError(VIR_ERR_INTERNAL_ERROR, - _("Unable to find correct value in 'bonding/arp_validate' " - "for '%s'"), name); + _("Unable to find correct value in 'bonding/arp_val= idate' " + "for '%s'"), name); goto error; } if (virStrToLong_i(tmp_str + 1, NULL, 10, &tmp_int) < 0) { virReportError(VIR_ERR_INTERNAL_ERROR, - _("Could not parse 'bonding/arp_validate' '%s' for '%s'"), - tmp_str, name); + _("Could not parse 'bonding/arp_validate' '%s' for = '%s'"), + tmp_str, name); goto error; } ifacedef->data.bond.validate =3D tmp_int; @@ -720,13 +726,14 @@ udevGetIfaceDefBond(struct udev *udev, tmp_str =3D udev_device_get_sysattr_value(dev, "bonding/use_carrier"); if (!tmp_str) { virReportError(VIR_ERR_INTERNAL_ERROR, - _("Could not retrieve 'bonding/use_carrier' for '%s'"), na= me); + _("Could not retrieve 'bonding/use_carrier' for '%s= '"), + name); goto error; } if (virStrToLong_i(tmp_str, NULL, 10, &tmp_int) < 0) { virReportError(VIR_ERR_INTERNAL_ERROR, - _("Could not parse 'bonding/use_carrier' '%s' for '%s'"), - tmp_str, name); + _("Could not parse 'bonding/use_carrier' '%s' for '= %s'"), + tmp_str, name); goto error; } ifacedef->data.bond.carrier =3D tmp_int + 1; @@ -745,7 +752,8 @@ udevGetIfaceDefBond(struct udev *udev, tmp_str =3D udev_device_get_sysattr_value(dev, "bonding/arp_ip_target"= ); if (!tmp_str) { virReportError(VIR_ERR_INTERNAL_ERROR, - _("Could not retrieve 'bonding/arp_ip_target' for '%s'"), = name); + _("Could not retrieve 'bonding/arp_ip_target' for '= %s'"), + name); goto error; } if (VIR_STRDUP(ifacedef->data.bond.target, tmp_str) < 0) @@ -754,11 +762,11 @@ udevGetIfaceDefBond(struct udev *udev, /* Slaves of the bond */ /* Get each slave in the bond */ slave_count =3D scandir(udev_device_get_syspath(dev), &slave_list, - udevBondScanDirFilter, alphasort); + udevBondScanDirFilter, alphasort); =20 if (slave_count < 0) { virReportSystemError(errno, - _("Could not get slaves of bond '%s'"), name); + _("Could not get slaves of bond '%s'"), name); goto error; } =20 @@ -785,8 +793,9 @@ udevGetIfaceDefBond(struct udev *udev, udevGetIfaceDef(udev, tmp_str); if (!ifacedef->data.bond.itf[i]) { virReportError(VIR_ERR_INTERNAL_ERROR, - _("Could not get interface information for '%s', which is " - "a enslaved in bond '%s'"), slave_list[i]->d_name, name); + _("Could not get interface information for '%s'= ," + " which is a enslaved in bond '%s'"), + slave_list[i]->d_name, name); goto error; } VIR_FREE(slave_list[i]); @@ -826,7 +835,8 @@ udevGetIfaceDefBridge(struct udev *udev, tmp_str =3D udev_device_get_sysattr_value(dev, "bridge/forward_delay"); if (!tmp_str) { virReportError(VIR_ERR_INTERNAL_ERROR, - _("Could not retrieve 'bridge/forward_delay' for '%s'"), n= ame); + _("Could not retrieve 'bridge/forward_delay' for '%= s'"), + name); goto error; } =20 @@ -837,14 +847,15 @@ udevGetIfaceDefBridge(struct udev *udev, tmp_str =3D udev_device_get_sysattr_value(dev, "bridge/stp_state"); if (!tmp_str) { virReportError(VIR_ERR_INTERNAL_ERROR, - _("Could not retrieve 'bridge/stp_state' for '%s'"), name); + _("Could not retrieve 'bridge/stp_state' for '%s'"), + name); goto error; } =20 if (virStrToLong_i(tmp_str, NULL, 10, &stp) < 0) { virReportError(VIR_ERR_INTERNAL_ERROR, - _("Could not parse 'bridge/stp_state' '%s' for '%s'"), - tmp_str, name); + _("Could not parse 'bridge/stp_state' '%s' for '%s'= "), + tmp_str, name); goto error; } =20 @@ -856,27 +867,27 @@ udevGetIfaceDefBridge(struct udev *udev, break; default: virReportError(VIR_ERR_INTERNAL_ERROR, - _("Invalid STP state value %d received for '%s'. Must be " - "-1, 0, or 1."), stp, name); + _("Invalid STP state value %d received for '%s'." + " Must be -1, 0, or 1."), stp, name); goto error; } =20 /* Members of the bridge */ if (virAsprintf(&member_path, "%s/%s", - udev_device_get_syspath(dev), "brif") < 0) + udev_device_get_syspath(dev), "brif") < 0) goto error; =20 /* Get each member of the bridge */ member_count =3D scandir(member_path, &member_list, - udevBridgeScanDirFilter, alphasort); + udevBridgeScanDirFilter, alphasort); =20 /* Don't need the path anymore */ VIR_FREE(member_path); =20 if (member_count < 0) { virReportSystemError(errno, - _("Could not get members of bridge '%s'"), - name); + _("Could not get members of bridge '%s'"), + name); goto error; } =20 @@ -891,8 +902,9 @@ udevGetIfaceDefBridge(struct udev *udev, udevGetIfaceDef(udev, member_list[i]->d_name); if (!ifacedef->data.bridge.itf[i]) { virReportError(VIR_ERR_INTERNAL_ERROR, - _("Could not get interface information for '%s', which is " - "a member of bridge '%s'"), member_list[i]->d_name, name= ); + _("Could not get interface information for '%s'= , " + "which is a member of bridge '%s'"), + member_list[i]->d_name, name); goto error; } VIR_FREE(member_list[i]); @@ -1018,7 +1030,7 @@ udevGetIfaceDef(struct udev *udev, const char *name) mtu_str =3D udev_device_get_sysattr_value(dev, "mtu"); if (virStrToLong_ui(mtu_str, NULL, 10, &mtu) < 0) { virReportError(VIR_ERR_INTERNAL_ERROR, - _("Could not parse MTU value '%s'"), mtu_str); + _("Could not parse MTU value '%s'"), mtu_str); goto error; } ifacedef->mtu =3D mtu; --=20 2.17.1 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Fri Apr 26 20:41:45 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 1538727175168729.0197206617577; Fri, 5 Oct 2018 01:12:55 -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 613BFCAA95; Fri, 5 Oct 2018 08:12:53 +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 23CBE68DA5; Fri, 5 Oct 2018 08:12:53 +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 CB4AF3D397; Fri, 5 Oct 2018 08:12:52 +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 w958CBXI009483 for ; Fri, 5 Oct 2018 04:12:11 -0400 Received: by smtp.corp.redhat.com (Postfix) id 11C2E183F0; Fri, 5 Oct 2018 08:12:11 +0000 (UTC) Received: from mx1.redhat.com (ext-mx14.extmail.prod.ext.phx2.redhat.com [10.5.110.43]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 04AC317F53 for ; Fri, 5 Oct 2018 08:12:08 +0000 (UTC) Received: from m97138.mail.qiye.163.com (m97138.mail.qiye.163.com [220.181.97.138]) by mx1.redhat.com (Postfix) with ESMTP id 6442F3081D84 for ; Fri, 5 Oct 2018 08:12:05 +0000 (UTC) Received: from localhost.localdomain (unknown [58.56.27.130]) by smtp9 (Coremail) with SMTP id u+CowAB3p3_PHLdb0blTAg--.62652S8; Fri, 05 Oct 2018 16:12:01 +0800 (CST) From: Shi Lei To: libvir-list@redhat.com Date: Fri, 5 Oct 2018 16:11:29 +0800 Message-Id: <20181005081145.29901-7-shi_lei@massclouds.com> In-Reply-To: <20181005081145.29901-1-shi_lei@massclouds.com> References: <20181005081145.29901-1-shi_lei@massclouds.com> X-CM-TRANSID: u+CowAB3p3_PHLdb0blTAg--.62652S8 X-Coremail-Antispam: 1Uf129KBjDUn29KB7ZKAUJUUUUU529EdanIXcx71UUUUU7v73 VFW2AGmfu7bjvjm3AaLaJ3UbIYCTnIWIevJa73UjIFyTuYvjTRGnmRUUUUU X-Originating-IP: [58.56.27.130] X-CM-SenderInfo: pvklsz1hl6ztxvvfz0xxgvhudrp/1tbifR3WT1rpNwSyJwAAss 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.43]); Fri, 05 Oct 2018 08:12:07 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.43]); Fri, 05 Oct 2018 08:12:07 +0000 (UTC) for IP:'220.181.97.138' DOMAIN:'m97138.mail.qiye.163.com' HELO:'m97138.mail.qiye.163.com' FROM:'shi_lei@massclouds.com' RCPT:'' X-RedHat-Spam-Score: -0.01 (RCVD_IN_DNSWL_NONE) 220.181.97.138 m97138.mail.qiye.163.com 220.181.97.138 m97138.mail.qiye.163.com X-Scanned-By: MIMEDefang 2.84 on 10.5.110.43 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 06/22] locking: Fix misaligned arguments 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.38]); Fri, 05 Oct 2018 08:12:53 +0000 (UTC) X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" This patch fixes misaligned arguments. Signed-off-by: Shi Lei --- src/locking/lock_manager.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/locking/lock_manager.c b/src/locking/lock_manager.c index 9067f5a..8872334 100644 --- a/src/locking/lock_manager.c +++ b/src/locking/lock_manager.c @@ -44,8 +44,8 @@ VIR_LOG_INIT("locking.lock_manager"); #define CHECK_DRIVER(field, errret) \ if (!driver->field) { \ virReportError(VIR_ERR_INTERNAL_ERROR, \ - _("Missing '%s' field in lock manager driver"), \ - #field); \ + _("Missing '%s' field in lock manager driver"), \ + #field); \ return errret; \ } =20 --=20 2.17.1 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Fri Apr 26 20:41:46 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 1538727151127332.59103584435024; Fri, 5 Oct 2018 01:12:31 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.25]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 1AB3A83F51; Fri, 5 Oct 2018 08:12:29 +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 C8F5D200824B; Fri, 5 Oct 2018 08:12:28 +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 64B36180BADC; Fri, 5 Oct 2018 08:12:28 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id w958C9w9009459 for ; Fri, 5 Oct 2018 04:12:10 -0400 Received: by smtp.corp.redhat.com (Postfix) id EBED15C230; Fri, 5 Oct 2018 08:12:09 +0000 (UTC) Received: from mx1.redhat.com (ext-mx05.extmail.prod.ext.phx2.redhat.com [10.5.110.29]) by smtp.corp.redhat.com (Postfix) with ESMTPS id E0A2C5C227 for ; Fri, 5 Oct 2018 08:12:07 +0000 (UTC) Received: from m97138.mail.qiye.163.com (m97138.mail.qiye.163.com [220.181.97.138]) by mx1.redhat.com (Postfix) with ESMTP id 8C27E58 for ; Fri, 5 Oct 2018 08:12:03 +0000 (UTC) Received: from localhost.localdomain (unknown [58.56.27.130]) by smtp9 (Coremail) with SMTP id u+CowAB3p3_PHLdb0blTAg--.62652S9; Fri, 05 Oct 2018 16:12:01 +0800 (CST) From: Shi Lei To: libvir-list@redhat.com Date: Fri, 5 Oct 2018 16:11:30 +0800 Message-Id: <20181005081145.29901-8-shi_lei@massclouds.com> In-Reply-To: <20181005081145.29901-1-shi_lei@massclouds.com> References: <20181005081145.29901-1-shi_lei@massclouds.com> X-CM-TRANSID: u+CowAB3p3_PHLdb0blTAg--.62652S9 X-Coremail-Antispam: 1Uf129KBjDUn29KB7ZKAUJUUUUU529EdanIXcx71UUUUU7v73 VFW2AGmfu7bjvjm3AaLaJ3UbIYCTnIWIevJa73UjIFyTuYvjTRGnmRUUUUU X-Originating-IP: [58.56.27.130] X-CM-SenderInfo: pvklsz1hl6ztxvvfz0xxgvhudrp/1tbigBHWT1rpNeJr0AAAsX 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.29]); Fri, 05 Oct 2018 08:12:05 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.29]); Fri, 05 Oct 2018 08:12:05 +0000 (UTC) for IP:'220.181.97.138' DOMAIN:'m97138.mail.qiye.163.com' HELO:'m97138.mail.qiye.163.com' FROM:'shi_lei@massclouds.com' RCPT:'' X-RedHat-Spam-Score: -0.01 (RCVD_IN_DNSWL_NONE) 220.181.97.138 m97138.mail.qiye.163.com 220.181.97.138 m97138.mail.qiye.163.com X-Scanned-By: MIMEDefang 2.78 on 10.5.110.29 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 07/22] network: Fix misaligned arguments 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.84 on 10.5.11.25 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.27]); Fri, 05 Oct 2018 08:12:29 +0000 (UTC) X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" This patch fixes misaligned arguments. Signed-off-by: Shi Lei --- src/network/bridge_driver.c | 25 ++++++++++++------------- 1 file changed, 12 insertions(+), 13 deletions(-) diff --git a/src/network/bridge_driver.c b/src/network/bridge_driver.c index 4bbc4f5..fbbc024 100644 --- a/src/network/bridge_driver.c +++ b/src/network/bridge_driver.c @@ -3478,9 +3478,9 @@ networkValidate(virNetworkDriverStatePtr driver, if (ipdef->nranges || ipdef->nhosts) { if (ipv4def) { virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", - _("Multiple IPv4 dhcp sections found -- " - "dhcp is supported only for a " - "single IPv4 address on each network")); + _("Multiple IPv4 dhcp sections found --= " + "dhcp is supported only for a " + "single IPv4 address on each network"= )); return -1; } else { ipv4def =3D true; @@ -3491,9 +3491,9 @@ networkValidate(virNetworkDriverStatePtr driver, if (ipdef->nranges || ipdef->nhosts) { if (ipv6def) { virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", - _("Multiple IPv6 dhcp sections found -- " - "dhcp is supported only for a " - "single IPv6 address on each network")); + _("Multiple IPv6 dhcp sections found --= " + "dhcp is supported only for a " + "single IPv6 address on each network"= )); return -1; } else { ipv6def =3D true; @@ -4321,7 +4321,7 @@ networkGetDHCPLeases(virNetworkPtr net, break; } if (!ipv6 && VIR_SOCKET_ADDR_IS_FAMILY(&ipdef_tmp->address, - AF_INET)) { + AF_INET)) { lease->prefix =3D virSocketAddrGetIPPrefix(&ipdef_tmp-= >address, &ipdef_tmp->n= etmask, ipdef_tmp->pr= efix); @@ -5740,12 +5740,11 @@ networkRegister(void) if (virRegisterStateDriver(&networkStateDriver) < 0) return -1; =20 - virDomainNetSetDeviceImpl( - networkAllocateActualDevice, - networkNotifyActualDevice, - networkReleaseActualDevice, - networkBandwidthChangeAllowed, - networkBandwidthUpdate); + virDomainNetSetDeviceImpl(networkAllocateActualDevice, + networkNotifyActualDevice, + networkReleaseActualDevice, + networkBandwidthChangeAllowed, + networkBandwidthUpdate); =20 return 0; } --=20 2.17.1 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Fri Apr 26 20:41:46 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 1538727146648950.7581306224002; Fri, 5 Oct 2018 01:12:26 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 49D0A9D433; Fri, 5 Oct 2018 08:12:24 +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 101A717F53; Fri, 5 Oct 2018 08:12: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 B3E2A180BAD1; Fri, 5 Oct 2018 08:12:23 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.25]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id w958C9kR009432 for ; Fri, 5 Oct 2018 04:12:09 -0400 Received: by smtp.corp.redhat.com (Postfix) id 37A0A2010D0C; Fri, 5 Oct 2018 08:12:09 +0000 (UTC) Received: from mx1.redhat.com (ext-mx04.extmail.prod.ext.phx2.redhat.com [10.5.110.28]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 2C4AA2010D5F for ; Fri, 5 Oct 2018 08:12:09 +0000 (UTC) Received: from m97138.mail.qiye.163.com (m97138.mail.qiye.163.com [220.181.97.138]) by mx1.redhat.com (Postfix) with ESMTP id A930288303 for ; Fri, 5 Oct 2018 08:12:02 +0000 (UTC) Received: from localhost.localdomain (unknown [58.56.27.130]) by smtp9 (Coremail) with SMTP id u+CowAB3p3_PHLdb0blTAg--.62652S10; Fri, 05 Oct 2018 16:12:01 +0800 (CST) From: Shi Lei To: libvir-list@redhat.com Date: Fri, 5 Oct 2018 16:11:31 +0800 Message-Id: <20181005081145.29901-9-shi_lei@massclouds.com> In-Reply-To: <20181005081145.29901-1-shi_lei@massclouds.com> References: <20181005081145.29901-1-shi_lei@massclouds.com> X-CM-TRANSID: u+CowAB3p3_PHLdb0blTAg--.62652S10 X-Coremail-Antispam: 1Uf129KBjvJXoWxuFyfXr1kCF1rXryxtrWxCrg_yoWxZFy5pa 1kJFsakrW8Xrs5JF4DGa13ZF1DArWkXF1UKrs5u3Z8Za1SkFn8Gw4SqFy5ZFW5Jr1DA3W2 vF15WFZ8uF1IgF7anT9S1TB71UUUUUUqnTZGkaVYY2UrUUUUjbIjqfuFe4nvWSU5nxnvy2 9KBjDUYxBIdaVFxhVjvjDU0xZFpf9x0pR8-B_UUUUU= X-Originating-IP: [58.56.27.130] X-CM-SenderInfo: pvklsz1hl6ztxvvfz0xxgvhudrp/1tbigRHWT1sfmGbD+wAAsL 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.28]); Fri, 05 Oct 2018 08:12:08 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.28]); Fri, 05 Oct 2018 08:12:08 +0000 (UTC) for IP:'220.181.97.138' DOMAIN:'m97138.mail.qiye.163.com' HELO:'m97138.mail.qiye.163.com' FROM:'shi_lei@massclouds.com' RCPT:'' X-RedHat-Spam-Score: -0.01 (RCVD_IN_DNSWL_NONE) 220.181.97.138 m97138.mail.qiye.163.com 220.181.97.138 m97138.mail.qiye.163.com X-Scanned-By: MIMEDefang 2.78 on 10.5.110.28 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.25 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 08/22] src:libvirt*.c: Fix misaligned arguments 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.13 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.39]); Fri, 05 Oct 2018 08:12:25 +0000 (UTC) X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" This patch fixes misaligned arguments. Signed-off-by: Shi Lei --- src/libvirt-domain.c | 14 +++++++------- src/libvirt-host.c | 4 ++-- src/libvirt-lxc.c | 5 ++--- src/libvirt-network.c | 2 +- src/libvirt-nodedev.c | 4 ++-- src/libvirt-storage.c | 13 ++++++------- src/libvirt.c | 4 ++-- 7 files changed, 22 insertions(+), 24 deletions(-) diff --git a/src/libvirt-domain.c b/src/libvirt-domain.c index 7690339..23f4889 100644 --- a/src/libvirt-domain.c +++ b/src/libvirt-domain.c @@ -3626,7 +3626,7 @@ virDomainMigrate(virDomainPtr domain, } else if (VIR_DRV_SUPPORTS_FEATURE(domain->conn->driver, domain->= conn, VIR_DRV_FEATURE_MIGRATION_V2) = && VIR_DRV_SUPPORTS_FEATURE(dconn->driver, dconn, - VIR_DRV_FEATURE_MIGRATION_V2)) { + VIR_DRV_FEATURE_MIGRATION_V2))= { VIR_DEBUG("Using migration protocol 2"); ddomain =3D virDomainMigrateVersion2(domain, dconn, flags, dname, uri, bandwidth); @@ -3778,7 +3778,7 @@ virDomainMigrate2(virDomainPtr domain, } else if (VIR_DRV_SUPPORTS_FEATURE(domain->conn->driver, domain->= conn, VIR_DRV_FEATURE_MIGRATION_V2) = && VIR_DRV_SUPPORTS_FEATURE(dconn->driver, dconn, - VIR_DRV_FEATURE_MIGRATION_V2)) { + VIR_DRV_FEATURE_MIGRATION_V2))= { VIR_DEBUG("Using migration protocol 2"); if (dxml) { virReportError(VIR_ERR_ARGUMENT_UNSUPPORTED, "%s", @@ -3967,7 +3967,7 @@ virDomainMigrate3(virDomainPtr domain, } else if (VIR_DRV_SUPPORTS_FEATURE(domain->conn->driver, domain->conn, VIR_DRV_FEATURE_MIGRATION_V2) && VIR_DRV_SUPPORTS_FEATURE(dconn->driver, dconn, - VIR_DRV_FEATURE_MIGRATION_V2)) { + VIR_DRV_FEATURE_MIGRATION_V2)) { VIR_DEBUG("Using migration protocol 2"); if (dxml) { virReportError(VIR_ERR_ARGUMENT_UNSUPPORTED, "%s", @@ -11051,8 +11051,8 @@ virDomainFSFreeze(virDomainPtr dom, virCheckNullArgGoto(mountpoints, error); =20 if (dom->conn->driver->domainFSFreeze) { - int ret =3D dom->conn->driver->domainFSFreeze( - dom, mountpoints, nmountpoints, flags); + int ret =3D dom->conn->driver->domainFSFreeze(dom, mountpoints, + nmountpoints, flags); if (ret < 0) goto error; return ret; @@ -11096,8 +11096,8 @@ virDomainFSThaw(virDomainPtr dom, virCheckNullArgGoto(mountpoints, error); =20 if (dom->conn->driver->domainFSThaw) { - int ret =3D dom->conn->driver->domainFSThaw( - dom, mountpoints, nmountpoints, flags); + int ret =3D dom->conn->driver->domainFSThaw(dom, mountpoints, + nmountpoints, flags); if (ret < 0) goto error; return ret; diff --git a/src/libvirt-host.c b/src/libvirt-host.c index e20d6ee..a044924 100644 --- a/src/libvirt-host.c +++ b/src/libvirt-host.c @@ -784,7 +784,7 @@ virNodeSetMemoryParameters(virConnectPtr conn, if (conn->driver->nodeSetMemoryParameters) { int ret; ret =3D conn->driver->nodeSetMemoryParameters(conn, params, - nparams, flags); + nparams, flags); if (ret < 0) goto error; return ret; @@ -857,7 +857,7 @@ virNodeGetCellsFreeMemory(virConnectPtr conn, unsigned = long long *freeMems, int startCell, int maxCells) { VIR_DEBUG("conn=3D%p, freeMems=3D%p, startCell=3D%d, maxCells=3D%d", - conn, freeMems, startCell, maxCells); + conn, freeMems, startCell, maxCells); =20 virResetLastError(); =20 diff --git a/src/libvirt-lxc.c b/src/libvirt-lxc.c index 9bf0174..380d008 100644 --- a/src/libvirt-lxc.c +++ b/src/libvirt-lxc.c @@ -235,9 +235,8 @@ virDomainLxcEnterSecurityLabel(virSecurityModelPtr mode= l, } =20 if (setexeccon(label->label) < 0) { - virReportSystemError(errno, - _("Cannot set context %s"), - label->label); + virReportSystemError(errno, _("Cannot set context %s"), + label->label); goto error; } #else diff --git a/src/libvirt-network.c b/src/libvirt-network.c index 9f9e0dd..42e2b3b 100644 --- a/src/libvirt-network.c +++ b/src/libvirt-network.c @@ -1200,7 +1200,7 @@ virNetworkGetDHCPLeases(virNetworkPtr network, { virConnectPtr conn; VIR_DEBUG("network=3D%p, mac=3D'%s' leases=3D%p, flags=3D0x%x", - network, NULLSTR(mac), leases, flags); + network, NULLSTR(mac), leases, flags); =20 virResetLastError(); =20 diff --git a/src/libvirt-nodedev.c b/src/libvirt-nodedev.c index 10050b1..5a27a10 100644 --- a/src/libvirt-nodedev.c +++ b/src/libvirt-nodedev.c @@ -258,7 +258,7 @@ virNodeDeviceLookupSCSIHostByWWN(virConnectPtr conn, conn->nodeDeviceDriver->nodeDeviceLookupSCSIHostByWWN) { virNodeDevicePtr ret; ret =3D conn->nodeDeviceDriver->nodeDeviceLookupSCSIHostByWWN(conn= , wwnn, - wwpn, flags); + wwpn, = flags); if (!ret) goto error; return ret; @@ -410,7 +410,7 @@ virNodeDeviceListCaps(virNodeDevicePtr dev, int maxnames) { VIR_DEBUG("dev=3D%p, conn=3D%p, names=3D%p, maxnames=3D%d", - dev, dev ? dev->conn : NULL, names, maxnames); + dev, dev ? dev->conn : NULL, names, maxnames); =20 virResetLastError(); =20 diff --git a/src/libvirt-storage.c b/src/libvirt-storage.c index 2ea3e94..e65eee5 100644 --- a/src/libvirt-storage.c +++ b/src/libvirt-storage.c @@ -1561,8 +1561,10 @@ virStorageVolCreateXMLFrom(virStoragePoolPtr pool, if (pool->conn->storageDriver && pool->conn->storageDriver->storageVolCreateXMLFrom) { virStorageVolPtr ret; - ret =3D pool->conn->storageDriver->storageVolCreateXMLFrom(pool, x= mlDesc, - clonevol, flags); + ret =3D pool->conn->storageDriver->storageVolCreateXMLFrom(pool, + xmlDesc, + clonevol, + flags); if (!ret) goto error; return ret; @@ -1709,11 +1711,8 @@ virStorageVolUpload(virStorageVolPtr vol, if (vol->conn->storageDriver && vol->conn->storageDriver->storageVolUpload) { int ret; - ret =3D vol->conn->storageDriver->storageVolUpload(vol, - stream, - offset, - length, - flags); + ret =3D vol->conn->storageDriver->storageVolUpload(vol, stream, of= fset, + length, flags); if (ret < 0) goto error; return ret; diff --git a/src/libvirt.c b/src/libvirt.c index 0a738ae..93d433f 100644 --- a/src/libvirt.c +++ b/src/libvirt.c @@ -581,7 +581,7 @@ virRegisterConnectDriver(virConnectDriverPtr driver, } =20 VIR_DEBUG("registering %s as driver %d", - driver->hypervisorDriver->name, virConnectDriverTabCount); + driver->hypervisorDriver->name, virConnectDriverTabCount); =20 if (setSharedDrivers) { if (driver->interfaceDriver =3D=3D NULL) @@ -1046,7 +1046,7 @@ virConnectOpenInternal(const char *name, i, virConnectDriverTab[i]->hypervisorDriver->name, res =3D=3D VIR_DRV_OPEN_SUCCESS ? "SUCCESS" : (res =3D=3D VIR_DRV_OPEN_DECLINED ? "DECLINED" : - (res =3D=3D VIR_DRV_OPEN_ERROR ? "ERROR" : "unknown stat= us"))); + (res =3D=3D VIR_DRV_OPEN_ERROR ? "ERROR" : "unknown sta= tus"))); =20 if (res =3D=3D VIR_DRV_OPEN_SUCCESS) { break; --=20 2.17.1 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Fri Apr 26 20:41:46 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 153872716630018.74433539666768; Fri, 5 Oct 2018 01:12:46 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 6491B8831C; Fri, 5 Oct 2018 08:12:44 +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 29D5362470; Fri, 5 Oct 2018 08:12:44 +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 C9AC13D396; Fri, 5 Oct 2018 08:12:43 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id w958CAnF009464 for ; Fri, 5 Oct 2018 04:12:10 -0400 Received: by smtp.corp.redhat.com (Postfix) id 01FBF5C227; Fri, 5 Oct 2018 08:12:10 +0000 (UTC) Received: from mx1.redhat.com (ext-mx12.extmail.prod.ext.phx2.redhat.com [10.5.110.41]) by smtp.corp.redhat.com (Postfix) with ESMTPS id EBE0A5C22B for ; Fri, 5 Oct 2018 08:12:09 +0000 (UTC) Received: from m97138.mail.qiye.163.com (m97138.mail.qiye.163.com [220.181.97.138]) by mx1.redhat.com (Postfix) with ESMTP id F0CBF308A95D for ; Fri, 5 Oct 2018 08:12:05 +0000 (UTC) Received: from localhost.localdomain (unknown [58.56.27.130]) by smtp9 (Coremail) with SMTP id u+CowAB3p3_PHLdb0blTAg--.62652S11; Fri, 05 Oct 2018 16:12:01 +0800 (CST) From: Shi Lei To: libvir-list@redhat.com Date: Fri, 5 Oct 2018 16:11:32 +0800 Message-Id: <20181005081145.29901-10-shi_lei@massclouds.com> In-Reply-To: <20181005081145.29901-1-shi_lei@massclouds.com> References: <20181005081145.29901-1-shi_lei@massclouds.com> X-CM-TRANSID: u+CowAB3p3_PHLdb0blTAg--.62652S11 X-Coremail-Antispam: 1Uf129KBjvJXoW3XF13XFWkXF1DuF18ArW7twb_yoWfJr1UpF 15CasYyrWrAFW09ws5XrWruF17Wr4kWFyUuFWkWayFyF45Wry5Kan7Gry3Aa47Xr18Ww1a qF4Fq3y5Can5Xw7anT9S1TB71UUUUUUqnTZGkaVYY2UrUUUUjbIjqfuFe4nvWSU5nxnvy2 9KBjDUYxBIdaVFxhVjvjDU0xZFpf9x0pR8-B_UUUUU= X-Originating-IP: [58.56.27.130] X-CM-SenderInfo: pvklsz1hl6ztxvvfz0xxgvhudrp/1tbigxHWT1sflN4LRwAAsJ 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.41]); Fri, 05 Oct 2018 08:12:07 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.41]); Fri, 05 Oct 2018 08:12:07 +0000 (UTC) for IP:'220.181.97.138' DOMAIN:'m97138.mail.qiye.163.com' HELO:'m97138.mail.qiye.163.com' FROM:'shi_lei@massclouds.com' RCPT:'' X-RedHat-Spam-Score: -0.01 (RCVD_IN_DNSWL_NONE) 220.181.97.138 m97138.mail.qiye.163.com 220.181.97.138 m97138.mail.qiye.163.com X-Scanned-By: MIMEDefang 2.84 on 10.5.110.41 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 09/22] nwfilter: Fix misaligned arguments and misaligned conditions 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.15 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.28]); Fri, 05 Oct 2018 08:12:45 +0000 (UTC) X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" This patch fixes misaligned arguments and misaligned conditions. Signed-off-by: Shi Lei --- src/nwfilter/nwfilter_dhcpsnoop.c | 10 +++---- src/nwfilter/nwfilter_driver.c | 8 ++--- src/nwfilter/nwfilter_ebiptables_driver.c | 18 +++++------- src/nwfilter/nwfilter_learnipaddr.c | 36 +++++++++-------------- 4 files changed, 31 insertions(+), 41 deletions(-) diff --git a/src/nwfilter/nwfilter_dhcpsnoop.c b/src/nwfilter/nwfilter_dhcp= snoop.c index e40f649..535c88d 100644 --- a/src/nwfilter/nwfilter_dhcpsnoop.c +++ b/src/nwfilter/nwfilter_dhcpsnoop.c @@ -1537,12 +1537,12 @@ virNWFilterDHCPSnoopThread(void *req0) } =20 if (virNWFilterSnoopDHCPDecodeJobSubmit(worker, packet, - hdr->caplen, - pcapConf[i].dir, - &pcapConf[i].qCtr) <= 0) { + hdr->caplen, + pcapConf[i].dir, + &pcapConf[i].qCtr)= < 0) { virReportError(VIR_ERR_INTERNAL_ERROR, - _("Job submission failed on " - "interface '%s'"), req->binding->port= devname); + _("Job submission failed on interface '= %s'"), + req->binding->portdevname); error =3D true; break; } diff --git a/src/nwfilter/nwfilter_driver.c b/src/nwfilter/nwfilter_driver.c index 1ee5162..8737769 100644 --- a/src/nwfilter/nwfilter_driver.c +++ b/src/nwfilter/nwfilter_driver.c @@ -228,7 +228,7 @@ nwfilterStateInitialize(bool privileged, nwfilterDriverInstallDBusMatches(sysbus) < 0) { virReportError(VIR_ERR_INTERNAL_ERROR, "%s", _("DBus matches could not be installed. " - "Disabling nwfilter driver")); + "Disabling nwfilter driver")); /* * unfortunately this is fatal since virNWFilterTechDriversInit * may have caused the ebiptables driver to use the firewall tool @@ -495,7 +495,7 @@ nwfilterConnectNumOfNWFilters(virConnectPtr conn) return -1; =20 return virNWFilterObjListNumOfNWFilters(driver->nwfilters, conn, - virConnectNumOfNWFiltersCheckACL); + virConnectNumOfNWFiltersCheckA= CL); } =20 =20 @@ -511,8 +511,8 @@ nwfilterConnectListNWFilters(virConnectPtr conn, =20 nwfilterDriverLock(); nnames =3D virNWFilterObjListGetNames(driver->nwfilters, conn, - virConnectListNWFiltersCheckACL, - names, maxnames); + virConnectListNWFiltersCheckACL, + names, maxnames); nwfilterDriverUnlock(); return nnames; } diff --git a/src/nwfilter/nwfilter_ebiptables_driver.c b/src/nwfilter/nwfil= ter_ebiptables_driver.c index 5be1c9b..7ace424 100644 --- a/src/nwfilter/nwfilter_ebiptables_driver.c +++ b/src/nwfilter/nwfilter_ebiptables_driver.c @@ -1703,7 +1703,7 @@ iptablesCreateRuleInstance(virFirewallPtr fw, const char *matchState; =20 if (!(rule->flags & RULE_FLAG_NO_STATEMATCH) && - (rule->flags & IPTABLES_STATE_FLAGS)) { + (rule->flags & IPTABLES_STATE_FLAGS)) { return iptablesCreateRuleInstanceStateCtrl(fw, layer, rule, @@ -1833,8 +1833,7 @@ ebtablesCreateRuleInstance(virFirewallPtr fw, virBuffer buf =3D VIR_BUFFER_INITIALIZER; =20 if (STREQ(chainSuffix, - virNWFilterChainSuffixTypeToString( - VIR_NWFILTER_CHAINSUFFIX_ROOT))) + virNWFilterChainSuffixTypeToString(VIR_NWFILTER_CHAINSUFFIX_= ROOT))) PRINT_ROOT_CHAIN(chain, chainPrefix, ifname); else PRINT_CHAIN(chain, chainPrefix, ifname, @@ -1927,7 +1926,7 @@ ebtablesCreateRuleInstance(virFirewallPtr fw, _("STP filtering in %s direction with " "source MAC address set is not supported"), virNWFilterRuleDirectionTypeToString( - VIR_NWFILTER_RULE_DIRECTION_INOUT)); + VIR_NWFILTER_RULE_DIRECTION_INOUT)); return -1; } =20 @@ -2441,8 +2440,7 @@ ebtablesCreateRuleInstance(virFirewallPtr fw, switch (rule->action) { case VIR_NWFILTER_RULE_ACTION_REJECT: /* REJECT not supported */ - target =3D virNWFilterJumpTargetTypeToString( - VIR_NWFILTER_RULE_ACTION_DROP); + target =3D virNWFilterJumpTargetTypeToString(VIR_NWFILTER_RULE_ACT= ION_DROP); break; default: target =3D virNWFilterJumpTargetTypeToString(rule->action); @@ -2722,7 +2720,7 @@ ebtablesRemoveSubChainsQuery(virFirewallPtr fw, virFirewallAddRuleFull(fw, VIR_FIREWALL_LAYER_ETHERNET, false, ebtablesRemoveSubChainsQuery, (void *)chainprefixes, - "-t", "nat", "-L", tmp, NULL); + "-t", "nat", "-L", tmp, NULL); virFirewallAddRuleFull(fw, VIR_FIREWALL_LAYER_ETHERNET, true, NULL, NULL, "-t", "nat", "-F", tmp, NULL); @@ -3161,7 +3159,7 @@ virNWFilterRuleInstSort(const void *a, const void *b) const virNWFilterRuleInst *insta =3D a; const virNWFilterRuleInst *instb =3D b; const char *root =3D virNWFilterChainSuffixTypeToString( - VIR_NWFILTER_CHAINSUFFIX_ROOT); + VIR_NWFILTER_CHAINSUFFIX_ROOT); bool root_a =3D STREQ(insta->chainSuffix, root); bool root_b =3D STREQ(instb->chainSuffix, root); =20 @@ -3222,7 +3220,7 @@ iptablesCheckBridgeNFCallEnabled(bool isIPv6) char msg[256]; snprintf(msg, sizeof(msg), _("To enable ip%stables filtering for the VM = do " - "'echo 1 > %s'"), + "'echo 1 > %s'"), isIPv6 ? "6" : "", pathname); VIR_WARN("%s", msg); @@ -3361,7 +3359,7 @@ ebtablesGetSubChainInsts(virHashTablePtr chains, for (i =3D 0; filter_names[i].key; i++) { struct ebtablesSubChainInst *inst; enum l3_proto_idx idx =3D ebtablesGetProtoIdxByFiltername( - filter_names[i].key); + filter_names[i].key); =20 if ((int)idx < 0) continue; diff --git a/src/nwfilter/nwfilter_learnipaddr.c b/src/nwfilter/nwfilter_le= arnipaddr.c index 008c24b..28bd8ad 100644 --- a/src/nwfilter/nwfilter_learnipaddr.c +++ b/src/nwfilter/nwfilter_learnipaddr.c @@ -556,11 +556,9 @@ learnIPAddressThread(void *arg) /* packets from the VM */ =20 if (etherType =3D=3D ETHERTYPE_IP && - (header.len >=3D ethHdrSize + - sizeof(struct iphdr))) { + (header.len >=3D ethHdrSize + sizeof(struct iphdr))) { VIR_WARNINGS_NO_CAST_ALIGN - struct iphdr *iphdr =3D (struct iphdr*)(packet + - ethHdrSize); + struct iphdr *iphdr =3D (struct iphdr*)(packet + ethHd= rSize); VIR_WARNINGS_RESET vmaddr =3D iphdr->saddr; /* skip mcast addresses (224.0.0.0 - 239.255.255.255), @@ -574,11 +572,10 @@ learnIPAddressThread(void *arg) =20 howDetected =3D DETECT_STATIC; } else if (etherType =3D=3D ETHERTYPE_ARP && - (header.len >=3D ethHdrSize + - sizeof(struct f_arphdr))) { + (header.len >=3D ethHdrSize + sizeof(struct f_a= rphdr))) { VIR_WARNINGS_NO_CAST_ALIGN struct f_arphdr *arphdr =3D (struct f_arphdr*)(packet + - ethHdrSize); + ethHdrSiz= e); VIR_WARNINGS_RESET switch (ntohs(arphdr->arphdr.ar_op)) { case ARPOP_REPLY: @@ -597,32 +594,27 @@ learnIPAddressThread(void *arg) virMacAddrIsBroadcastRaw(ether_hdr->ether_dhost)) { /* packets to the VM */ if (etherType =3D=3D ETHERTYPE_IP && - (header.len >=3D ethHdrSize + - sizeof(struct iphdr))) { + (header.len >=3D ethHdrSize + sizeof(struct iphdr))) { VIR_WARNINGS_NO_CAST_ALIGN - struct iphdr *iphdr =3D (struct iphdr*)(packet + - ethHdrSize); + struct iphdr *iphdr =3D (struct iphdr*)(packet + ethHd= rSize); VIR_WARNINGS_RESET if ((iphdr->protocol =3D=3D IPPROTO_UDP) && - (header.len >=3D ethHdrSize + - iphdr->ihl * 4 + - sizeof(struct udphdr))) { + (header.len >=3D + ethHdrSize + iphdr->ihl * 4 + sizeof(struct udphd= r))) { VIR_WARNINGS_NO_CAST_ALIGN struct udphdr *udphdr =3D (struct udphdr *) ((char *)iphdr + iphdr->ihl * 4); VIR_WARNINGS_RESET if (ntohs(udphdr->source) =3D=3D 67 && ntohs(udphdr->dest) =3D=3D 68 && - header.len >=3D ethHdrSize + - iphdr->ihl * 4 + - sizeof(struct udphdr) + - sizeof(struct dhcp)) { + (header.len >=3D (ethHdrSize + iphdr->ihl * 4 + + sizeof(struct udphdr) + + sizeof(struct dhcp)))) { struct dhcp *dhcp =3D (struct dhcp *) ((char *)udphdr + sizeof(udphdr)); if (dhcp->op =3D=3D 2 /* BOOTREPLY */ && - virMacAddrCmpRaw( - &req->binding->mac, - &dhcp->chaddr[0]) =3D=3D 0) { + virMacAddrCmpRaw(&req->binding->mac, + &dhcp->chaddr[0]) =3D=3D = 0) { dhcp_opts_len =3D header.len - (ethHdrSize + iphdr->ihl * 4 + sizeof(struct udphdr) + @@ -670,7 +662,7 @@ learnIPAddressThread(void *arg) if ((inetaddr =3D virSocketAddrFormat(&sa)) !=3D NULL) { if (virNWFilterIPAddrMapAddIPAddr(req->binding->portdevname, i= netaddr) < 0) { VIR_ERROR(_("Failed to add IP address %s to IP address " - "cache for interface %s"), inetaddr, req->bindin= g->portdevname); + "cache for interface %s"), inetaddr, req->bind= ing->portdevname); } =20 ret =3D virNWFilterInstantiateFilterLate(req->driver, --=20 2.17.1 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Fri Apr 26 20:41:46 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 1538727185209973.4414801896047; Fri, 5 Oct 2018 01:13:05 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 1618930833B1; Fri, 5 Oct 2018 08:13:02 +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 B2FA72E173; Fri, 5 Oct 2018 08:13:01 +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 30879180B5B7; Fri, 5 Oct 2018 08:13:01 +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 w958CB7O009504 for ; Fri, 5 Oct 2018 04:12:11 -0400 Received: by smtp.corp.redhat.com (Postfix) id 9BC2860922; Fri, 5 Oct 2018 08:12:11 +0000 (UTC) Received: from mx1.redhat.com (ext-mx16.extmail.prod.ext.phx2.redhat.com [10.5.110.45]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 0460566082 for ; Fri, 5 Oct 2018 08:12:08 +0000 (UTC) Received: from m97138.mail.qiye.163.com (m97138.mail.qiye.163.com [220.181.97.138]) by mx1.redhat.com (Postfix) with ESMTP id 1329F3082A26 for ; Fri, 5 Oct 2018 08:12:06 +0000 (UTC) Received: from localhost.localdomain (unknown [58.56.27.130]) by smtp9 (Coremail) with SMTP id u+CowAB3p3_PHLdb0blTAg--.62652S12; Fri, 05 Oct 2018 16:12:01 +0800 (CST) From: Shi Lei To: libvir-list@redhat.com Date: Fri, 5 Oct 2018 16:11:33 +0800 Message-Id: <20181005081145.29901-11-shi_lei@massclouds.com> In-Reply-To: <20181005081145.29901-1-shi_lei@massclouds.com> References: <20181005081145.29901-1-shi_lei@massclouds.com> X-CM-TRANSID: u+CowAB3p3_PHLdb0blTAg--.62652S12 X-Coremail-Antispam: 1Uf129KBjvJXoWxAFykKw4fKw4xKry3Ww17ZFb_yoW5Gr1Upa yfta4SyrWqqF4rZFZFq3WYga4ftFyUKFW7Krn3Ww4Dua1UtwsxWw13ur1UA34DXrZ3XFW0 vF1DJayDWa1UAFJanT9S1TB71UUUUUUqnTZGkaVYY2UrUUUUjbIjqfuFe4nvWSU5nxnvy2 9KBjDUYxBIdaVFxhVjvjDU0xZFpf9x0piqg43UUUUU= X-Originating-IP: [58.56.27.130] X-CM-SenderInfo: pvklsz1hl6ztxvvfz0xxgvhudrp/1tbigBLWT1rpNeJr1wAAsT 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.45]); Fri, 05 Oct 2018 08:12:07 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.45]); Fri, 05 Oct 2018 08:12:07 +0000 (UTC) for IP:'220.181.97.138' DOMAIN:'m97138.mail.qiye.163.com' HELO:'m97138.mail.qiye.163.com' FROM:'shi_lei@massclouds.com' RCPT:'' X-RedHat-Spam-Score: -0.01 (RCVD_IN_DNSWL_NONE) 220.181.97.138 m97138.mail.qiye.163.com 220.181.97.138 m97138.mail.qiye.163.com X-Scanned-By: MIMEDefang 2.84 on 10.5.110.45 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 10/22] phyp: Fix misaligned arguments 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.84 on 10.5.11.23 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.44]); Fri, 05 Oct 2018 08:13:04 +0000 (UTC) X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" This patch fixes misaligned arguments. Signed-off-by: Shi Lei --- src/phyp/phyp_driver.c | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/src/phyp/phyp_driver.c b/src/phyp/phyp_driver.c index 05bf6df..96216c4 100644 --- a/src/phyp/phyp_driver.c +++ b/src/phyp/phyp_driver.c @@ -1792,9 +1792,8 @@ phypDomainAttachDevice(virDomainPtr domain, const cha= r *xml) ret =3D phypExecBuffer(session, &buf, &exit_status, conn, false); =20 if (exit_status < 0 || ret =3D=3D NULL) { - VIR_ERROR(_ - ("Possibly you don't have IBM Tools installed in your L= PAR." - "Contact your support to enable this feature.")); + VIR_ERROR(_("Possibly you don't have IBM Tools installed in your L= PAR." + " Contact your support to enable this feature.")); goto cleanup; } =20 @@ -2825,9 +2824,8 @@ phypInterfaceDefineXML(virConnectPtr conn, const char= *xml, if (system_type =3D=3D HMC) virBufferAsprintf(&buf, "-m %s ", managed_system); =20 - virBufferAsprintf(&buf, - " -r virtualio --rsubtype eth" - " -p %s -o r -s %d", def->name, slot); + virBufferAsprintf(&buf, " -r virtualio --rsubtype eth -p %s -o r -= s %d", + def->name, slot); VIR_FREE(ret); ret =3D phypExecBuffer(session, &buf, &exit_status, conn, false); goto cleanup; @@ -3127,8 +3125,9 @@ phypConnectListDefinedDomains(virConnectPtr conn, cha= r **const names, int nnames virBufferAddLit(&buf, "lssyscfg -r lpar"); if (system_type =3D=3D HMC) virBufferAsprintf(&buf, " -m %s", managed_system); - virBufferAddLit(&buf, " -F name,state" - "|sed -n '/Not Activated/ {\n s/,.*$//\n p\n}'"); + virBufferAddLit(&buf, + " -F name,state" + "|sed -n '/Not Activated/ {\n s/,.*$//\n p\n}'"); ret =3D phypExecBuffer(session, &buf, &exit_status, conn, false); =20 /* I need to parse the textual return in order to get the domains */ @@ -3605,7 +3604,7 @@ phypDomainSetVcpusFlags(virDomainPtr dom, unsigned in= t nvcpus, =20 if (nvcpus > phypDomainGetMaxVcpus(dom)) { VIR_ERROR(_("You are trying to set a number of CPUs bigger than " - "the max possible.")); + "the max possible.")); return 0; } =20 @@ -3628,8 +3627,7 @@ phypDomainSetVcpusFlags(virDomainPtr dom, unsigned in= t nvcpus, ret =3D phypExecBuffer(session, &buf, &exit_status, dom->conn, false); =20 if (exit_status < 0) { - VIR_ERROR(_ - ("Possibly you don't have IBM Tools installed in your L= PAR." + VIR_ERROR(_("Possibly you don't have IBM Tools installed in your L= PAR." " Contact your support to enable this feature.")); } =20 --=20 2.17.1 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Fri Apr 26 20:41:46 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 1538727132057195.0258120544438; Fri, 5 Oct 2018 01:12:12 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id C02A6C04BD5C; Fri, 5 Oct 2018 08:12:09 +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 55C432E056; Fri, 5 Oct 2018 08:12:09 +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 27A384BB79; Fri, 5 Oct 2018 08:12:08 +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 w958C7N5009391 for ; Fri, 5 Oct 2018 04:12:07 -0400 Received: by smtp.corp.redhat.com (Postfix) id 84F0B6246B; Fri, 5 Oct 2018 08:12:07 +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 7D6E15EDEF for ; Fri, 5 Oct 2018 08:12:05 +0000 (UTC) Received: from m97138.mail.qiye.163.com (m97138.mail.qiye.163.com [220.181.97.138]) by mx1.redhat.com (Postfix) with ESMTP id 4920312C29 for ; Fri, 5 Oct 2018 08:12:03 +0000 (UTC) Received: from localhost.localdomain (unknown [58.56.27.130]) by smtp9 (Coremail) with SMTP id u+CowAB3p3_PHLdb0blTAg--.62652S13; Fri, 05 Oct 2018 16:12:02 +0800 (CST) From: Shi Lei To: libvir-list@redhat.com Date: Fri, 5 Oct 2018 16:11:34 +0800 Message-Id: <20181005081145.29901-12-shi_lei@massclouds.com> In-Reply-To: <20181005081145.29901-1-shi_lei@massclouds.com> References: <20181005081145.29901-1-shi_lei@massclouds.com> X-CM-TRANSID: u+CowAB3p3_PHLdb0blTAg--.62652S13 X-Coremail-Antispam: 1Uf129KBjvJXoW3JF4DWw45Jr47JF4DZF47urg_yoWxGry5pF 4UK3s5KF4kJF4aqa9rAF1Du3s8uw1qqF4Y9347WrW7Xayq9FyfJF4xKFZ8CayYyrZYgFWY qF1Yq34xZa15WaDanT9S1TB71UUUUUUqnTZGkaVYY2UrUUUUjbIjqfuFe4nvWSU5nxnvy2 9KBjDUYxBIdaVFxhVjvjDU0xZFpf9x0piqg43UUUUU= X-Originating-IP: [58.56.27.130] X-CM-SenderInfo: pvklsz1hl6ztxvvfz0xxgvhudrp/1tbighLWT1sfmG0bVQAAs2 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.26]); Fri, 05 Oct 2018 08:12:04 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.26]); Fri, 05 Oct 2018 08:12:04 +0000 (UTC) for IP:'220.181.97.138' DOMAIN:'m97138.mail.qiye.163.com' HELO:'m97138.mail.qiye.163.com' FROM:'shi_lei@massclouds.com' RCPT:'' X-RedHat-Spam-Score: -0.01 (RCVD_IN_DNSWL_NONE) 220.181.97.138 m97138.mail.qiye.163.com 220.181.97.138 m97138.mail.qiye.163.com 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 Subject: [libvirt] [PATCH 11/22] remote: Fix misaligned arguments 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.84 on 10.5.11.23 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.31]); Fri, 05 Oct 2018 08:12:10 +0000 (UTC) X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" This patch fixes misaligned arguments. Signed-off-by: Shi Lei --- src/remote/remote_daemon.c | 2 +- src/remote/remote_daemon_dispatch.c | 16 +++++++-------- src/remote/remote_driver.c | 31 +++++++++++++++-------------- 3 files changed, 25 insertions(+), 24 deletions(-) diff --git a/src/remote/remote_daemon.c b/src/remote/remote_daemon.c index c14a561..c67f1b0 100644 --- a/src/remote/remote_daemon.c +++ b/src/remote/remote_daemon.c @@ -549,7 +549,7 @@ daemonSetupNetworking(virNetServerPtr srv, (ipsock && config->listen_tls && config->auth_tls =3D=3D REMOTE_AU= TH_SASL) || (ipsock && config->listen_tcp && config->auth_tcp =3D=3D REMOTE_AU= TH_SASL)) { saslCtxt =3D virNetSASLContextNewServer( - (const char *const*)config->sasl_allowed_username_list); + (const char *const*)config->sasl_allowed_username_list= ); if (!saslCtxt) goto cleanup; } diff --git a/src/remote/remote_daemon_dispatch.c b/src/remote/remote_daemon= _dispatch.c index e62ebfb..50d2079 100644 --- a/src/remote/remote_daemon_dispatch.c +++ b/src/remote/remote_daemon_dispatch.c @@ -6004,10 +6004,10 @@ remoteDispatchConnectStoragePoolEventRegisterAny(vi= rNetServerPtr server ATTRIBUT =20 static int remoteDispatchConnectStoragePoolEventDeregisterAny(virNetServerPtr server = ATTRIBUTE_UNUSED, - virNetServerClientPtr clien= t, - virNetMessagePtr msg ATTRIB= UTE_UNUSED, - virNetMessageErrorPtr rerr = ATTRIBUTE_UNUSED, - remote_connect_storage_pool= _event_deregister_any_args *args) + virNetServerClientPtr c= lient, + virNetMessagePtr msg AT= TRIBUTE_UNUSED, + virNetMessageErrorPtr r= err ATTRIBUTE_UNUSED, + remote_connect_storage_= pool_event_deregister_any_args *args) { int rv =3D -1; size_t i; @@ -6246,10 +6246,10 @@ remoteDispatchConnectSecretEventRegisterAny(virNetS= erverPtr server ATTRIBUTE_UNU =20 static int remoteDispatchConnectSecretEventDeregisterAny(virNetServerPtr server ATTRI= BUTE_UNUSED, - virNetServerClientPtr cl= ient, - virNetMessagePtr msg ATT= RIBUTE_UNUSED, - virNetMessageErrorPtr re= rr ATTRIBUTE_UNUSED, - remote_connect_secret_ev= ent_deregister_any_args *args) + virNetServerClientPtr client, + virNetMessagePtr msg ATTRIBU= TE_UNUSED, + virNetMessageErrorPtr rerr A= TTRIBUTE_UNUSED, + remote_connect_secret_event_= deregister_any_args *args) { int rv =3D -1; size_t i; diff --git a/src/remote/remote_driver.c b/src/remote/remote_driver.c index 3b43e21..58528af 100644 --- a/src/remote/remote_driver.c +++ b/src/remote/remote_driver.c @@ -326,8 +326,8 @@ remoteDomainBuildEventCallbackBalloonChange(virNetClien= tProgramPtr prog, =20 static void remoteDomainBuildEventPMSuspendDisk(virNetClientProgramPtr prog, - virNetClientPtr client, - void *evdata, void *opaque); + virNetClientPtr client, + void *evdata, void *opaque); static void remoteDomainBuildEventCallbackPMSuspendDisk(virNetClientProgramPtr prog, virNetClientPtr client, @@ -914,7 +914,7 @@ doRemoteOpen(virConnectPtr conn, } =20 VIR_DEBUG("passing through variable '%s' ('%s') to remote end", - var->name, var->value); + var->name, var->value); } =20 /* Construct the original name. */ @@ -1197,8 +1197,8 @@ doRemoteOpen(virConnectPtr conn, goto failed; =20 if (virNetClientKeepAliveIsSupported(priv->client)) { - priv->serverKeepAlive =3D remoteConnectSupportsFeatureUnlocked(con= n, - priv, VIR_DRV_FEATURE_PROGRAM_KEEPALIV= E); + priv->serverKeepAlive =3D remoteConnectSupportsFeatureUnlocked( + conn, priv, VIR_DRV_FEATURE_PROGRAM_KE= EPALIVE); if (!priv->serverKeepAlive) { VIR_INFO("Disabling keepalive protocol since it is not support= ed" " by the server"); @@ -1239,15 +1239,16 @@ doRemoteOpen(virConnectPtr conn, if (!(priv->eventState =3D virObjectEventStateNew())) goto failed; =20 - priv->serverEventFilter =3D remoteConnectSupportsFeatureUnlocked(conn, - priv, VIR_DRV_FEATURE_REMOTE_EVENT_CALLBAC= K); + priv->serverEventFilter =3D remoteConnectSupportsFeatureUnlocked( + conn, priv, VIR_DRV_FEATURE_REMOTE_EVENT_C= ALLBACK); if (!priv->serverEventFilter) { VIR_INFO("Avoiding server event filtering since it is not " "supported by the server"); } =20 - priv->serverCloseCallback =3D remoteConnectSupportsFeatureUnlocked(con= n, - priv, VIR_DRV_FEATURE_REMOTE_CLOSE_CAL= LBACK); + priv->serverCloseCallback =3D remoteConnectSupportsFeatureUnlocked( + conn, priv, + VIR_DRV_FEATURE_REMOTE_CLOSE_CALLBACK); if (!priv->serverCloseCallback) { VIR_INFO("Close callback registering isn't supported " "by the remote side."); @@ -2913,9 +2914,9 @@ static int remoteDomainGetBlockJobInfo(virDomainPtr d= omain, =20 if (call(domain->conn, priv, 0, REMOTE_PROC_DOMAIN_GET_BLOCK_JOB_INFO, (xdrproc_t)xdr_remote_domain_get_block_job_info_args, - (char *)&args, + (char *)&args, (xdrproc_t)xdr_remote_domain_get_block_job_info_ret, - (char *)&ret) =3D=3D -1) + (char *)&ret) =3D=3D -1) goto done; =20 if (ret.found) { @@ -2956,9 +2957,9 @@ static int remoteDomainGetBlockIoTune(virDomainPtr do= main, =20 if (call(domain->conn, priv, 0, REMOTE_PROC_DOMAIN_GET_BLOCK_IO_TUNE, (xdrproc_t) xdr_remote_domain_get_block_io_tune_args, - (char *) &args, + (char *) &args, (xdrproc_t) xdr_remote_domain_get_block_io_tune_ret, - (char *) &ret) =3D=3D -1) { + (char *) &ret) =3D=3D -1) { goto done; } =20 @@ -3426,7 +3427,7 @@ remoteConnectSecretEventRegisterAny(virConnectPtr con= n, =20 static int remoteConnectSecretEventDeregisterAny(virConnectPtr conn, - int callbackID) + int callbackID) { struct private_data *priv =3D conn->privateData; int rv =3D -1; @@ -8239,7 +8240,7 @@ make_nonnull_network(remote_nonnull_network *net_dst,= virNetworkPtr net_src) =20 static void make_nonnull_interface(remote_nonnull_interface *interface_dst, - virInterfacePtr interface_src) + virInterfacePtr interface_src) { interface_dst->name =3D interface_src->name; interface_dst->mac =3D interface_src->mac; --=20 2.17.1 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Fri Apr 26 20:41:46 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 1538727155065640.5635660317836; Fri, 5 Oct 2018 01:12:35 -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 57DAF3001943; Fri, 5 Oct 2018 08:12:33 +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 0E5025D9CC; Fri, 5 Oct 2018 08:12:33 +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 A8D923D390; Fri, 5 Oct 2018 08:12:32 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.24]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id w958CML6009602 for ; Fri, 5 Oct 2018 04:12:22 -0400 Received: by smtp.corp.redhat.com (Postfix) id EA054308BDA4; Fri, 5 Oct 2018 08:12:22 +0000 (UTC) Received: from mx1.redhat.com (ext-mx03.extmail.prod.ext.phx2.redhat.com [10.5.110.27]) by smtp.corp.redhat.com (Postfix) with ESMTPS id E1D38308BDA1 for ; Fri, 5 Oct 2018 08:12:22 +0000 (UTC) Received: from m97138.mail.qiye.163.com (m97138.mail.qiye.163.com [220.181.97.138]) by mx1.redhat.com (Postfix) with ESMTP id A2BBF83F51 for ; Fri, 5 Oct 2018 08:12:12 +0000 (UTC) Received: from localhost.localdomain (unknown [58.56.27.130]) by smtp9 (Coremail) with SMTP id u+CowAB3p3_PHLdb0blTAg--.62652S14; Fri, 05 Oct 2018 16:12:02 +0800 (CST) From: Shi Lei To: libvir-list@redhat.com Date: Fri, 5 Oct 2018 16:11:35 +0800 Message-Id: <20181005081145.29901-13-shi_lei@massclouds.com> In-Reply-To: <20181005081145.29901-1-shi_lei@massclouds.com> References: <20181005081145.29901-1-shi_lei@massclouds.com> X-CM-TRANSID: u+CowAB3p3_PHLdb0blTAg--.62652S14 X-Coremail-Antispam: 1Uf129KBjvJXoW3Xry5Wr4kXr4fWFyDGr1fCrg_yoW7XFykpw nrAFs09r9YvF47ZanxJFy5Gw1fAFnYgr15K392g3s7Ww4DC34xJF42kFy8t398Zry5Ja4a q3Z09345Ca15JFDanT9S1TB71UUUUUUqnTZGkaVYY2UrUUUUjbIjqfuFe4nvWSU5nxnvy2 9KBjDUYxBIdaVFxhVjvjDU0xZFpf9x0piqg43UUUUU= X-Originating-IP: [58.56.27.130] X-CM-SenderInfo: pvklsz1hl6ztxvvfz0xxgvhudrp/1tbieRLWT1qrhVi6hQAAsh 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.27]); Fri, 05 Oct 2018 08:12:21 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.27]); Fri, 05 Oct 2018 08:12:21 +0000 (UTC) for IP:'220.181.97.138' DOMAIN:'m97138.mail.qiye.163.com' HELO:'m97138.mail.qiye.163.com' FROM:'shi_lei@massclouds.com' RCPT:'' X-RedHat-Spam-Score: -0.01 (RCVD_IN_DNSWL_NONE) 220.181.97.138 m97138.mail.qiye.163.com 220.181.97.138 m97138.mail.qiye.163.com X-Scanned-By: MIMEDefang 2.78 on 10.5.110.27 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.24 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 12/22] rpc: Fix misaligned arguments 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.14 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.40]); Fri, 05 Oct 2018 08:12:34 +0000 (UTC) X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" This patch fixes misaligned arguments. Signed-off-by: Shi Lei --- src/rpc/virnetclient.c | 40 +++++++++++++++++++---------------- src/rpc/virnetlibsshsession.c | 2 +- src/rpc/virnetservermdns.c | 4 ++-- src/rpc/virnetsocket.c | 23 +++++++++++--------- src/rpc/virnetsshsession.c | 2 +- 5 files changed, 39 insertions(+), 32 deletions(-) diff --git a/src/rpc/virnetclient.c b/src/rpc/virnetclient.c index b4d8fb2..d2162d4 100644 --- a/src/rpc/virnetclient.c +++ b/src/rpc/virnetclient.c @@ -493,15 +493,17 @@ virNetClientPtr virNetClientNewLibSSH2(const char *ho= st, if (!(nc =3D virBufferContentAndReset(&buf))) goto no_memory; =20 - virBufferAsprintf(&buf, - "sh -c " - "'if '%s' -q 2>&1 | grep \"requires an argument\" >/dev/null 2>&1= ; then " - "ARG=3D-q0;" - "else " - "ARG=3D;" - "fi;" - "'%s' $ARG -U %s'", - nc, nc, socketPath); +#define COMMAND_FORMAT "sh -c " \ + "'if '%s' -q 2>&1 | grep \"requires an argument\" >/dev/null 2>&1; the= n " \ + "ARG=3D-q0;" \ + "else " \ + "ARG=3D;" \ + "fi;" \ + "'%s' $ARG -U %s'" + + virBufferAsprintf(&buf, COMMAND_FORMAT, nc, nc, socketPath); + +#undef COMMAND_FORMAT =20 if (!(command =3D virBufferContentAndReset(&buf))) goto no_memory; @@ -601,17 +603,19 @@ virNetClientPtr virNetClientNewLibssh(const char *hos= t, if (!(nc =3D virBufferContentAndReset(&buf))) goto no_memory; =20 - if (virAsprintf(&command, - "sh -c " - "'if '%s' -q 2>&1 | grep \"requires an argument\" >/dev/null 2>&1= ; then " - "ARG=3D-q0;" - "else " - "ARG=3D;" - "fi;" - "'%s' $ARG -U %s'", - nc, nc, socketPath) < 0) +#define COMMAND_FORMAT "sh -c " \ + "'if '%s' -q 2>&1 | grep \"requires an argument\" >/dev/null 2>&1; the= n " \ + "ARG=3D-q0;" \ + "else " \ + "ARG=3D;" \ + "fi;" \ + "'%s' $ARG -U %s'" + + if (virAsprintf(&command, COMMAND_FORMAT, nc, nc, socketPath) < 0) goto cleanup; =20 +#undef COMMAND_FORMAT + if (virNetSocketNewConnectLibssh(host, port, family, username, privkey, diff --git a/src/rpc/virnetlibsshsession.c b/src/rpc/virnetlibsshsession.c index 7c5f158..2422150 100644 --- a/src/rpc/virnetlibsshsession.c +++ b/src/rpc/virnetlibsshsession.c @@ -1124,7 +1124,7 @@ virNetLibsshSessionAuthAddKeyboardAuth(virNetLibsshSe= ssionPtr sess, =20 int virNetLibsshSessionSetChannelCommand(virNetLibsshSessionPtr sess, - const char *command) + const char *command) { int ret =3D 0; virObjectLock(sess); diff --git a/src/rpc/virnetservermdns.c b/src/rpc/virnetservermdns.c index e0a9aef..3669998 100644 --- a/src/rpc/virnetservermdns.c +++ b/src/rpc/virnetservermdns.c @@ -347,8 +347,8 @@ static AvahiTimeout *virNetServerMDNSTimeoutNew(const A= vahiPoll *api ATTRIBUTE_U } =20 VIR_DEBUG("Trigger timed for %d %d %d %d", - (int)now.tv_sec, (int)now.tv_usec, - (int)(tv ? tv->tv_sec : 0), (int)(tv ? tv->tv_usec : 0)); + (int)now.tv_sec, (int)now.tv_usec, + (int)(tv ? tv->tv_sec : 0), (int)(tv ? tv->tv_usec : 0)); nowms =3D (now.tv_sec * 1000ll) + (now.tv_usec / 1000ll); if (tv) { thenms =3D (tv->tv_sec * 1000ll) + (tv->tv_usec/1000ll); diff --git a/src/rpc/virnetsocket.c b/src/rpc/virnetsocket.c index 55de3b2..5fe0930 100644 --- a/src/rpc/virnetsocket.c +++ b/src/rpc/virnetsocket.c @@ -634,7 +634,7 @@ int virNetSocketNewConnectUNIX(const char *path, bool daemonLaunched =3D false; =20 VIR_DEBUG("path=3D%s spawnDaemon=3D%d binary=3D%s", path, spawnDaemon, - NULLSTR(binary)); + NULLSTR(binary)); =20 memset(&localAddr, 0, sizeof(localAddr)); memset(&remoteAddr, 0, sizeof(remoteAddr)); @@ -883,14 +883,17 @@ int virNetSocketNewConnectSSH(const char *nodename, * Fedora's 'nc' doesn't have this option, and defaults to the desired * behavior. */ - virCommandAddArgFormat(cmd, - "'if '%s' -q 2>&1 | grep \"requires an argument\" >/dev/null 2>&1= ; then " - "ARG=3D-q0;" - "else " - "ARG=3D;" - "fi;" - "'%s' $ARG -U %s'", - quoted, quoted, path); +#define COMMAND_FORMAT "" \ + "'if '%s' -q 2>&1 | grep \"requires an argument\" >/dev/null 2>&1; the= n " \ + "ARG=3D-q0;" \ + "else " \ + "ARG=3D;" \ + "fi;" \ + "'%s' $ARG -U %s'" + + virCommandAddArgFormat(cmd, COMMAND_FORMAT, quoted, quoted, path); + +#undef COMMAND_FORMAT =20 VIR_FREE(quoted); return virNetSocketNewConnectCommand(cmd, retsock); @@ -1534,7 +1537,7 @@ int virNetSocketGetUNIXIdentity(virNetSocketPtr sock, */ if (errno !=3D EOPNOTSUPP) { virReportSystemError(errno, "%s", - _("Failed to get client socket PID")); + _("Failed to get client socket PID")); goto cleanup; } } diff --git a/src/rpc/virnetsshsession.c b/src/rpc/virnetsshsession.c index 35dc6c5..1114036 100644 --- a/src/rpc/virnetsshsession.c +++ b/src/rpc/virnetsshsession.c @@ -462,7 +462,7 @@ virNetSSHCheckHostKey(virNetSSHSessionPtr sess) if (sess->knownHostsFile) { if (libssh2_knownhost_writefile(sess->knownHosts, sess->knownHostsFile, - LIBSSH2_KNOWNHOST_FILE_OPENSSH) <= 0) { + LIBSSH2_KNOWNHOST_FILE_OPENSSH= ) < 0) { libssh2_session_last_error(sess->session, &errmsg, NULL, 0= ); virReportError(VIR_ERR_SSH, _("failed to write known_host file '%s': %s= "), --=20 2.17.1 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Fri Apr 26 20:41:46 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 1538727171147497.7820513604256; Fri, 5 Oct 2018 01:12:51 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 27A6B356D3; Fri, 5 Oct 2018 08:12:49 +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 DAAF62E020; Fri, 5 Oct 2018 08:12:48 +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 7AC5E180B61F; Fri, 5 Oct 2018 08:12:48 +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 w958CBdB009482 for ; Fri, 5 Oct 2018 04:12:11 -0400 Received: by smtp.corp.redhat.com (Postfix) id 11ACA60922; Fri, 5 Oct 2018 08:12:11 +0000 (UTC) Received: from mx1.redhat.com (ext-mx05.extmail.prod.ext.phx2.redhat.com [10.5.110.29]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 0452E17DCC for ; Fri, 5 Oct 2018 08:12:10 +0000 (UTC) Received: from m97138.mail.qiye.163.com (m97138.mail.qiye.163.com [220.181.97.138]) by mx1.redhat.com (Postfix) with ESMTP id 36D7513A9A for ; Fri, 5 Oct 2018 08:12:05 +0000 (UTC) Received: from localhost.localdomain (unknown [58.56.27.130]) by smtp9 (Coremail) with SMTP id u+CowAB3p3_PHLdb0blTAg--.62652S15; Fri, 05 Oct 2018 16:12:03 +0800 (CST) From: Shi Lei To: libvir-list@redhat.com Date: Fri, 5 Oct 2018 16:11:36 +0800 Message-Id: <20181005081145.29901-14-shi_lei@massclouds.com> In-Reply-To: <20181005081145.29901-1-shi_lei@massclouds.com> References: <20181005081145.29901-1-shi_lei@massclouds.com> X-CM-TRANSID: u+CowAB3p3_PHLdb0blTAg--.62652S15 X-Coremail-Antispam: 1Uf129KBjvJXoW3XFWkCr45ZryUtF43Kw4Uurg_yoW3Xr48pa 1kA3s8Kr4DWF4fAwsrXFy7AF1fCr4kKFyUK398Wa1Igw4UJa4agr17CF95Zay7Gr1kXrnI yFs0gFy7GF1rGF7anT9S1TB71UUUUUUqnTZGkaVYY2UrUUUUjbIjqfuFe4nvWSU5nxnvy2 9KBjDUYxBIdaVFxhVjvjDU0xZFpf9x0piqg43UUUUU= X-Originating-IP: [58.56.27.130] X-CM-SenderInfo: pvklsz1hl6ztxvvfz0xxgvhudrp/1tbifxPWT1rpNccukQAAsL 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.29]); Fri, 05 Oct 2018 08:12:08 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.29]); Fri, 05 Oct 2018 08:12:08 +0000 (UTC) for IP:'220.181.97.138' DOMAIN:'m97138.mail.qiye.163.com' HELO:'m97138.mail.qiye.163.com' FROM:'shi_lei@massclouds.com' RCPT:'' X-RedHat-Spam-Score: -0.01 (RCVD_IN_DNSWL_NONE) 220.181.97.138 m97138.mail.qiye.163.com 220.181.97.138 m97138.mail.qiye.163.com X-Scanned-By: MIMEDefang 2.78 on 10.5.110.29 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 13/22] storage: Fix misaligned arguments and misaligned conditions 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.84 on 10.5.11.23 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.30]); Fri, 05 Oct 2018 08:12:49 +0000 (UTC) X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" This patch fixes misaligned arguments and misaligned conditions. Signed-off-by: Shi Lei --- src/storage/storage_backend_disk.c | 7 +++---- src/storage/storage_backend_gluster.c | 2 +- src/storage/storage_backend_iscsi_direct.c | 2 +- src/storage/storage_backend_rbd.c | 14 +++++++------- src/storage/storage_driver.c | 6 +++--- src/storage/storage_util.c | 16 +++++++--------- 6 files changed, 22 insertions(+), 25 deletions(-) diff --git a/src/storage/storage_backend_disk.c b/src/storage/storage_backe= nd_disk.c index 10df071..9176511 100644 --- a/src/storage/storage_backend_disk.c +++ b/src/storage/storage_backend_disk.c @@ -681,7 +681,7 @@ virStorageBackendDiskPartBoundaries(virStoragePoolObjPt= r pool, dev->geometry.sectors * SECTOR_SIZE; =20 VIR_DEBUG("find free area: allocation %llu, cyl size %llu", allocation, - cylinderSize); + cylinderSize); int partType =3D virStorageBackendDiskPartTypeToCreate(pool); =20 /* how many extra bytes we have since we allocate @@ -708,8 +708,7 @@ virStorageBackendDiskPartBoundaries(virStoragePoolObjPt= r pool, size -=3D SECTOR_SIZE; } if (size > neededSize && - (smallestSize =3D=3D 0 || - size < smallestSize)) { + (smallestSize =3D=3D 0 || size < smallestSize)) { /* for logical partition, the free extent must be within a logical free area */ if (partType =3D=3D VIR_STORAGE_VOL_DISK_TYPE_LOGICAL && @@ -798,7 +797,7 @@ virStorageBackendDiskDeleteVol(virStoragePoolObjPtr poo= l, if (!vol->target.path) { virReportError(VIR_ERR_INVALID_ARG, _("volume target path empty for source path '%s'"), - src_path); + src_path); return -1; } =20 diff --git a/src/storage/storage_backend_gluster.c b/src/storage/storage_ba= ckend_gluster.c index e09bc54..4a3c848 100644 --- a/src/storage/storage_backend_gluster.c +++ b/src/storage/storage_backend_gluster.c @@ -350,7 +350,7 @@ virStorageBackendGlusterRefreshPool(virStoragePoolObjPt= r pool) struct dirent ent; /* See comment below about readdir_r needing padding */ char padding[MAX(1, 256 - (int)(sizeof(struct dirent) - - offsetof(struct dirent, d_name)= ))]; + - offsetof(struct dirent, d_name))= )]; } de; struct dirent *ent; glfs_fd_t *dir =3D NULL; diff --git a/src/storage/storage_backend_iscsi_direct.c b/src/storage/stora= ge_backend_iscsi_direct.c index 5c1b251..1142050 100644 --- a/src/storage/storage_backend_iscsi_direct.c +++ b/src/storage/storage_backend_iscsi_direct.c @@ -669,7 +669,7 @@ virStorageBackendISCSIDirectVolWipeZero(virStorageVolDe= fPtr vol, lba +=3D BLOCK_PER_PACKET; } else { if (!(task =3D iscsi_write10_sync(iscsi, lun, lba, data, block= _size, - block_size, 0, 0, 0, 0, 0))) + block_size, 0, 0, 0, 0, 0))) goto cleanup; scsi_free_scsi_task(task); lba++; diff --git a/src/storage/storage_backend_rbd.c b/src/storage/storage_backen= d_rbd.c index 2cba678..f91a6bf 100644 --- a/src/storage/storage_backend_rbd.c +++ b/src/storage/storage_backend_rbd.c @@ -136,7 +136,7 @@ virStorageBackendRBDOpenRADOSConn(virStorageBackendRBDS= tatePtr ptr, virBufferAsprintf(&mon_host, "%s,", source->hosts[i].name); } else if (source->hosts[i].name !=3D NULL && - source->hosts[i].port) { + source->hosts[i].port) { virBufferAsprintf(&mon_host, "%s:%d,", source->hosts[i].name, source->hosts[i].port); @@ -281,7 +281,7 @@ volStorageBackendRBDGetFeatures(rbd_image_t image, =20 if ((r =3D rbd_get_features(image, features)) < 0) { virReportSystemError(-r, _("failed to get the features of RBD imag= e " - "%s"), volname); + "%s"), volname); goto cleanup; } ret =3D 0; @@ -397,7 +397,7 @@ volStorageBackendRBDRefreshVolInfo(virStorageVolDefPtr = vol, } =20 VIR_DEBUG("Refreshed RBD image %s/%s (capacity: %llu allocation: %llu " - "obj_size: %"PRIu64" num_objs: %"PRIu64")", + "obj_size: %"PRIu64" num_objs: %"PRIu64")", def->source.name, vol->name, vol->target.capacity, vol->target.allocation, info.obj_size, info.num_objs); =20 @@ -895,7 +895,7 @@ virStorageBackendRBDSnapshotCreate(rbd_image_t image, =20 if ((r =3D rbd_snap_create(image, snapname)) < 0) { virReportSystemError(-r, _("failed to create RBD snapshot %s@%s"), - imgname, snapname); + imgname, snapname); goto cleanup; } =20 @@ -928,7 +928,7 @@ virStorageBackendRBDSnapshotProtect(rbd_image_t image, =20 if ((r =3D rbd_snap_protect(image, snapname)) < 0) { virReportSystemError(-r, _("failed to protect RBD snapshot %s@= %s"), - imgname, snapname); + imgname, snapname); goto cleanup; } } else { @@ -1140,7 +1140,7 @@ virStorageBackendRBDVolWipeZero(rbd_image_t image, if ((r =3D rbd_write(image, offset, length, writebuf)) < 0) { virReportSystemError(-r, _("writing %llu bytes failed on " "RBD image %s at offset %llu"), - length, imgname, offset); + length, imgname, offset); goto cleanup; } =20 @@ -1177,7 +1177,7 @@ virStorageBackendRBDVolWipeDiscard(rbd_image_t image, if ((r =3D rbd_discard(image, offset, length)) < 0) { virReportSystemError(-r, _("discarding %llu bytes failed on " "RBD image %s at offset %llu"), - length, imgname, offset); + length, imgname, offset); goto cleanup; } =20 diff --git a/src/storage/storage_driver.c b/src/storage/storage_driver.c index 7c22c43..d9d6be7 100644 --- a/src/storage/storage_driver.c +++ b/src/storage/storage_driver.c @@ -273,9 +273,9 @@ storageStateInitialize(bool privileged, goto error; =20 if ((virAsprintf(&driver->configDir, - "%s/storage", configdir) < 0) || + "%s/storage", configdir) < 0) || (virAsprintf(&driver->autostartDir, - "%s/storage/autostart", configdir) < 0) || + "%s/storage/autostart", configdir) < 0) || (virAsprintf(&driver->stateDir, "%s/storage/run", rundir) < 0)) goto error; @@ -586,7 +586,7 @@ storageConnectNumOfDefinedStoragePools(virConnectPtr co= nn) return -1; =20 return virStoragePoolObjNumOfStoragePools(driver->pools, conn, false, - virConnectNumOfDefinedStora= gePoolsCheckACL); + virConnectNumOfDefinedStorag= ePoolsCheckACL); } =20 =20 diff --git a/src/storage/storage_util.c b/src/storage/storage_util.c index 318a556..5532221 100644 --- a/src/storage/storage_util.c +++ b/src/storage/storage_util.c @@ -1537,7 +1537,7 @@ virStorageBackendDetectBlockVolFormatFD(virStorageSou= rcePtr target, if (disk_types[i].offset + disk_types[i].length > bytes) continue; if (memcmp(buffer+disk_types[i].offset, &disk_types[i].magic, - disk_types[i].length) =3D=3D 0) { + disk_types[i].length) =3D=3D 0) { target->format =3D disk_types[i].part_table_type; break; } @@ -3760,13 +3760,11 @@ virStorageBackendSCSISerial(const char *dev) { char *serial =3D NULL; #ifdef WITH_UDEV - virCommandPtr cmd =3D virCommandNewArgList( - "/lib/udev/scsi_id", - "--replace-whitespace", - "--whitelisted", - "--device", dev, - NULL - ); + virCommandPtr cmd =3D virCommandNewArgList("/lib/udev/scsi_id", + "--replace-whitespace", + "--whitelisted", + "--device", dev, + NULL); =20 /* Run the program and capture its output */ virCommandSetOutputBuffer(cmd, &serial); @@ -4156,7 +4154,7 @@ processLU(virStoragePoolObjPtr pool, =20 int virStorageBackendSCSIFindLUs(virStoragePoolObjPtr pool, - uint32_t scanhost) + uint32_t scanhost) { virStoragePoolDefPtr def =3D virStoragePoolObjGetDef(pool); int retval =3D 0; --=20 2.17.1 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Fri Apr 26 20:41:46 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 1538727162022374.2073147486242; Fri, 5 Oct 2018 01:12:42 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.25]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 2C71480F7B; Fri, 5 Oct 2018 08:12:40 +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 E03AC20155F1; Fri, 5 Oct 2018 08:12:39 +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 914343D393; Fri, 5 Oct 2018 08:12:39 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.25]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id w958CAKK009462 for ; Fri, 5 Oct 2018 04:12:10 -0400 Received: by smtp.corp.redhat.com (Postfix) id F20BF2010D5F; Fri, 5 Oct 2018 08:12:09 +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 E7C1C2010D0C for ; Fri, 5 Oct 2018 08:12:09 +0000 (UTC) Received: from m97138.mail.qiye.163.com (m97138.mail.qiye.163.com [220.181.97.138]) by mx1.redhat.com (Postfix) with ESMTP id 63463C04FF85 for ; Fri, 5 Oct 2018 08:12:07 +0000 (UTC) Received: from localhost.localdomain (unknown [58.56.27.130]) by smtp9 (Coremail) with SMTP id u+CowAB3p3_PHLdb0blTAg--.62652S16; Fri, 05 Oct 2018 16:12:03 +0800 (CST) From: Shi Lei To: libvir-list@redhat.com Date: Fri, 5 Oct 2018 16:11:37 +0800 Message-Id: <20181005081145.29901-15-shi_lei@massclouds.com> In-Reply-To: <20181005081145.29901-1-shi_lei@massclouds.com> References: <20181005081145.29901-1-shi_lei@massclouds.com> X-CM-TRANSID: u+CowAB3p3_PHLdb0blTAg--.62652S16 X-Coremail-Antispam: 1Uf129KBjvJXoWxtF1Uuw17WFyfurW7tF1xAFb_yoWxGrWUpF 4jy3Z0yan8GrsxXa4SkF1DZ3Wjqa48WryUt3s0gw409r45Ars5JFWSgr1vvr4ayr1fZay7 AryYqayxuF13JFDanT9S1TB71UUUUUUqnTZGkaVYY2UrUUUUjbIjqfuFe4nvWSU5nxnvy2 9KBjDUYxBIdaVFxhVjvjDU0xZFpf9x0piqg43UUUUU= X-Originating-IP: [58.56.27.130] X-CM-SenderInfo: pvklsz1hl6ztxvvfz0xxgvhudrp/1tbigxPWT1sflN4LTQAAsB 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]); Fri, 05 Oct 2018 08:12:08 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.31]); Fri, 05 Oct 2018 08:12:08 +0000 (UTC) for IP:'220.181.97.138' DOMAIN:'m97138.mail.qiye.163.com' HELO:'m97138.mail.qiye.163.com' FROM:'shi_lei@massclouds.com' RCPT:'' X-RedHat-Spam-Score: -0.01 (RCVD_IN_DNSWL_NONE) 220.181.97.138 m97138.mail.qiye.163.com 220.181.97.138 m97138.mail.qiye.163.com X-Scanned-By: MIMEDefang 2.78 on 10.5.110.31 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.25 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 14/22] uml: Fix misaligned arguments 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.84 on 10.5.11.25 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.27]); Fri, 05 Oct 2018 08:12:40 +0000 (UTC) X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" This patch fixes misaligned arguments. Signed-off-by: Shi Lei --- src/uml/uml_driver.c | 50 ++++++++++++++++++++++---------------------- 1 file changed, 25 insertions(+), 25 deletions(-) diff --git a/src/uml/uml_driver.c b/src/uml/uml_driver.c index d1c71d8..73f1868 100644 --- a/src/uml/uml_driver.c +++ b/src/uml/uml_driver.c @@ -192,8 +192,8 @@ umlAutostartDomain(virDomainObjPtr vm, } else { virObjectEventPtr event =3D virDomainEventLifecycleNewFromObj(vm, - VIR_DOMAIN_EVENT_STARTED, - VIR_DOMAIN_EVENT_STARTED_BOOTED); + VIR_DOMAIN_EVENT_STARTED, + VIR_DOMAIN_EVENT_STARTED= _BOOTED); virObjectEventStateQueue(data->driver->domainEventState, event= ); } } @@ -342,8 +342,8 @@ umlInotifyEvent(int watch, umlShutdownVMDaemon(driver, dom, VIR_DOMAIN_SHUTOFF_SHUTDOWN); virDomainAuditStop(dom, "shutdown"); event =3D virDomainEventLifecycleNewFromObj(dom, - VIR_DOMAIN_EVENT_STOPPED, - VIR_DOMAIN_EVENT_STOPPED_SHUT= DOWN); + VIR_DOMAIN_EVENT_STO= PPED, + VIR_DOMAIN_EVENT_STO= PPED_SHUTDOWN); if (!dom->persistent) virDomainObjListRemove(driver->domains, dom); } else if (e.mask & (IN_CREATE | IN_MODIFY)) { @@ -373,8 +373,8 @@ umlInotifyEvent(int watch, VIR_DOMAIN_SHUTOFF_FAILED); virDomainAuditStop(dom, "failed"); event =3D virDomainEventLifecycleNewFromObj(dom, - VIR_DOMAIN_EVENT_STOPPED, - VIR_DOMAIN_EVENT_STOPPED_= FAILED); + VIR_DOMAIN_EVENT= _STOPPED, + VIR_DOMAIN_EVENT= _STOPPED_FAILED); if (!dom->persistent) virDomainObjListRemove(driver->domains, dom); } else if (umlIdentifyChrPTY(driver, dom) < 0) { @@ -383,8 +383,8 @@ umlInotifyEvent(int watch, VIR_DOMAIN_SHUTOFF_FAILED); virDomainAuditStop(dom, "failed"); event =3D virDomainEventLifecycleNewFromObj(dom, - VIR_DOMAIN_EVENT_STOPPED, - VIR_DOMAIN_EVENT_STOPPED_= FAILED); + VIR_DOMAIN_EVENT= _STOPPED, + VIR_DOMAIN_EVENT= _STOPPED_FAILED); if (!dom->persistent) virDomainObjListRemove(driver->domains, dom); } @@ -606,8 +606,8 @@ static void umlNotifyLoadDomain(virDomainObjPtr vm, int= newVM, void *opaque) if (newVM) { virObjectEventPtr event =3D virDomainEventLifecycleNewFromObj(vm, - VIR_DOMAIN_EVENT_DEFINED, - VIR_DOMAIN_EVENT_DEFINED_ADDED); + VIR_DOMAIN_EVENT_DEFINED, + VIR_DOMAIN_EVENT_DEFINED_ADD= ED); virObjectEventStateQueue(driver->domainEventState, event); } } @@ -736,8 +736,8 @@ static int umlProcessAutoDestroyDom(void *payload, umlShutdownVMDaemon(data->driver, dom, VIR_DOMAIN_SHUTOFF_DESTROYED); virDomainAuditStop(dom, "destroyed"); event =3D virDomainEventLifecycleNewFromObj(dom, - VIR_DOMAIN_EVENT_STOPPED, - VIR_DOMAIN_EVENT_STOPPED_DESTROYED); + VIR_DOMAIN_EVENT_STOPPED, + VIR_DOMAIN_EVENT_STOPPED_DES= TROYED); =20 if (!dom->persistent) virDomainObjListRemove(data->driver->domains, dom); @@ -1154,7 +1154,7 @@ static void umlShutdownVMDaemon(struct uml_driver *dr= iver, =20 if ((ret =3D waitpid(vm->pid, NULL, 0)) !=3D vm->pid) { VIR_WARN("Got unexpected pid %d !=3D %d", - ret, vm->pid); + ret, vm->pid); } =20 vm->pid =3D -1; @@ -1323,7 +1323,7 @@ static int umlGetProcessInfo(unsigned long long *cpuT= ime, pid_t pid) =20 =20 static virDomainPtr umlDomainLookupByID(virConnectPtr conn, - int id) + int id) { struct uml_driver *driver =3D (struct uml_driver *)conn->privateData; virDomainObjPtr vm; @@ -1370,7 +1370,7 @@ static virDomainPtr umlDomainLookupByUUID(virConnectP= tr conn, } =20 static virDomainPtr umlDomainLookupByName(virConnectPtr conn, - const char *name) + const char *name) { struct uml_driver *driver =3D (struct uml_driver *)conn->privateData; virDomainObjPtr vm; @@ -1566,8 +1566,8 @@ static virDomainPtr umlDomainCreateXML(virConnectPtr = conn, const char *xml, } virDomainAuditStart(vm, "booted", true); event =3D virDomainEventLifecycleNewFromObj(vm, - VIR_DOMAIN_EVENT_STARTED, - VIR_DOMAIN_EVENT_STARTED_BOOTED); + VIR_DOMAIN_EVENT_STARTED, + VIR_DOMAIN_EVENT_STARTED_BOO= TED); =20 dom =3D virGetDomain(conn, vm->def->name, vm->def->uuid, vm->def->id); =20 @@ -1639,8 +1639,8 @@ umlDomainDestroyFlags(virDomainPtr dom, umlShutdownVMDaemon(driver, vm, VIR_DOMAIN_SHUTOFF_DESTROYED); virDomainAuditStop(vm, "destroyed"); event =3D virDomainEventLifecycleNewFromObj(vm, - VIR_DOMAIN_EVENT_STOPPED, - VIR_DOMAIN_EVENT_STOPPED_DESTROYED); + VIR_DOMAIN_EVENT_STOPPED, + VIR_DOMAIN_EVENT_STOPPED_DES= TROYED); if (!vm->persistent) virDomainObjListRemove(driver->domains, vm); ret =3D 0; @@ -1758,7 +1758,7 @@ static int umlDomainSetMemory(virDomainPtr dom, unsig= ned long newmem) } =20 static int umlDomainGetInfo(virDomainPtr dom, - virDomainInfoPtr info) + virDomainInfoPtr info) { struct uml_driver *driver =3D dom->conn->privateData; virDomainObjPtr vm; @@ -1901,8 +1901,8 @@ static int umlDomainCreateWithFlags(virDomainPtr dom,= unsigned int flags) virDomainAuditStart(vm, "booted", ret >=3D 0); if (ret =3D=3D 0) event =3D virDomainEventLifecycleNewFromObj(vm, - VIR_DOMAIN_EVENT_STARTED, - VIR_DOMAIN_EVENT_STARTED_BOOTED); + VIR_DOMAIN_EVENT_STARTED, + VIR_DOMAIN_EVENT_STARTED= _BOOTED); =20 cleanup: virDomainObjEndAPI(&vm); @@ -2240,7 +2240,7 @@ umlDomainDetachDeviceFlags(virDomainPtr dom, =20 =20 static int umlDomainGetAutostart(virDomainPtr dom, - int *autostart) + int *autostart) { struct uml_driver *driver =3D dom->conn->privateData; virDomainObjPtr vm; @@ -2263,7 +2263,7 @@ static int umlDomainGetAutostart(virDomainPtr dom, } =20 static int umlDomainSetAutostart(virDomainPtr dom, - int autostart) + int autostart) { struct uml_driver *driver =3D dom->conn->privateData; virDomainObjPtr vm; @@ -2437,7 +2437,7 @@ umlDomainOpenConsole(virDomainPtr dom, =20 if (chr->source->type !=3D VIR_DOMAIN_CHR_TYPE_PTY) { virReportError(VIR_ERR_INTERNAL_ERROR, - _("character device %s is not using a PTY"), + _("character device %s is not using a PTY"), dev_name ? dev_name : NULLSTR(chr->info.alias)); goto cleanup; } --=20 2.17.1 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Fri Apr 26 20:41:46 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 1538727154106702.8335756021395; Fri, 5 Oct 2018 01:12:34 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 94EE6DF2C; Fri, 5 Oct 2018 08:12:31 +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 58D572E04A; Fri, 5 Oct 2018 08:12:31 +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 F00F63D38E; Fri, 5 Oct 2018 08:12:30 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.25]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id w958C9dO009444 for ; Fri, 5 Oct 2018 04:12:09 -0400 Received: by smtp.corp.redhat.com (Postfix) id 8C4C62010D5F; Fri, 5 Oct 2018 08:12:09 +0000 (UTC) Received: from mx1.redhat.com (ext-mx13.extmail.prod.ext.phx2.redhat.com [10.5.110.42]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 83EF12010D0C for ; Fri, 5 Oct 2018 08:12:09 +0000 (UTC) Received: from m97138.mail.qiye.163.com (m97138.mail.qiye.163.com [220.181.97.138]) by mx1.redhat.com (Postfix) with ESMTP id 81B74308212A for ; Fri, 5 Oct 2018 08:12:07 +0000 (UTC) Received: from localhost.localdomain (unknown [58.56.27.130]) by smtp9 (Coremail) with SMTP id u+CowAB3p3_PHLdb0blTAg--.62652S17; Fri, 05 Oct 2018 16:12:03 +0800 (CST) From: Shi Lei To: libvir-list@redhat.com Date: Fri, 5 Oct 2018 16:11:38 +0800 Message-Id: <20181005081145.29901-16-shi_lei@massclouds.com> In-Reply-To: <20181005081145.29901-1-shi_lei@massclouds.com> References: <20181005081145.29901-1-shi_lei@massclouds.com> X-CM-TRANSID: u+CowAB3p3_PHLdb0blTAg--.62652S17 X-Coremail-Antispam: 1Uf129KBjDUn29KB7ZKAUJUUUUU529EdanIXcx71UUUUU7v73 VFW2AGmfu7bjvjm3AaLaJ3UbIYCTnIWIevJa73UjIFyTuYvjTRP3kZUUUUU X-Originating-IP: [58.56.27.130] X-CM-SenderInfo: pvklsz1hl6ztxvvfz0xxgvhudrp/1tbieRPWT1qrhVi6hwAAsi 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.42]); Fri, 05 Oct 2018 08:12:08 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.42]); Fri, 05 Oct 2018 08:12:08 +0000 (UTC) for IP:'220.181.97.138' DOMAIN:'m97138.mail.qiye.163.com' HELO:'m97138.mail.qiye.163.com' FROM:'shi_lei@massclouds.com' RCPT:'' X-RedHat-Spam-Score: -0.01 (RCVD_IN_DNSWL_NONE) 220.181.97.138 m97138.mail.qiye.163.com 220.181.97.138 m97138.mail.qiye.163.com X-Scanned-By: MIMEDefang 2.84 on 10.5.110.42 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.25 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 15/22] vmware: Fix misaligned arguments and misaligned conditions 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.84 on 10.5.11.23 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.30]); Fri, 05 Oct 2018 08:12:32 +0000 (UTC) X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" This patch fixes misaligned arguments and misaligned conditions. Signed-off-by: Shi Lei --- src/vmware/vmware_conf.c | 2 +- src/vmware/vmware_driver.c | 10 ++++++---- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/src/vmware/vmware_conf.c b/src/vmware/vmware_conf.c index 89ed639..3f4db2e 100644 --- a/src/vmware/vmware_conf.c +++ b/src/vmware/vmware_conf.c @@ -152,7 +152,7 @@ vmwareLoadDomains(struct vmware_driver *driver) goto cleanup; =20 for (str =3D outbuf; (vmxPath =3D strtok_r(str, "\n", &saveptr)) !=3D = NULL; - str =3D NULL) { + str =3D NULL) { =20 if (vmxPath[0] !=3D '/') continue; diff --git a/src/vmware/vmware_driver.c b/src/vmware/vmware_driver.c index f94b325..beaa847 100644 --- a/src/vmware/vmware_driver.c +++ b/src/vmware/vmware_driver.c @@ -206,8 +206,9 @@ vmwareConnectOpen(virConnectPtr conn, goto cleanup; =20 if ((tmp =3D STRSKIP(conn->uri->scheme, "vmware")) =3D=3D NULL) { - virReportError(VIR_ERR_INTERNAL_ERROR, _("unable to parse URI " - "scheme '%s'"), conn->uri->scheme); + virReportError(VIR_ERR_INTERNAL_ERROR, + _("unable to parse URI scheme '%s'"), + conn->uri->scheme); goto cleanup; } =20 @@ -215,8 +216,9 @@ vmwareConnectOpen(virConnectPtr conn, driver->type =3D vmwareDriverTypeFromString(tmp); =20 if (driver->type =3D=3D -1) { - virReportError(VIR_ERR_INTERNAL_ERROR, _("unable to find valid " - "requested VMware backend '%s'"), tmp); + virReportError(VIR_ERR_INTERNAL_ERROR, + _("unable to find valid requested VMware backend '%= s'"), + tmp); goto cleanup; } =20 --=20 2.17.1 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Fri Apr 26 20:41:46 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 1538727146223610.2747978645699; Fri, 5 Oct 2018 01:12:26 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id CF7E481DEC; Fri, 5 Oct 2018 08:12:23 +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 9ABAA183EC; Fri, 5 Oct 2018 08:12:23 +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 0EFD118005B5; Fri, 5 Oct 2018 08:12:23 +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 w958C9cG009429 for ; Fri, 5 Oct 2018 04:12:09 -0400 Received: by smtp.corp.redhat.com (Postfix) id 2D56F6246B; Fri, 5 Oct 2018 08:12:09 +0000 (UTC) Received: from mx1.redhat.com (ext-mx05.extmail.prod.ext.phx2.redhat.com [10.5.110.29]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 24ED05EDEF for ; Fri, 5 Oct 2018 08:12:09 +0000 (UTC) Received: from m97138.mail.qiye.163.com (m97138.mail.qiye.163.com [220.181.97.138]) by mx1.redhat.com (Postfix) with ESMTP id B9F9936A5EE for ; Fri, 5 Oct 2018 08:12:05 +0000 (UTC) Received: from localhost.localdomain (unknown [58.56.27.130]) by smtp9 (Coremail) with SMTP id u+CowAB3p3_PHLdb0blTAg--.62652S18; Fri, 05 Oct 2018 16:12:03 +0800 (CST) From: Shi Lei To: libvir-list@redhat.com Date: Fri, 5 Oct 2018 16:11:39 +0800 Message-Id: <20181005081145.29901-17-shi_lei@massclouds.com> In-Reply-To: <20181005081145.29901-1-shi_lei@massclouds.com> References: <20181005081145.29901-1-shi_lei@massclouds.com> X-CM-TRANSID: u+CowAB3p3_PHLdb0blTAg--.62652S18 X-Coremail-Antispam: 1Uf129KBjvJXoWxAFykCF43XF45uryfJw1UKFg_yoW5Ar1xpF W3J39xGayrtF43KF40ga4rG3W5XFsrtr48Ars7W3yvqw1fW3WS9w4fXr1Fkry5trnFq3yr ZFW8JFWjv3Z7taUanT9S1TB71UUUUUUqnTZGkaVYY2UrUUUUjbIjqfuFe4nvWSU5nxnvy2 9KBjDUYxBIdaVFxhVjvjDU0xZFpf9x0piqg43UUUUU= X-Originating-IP: [58.56.27.130] X-CM-SenderInfo: pvklsz1hl6ztxvvfz0xxgvhudrp/1tbifhPWT1rpNbHTcQAAsh 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.29]); Fri, 05 Oct 2018 08:12:08 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.29]); Fri, 05 Oct 2018 08:12:08 +0000 (UTC) for IP:'220.181.97.138' DOMAIN:'m97138.mail.qiye.163.com' HELO:'m97138.mail.qiye.163.com' FROM:'shi_lei@massclouds.com' RCPT:'' X-RedHat-Spam-Score: -0.01 (RCVD_IN_DNSWL_NONE) 220.181.97.138 m97138.mail.qiye.163.com 220.181.97.138 m97138.mail.qiye.163.com X-Scanned-By: MIMEDefang 2.78 on 10.5.110.29 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 16/22] vmx: Fix misaligned arguments 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.13 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.25]); Fri, 05 Oct 2018 08:12:24 +0000 (UTC) X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" This patch fixes misaligned arguments. Signed-off-by: Shi Lei --- src/vmx/vmx.c | 23 +++++++++++------------ 1 file changed, 11 insertions(+), 12 deletions(-) diff --git a/src/vmx/vmx.c b/src/vmx/vmx.c index 937bf0c..3016f4f 100644 --- a/src/vmx/vmx.c +++ b/src/vmx/vmx.c @@ -803,8 +803,8 @@ virVMXGetConfigLong(virConfPtr conf, const char *name, = long long *number, *number =3D -1; } else if (virStrToLong_ll(string, NULL, 10, number) < 0) { virReportError(VIR_ERR_INTERNAL_ERROR, - _("Config entry '%s' must represent an integer value"), - name); + _("Config entry '%s' must represent an integer valu= e"), + name); goto cleanup; } =20 @@ -1183,9 +1183,8 @@ virVMXGatherSCSIControllers(virVMXContext *ctx, virDo= mainDefPtr def, =20 if (disk->bus =3D=3D VIR_DOMAIN_DISK_BUS_SCSI && disk->info.addr.drive.controller =3D=3D controller->id= x) { - if (ctx->autodetectSCSIControllerModel - (disk, &autodetectedModels[count], - ctx->opaque) < 0) { + if (ctx->autodetectSCSIControllerModel( + disk, &autodetectedModels[count], ctx->opaque)= < 0) { goto cleanup; } =20 @@ -1667,8 +1666,8 @@ virVMXParseConfig(virVMXContext *ctx, } =20 if (virVMXParseDisk(ctx, xmlopt, conf, VIR_DOMAIN_DISK_DEVICE_= CDROM, - VIR_DOMAIN_DISK_BUS_SCSI, controller, uni= t, - &def->disks[def->ndisks], def) < 0) { + VIR_DOMAIN_DISK_BUS_SCSI, controller, unit, + &def->disks[def->ndisks], def) < 0) { goto cleanup; } =20 @@ -1904,7 +1903,7 @@ virVMXParseVNC(virConfPtr conf, virDomainGraphicsDefP= tr *def) =20 if (port < 0) { VIR_WARN("VNC is enabled but VMX entry 'RemoteDisplay.vnc.port' " - "is missing, the VNC port is unknown"); + "is missing, the VNC port is unknown"); =20 (*def)->data.vnc.port =3D 0; (*def)->data.vnc.autoport =3D true; @@ -3316,8 +3315,8 @@ virVMXFormatConfig(virVMXContext *ctx, virDomainXMLOp= tionPtr xmlopt, virDomainDe =20 if (scsi_virtualDev[i] !=3D -1) { virBufferAsprintf(&buffer, "scsi%zu.virtualDev =3D \"%s\"\= n", i, - virVMXControllerModelSCSITypeToString - (scsi_virtualDev[i])); + virVMXControllerModelSCSITypeToString( + scsi_virtualDev[i])); } } } @@ -3461,7 +3460,7 @@ virVMXFormatVNC(virDomainGraphicsDefPtr def, virBuffe= rPtr buffer) =20 if (def->data.vnc.autoport) { VIR_WARN("VNC autoport is enabled, but the automatically assigned " - "VNC port cannot be read back"); + "VNC port cannot be read back"); } else { if (def->data.vnc.port < 5900 || def->data.vnc.port > 5964) { VIR_WARN("VNC port %d it out of [5900..5964] range", @@ -3918,7 +3917,7 @@ virVMXFormatSerial(virVMXContext *ctx, virDomainChrDe= fPtr def, virReportError(VIR_ERR_CONFIG_UNSUPPORTED, _("Unsupported character device TCP protocol '%= s'"), virDomainChrTcpProtocolTypeToString( - def->source->data.tcp.protocol)); + def->source->data.tcp.protocol)); return -1; } =20 --=20 2.17.1 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Fri Apr 26 20:41:46 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 1538727180264610.2759113309116; Fri, 5 Oct 2018 01:13:00 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.24]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 557FBC04AC4C; Fri, 5 Oct 2018 08:12:57 +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 1B514308BDB4; Fri, 5 Oct 2018 08:12:57 +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 BD2E83D39C; Fri, 5 Oct 2018 08:12:56 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.24]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id w958CBaJ009498 for ; Fri, 5 Oct 2018 04:12:11 -0400 Received: by smtp.corp.redhat.com (Postfix) id 6FEB2308BDA4; Fri, 5 Oct 2018 08:12:11 +0000 (UTC) Received: from mx1.redhat.com (ext-mx14.extmail.prod.ext.phx2.redhat.com [10.5.110.43]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 672F5308BDA1 for ; Fri, 5 Oct 2018 08:12:08 +0000 (UTC) Received: from m97138.mail.qiye.163.com (m97138.mail.qiye.163.com [220.181.97.138]) by mx1.redhat.com (Postfix) with ESMTP id DE555300294E for ; Fri, 5 Oct 2018 08:12:05 +0000 (UTC) Received: from localhost.localdomain (unknown [58.56.27.130]) by smtp9 (Coremail) with SMTP id u+CowAB3p3_PHLdb0blTAg--.62652S19; Fri, 05 Oct 2018 16:12:03 +0800 (CST) From: Shi Lei To: libvir-list@redhat.com Date: Fri, 5 Oct 2018 16:11:40 +0800 Message-Id: <20181005081145.29901-18-shi_lei@massclouds.com> In-Reply-To: <20181005081145.29901-1-shi_lei@massclouds.com> References: <20181005081145.29901-1-shi_lei@massclouds.com> X-CM-TRANSID: u+CowAB3p3_PHLdb0blTAg--.62652S19 X-Coremail-Antispam: 1Uf129KBjvJXoW3XFWUAFWxZw4rArW8XrWkZwb_yoW7XrWxpF 4UJa9FgFW5JFW3Z3yrGF4Uu3s8G34vv34UCrnxKas2ga1jqrsxJr1SgFy8urWjyr4kZFWI vF4YyrZ8Xa1UGFJanT9S1TB71UUUUUUqnTZGkaVYY2UrUUUUjbIjqfuFe4nvWSU5nxnvy2 9KBjDUYxBIdaVFxhVjvjDU0xZFpf9x0piqg43UUUUU= X-Originating-IP: [58.56.27.130] X-CM-SenderInfo: pvklsz1hl6ztxvvfz0xxgvhudrp/1tbigxPWT1sflN4LUAAAsc 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.43]); Fri, 05 Oct 2018 08:12:07 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.43]); Fri, 05 Oct 2018 08:12:07 +0000 (UTC) for IP:'220.181.97.138' DOMAIN:'m97138.mail.qiye.163.com' HELO:'m97138.mail.qiye.163.com' FROM:'shi_lei@massclouds.com' RCPT:'' X-RedHat-Spam-Score: -0.01 (RCVD_IN_DNSWL_NONE) 220.181.97.138 m97138.mail.qiye.163.com 220.181.97.138 m97138.mail.qiye.163.com X-Scanned-By: MIMEDefang 2.84 on 10.5.110.43 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.24 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 17/22] vz: Fix misaligned arguments and misaligned conditions 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.84 on 10.5.11.24 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.31]); Fri, 05 Oct 2018 08:12:59 +0000 (UTC) X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" This patch fixes misaligned arguments and misaligned conditions. Signed-off-by: Shi Lei --- src/vz/vz_driver.c | 14 +++++++------- src/vz/vz_sdk.c | 26 ++++++++++++++------------ src/vz/vz_utils.c | 2 +- 3 files changed, 22 insertions(+), 20 deletions(-) diff --git a/src/vz/vz_driver.c b/src/vz/vz_driver.c index bedc631..0900ff3 100644 --- a/src/vz/vz_driver.c +++ b/src/vz/vz_driver.c @@ -1844,8 +1844,8 @@ vzDomainBlockStatsFlags(virDomainPtr domain, =20 static int vzDomainInterfaceStats(virDomainPtr domain, - const char *device, - virDomainInterfaceStatsPtr stats) + const char *device, + virDomainInterfaceStatsPtr stats) { virDomainObjPtr dom =3D NULL; vzDomObjPtr privdom; @@ -2157,8 +2157,8 @@ vzSnapObjFromSnapshot(virDomainSnapshotObjListPtr sna= pshots, =20 static int vzCurrentSnapshotIterator(void *payload, - const void *name ATTRIBUTE_UNUSED, - void *data) + const void *name ATTRIBUTE_UNUSED, + void *data) { virDomainSnapshotObjPtr snapshot =3D payload; virDomainSnapshotObjPtr *current =3D data; @@ -2569,7 +2569,7 @@ vzDomainSnapshotIsCurrent(virDomainSnapshotPtr snapsh= ot, unsigned int flags) =20 static int vzDomainSnapshotHasMetadata(virDomainSnapshotPtr snapshot, - unsigned int flags) + unsigned int flags) { virDomainObjPtr dom; int ret =3D -1; @@ -2790,8 +2790,8 @@ vzBakeCookie(vzDriverPtr driver, if (flags & VZ_MIGRATION_COOKIE_DOMAIN_NAME) { /* if dom is NULL just pass some name for backward compat. * It is not used by peer */ - virBufferAsprintf(&buf, "%s\n", dom ? dom->def->name : - "__fakename__"); + virBufferAsprintf(&buf, "%s\n", + dom ? dom->def->name : "__fakename__"); } =20 virBufferAdjustIndent(&buf, -2); diff --git a/src/vz/vz_sdk.c b/src/vz/vz_sdk.c index 5ca906e..e73a750 100644 --- a/src/vz/vz_sdk.c +++ b/src/vz/vz_sdk.c @@ -1003,8 +1003,8 @@ prlsdkGetRoutes(PRL_HANDLE sdknet, virDomainNetDefPtr= net) if (*gw !=3D '\0') { =20 if (!(route =3D virNetDevIPRouteCreate(_("Domain interface"), - "ipv4", VIR_SOCKET_ADDR_IPV= 4_ALL, - NULL, gw, 0, true, 0, false= ))) + "ipv4", VIR_SOCKET_ADDR_IPV4_= ALL, + NULL, gw, 0, true, 0, false))) goto cleanup; =20 if (VIR_APPEND_ELEMENT(net->guestIP.routes, net->guestIP.nroutes, = route) < 0) @@ -1013,8 +1013,8 @@ prlsdkGetRoutes(PRL_HANDLE sdknet, virDomainNetDefPtr= net) =20 if (*gw6 !=3D '\0') { if (!(route =3D virNetDevIPRouteCreate(_("Domain interface"), - "ipv6", VIR_SOCKET_ADDR_IPV= 6_ALL, - NULL, gw6, 0, true, 0, fals= e))) + "ipv6", VIR_SOCKET_ADDR_IPV6_= ALL, + NULL, gw6, 0, true, 0, false)= )) goto cleanup; =20 if (VIR_APPEND_ELEMENT(net->guestIP.routes, net->guestIP.nroutes, = route) < 0) @@ -2897,7 +2897,7 @@ static int prlsdkCheckSerialUnsupportedParams(virDoma= inChrDefPtr chr) } =20 if (chr->source->type =3D=3D VIR_DOMAIN_CHR_TYPE_TCP && - chr->source->data.tcp.protocol !=3D VIR_DOMAIN_CHR_TCP_PROTOCOL_RA= W) { + chr->source->data.tcp.protocol !=3D VIR_DOMAIN_CHR_TCP_PROTOCOL_RAW= ) { virReportError(VIR_ERR_CONFIG_UNSUPPORTED, _("Protocol '%s' is not supported for " "tcp character device."), @@ -3078,8 +3078,9 @@ static int prlsdkApplyGraphicsParams(PRL_HANDLE sdkdo= m, } =20 glisten =3D virDomainGraphicsGetListen(gr, 0); - pret =3D PrlVmCfg_SetVNCHostName(sdkdom, glisten && glisten->address ? - glisten->address : VIR_LOOPBACK= _IPV4_ADDR); + pret =3D PrlVmCfg_SetVNCHostName(sdkdom, + glisten && glisten->address ? + glisten->address : VIR_LOOPBACK_IPV4_AD= DR); prlsdkCheckRetGoto(pret, cleanup); =20 ret =3D 0; @@ -3219,10 +3220,10 @@ static int prlsdkConfigureGateways(PRL_HANDLE sdkne= t, virDomainNetDefPtr net) gateway =3D virNetDevIPRouteGetGateway(net->guestIP.routes[i]); =20 ignore_value(virSocketAddrParse(&zero, - (VIR_SOCKET_ADDR_IS_FAMILY(addrdst, AF_INE= T) - ? VIR_SOCKET_ADDR_IPV4_ALL - : VIR_SOCKET_ADDR_IPV6_ALL), - VIR_SOCKET_ADDR_FAMILY(addrdst))); + (VIR_SOCKET_ADDR_IS_FAMILY(addrdst= , AF_INET) + ? VIR_SOCKET_ADDR_IPV4_ALL + : VIR_SOCKET_ADDR_IPV6_ALL), + VIR_SOCKET_ADDR_FAMILY(addrdst))); /* virSocketAddrParse raises an error * and we are not going to report it, reset it expicitly*/ virResetLastError(); @@ -3419,7 +3420,8 @@ static int prlsdkConfigureNet(vzDriverPtr driver ATTR= IBUTE_UNUSED, } =20 pret =3D PrlVmDevNet_SetPktFilterPreventMacSpoof(sdknet, - net->trustGuestRxFilters =3D=3D VIR_TRISTATE_BOOL_YES); + (net->trustGuestRxFilte= rs =3D=3D + VIR_TRISTATE_BOOL_YES)= ); prlsdkCheckRetGoto(pret, cleanup); =20 ret =3D 0; diff --git a/src/vz/vz_utils.c b/src/vz/vz_utils.c index 13f5dee..384badd 100644 --- a/src/vz/vz_utils.c +++ b/src/vz/vz_utils.c @@ -481,7 +481,7 @@ int vzGetDefaultSCSIModel(vzDriverPtr driver, virReportError(VIR_ERR_INTERNAL_ERROR, _("Unknown SCSI controller model %s"), virDomainControllerModelSCSITypeToString( - driver->vzCaps.scsiControllerModel)); + driver->vzCaps.scsiControllerModel)); return -1; } return 0; --=20 2.17.1 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Fri Apr 26 20:41:46 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 153872715206640.339108667917344; Fri, 5 Oct 2018 01:12:32 -0700 (PDT) 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 E914481101; Fri, 5 Oct 2018 08:12:28 +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 9C4375C22B; Fri, 5 Oct 2018 08:12:28 +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 41C943D38C; Fri, 5 Oct 2018 08:12:28 +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 w958CBDO009481 for ; Fri, 5 Oct 2018 04:12:11 -0400 Received: by smtp.corp.redhat.com (Postfix) id 166545D9CB; Fri, 5 Oct 2018 08:12:11 +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 0BA695D9CA for ; Fri, 5 Oct 2018 08:12:08 +0000 (UTC) Received: from m97138.mail.qiye.163.com (m97138.mail.qiye.163.com [220.181.97.138]) by mx1.redhat.com (Postfix) with ESMTP id 110E88764F for ; Fri, 5 Oct 2018 08:12:06 +0000 (UTC) Received: from localhost.localdomain (unknown [58.56.27.130]) by smtp9 (Coremail) with SMTP id u+CowAB3p3_PHLdb0blTAg--.62652S20; Fri, 05 Oct 2018 16:12:03 +0800 (CST) From: Shi Lei To: libvir-list@redhat.com Date: Fri, 5 Oct 2018 16:11:41 +0800 Message-Id: <20181005081145.29901-19-shi_lei@massclouds.com> In-Reply-To: <20181005081145.29901-1-shi_lei@massclouds.com> References: <20181005081145.29901-1-shi_lei@massclouds.com> X-CM-TRANSID: u+CowAB3p3_PHLdb0blTAg--.62652S20 X-Coremail-Antispam: 1Uf129KBjDUn29KB7ZKAUJUUUUU529EdanIXcx71UUUUU7v73 VFW2AGmfu7bjvjm3AaLaJ3UbIYCTnIWIevJa73UjIFyTuYvjTRP3kZUUUUU X-Originating-IP: [58.56.27.130] X-CM-SenderInfo: pvklsz1hl6ztxvvfz0xxgvhudrp/1tbifBTWT1rpNuEgzgAAs7 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.26]); Fri, 05 Oct 2018 08:12:07 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.26]); Fri, 05 Oct 2018 08:12:07 +0000 (UTC) for IP:'220.181.97.138' DOMAIN:'m97138.mail.qiye.163.com' HELO:'m97138.mail.qiye.163.com' FROM:'shi_lei@massclouds.com' RCPT:'' X-RedHat-Spam-Score: -0.01 (RCVD_IN_DNSWL_NONE) 220.181.97.138 m97138.mail.qiye.163.com 220.181.97.138 m97138.mail.qiye.163.com 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 Subject: [libvirt] [PATCH 18/22] xenapi: Fix misaligned arguments 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.16 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.28]); Fri, 05 Oct 2018 08:12:30 +0000 (UTC) X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" This patch fixes misaligned arguments. Signed-off-by: Shi Lei --- src/xenapi/xenapi_utils.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/xenapi/xenapi_utils.c b/src/xenapi/xenapi_utils.c index 723f348..fee63c9 100644 --- a/src/xenapi/xenapi_utils.c +++ b/src/xenapi/xenapi_utils.c @@ -56,7 +56,7 @@ xenSessionFree(xen_session *session) =20 char * xenapiUtil_RequestPassword(virConnectAuthPtr auth, const char *username, - const char *hostname) + const char *hostname) { unsigned int ncred; virConnectCredential cred; @@ -107,7 +107,8 @@ xenapiUtil_ParseQuery(virConnectPtr conn, virURIPtr uri= , int *noVerify) if (virStrToLong_i(queryParam->value, NULL, 10, noVerify) < 0 = || (*noVerify !=3D 0 && *noVerify !=3D 1)) { xenapiSessionErrorHandler(conn, VIR_ERR_INVALID_ARG, - _("Query parameter 'no_verify' has unexpected value (should be 0 or = 1)")); + _("Query parameter 'no_verify' h= as " + "unexpected value (should be 0= or 1)")); goto failure; } } @@ -344,8 +345,9 @@ allocStringMap(xen_string_string_map **strings, char *k= ey, char *val) { int sz =3D ((*strings) =3D=3D NULL) ? 0 : (*strings)->size; sz++; - if (VIR_REALLOC_N(*strings, sizeof(xen_string_string_map) + - sizeof(xen_string_string_map_contents) * s= z) < 0) + if (VIR_REALLOC_N(*strings, + (sizeof(xen_string_string_map) + + sizeof(xen_string_string_map_contents) * sz)) < 0) return -1; (*strings)->size =3D sz; if (VIR_STRDUP((*strings)->contents[sz-1].key, key) < 0 || @@ -532,7 +534,7 @@ createVMRecordFromXml(virConnectPtr conn, virDomainDefP= tr def, (*record)->xenstore_data =3D xen_string_string_map_alloc(0); (*record)->hvm_shadow_multiplier =3D 1.000; if (!xen_vm_create(((struct _xenapiPrivate *)(conn->privateData))->ses= sion, - vm, *record)) { + vm, *record)) { xenapiSessionErrorHandler(conn, VIR_ERR_INTERNAL_ERROR, NULL); return -1; } --=20 2.17.1 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Fri Apr 26 20:41:46 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 1538727193368665.8598486916716; Fri, 5 Oct 2018 01:13:13 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.24]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id ADC333002C88; Fri, 5 Oct 2018 08:13:11 +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 743C0308BDA1; Fri, 5 Oct 2018 08:13:11 +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 1D5EE3D38E; Fri, 5 Oct 2018 08:13:11 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id w958CZ18009654 for ; Fri, 5 Oct 2018 04:12:35 -0400 Received: by smtp.corp.redhat.com (Postfix) id B5DD3100194A; Fri, 5 Oct 2018 08:12:35 +0000 (UTC) Received: from mx1.redhat.com (ext-mx12.extmail.prod.ext.phx2.redhat.com [10.5.110.41]) by smtp.corp.redhat.com (Postfix) with ESMTPS id AE95B104C53C for ; Fri, 5 Oct 2018 08:12:32 +0000 (UTC) Received: from m97138.mail.qiye.163.com (m97138.mail.qiye.163.com [220.181.97.138]) by mx1.redhat.com (Postfix) with ESMTP id 3E12730001D8 for ; Fri, 5 Oct 2018 08:12:14 +0000 (UTC) Received: from localhost.localdomain (unknown [58.56.27.130]) by smtp9 (Coremail) with SMTP id u+CowAB3p3_PHLdb0blTAg--.62652S21; Fri, 05 Oct 2018 16:12:04 +0800 (CST) From: Shi Lei To: libvir-list@redhat.com Date: Fri, 5 Oct 2018 16:11:42 +0800 Message-Id: <20181005081145.29901-20-shi_lei@massclouds.com> In-Reply-To: <20181005081145.29901-1-shi_lei@massclouds.com> References: <20181005081145.29901-1-shi_lei@massclouds.com> X-CM-TRANSID: u+CowAB3p3_PHLdb0blTAg--.62652S21 X-Coremail-Antispam: 1Uf129KBjvJXoWxKr4xtFWfGF15JF48tr47Arb_yoW7ZFW8pF 1xAa4YkrW5XF13Aws5tr1Fg348JF1vqFWfAr9a939Yvr17K3s3ZrsFvrs7W34DXa4vqF4U ArWrKr4rua15AF7anT9S1TB71UUUUUUqnTZGkaVYY2UrUUUUjbIjqfuFe4nvWSU5nxnvy2 9KBjDUYxBIdaVFxhVjvjDU0xZFpf9x0piqg43UUUUU= X-Originating-IP: [58.56.27.130] X-CM-SenderInfo: pvklsz1hl6ztxvvfz0xxgvhudrp/1tbigxTWT1sflN4LUwAAsY 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.41]); Fri, 05 Oct 2018 08:12:31 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.41]); Fri, 05 Oct 2018 08:12:31 +0000 (UTC) for IP:'220.181.97.138' DOMAIN:'m97138.mail.qiye.163.com' HELO:'m97138.mail.qiye.163.com' FROM:'shi_lei@massclouds.com' RCPT:'' X-RedHat-Spam-Score: -0.01 (RCVD_IN_DNSWL_NONE) 220.181.97.138 m97138.mail.qiye.163.com 220.181.97.138 m97138.mail.qiye.163.com X-Scanned-By: MIMEDefang 2.84 on 10.5.110.41 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 19/22] xenconfig: Fix misaligned arguments and misaligned conditions 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.84 on 10.5.11.24 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.46]); Fri, 05 Oct 2018 08:13:12 +0000 (UTC) X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" This patch fixes misaligned arguments and misaligned conditions. Signed-off-by: Shi Lei --- src/xenconfig/xen_common.c | 21 +++++++++++++-------- src/xenconfig/xen_xl.c | 23 +++++++++++------------ src/xenconfig/xen_xm.c | 8 ++++---- 3 files changed, 28 insertions(+), 24 deletions(-) diff --git a/src/xenconfig/xen_common.c b/src/xenconfig/xen_common.c index 0a99587..d1d5b9a 100644 --- a/src/xenconfig/xen_common.c +++ b/src/xenconfig/xen_common.c @@ -295,11 +295,11 @@ xenParseMem(virConfPtr conf, virDomainDefPtr def) unsigned long long memory; =20 if (xenConfigGetULongLong(conf, "memory", &def->mem.cur_balloon, - MIN_XEN_GUEST_SIZE * 2) < 0) + MIN_XEN_GUEST_SIZE * 2) < 0) return -1; =20 if (xenConfigGetULongLong(conf, "maxmem", &memory, - def->mem.cur_balloon) < 0) + def->mem.cur_balloon) < 0) return -1; =20 def->mem.cur_balloon *=3D 1024; @@ -1104,8 +1104,12 @@ xenParseGeneralMeta(virConfPtr conf, virDomainDefPtr= def, virCapsPtr caps) =20 def->os.type =3D (hvm ? VIR_DOMAIN_OSTYPE_HVM : VIR_DOMAIN_OSTYPE_XEN); =20 - if (!(capsdata =3D virCapabilitiesDomainDataLookup(caps, def->os.type, - VIR_ARCH_NONE, def->virtType, NULL, NULL))) + if (!(capsdata =3D virCapabilitiesDomainDataLookup(caps, + def->os.type, + VIR_ARCH_NONE, + def->virtType, + NULL, + NULL))) goto out; =20 def->os.arch =3D capsdata->arch; @@ -1680,17 +1684,17 @@ xenFormatCPUFeatures(virConfPtr conf, virDomainDefP= tr def) if (hvm) { if (xenConfigSetInt(conf, "pae", (def->features[VIR_DOMAIN_FEATURE_PAE] =3D=3D - VIR_TRISTATE_SWITCH_ON) ? 1 : 0) < 0) + VIR_TRISTATE_SWITCH_ON) ? 1 : 0) < 0) return -1; =20 if (xenConfigSetInt(conf, "acpi", (def->features[VIR_DOMAIN_FEATURE_ACPI] =3D=3D - VIR_TRISTATE_SWITCH_ON) ? 1 : 0) < 0) + VIR_TRISTATE_SWITCH_ON) ? 1 : 0) < 0) return -1; =20 if (xenConfigSetInt(conf, "apic", (def->features[VIR_DOMAIN_FEATURE_APIC] =3D=3D - VIR_TRISTATE_SWITCH_ON) ? 1 : 0) < 0) + VIR_TRISTATE_SWITCH_ON) ? 1 : 0) < 0) return -1; =20 if (def->features[VIR_DOMAIN_FEATURE_HAP] =3D=3D VIR_TRISTATE_SWIT= CH_OFF) { @@ -1805,7 +1809,8 @@ xenFormatVfb(virConfPtr conf, virDomainDefPtr def) return -1; =20 if (xenConfigSetInt(conf, "vncunused", - def->graphics[0]->data.vnc.autoport ? 1 : 0)= < 0) + (def->graphics[0]->data.vnc.autoport ? + 1 : 0)) < 0) return -1; =20 if (!def->graphics[0]->data.vnc.autoport && diff --git a/src/xenconfig/xen_xl.c b/src/xenconfig/xen_xl.c index 7250e57..2afaa25 100644 --- a/src/xenconfig/xen_xl.c +++ b/src/xenconfig/xen_xl.c @@ -467,8 +467,7 @@ xenParseXLVnuma(virConfPtr conf, const char *data; const char *str =3D vnode->str; =20 - if (!str || - !(data =3D strrchr(str, '=3D'))) { + if (!str || !(data =3D strrchr(str, '=3D'))) { virReportError(VIR_ERR_INTERNAL_ERROR, _("vnuma vnode invalid format '%s'"), str); @@ -545,8 +544,9 @@ xenParseXLVnuma(virConfPtr conf, =20 if (ndistances !=3D nr_nodes) { virReportError(VIR_ERR_CONFIG_UNSUPPORTED, - _("vnuma pnode %d configured '%s' (= count %zu) doesn't fit the number of specified vnodes %zu"), - pnode, str, ndistances, nr_nodes); + _("vnuma pnode %d configured '%= s' (count %zu)" + " doesn't fit the number of s= pecified vnodes %zu"), + pnode, str, ndistances, nr_node= s); goto cleanup; } =20 @@ -844,9 +844,9 @@ xenParseXLInputDevs(virConfPtr conf, virDomainDefPtr de= f) str =3D val->str; =20 if (str && - (STREQ(str, "tablet") || - STREQ(str, "mouse") || - STREQ(str, "keyboard"))) { + (STREQ(str, "tablet") || + STREQ(str, "mouse") || + STREQ(str, "keyboard"))) { virDomainInputDefPtr input; if (VIR_ALLOC(input) < 0) return -1; @@ -1288,7 +1288,7 @@ xenFormatXLOS(virConfPtr conf, virDomainDefPtr def) /* XXX floppy disks */ } else { if (def->os.bootloader && - xenConfigSetString(conf, "bootloader", def->os.bootloader) < = 0) + xenConfigSetString(conf, "bootloader", def->os.bootloader) < 0) return -1; =20 if (def->os.bootloaderArgs && @@ -1337,9 +1337,8 @@ xenFormatXLCPUID(virConfPtr conf, virDomainDefPtr def) =20 j =3D 1; for (i =3D 0; i < def->cpu->nfeatures; i++) { - const char *feature_name =3D xenTranslateCPUFeature( - def->cpu->features[i].name, - false); + const char *feature_name =3D xenTranslateCPUFeature(def->cpu->feat= ures[i].name, + false); const char *policy =3D NULL; =20 if (STREQ(feature_name, "vmx") || STREQ(feature_name, "svm")) @@ -1453,7 +1452,7 @@ xenFormatXLVnuma(virConfValuePtr list, virBufferAddLit(&buf, "vdistances=3D"); for (i =3D 0; i < nr_nodes; i++) { virBufferAsprintf(&buf, "%zu", - virDomainNumaGetNodeDistance(numa, node, i)); + virDomainNumaGetNodeDistance(numa, node, i)); if ((nr_nodes - i) > 1) virBufferAddLit(&buf, ","); } diff --git a/src/xenconfig/xen_xm.c b/src/xenconfig/xen_xm.c index 909e8fa..96f046b 100644 --- a/src/xenconfig/xen_xm.c +++ b/src/xenconfig/xen_xm.c @@ -424,9 +424,9 @@ xenParseXMInputDevs(virConfPtr conf, virDomainDefPtr de= f) if (xenConfigGetString(conf, "usbdevice", &str, NULL) < 0) return -1; if (str && - (STREQ(str, "tablet") || - STREQ(str, "mouse") || - STREQ(str, "keyboard"))) { + (STREQ(str, "tablet") || + STREQ(str, "mouse") || + STREQ(str, "keyboard"))) { virDomainInputDefPtr input; if (VIR_ALLOC(input) < 0) return -1; @@ -532,7 +532,7 @@ xenFormatXMOS(virConfPtr conf, virDomainDefPtr def) /* XXX floppy disks */ } else { if (def->os.bootloader && - xenConfigSetString(conf, "bootloader", def->os.bootloader) < = 0) + xenConfigSetString(conf, "bootloader", def->os.bootloader) < 0) return -1; =20 if (def->os.bootloaderArgs && --=20 2.17.1 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Fri Apr 26 20:41:46 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 1538727132003124.4302822124647; Fri, 5 Oct 2018 01:12:12 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id E24C930642A6; Fri, 5 Oct 2018 08:12:09 +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 AC1962E020; Fri, 5 Oct 2018 08:12:09 +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 CA3273D382; Fri, 5 Oct 2018 08:12:08 +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 w958C7Dn009393 for ; Fri, 5 Oct 2018 04:12:07 -0400 Received: by smtp.corp.redhat.com (Postfix) id A794562471; Fri, 5 Oct 2018 08:12:07 +0000 (UTC) Received: from mx1.redhat.com (ext-mx19.extmail.prod.ext.phx2.redhat.com [10.5.110.48]) by smtp.corp.redhat.com (Postfix) with ESMTPS id A01B462470 for ; Fri, 5 Oct 2018 08:12:07 +0000 (UTC) Received: from m97138.mail.qiye.163.com (m97138.mail.qiye.163.com [220.181.97.138]) by mx1.redhat.com (Postfix) with ESMTP id 6BA40307D90F for ; Fri, 5 Oct 2018 08:12:05 +0000 (UTC) Received: from localhost.localdomain (unknown [58.56.27.130]) by smtp9 (Coremail) with SMTP id u+CowAB3p3_PHLdb0blTAg--.62652S22; Fri, 05 Oct 2018 16:12:04 +0800 (CST) From: Shi Lei To: libvir-list@redhat.com Date: Fri, 5 Oct 2018 16:11:43 +0800 Message-Id: <20181005081145.29901-21-shi_lei@massclouds.com> In-Reply-To: <20181005081145.29901-1-shi_lei@massclouds.com> References: <20181005081145.29901-1-shi_lei@massclouds.com> X-CM-TRANSID: u+CowAB3p3_PHLdb0blTAg--.62652S22 X-Coremail-Antispam: 1Uf129KBjvJXoWxAF1rZF45Aw4UGr15uFyUKFg_yoW5GrWkpF 4YyFn3urWDXr12y34IyFy5Xr1fZa9YgFyDZr13Z3W8Ja4kta4UtryIg3Z5ur1UuF1kArWU ua9Igr4DuF10vrDanT9S1TB71UUUUUUqnTZGkaVYY2UrUUUUjbIjqfuFe4nvWSU5nxnvy2 9KBjDUYxBIdaVFxhVjvjDU0xZFpf9x0pRUku7UUUUU= X-Originating-IP: [58.56.27.130] X-CM-SenderInfo: pvklsz1hl6ztxvvfz0xxgvhudrp/1tbiARTWT1ikTghdeAAAsT 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.48]); Fri, 05 Oct 2018 08:12:06 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.48]); Fri, 05 Oct 2018 08:12:06 +0000 (UTC) for IP:'220.181.97.138' DOMAIN:'m97138.mail.qiye.163.com' HELO:'m97138.mail.qiye.163.com' FROM:'shi_lei@massclouds.com' RCPT:'' X-RedHat-Spam-Score: -0.01 (RCVD_IN_DNSWL_NONE) 220.181.97.138 m97138.mail.qiye.163.com 220.181.97.138 m97138.mail.qiye.163.com X-Scanned-By: MIMEDefang 2.84 on 10.5.110.48 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 20/22] build-aux:check-spacing: Relax the check-rule for misaligned stuff 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.84 on 10.5.11.23 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.49]); Fri, 05 Oct 2018 08:12:10 +0000 (UTC) X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" Linefeed can be put behind the open-parenthesis of the function, the position of argument should be: 1) pos % 4 =3D=3D 0 2) pos > start_of_function_name(includes func's parent_pointer) 3) pos is the first place which matches 1) and 2) E.g. [indent]if (virLongLongLongFunctionName( [4-spaces-align]LongLongLongFirstName, [4-spaces-align]LongLongLongSecondName) < 0) or [indent]ret =3D pointer->virFunctionName( [4-spaces-align]LongLongLongFirstName, [4-spaces-align]LongLongLongSecondName); Signed-off-by: Shi Lei --- build-aux/check-spacing.pl | 22 +++++++++++++++++----- 1 file changed, 17 insertions(+), 5 deletions(-) diff --git a/build-aux/check-spacing.pl b/build-aux/check-spacing.pl index d36b004..64a5dac 100755 --- a/build-aux/check-spacing.pl +++ b/build-aux/check-spacing.pl @@ -275,10 +275,10 @@ sub CheckMisalignment { my $pos =3D $$paren_stack[-1][0]; my $linenum =3D $$paren_stack[-1][1]; my $code =3D $$paren_stack[-1][2]; - if ($pos + 1 !=3D length($`)) { + if ($pos !=3D length($`)) { my $pad =3D ""; if ($. > $linenum + 1) { - $pad =3D " " x $pos . " ...\n"; + $pad =3D " " x $pos . "...\n"; } print "Misaligned line in parenthesis:\n"; print "$$file:$linenum-$.:\n$code$pad$$line\n"; @@ -291,6 +291,7 @@ sub CheckMisalignment { if ($$data =3D~ /.*[()]/) { my $pos =3D 0; my $temp =3D $$data; + $temp =3D~ s/\s+$//; =20 # Kill the content between matched parenthesis and themselves # within the current line. @@ -310,9 +311,20 @@ sub CheckMisalignment { } =20 # Push the item for open-paren on @paren_stack - # @item =3D [ position of the open-paren, linenum, code-line ] + # @item =3D [ correct-indent, linenum, code-line ] while (($pos =3D index($temp, "\(", $pos)) >=3D 0) { - push @$paren_stack, [$pos, $., $$line]; + if ($pos+1 =3D=3D length($temp)) { + my $recent =3D rindex($temp, "\(", $pos-1) + 1; + my $correct =3D rindex($temp, " ", $pos-1) + 1; + $correct =3D ($correct >=3D $recent) ? $correct : $recent; + $correct +=3D 4 - ($correct % 4); + if ($correct < $pos) { + push @$paren_stack, [$correct, $., $$line]; + last; + } + } + + push @$paren_stack, [$pos+1, $., $$line]; $pos++; } } @@ -370,7 +382,7 @@ foreach my $file (@ARGV) { # We _need_ fix these misalignment in batches. # We _should_ remove it as soon as fixing all. ##################################################################= ### - next unless $file =3D~ /^src\/util\//; + next unless $file =3D~ /^src\/(?!esx|qemu|hyperv|lxc|conf|libxl|vb= ox|test|security)/; =20 $ret =3D 1 if CheckMisalignment(\$data, \$file, \$line, \@paren_st= ack); } --=20 2.17.1 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Fri Apr 26 20:41:46 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 1538727141363221.09802621184883; Fri, 5 Oct 2018 01:12:21 -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 8309E30833AF; Fri, 5 Oct 2018 08:12:19 +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 468845D9CA; Fri, 5 Oct 2018 08:12:19 +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 E2718180B5B7; Fri, 5 Oct 2018 08:12:18 +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 w958C7as009392 for ; Fri, 5 Oct 2018 04:12:07 -0400 Received: by smtp.corp.redhat.com (Postfix) id 9777A5EDEF; Fri, 5 Oct 2018 08:12:07 +0000 (UTC) Received: from mx1.redhat.com (ext-mx09.extmail.prod.ext.phx2.redhat.com [10.5.110.38]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 9000262470 for ; Fri, 5 Oct 2018 08:12:07 +0000 (UTC) Received: from m97138.mail.qiye.163.com (m97138.mail.qiye.163.com [220.181.97.138]) by mx1.redhat.com (Postfix) with ESMTP id 924AA8CDC for ; Fri, 5 Oct 2018 08:12:05 +0000 (UTC) Received: from localhost.localdomain (unknown [58.56.27.130]) by smtp9 (Coremail) with SMTP id u+CowAB3p3_PHLdb0blTAg--.62652S23; Fri, 05 Oct 2018 16:12:04 +0800 (CST) From: Shi Lei To: libvir-list@redhat.com Date: Fri, 5 Oct 2018 16:11:44 +0800 Message-Id: <20181005081145.29901-22-shi_lei@massclouds.com> In-Reply-To: <20181005081145.29901-1-shi_lei@massclouds.com> References: <20181005081145.29901-1-shi_lei@massclouds.com> X-CM-TRANSID: u+CowAB3p3_PHLdb0blTAg--.62652S23 X-Coremail-Antispam: 1Uf129KBjDUn29KB7ZKAUJUUUUU529EdanIXcx71UUUUU7v73 VFW2AGmfu7bjvjm3AaLaJ3UbIYCTnIWIevJa73UjIFyTuYvjTRJYFAUUUUU X-Originating-IP: [58.56.27.130] X-CM-SenderInfo: pvklsz1hl6ztxvvfz0xxgvhudrp/1tbigRTWT1sfmGbEDQAAs- 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.38]); Fri, 05 Oct 2018 08:12:06 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.38]); Fri, 05 Oct 2018 08:12:06 +0000 (UTC) for IP:'220.181.97.138' DOMAIN:'m97138.mail.qiye.163.com' HELO:'m97138.mail.qiye.163.com' FROM:'shi_lei@massclouds.com' RCPT:'' X-RedHat-Spam-Score: -0.01 (RCVD_IN_DNSWL_NONE) 220.181.97.138 m97138.mail.qiye.163.com 220.181.97.138 m97138.mail.qiye.163.com X-Scanned-By: MIMEDefang 2.78 on 10.5.110.38 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 21/22] build-aux:check-spacing: Add indicator to help correcting misaligned stuff 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.14 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.44]); Fri, 05 Oct 2018 08:12:20 +0000 (UTC) X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" This patch definitely indicates the correct position for misaligned stuff. Signed-off-by: Shi Lei --- build-aux/check-spacing.pl | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/build-aux/check-spacing.pl b/build-aux/check-spacing.pl index 64a5dac..478e7ab 100755 --- a/build-aux/check-spacing.pl +++ b/build-aux/check-spacing.pl @@ -277,11 +277,22 @@ sub CheckMisalignment { my $code =3D $$paren_stack[-1][2]; if ($pos !=3D length($`)) { my $pad =3D ""; + my $indicator =3D ""; if ($. > $linenum + 1) { $pad =3D " " x $pos . "...\n"; } print "Misaligned line in parenthesis:\n"; - print "$$file:$linenum-$.:\n$code$pad$$line\n"; + print "$$file:$linenum-$.:\n$code$pad$$line"; + if ($pos > length($`)) { + $indicator =3D " " x length($`); + $indicator .=3D "~" x ($pos - length($`)); + $indicator .=3D "^"; + } else { + $indicator =3D " " x $pos; + $indicator .=3D "^"; + $indicator .=3D "~" x (length($`) - $pos); + } + print "$indicator\n"; $ret =3D 1; } } --=20 2.17.1 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Fri Apr 26 20:41:46 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 1538727188699757.8865896550132; Fri, 5 Oct 2018 01:13:08 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id C5940308FB85; Fri, 5 Oct 2018 08:13:06 +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 8677B66082; Fri, 5 Oct 2018 08:13:06 +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 2E22418033C3; Fri, 5 Oct 2018 08:13:06 +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 w958CBJU009512 for ; Fri, 5 Oct 2018 04:12:11 -0400 Received: by smtp.corp.redhat.com (Postfix) id C106217DCC; Fri, 5 Oct 2018 08:12:11 +0000 (UTC) Received: from mx1.redhat.com (ext-mx09.extmail.prod.ext.phx2.redhat.com [10.5.110.38]) by smtp.corp.redhat.com (Postfix) with ESMTPS id B52C360922 for ; Fri, 5 Oct 2018 08:12:11 +0000 (UTC) Received: from m97138.mail.qiye.163.com (m97138.mail.qiye.163.com [220.181.97.138]) by mx1.redhat.com (Postfix) with ESMTP id DD1CF8CDC for ; Fri, 5 Oct 2018 08:12:07 +0000 (UTC) Received: from localhost.localdomain (unknown [58.56.27.130]) by smtp9 (Coremail) with SMTP id u+CowAB3p3_PHLdb0blTAg--.62652S24; Fri, 05 Oct 2018 16:12:04 +0800 (CST) From: Shi Lei To: libvir-list@redhat.com Date: Fri, 5 Oct 2018 16:11:45 +0800 Message-Id: <20181005081145.29901-23-shi_lei@massclouds.com> In-Reply-To: <20181005081145.29901-1-shi_lei@massclouds.com> References: <20181005081145.29901-1-shi_lei@massclouds.com> X-CM-TRANSID: u+CowAB3p3_PHLdb0blTAg--.62652S24 X-Coremail-Antispam: 1Uf129KBjvJXoWfJry5Kr15Xw1xJFW7Wr43trb_yoWkCw45pa 9xJr4Skrs0grs7ta40yryDXrn3W3ykKr45JryDZw1kAFyUGr1DtrWjq3WvyFWj9F4UA3yj qan0qF43ur1qvFDanT9S1TB71UUUUUUqnTZGkaVYY2UrUUUUjbIjqfuFe4nvWSU5nxnvy2 9KBjDUYxBIdaVFxhVjvjDU0xZFpf9x0pRUku7UUUUU= X-Originating-IP: [58.56.27.130] X-CM-SenderInfo: pvklsz1hl6ztxvvfz0xxgvhudrp/1tbifQDWT1rpNwSyNQAAsj 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.38]); Fri, 05 Oct 2018 08:12:10 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.38]); Fri, 05 Oct 2018 08:12:10 +0000 (UTC) for IP:'220.181.97.138' DOMAIN:'m97138.mail.qiye.163.com' HELO:'m97138.mail.qiye.163.com' FROM:'shi_lei@massclouds.com' RCPT:'' X-RedHat-Spam-Score: -0.01 (RCVD_IN_DNSWL_NONE) 220.181.97.138 m97138.mail.qiye.163.com 220.181.97.138 m97138.mail.qiye.163.com X-Scanned-By: MIMEDefang 2.78 on 10.5.110.38 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 22/22] build-aux:check-spacing: Remove arguments of subroutines for speed 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.13 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.43]); Fri, 05 Oct 2018 08:13:07 +0000 (UTC) X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" This patch replaces those 'my varname;' with 'our varname;', i.e. it uses global var, rather than passing arguments to subroutine. So it can be a bit faster. Signed-off-by: Shi Lei --- build-aux/check-spacing.pl | 218 ++++++++++++++++++------------------- 1 file changed, 107 insertions(+), 111 deletions(-) diff --git a/build-aux/check-spacing.pl b/build-aux/check-spacing.pl index 478e7ab..9e2a2a4 100755 --- a/build-aux/check-spacing.pl +++ b/build-aux/check-spacing.pl @@ -23,12 +23,15 @@ use strict; use warnings; =20 +our $ret =3D 0; + # # CheckFunctionBody: # $_[0]: $data(in) -# $_[1]: $location(in), which format is file-path:line-num:line-code -# $_[2]: $fn_linenum(inout), maintains start line-num of function body -# Returns 0 in case of success or 1 on failure +# $_[1]: $file(in) +# $_[2]: $line(in) +# $_[3]: $fn_linenum(inout), maintains start line-num of function body +# Set $ret 1 on failure # # Check incorrect indentation and blank first line in function body. # For efficiency, it only checks the first line of function body. @@ -37,29 +40,28 @@ use warnings; # move it into this subroutine. But *state* requires version >=3D v5.10.) # sub CheckFunctionBody { - my $ret =3D 0; - my ($data, $location, $fn_linenum) =3D @_; + our ($data, $file, $line, $fn_linenum); =20 # Check first line of function block - if ($$fn_linenum) { - if ($$data =3D~ /^\s*$/) { - print "Blank line before content in function body:\n$$location= "; + if ($fn_linenum) { + if ($data =3D~ /^\s*$/) { + print "Blank line before content in function body:\n"; + print "$file:$.:\n$line"; $ret =3D 1; - } elsif ($$data !~ /^[ ]{4}\S/) { - unless ($$data =3D~ /^[ ]\w+:$/ || $$data =3D~ /^}/) { - print "Incorrect indentation in function body:\n$$location= "; + } elsif ($data !~ /^[ ]{4}\S/) { + unless ($data =3D~ /^[ ]\w+:$/ || $data =3D~ /^}/) { + print "Incorrect indentation in function body:\n"; + print "$file:$.:\n$line"; $ret =3D 1; } } - $$fn_linenum =3D 0; + $fn_linenum =3D 0; } =20 # Detect start of function block - if ($$data =3D~ /^{$/) { - $$fn_linenum =3D $.; + if ($data =3D~ /^{$/) { + $fn_linenum =3D $.; } - - return $ret; } =20 # @@ -71,42 +73,40 @@ sub CheckFunctionBody { # (Also, the @incomment could be declared with *state* and move it in.) # sub KillComments { - my ($data, $incomment) =3D @_; + our ($data, $incomment); =20 # Kill contents of multi-line comments # and detect end of multi-line comments - if ($$incomment) { - if ($$data =3D~ m,\*/,) { - $$incomment =3D 0; - $$data =3D~ s,^.*\*/,*/,; + if ($incomment) { + if ($data =3D~ m,\*/,) { + $incomment =3D 0; + $data =3D~ s,^.*\*/,*/,; } else { - $$data =3D ""; + $data =3D ""; } } =20 # Kill single line comments, and detect # start of multi-line comments - if ($$data =3D~ m,/\*.*\*/,) { - $$data =3D~ s,/\*.*\*/,/* */,; - } elsif ($$data =3D~ m,/\*,) { - $$incomment =3D 1; - $$data =3D~ s,/\*.*,/*,; + if ($data =3D~ m,/\*.*\*/,) { + $data =3D~ s,/\*.*\*/,/* */,; + } elsif ($data =3D~ m,/\*,) { + $incomment =3D 1; + $data =3D~ s,/\*.*,/*,; } - - return; } =20 # # CheckWhiteSpaces: # $_[0]: $data(in) -# $_[1]: $location(in), which format is file-path:line-num:line-code -# Returns 0 in case of success or 1 on failure +# $_[1]: $file(in) +# $_[1]: $line(in) +# Set $ret on failure # # Check whitespaces according to code spec of libvirt. # sub CheckWhiteSpaces { - my $ret =3D 0; - my ($data, $location) =3D @_; + our ($data, $file, $line); =20 # We need to match things like # @@ -126,7 +126,7 @@ sub CheckWhiteSpaces { # later on. =20 # For temporary modifications - my $tmpdata =3D $$data; + my $tmpdata =3D $data; while ($tmpdata =3D~ /(\w+)\s\((?!\*)/) { my $kw =3D $1; =20 @@ -134,30 +134,34 @@ sub CheckWhiteSpaces { if ($kw =3D~ /^(?:if|for|while|switch|return)$/) { $tmpdata =3D~ s/(?:$kw\s\()/XXX(/; } else { - print "Whitespace after non-keyword:\n$$location"; + print "Whitespace after non-keyword:\n"; + print "$file:$.:\n$line"; $ret =3D 1; last; } } =20 # Require whitespace immediately after keywords - if ($$data =3D~ /\b(?:if|for|while|switch|return)\(/) { - print "No whitespace after keyword:\n$$location"; + if ($data =3D~ /\b(?:if|for|while|switch|return)\(/) { + print "No whitespace after keyword:\n"; + print "$file:$.:\n$line"; $ret =3D 1; } =20 # Forbid whitespace between )( of a function typedef - if ($$data =3D~ /\(\*\w+\)\s+\(/) { - print "Whitespace between ')' and '(':\n$$location"; + if ($data =3D~ /\(\*\w+\)\s+\(/) { + print "Whitespace between ')' and '(':\n"; + print "$file:$.:\n$line"; $ret =3D 1; } =20 # Forbid whitespace following ( or prior to ) # but allow whitespace before ) on a single line # (optionally followed by a semicolon) - if (($$data =3D~ /\s\)/ && not $$data =3D~ /^\s+\);?$/) || - $$data =3D~ /\((?!$)\s/) { - print "Whitespace after '(' or before ')':\n$$location"; + if (($data =3D~ /\s\)/ && not $data =3D~ /^\s+\);?$/) || + $data =3D~ /\((?!$)\s/) { + print "Whitespace after '(' or before ')':\n"; + print "$file:$.:\n$line"; $ret =3D 1; } =20 @@ -171,35 +175,37 @@ sub CheckWhiteSpaces { # errno =3D=3D EINTR) # ; # - if ($$data =3D~ /\s[;,]/) { - unless ($$data =3D~ /\S; ; / || - $$data =3D~ /^\s+;/) { - print "Whitespace before semicolon or comma:\n$$location"; + if ($data =3D~ /\s[;,]/) { + unless ($data =3D~ /\S; ; / || + $data =3D~ /^\s+;/) { + print "Whitespace before semicolon or comma:\n"; + print "$file:$.:\n$line"; $ret =3D 1; } } =20 # Require EOL, macro line continuation, or whitespace after ";". # Allow "for (;;)" as an exception. - if ($$data =3D~ /;[^ \\\n;)]/) { - print "Invalid character after semicolon:\n$$location"; + if ($data =3D~ /;[^ \\\n;)]/) { + print "Invalid character after semicolon:\n"; + print "$file:$.:\n$line"; $ret =3D 1; } =20 # Require EOL, space, or enum/struct end after comma. - if ($$data =3D~ /,[^ \\\n)}]/) { - print "Invalid character after comma:\n$$location"; + if ($data =3D~ /,[^ \\\n)}]/) { + print "Invalid character after comma:\n"; + print "$file:$.:\n$line"; $ret =3D 1; } =20 # Require spaces around assignment '=3D', compounds and '=3D=3D' - if ($$data =3D~ /[^ ]\b[!<>&|\-+*\/%\^=3D]?=3D/ || - $$data =3D~ /=3D[^=3D \\\n]/) { - print "Spacing around '=3D' or '=3D=3D':\n$$location"; + if ($data =3D~ /[^ ]\b[!<>&|\-+*\/%\^=3D]?=3D/ || + $data =3D~ /=3D[^=3D \\\n]/) { + print "Spacing around '=3D' or '=3D=3D':\n"; + print "$file:$.:\n$line"; $ret =3D 1; } - - return $ret; } =20 # @@ -210,46 +216,43 @@ sub CheckWhiteSpaces { # $_[3]: $cb_linenum(inout) # $_[4]: $cb_code(inout) # $_[5]: $cb_scolon(inout) -# Returns 0 in case of success or 1 on failure +# Set $ret 1 on failure # # Check whitespaces according to code spec of libvirt. # sub CheckCurlyBrackets { - my $ret =3D 0; - my ($data, $file, $line, $cb_linenum, $cb_code, $cb_scolon) =3D @_; + our ($data, $file, $line, $cb_linenum, $cb_code, $cb_scolon); =20 # One line conditional statements with one line bodies should # not use curly brackets. - if ($$data =3D~ /^\s*(if|while|for)\b.*\{$/) { - $$cb_linenum =3D $.; - $$cb_code =3D $$line; - $$cb_scolon =3D 0; + if ($data =3D~ /^\s*(if|while|for)\b.*\{$/) { + $cb_linenum =3D $.; + $cb_code =3D $line; + $cb_scolon =3D 0; } =20 # We need to check for exactly one semicolon inside the body, # because empty statements (e.g. with comment only) are # allowed - if ($$cb_linenum =3D=3D $. - 1 && $$data =3D~ /^[^;]*;[^;]*$/) { - $$cb_code .=3D $$line; - $$cb_scolon =3D 1; + if ($cb_linenum =3D=3D $. - 1 && $data =3D~ /^[^;]*;[^;]*$/) { + $cb_code .=3D $line; + $cb_scolon =3D 1; } =20 - if ($$data =3D~ /^\s*}\s*$/ && - $$cb_linenum =3D=3D $. - 2 && - $$cb_scolon) { + if ($data =3D~ /^\s*}\s*$/ && + $cb_linenum =3D=3D $. - 2 && + $cb_scolon) { =20 print "Curly brackets around single-line body:\n"; - print "$$file:$$cb_linenum-$.:\n$$cb_code$$line"; + print "$file:$cb_linenum-$.:\n$cb_code$line"; $ret =3D 1; =20 # There _should_ be no need to reset the values; but to # keep my inner peace... - $$cb_linenum =3D 0; - $$cb_scolon =3D 0; - $$cb_code =3D ""; + $cb_linenum =3D 0; + $cb_scolon =3D 0; + $cb_code =3D ""; } - - return $ret; } =20 # @@ -259,22 +262,21 @@ sub CheckCurlyBrackets { # $_[2]: $line(in) # $_[3]: @paren_stack(inout), which maintains information # of the parenthesis -# Returns 0 in case of success or 1 on failure +# Set $ret 1 on failure # # Check misaligned stuff in parenthesis: # 1. For misaligned arguments of function # 2. For misaligned conditions of [if|while|switch|...] # sub CheckMisalignment { - my $ret =3D 0; - my ($data, $file, $line, $paren_stack) =3D @_; + our ($data, $file, $line, @paren_stack); =20 # Check alignment based on @paren_stack - if (@$paren_stack) { - if ($$data =3D~ /(\S+.*$)/) { - my $pos =3D $$paren_stack[-1][0]; - my $linenum =3D $$paren_stack[-1][1]; - my $code =3D $$paren_stack[-1][2]; + if (@paren_stack) { + if ($data =3D~ /(\S+.*$)/) { + my $pos =3D $paren_stack[-1][0]; + my $linenum =3D $paren_stack[-1][1]; + my $code =3D $paren_stack[-1][2]; if ($pos !=3D length($`)) { my $pad =3D ""; my $indicator =3D ""; @@ -282,7 +284,7 @@ sub CheckMisalignment { $pad =3D " " x $pos . "...\n"; } print "Misaligned line in parenthesis:\n"; - print "$$file:$linenum-$.:\n$code$pad$$line"; + print "$file:$linenum-$.:\n$code$pad$line"; if ($pos > length($`)) { $indicator =3D " " x length($`); $indicator .=3D "~" x ($pos - length($`)); @@ -299,9 +301,9 @@ sub CheckMisalignment { } =20 # Maintain @paren_stack - if ($$data =3D~ /.*[()]/) { + if ($data =3D~ /.*[()]/) { my $pos =3D 0; - my $temp =3D $$data; + my $temp =3D $data; $temp =3D~ s/\s+$//; =20 # Kill the content between matched parenthesis and themselves @@ -310,12 +312,12 @@ sub CheckMisalignment { =20 # Pop a item for the open-paren when finding close-paren while (($pos =3D index($temp, "\)", $pos)) >=3D 0) { - if (@$paren_stack) { - pop(@$paren_stack); + if (@paren_stack) { + pop(@paren_stack); $pos++; } else { print "Warning: found unbalanced parenthesis:\n"; - print "$$file:$.:\n$$line\n"; + print "$file:$.:\n$line\n"; $ret =3D 1; last; } @@ -330,36 +332,31 @@ sub CheckMisalignment { $correct =3D ($correct >=3D $recent) ? $correct : $recent; $correct +=3D 4 - ($correct % 4); if ($correct < $pos) { - push @$paren_stack, [$correct, $., $$line]; + push @paren_stack, [$correct, $., $line]; last; } } =20 - push @$paren_stack, [$pos+1, $., $$line]; + push @paren_stack, [$pos+1, $., $line]; $pos++; } } - - return $ret; } =20 -my $ret =3D 0; - -foreach my $file (@ARGV) { +foreach our $file (@ARGV) { # Per-file variables for multiline Curly Bracket (cb_) check - my $cb_linenum =3D 0; - my $cb_code =3D ""; - my $cb_scolon =3D 0; - my $fn_linenum =3D 0; - my $incomment =3D 0; - my @paren_stack; + our $cb_linenum =3D 0; + our $cb_code =3D ""; + our $cb_scolon =3D 0; + our $fn_linenum =3D 0; + our $incomment =3D 0; + our @paren_stack =3D (); =20 open FILE, $file; =20 - while (defined (my $line =3D )) { - my $has_define =3D 0; - my $data =3D $line; - my $location =3D "$file:$.:\n$line"; + while (defined (our $line =3D )) { + our $has_define =3D 0; + our $data =3D $line; =20 # Kill any quoted , ; =3D or " $data =3D~ s/'[";,=3D]'/'X'/g; @@ -376,14 +373,13 @@ foreach my $file (@ARGV) { # Ignore all macros except for #define next if $data =3D~ /^#/; =20 - $ret =3D 1 if CheckFunctionBody(\$data, \$location, \$fn_linen= um); + CheckFunctionBody(); =20 - KillComments(\$data, \$incomment); + KillComments(); =20 - $ret =3D 1 if CheckWhiteSpaces(\$data, \$location); + CheckWhiteSpaces(); =20 - $ret =3D 1 if CheckCurlyBrackets(\$data, \$file, \$line, - \$cb_linenum, \$cb_code, \$cb_s= colon); + CheckCurlyBrackets(); } =20 ##################################################################= ### @@ -395,7 +391,7 @@ foreach my $file (@ARGV) { ##################################################################= ### next unless $file =3D~ /^src\/(?!esx|qemu|hyperv|lxc|conf|libxl|vb= ox|test|security)/; =20 - $ret =3D 1 if CheckMisalignment(\$data, \$file, \$line, \@paren_st= ack); + CheckMisalignment(); } close FILE; } --=20 2.17.1 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list