From nobody Tue May 13 16:01:26 2025 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