From nobody Fri Apr 26 16:41:21 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 1499433660965541.7515350317549; Fri, 7 Jul 2017 06:21:00 -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 7E75A51156; Fri, 7 Jul 2017 13:20:58 +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 1CC9B7F546; Fri, 7 Jul 2017 13:20:58 +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 BA89A1800C94; Fri, 7 Jul 2017 13:20:55 +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 v67DKsxR016738 for ; Fri, 7 Jul 2017 09:20:54 -0400 Received: by smtp.corp.redhat.com (Postfix) id 48BD360BE1; Fri, 7 Jul 2017 13:20:54 +0000 (UTC) Received: from dnr.brq.redhat.com (unknown [10.43.2.58]) by smtp.corp.redhat.com (Postfix) with ESMTP id C45A660BE6 for ; Fri, 7 Jul 2017 13:20:53 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 7E75A51156 Authentication-Results: ext-mx10.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx10.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=libvir-list-bounces@redhat.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com 7E75A51156 From: =?UTF-8?q?J=C3=A1n=20Tomko?= To: libvir-list@redhat.com Date: Fri, 7 Jul 2017 15:20:48 +0200 Message-Id: In-Reply-To: References: In-Reply-To: References: X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 1/2] qemuDomainSetSchedulerParametersFlags: use the value_ul variable 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.39]); Fri, 07 Jul 2017 13:20:59 +0000 (UTC) X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" We assign the unsigned long value of the currently processed parameter to a temporary value_ul variable. Use it consistently in all cases. --- src/qemu/qemu_driver.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c index cdb727b55..74da8c3d0 100644 --- a/src/qemu/qemu_driver.c +++ b/src/qemu/qemu_driver.c @@ -10118,7 +10118,7 @@ qemuDomainSetSchedulerParametersFlags(virDomainPtr = dom, } =20 if (persistentDef) - persistentDefCopy->cputune.period =3D params[i].value.ul; + persistentDefCopy->cputune.period =3D value_ul; =20 } else if (STREQ(param->field, VIR_DOMAIN_SCHEDULER_VCPU_QUOTA)) { SCHED_RANGE_CHECK(value_l, VIR_DOMAIN_SCHEDULER_VCPU_QUOTA, @@ -10158,7 +10158,7 @@ qemuDomainSetSchedulerParametersFlags(virDomainPtr = dom, } =20 if (persistentDef) - persistentDefCopy->cputune.period =3D params[i].value.ul; + persistentDefCopy->cputune.period =3D value_ul; =20 } else if (STREQ(param->field, VIR_DOMAIN_SCHEDULER_GLOBAL_QUOTA))= { SCHED_RANGE_CHECK(value_l, VIR_DOMAIN_SCHEDULER_GLOBAL_QUOTA, @@ -10240,7 +10240,7 @@ qemuDomainSetSchedulerParametersFlags(virDomainPtr = dom, } =20 if (persistentDef) - persistentDefCopy->cputune.iothread_period =3D params[i].v= alue.ul; + persistentDefCopy->cputune.iothread_period =3D value_ul; =20 } else if (STREQ(param->field, VIR_DOMAIN_SCHEDULER_IOTHREAD_QUOTA= )) { SCHED_RANGE_CHECK(value_l, VIR_DOMAIN_SCHEDULER_IOTHREAD_QUOTA, --=20 2.13.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Fri Apr 26 16:41:21 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 1499433677269725.838755163032; Fri, 7 Jul 2017 06:21:17 -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 4760364A52; Fri, 7 Jul 2017 13:21:15 +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 1DDE571C5A; Fri, 7 Jul 2017 13:21:15 +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 2CC9F3FADF; Fri, 7 Jul 2017 13:21:14 +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 v67DKtMH016747 for ; Fri, 7 Jul 2017 09:20:55 -0400 Received: by smtp.corp.redhat.com (Postfix) id 198B260BE6; Fri, 7 Jul 2017 13:20:55 +0000 (UTC) Received: from dnr.brq.redhat.com (unknown [10.43.2.58]) by smtp.corp.redhat.com (Postfix) with ESMTP id 94C9260BE1 for ; Fri, 7 Jul 2017 13:20:54 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 4760364A52 Authentication-Results: ext-mx02.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx02.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=libvir-list-bounces@redhat.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com 4760364A52 From: =?UTF-8?q?J=C3=A1n=20Tomko?= To: libvir-list@redhat.com Date: Fri, 7 Jul 2017 15:20:49 +0200 Message-Id: <3176512c50e9a14adf5c803eafc2fc57314ba114.1499433623.git.jtomko@redhat.com> In-Reply-To: References: In-Reply-To: References: X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 2/2] qemuDomainSetInterfaceParameters: use the temporary params variable 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.26]); Fri, 07 Jul 2017 13:21:16 +0000 (UTC) X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" We have a temporary pointer to the currently processed parameter. Use it to save three bytes per use. --- src/qemu/qemu_driver.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c index 74da8c3d0..a512f2199 100644 --- a/src/qemu/qemu_driver.c +++ b/src/qemu/qemu_driver.c @@ -10993,22 +10993,22 @@ qemuDomainSetInterfaceParameters(virDomainPtr dom, virTypedParameterPtr param =3D ¶ms[i]; =20 if (STREQ(param->field, VIR_DOMAIN_BANDWIDTH_IN_AVERAGE)) { - bandwidth->in->average =3D params[i].value.ui; + bandwidth->in->average =3D param->value.ui; inboundSpecified =3D true; } else if (STREQ(param->field, VIR_DOMAIN_BANDWIDTH_IN_PEAK)) { - bandwidth->in->peak =3D params[i].value.ui; + bandwidth->in->peak =3D param->value.ui; } else if (STREQ(param->field, VIR_DOMAIN_BANDWIDTH_IN_BURST)) { - bandwidth->in->burst =3D params[i].value.ui; + bandwidth->in->burst =3D param->value.ui; } else if (STREQ(param->field, VIR_DOMAIN_BANDWIDTH_IN_FLOOR)) { - bandwidth->in->floor =3D params[i].value.ui; + bandwidth->in->floor =3D param->value.ui; inboundSpecified =3D true; } else if (STREQ(param->field, VIR_DOMAIN_BANDWIDTH_OUT_AVERAGE)) { - bandwidth->out->average =3D params[i].value.ui; + bandwidth->out->average =3D param->value.ui; outboundSpecified =3D true; } else if (STREQ(param->field, VIR_DOMAIN_BANDWIDTH_OUT_PEAK)) { - bandwidth->out->peak =3D params[i].value.ui; + bandwidth->out->peak =3D param->value.ui; } else if (STREQ(param->field, VIR_DOMAIN_BANDWIDTH_OUT_BURST)) { - bandwidth->out->burst =3D params[i].value.ui; + bandwidth->out->burst =3D param->value.ui; } } =20 --=20 2.13.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list