From nobody Mon May 6 19:06:14 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; envelope-from=libvir-list-bounces@redhat.com; helo=mx1.redhat.com; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1548870041089565.9545744937358; Wed, 30 Jan 2019 09:40:41 -0800 (PST) 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 74CB8804F8; Wed, 30 Jan 2019 17:40:37 +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 9D3A6608C4; Wed, 30 Jan 2019 17:40:36 +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 5203F3F603; Wed, 30 Jan 2019 17:40:35 +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 x0UHeXmJ026458 for ; Wed, 30 Jan 2019 12:40:33 -0500 Received: by smtp.corp.redhat.com (Postfix) id 5DCE95D991; Wed, 30 Jan 2019 17:40:33 +0000 (UTC) Received: from localhost.localdomain.com (ovpn-112-64.ams2.redhat.com [10.36.112.64]) by smtp.corp.redhat.com (Postfix) with ESMTP id 99C2F5D97A; Wed, 30 Jan 2019 17:40:32 +0000 (UTC) From: =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= To: libvir-list@redhat.com Date: Wed, 30 Jan 2019 17:40:21 +0000 Message-Id: <20190130174026.20675-2-berrange@redhat.com> In-Reply-To: <20190130174026.20675-1-berrange@redhat.com> References: <20190130174026.20675-1-berrange@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 1/6] conf: remove pointless check on enum value X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="utf-8" 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.27]); Wed, 30 Jan 2019 17:40:39 +0000 (UTC) 'val' is initialized from virDomainCapsFeatureTypeFromString and a few lines earlier there was already a check for 'val < 0'. The 'val >=3D 0' is thus always true. The enum conversion similarly ensures that the val will be less than VIR_DOMAIN_CAPS_FEATURE_LAST, so "val < VIR_DOMAIN_CAPS_FEATURE_LAST' is thus always true too. Signed-off-by: Daniel P. Berrang=C3=A9 Reviewed-by: John Ferlan --- src/conf/domain_conf.c | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index 9409d93c23..f2ef53a9a3 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -20524,18 +20524,16 @@ virDomainDefParseXML(xmlDocPtr xml, goto error; } =20 - if (val >=3D 0 && val < VIR_DOMAIN_CAPS_FEATURE_LAST) { - if ((tmp =3D virXMLPropString(nodes[i], "state"))) { - if ((def->caps_features[val] =3D virTristateSwitchTypeFrom= String(tmp)) =3D=3D -1) { - virReportError(VIR_ERR_CONFIG_UNSUPPORTED, - _("unknown state attribute '%s' of feat= ure capability '%s'"), - tmp, virDomainFeatureTypeToString(val)); - goto error; - } - VIR_FREE(tmp); - } else { - def->caps_features[val] =3D VIR_TRISTATE_SWITCH_ON; + if ((tmp =3D virXMLPropString(nodes[i], "state"))) { + if ((def->caps_features[val] =3D virTristateSwitchTypeFromStri= ng(tmp)) =3D=3D -1) { + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, + _("unknown state attribute '%s' of feature = capability '%s'"), + tmp, virDomainFeatureTypeToString(val)); + goto error; } + VIR_FREE(tmp); + } else { + def->caps_features[val] =3D VIR_TRISTATE_SWITCH_ON; } } VIR_FREE(nodes); --=20 2.20.1 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Mon May 6 19:06:14 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; envelope-from=libvir-list-bounces@redhat.com; helo=mx1.redhat.com; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1548870454041955.4734497217058; Wed, 30 Jan 2019 09:47:34 -0800 (PST) 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 887978E3E7; Wed, 30 Jan 2019 17:47:31 +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 45D4D5D97A; Wed, 30 Jan 2019 17:47: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 E033818033A2; Wed, 30 Jan 2019 17:47:30 +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 x0UHeYTj026469 for ; Wed, 30 Jan 2019 12:40:34 -0500 Received: by smtp.corp.redhat.com (Postfix) id D35825D97A; Wed, 30 Jan 2019 17:40:34 +0000 (UTC) Received: from localhost.localdomain.com (ovpn-112-64.ams2.redhat.com [10.36.112.64]) by smtp.corp.redhat.com (Postfix) with ESMTP id C13DE5D97E; Wed, 30 Jan 2019 17:40:33 +0000 (UTC) From: =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= To: libvir-list@redhat.com Date: Wed, 30 Jan 2019 17:40:22 +0000 Message-Id: <20190130174026.20675-3-berrange@redhat.com> In-Reply-To: <20190130174026.20675-1-berrange@redhat.com> References: <20190130174026.20675-1-berrange@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 2/6] remote: remove variable whose value is a constant X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="utf-8" 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.25]); Wed, 30 Jan 2019 17:47:32 +0000 (UTC) The 'rv' variable is never changed after being declared, so can be removed. Signed-off-by: Daniel P. Berrang=C3=A9 Reviewed-by: John Ferlan --- src/remote/remote_daemon_dispatch.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/src/remote/remote_daemon_dispatch.c b/src/remote/remote_daemon= _dispatch.c index fcd602304f..df28259042 100644 --- a/src/remote/remote_daemon_dispatch.c +++ b/src/remote/remote_daemon_dispatch.c @@ -3659,7 +3659,6 @@ remoteDispatchAuthSaslStart(virNetServerPtr server, const char *serverout; size_t serveroutlen; int err; - int rv =3D -1; struct daemonClientPrivate *priv =3D virNetServerClientGetPrivateData(client); const char *identity; @@ -3739,8 +3738,7 @@ remoteDispatchAuthSaslStart(virNetServerPtr server, virResetLastError(); virReportError(VIR_ERR_AUTH_FAILED, "%s", _("authentication failed")); - if (rv < 0) - virNetMessageSaveError(rerr); + virNetMessageSaveError(rerr); virMutexUnlock(&priv->lock); return -1; } @@ -3757,7 +3755,6 @@ remoteDispatchAuthSaslStep(virNetServerPtr server, const char *serverout; size_t serveroutlen; int err; - int rv =3D -1; struct daemonClientPrivate *priv =3D virNetServerClientGetPrivateData(client); const char *identity; @@ -3837,8 +3834,7 @@ remoteDispatchAuthSaslStep(virNetServerPtr server, virResetLastError(); virReportError(VIR_ERR_AUTH_FAILED, "%s", _("authentication failed")); - if (rv < 0) - virNetMessageSaveError(rerr); + virNetMessageSaveError(rerr); virMutexUnlock(&priv->lock); return -1; } --=20 2.20.1 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Mon May 6 19:06:14 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; envelope-from=libvir-list-bounces@redhat.com; helo=mx1.redhat.com; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1548870042926725.9863217373304; Wed, 30 Jan 2019 09:40:42 -0800 (PST) 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 9BDCA7AE8B; Wed, 30 Jan 2019 17:40:40 +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 5772F5C21A; Wed, 30 Jan 2019 17:40:40 +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 ABC4518033A2; Wed, 30 Jan 2019 17:40:38 +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 x0UHeaa1026476 for ; Wed, 30 Jan 2019 12:40:36 -0500 Received: by smtp.corp.redhat.com (Postfix) id 1FC735D97E; Wed, 30 Jan 2019 17:40:36 +0000 (UTC) Received: from localhost.localdomain.com (ovpn-112-64.ams2.redhat.com [10.36.112.64]) by smtp.corp.redhat.com (Postfix) with ESMTP id 476D05D97A; Wed, 30 Jan 2019 17:40:35 +0000 (UTC) From: =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= To: libvir-list@redhat.com Date: Wed, 30 Jan 2019 17:40:23 +0000 Message-Id: <20190130174026.20675-4-berrange@redhat.com> In-Reply-To: <20190130174026.20675-1-berrange@redhat.com> References: <20190130174026.20675-1-berrange@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 3/6] storage: pass struct _virStorageBackendQemuImgInfo by reference X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="utf-8" 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.25]); Wed, 30 Jan 2019 17:40:41 +0000 (UTC) The struct _virStorageBackendQemuImgInfo is quite large so it is preferrable to pass it by reference instead of by value. This requires us to stop modifying the "compat" field. Signed-off-by: Daniel P. Berrang=C3=A9 Reviewed-by: John Ferlan --- src/storage/storage_util.c | 35 +++++++++++++++++------------------ 1 file changed, 17 insertions(+), 18 deletions(-) diff --git a/src/storage/storage_util.c b/src/storage/storage_util.c index 37b3d58667..de6f8ec2bd 100644 --- a/src/storage/storage_util.c +++ b/src/storage/storage_util.c @@ -742,38 +742,40 @@ struct _virStorageBackendQemuImgInfo { static int storageBackendCreateQemuImgOpts(virStorageEncryptionInfoDefPtr encinfo, char **opts, - struct _virStorageBackendQemuImgInfo info) + struct _virStorageBackendQemuImgInfo *info) { virBuffer buf =3D VIR_BUFFER_INITIALIZER; =20 - if (info.backingPath) + if (info->backingPath) virBufferAsprintf(&buf, "backing_fmt=3D%s,", - virStorageFileFormatTypeToString(info.backingFor= mat)); + virStorageFileFormatTypeToString(info->backingFo= rmat)); =20 if (encinfo) - virQEMUBuildQemuImgKeySecretOpts(&buf, encinfo, info.secretAlias); + virQEMUBuildQemuImgKeySecretOpts(&buf, encinfo, info->secretAlias); =20 - if (info.preallocate) { - if (info.size_arg > info.allocation) + if (info->preallocate) { + if (info->size_arg > info->allocation) virBufferAddLit(&buf, "preallocation=3Dmetadata,"); else virBufferAddLit(&buf, "preallocation=3Dfalloc,"); } =20 - if (info.nocow) + if (info->nocow) virBufferAddLit(&buf, "nocow=3Don,"); =20 - if (info.compat) - virBufferAsprintf(&buf, "compat=3D%s,", info.compat); + if (info->compat) + virBufferAsprintf(&buf, "compat=3D%s,", info->compat); + else if (info->format =3D=3D VIR_STORAGE_FILE_QCOW2) + virBufferAddLit(&buf, "compat=3D0.10,"); =20 - if (info.features && info.format =3D=3D VIR_STORAGE_FILE_QCOW2) { - if (virBitmapIsBitSet(info.features, + if (info->features && info->format =3D=3D VIR_STORAGE_FILE_QCOW2) { + if (virBitmapIsBitSet(info->features, VIR_STORAGE_FILE_FEATURE_LAZY_REFCOUNTS)) { - if (STREQ_NULLABLE(info.compat, "0.10")) { + if (STREQ_NULLABLE(info->compat, "0.10")) { virReportError(VIR_ERR_CONFIG_UNSUPPORTED, _("lazy_refcounts not supported with compat" " level %s"), - info.compat); + info->compat); goto error; } virBufferAddLit(&buf, "lazy_refcounts,"); @@ -942,13 +944,10 @@ storageBackendCreateQemuImgSetBacking(virStoragePoolO= bjPtr pool, static int storageBackendCreateQemuImgSetOptions(virCommandPtr cmd, virStorageEncryptionInfoDefPtr encin= fo, - struct _virStorageBackendQemuImgInfo= info) + struct _virStorageBackendQemuImgInfo= *info) { char *opts =3D NULL; =20 - if (info.format =3D=3D VIR_STORAGE_FILE_QCOW2 && !info.compat) - info.compat =3D "0.10"; - if (storageBackendCreateQemuImgOpts(encinfo, &opts, info) < 0) return -1; if (opts) @@ -1196,7 +1195,7 @@ virStorageBackendCreateQemuImgCmdFromVol(virStoragePo= olObjPtr pool, } =20 if (convertStep !=3D VIR_STORAGE_VOL_ENCRYPT_CONVERT) { - if (storageBackendCreateQemuImgSetOptions(cmd, encinfo, info) < 0) + if (storageBackendCreateQemuImgSetOptions(cmd, encinfo, &info) < 0) goto error; if (info.inputPath) virCommandAddArg(cmd, info.inputPath); --=20 2.20.1 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Mon May 6 19:06:14 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; envelope-from=libvir-list-bounces@redhat.com; helo=mx1.redhat.com; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1548870052526399.9910073988393; Wed, 30 Jan 2019 09:40:52 -0800 (PST) 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 2EB8B88E5A; Wed, 30 Jan 2019 17:40:50 +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 DAD48608E5; Wed, 30 Jan 2019 17:40: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 772133F603; Wed, 30 Jan 2019 17:40:48 +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 x0UHebTq026486 for ; Wed, 30 Jan 2019 12:40:37 -0500 Received: by smtp.corp.redhat.com (Postfix) id 680025D982; Wed, 30 Jan 2019 17:40:37 +0000 (UTC) Received: from localhost.localdomain.com (ovpn-112-64.ams2.redhat.com [10.36.112.64]) by smtp.corp.redhat.com (Postfix) with ESMTP id 79A175D97A; Wed, 30 Jan 2019 17:40:36 +0000 (UTC) From: =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= To: libvir-list@redhat.com Date: Wed, 30 Jan 2019 17:40:24 +0000 Message-Id: <20190130174026.20675-5-berrange@redhat.com> In-Reply-To: <20190130174026.20675-1-berrange@redhat.com> References: <20190130174026.20675-1-berrange@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 4/6] qemu: pass virDomainDeviceInfo by reference X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="utf-8" 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]); Wed, 30 Jan 2019 17:40:51 +0000 (UTC) The virDomainDeviceInfo parameter is a large struct so it is preferrable to pass it by reference instead of by value. Signed-off-by: Daniel P. Berrang=C3=A9 Reviewed-by: John Ferlan --- src/qemu/qemu_command.c | 4 ++-- src/qemu/qemu_domain.c | 10 +++++----- src/qemu/qemu_domain.h | 9 +++++---- src/qemu/qemu_domain_address.c | 2 +- 4 files changed, 13 insertions(+), 12 deletions(-) diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c index 3e46f3ced3..a59583fb75 100644 --- a/src/qemu/qemu_command.c +++ b/src/qemu/qemu_command.c @@ -1894,7 +1894,7 @@ qemuBuildDiskDeviceStr(const virDomainDef *def, if (qemuCheckDiskConfig(disk, qemuCaps) < 0) goto error; =20 - if (!qemuDomainCheckCCWS390AddressSupport(def, disk->info, qemuCaps, d= isk->dst)) + if (!qemuDomainCheckCCWS390AddressSupport(def, &disk->info, qemuCaps, = disk->dst)) goto error; =20 if (disk->iothread && !qemuCheckIOThreads(def, disk)) @@ -5961,7 +5961,7 @@ qemuBuildRNGDevStr(const virDomainDef *def, { virBuffer buf =3D VIR_BUFFER_INITIALIZER; =20 - if (!qemuDomainCheckCCWS390AddressSupport(def, dev->info, qemuCaps, + if (!qemuDomainCheckCCWS390AddressSupport(def, &dev->info, qemuCaps, dev->source.file)) goto error; =20 diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c index 63879e3e4c..6a78c023c8 100644 --- a/src/qemu/qemu_domain.c +++ b/src/qemu/qemu_domain.c @@ -5807,7 +5807,7 @@ qemuDomainDeviceDefValidateController(const virDomain= ControllerDef *controller, { int ret =3D 0; =20 - if (!qemuDomainCheckCCWS390AddressSupport(def, controller->info, qemuC= aps, + if (!qemuDomainCheckCCWS390AddressSupport(def, &controller->info, qemu= Caps, "controller")) return -1; =20 @@ -5861,7 +5861,7 @@ qemuDomainDeviceDefValidateVsock(const virDomainVsock= Def *vsock, return -1; } =20 - if (!qemuDomainCheckCCWS390AddressSupport(def, vsock->info, qemuCaps, + if (!qemuDomainCheckCCWS390AddressSupport(def, &vsock->info, qemuCaps, "vsock")) return -1; =20 @@ -13474,11 +13474,11 @@ qemuDomainGetMachineName(virDomainObjPtr vm) */ bool qemuDomainCheckCCWS390AddressSupport(const virDomainDef *def, - virDomainDeviceInfo info, + const virDomainDeviceInfo *info, virQEMUCapsPtr qemuCaps, const char *devicename) { - if (info.type =3D=3D VIR_DOMAIN_DEVICE_ADDRESS_TYPE_CCW) { + if (info->type =3D=3D VIR_DOMAIN_DEVICE_ADDRESS_TYPE_CCW) { if (!qemuDomainIsS390CCW(def)) { virReportError(VIR_ERR_CONFIG_UNSUPPORTED, _("cannot use CCW address type for device " @@ -13491,7 +13491,7 @@ qemuDomainCheckCCWS390AddressSupport(const virDomai= nDef *def, "this QEMU")); return false; } - } else if (info.type =3D=3D VIR_DOMAIN_DEVICE_ADDRESS_TYPE_VIRTIO_S390= ) { + } else if (info->type =3D=3D VIR_DOMAIN_DEVICE_ADDRESS_TYPE_VIRTIO_S39= 0) { if (!virQEMUCapsGet(qemuCaps, QEMU_CAPS_VIRTIO_S390)) { virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", _("virtio S390 address type is not supported by= " diff --git a/src/qemu/qemu_domain.h b/src/qemu/qemu_domain.h index defbffbf94..462da8224d 100644 --- a/src/qemu/qemu_domain.h +++ b/src/qemu/qemu_domain.h @@ -1064,10 +1064,11 @@ int qemuDomainObjPrivateXMLParseAllowReboot(xmlXPathContextPtr ctxt, virTristateBool *allowReboot); =20 -bool qemuDomainCheckCCWS390AddressSupport(const virDomainDef *def, - virDomainDeviceInfo info, - virQEMUCapsPtr qemuCaps, - const char *devicename); +bool +qemuDomainCheckCCWS390AddressSupport(const virDomainDef *def, + const virDomainDeviceInfo *info, + virQEMUCapsPtr qemuCaps, + const char *devicename); =20 int qemuDomainPrepareDiskSourceData(virDomainDiskDefPtr disk, diff --git a/src/qemu/qemu_domain_address.c b/src/qemu/qemu_domain_address.c index d50744a952..c376f3f897 100644 --- a/src/qemu/qemu_domain_address.c +++ b/src/qemu/qemu_domain_address.c @@ -3226,7 +3226,7 @@ qemuDomainEnsureVirtioAddress(bool *releaseAddr, else if (virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_VIRTIO_S390)) info->type =3D VIR_DOMAIN_DEVICE_ADDRESS_TYPE_VIRTIO_S390; } else { - if (!qemuDomainCheckCCWS390AddressSupport(vm->def, *info, priv->qe= muCaps, + if (!qemuDomainCheckCCWS390AddressSupport(vm->def, info, priv->qem= uCaps, devicename)) return -1; } --=20 2.20.1 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Mon May 6 19:06:14 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; envelope-from=libvir-list-bounces@redhat.com; helo=mx1.redhat.com; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1548870086839507.954629609853; Wed, 30 Jan 2019 09:41:26 -0800 (PST) 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 B909E5F758; Wed, 30 Jan 2019 17:41: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 B95A5176CB; Wed, 30 Jan 2019 17:41: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 5594C18033A2; Wed, 30 Jan 2019 17:41:23 +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 x0UHecNA026494 for ; Wed, 30 Jan 2019 12:40:38 -0500 Received: by smtp.corp.redhat.com (Postfix) id A6C7C5D982; Wed, 30 Jan 2019 17:40:38 +0000 (UTC) Received: from localhost.localdomain.com (ovpn-112-64.ams2.redhat.com [10.36.112.64]) by smtp.corp.redhat.com (Postfix) with ESMTP id CD4CF5D97A; Wed, 30 Jan 2019 17:40:37 +0000 (UTC) From: =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= To: libvir-list@redhat.com Date: Wed, 30 Jan 2019 17:40:25 +0000 Message-Id: <20190130174026.20675-6-berrange@redhat.com> In-Reply-To: <20190130174026.20675-1-berrange@redhat.com> References: <20190130174026.20675-1-berrange@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 5/6] hyperv: remove unused 'total' 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: , Content-Type: text/plain; charset="utf-8" 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.39]); Wed, 30 Jan 2019 17:41:25 +0000 (UTC) Signed-off-by: Daniel P. Berrang=C3=A9 Reviewed-by: John Ferlan --- src/hyperv/hyperv_wmi_generator.py | 1 - 1 file changed, 1 deletion(-) diff --git a/src/hyperv/hyperv_wmi_generator.py b/src/hyperv/hyperv_wmi_gen= erator.py index 518a55fd6d..fc1370955f 100755 --- a/src/hyperv/hyperv_wmi_generator.py +++ b/src/hyperv/hyperv_wmi_generator.py @@ -280,7 +280,6 @@ class WmiClass: =20 # alter each version's property list so that common members are fi= rst # and in the same order as in the common dictionary - total =3D len(common) for cls in self.versions: index =3D 0 count =3D len(cls.properties) --=20 2.20.1 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Mon May 6 19:06:14 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; envelope-from=libvir-list-bounces@redhat.com; helo=mx1.redhat.com; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1548870091629273.1538666137842; Wed, 30 Jan 2019 09:41:31 -0800 (PST) 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 0F5CEA0906; Wed, 30 Jan 2019 17:41: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 BBC3F5C239; Wed, 30 Jan 2019 17:41: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 6C18A18033A7; Wed, 30 Jan 2019 17:41: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 x0UHedul026502 for ; Wed, 30 Jan 2019 12:40:39 -0500 Received: by smtp.corp.redhat.com (Postfix) id DCE985D97E; Wed, 30 Jan 2019 17:40:39 +0000 (UTC) Received: from localhost.localdomain.com (ovpn-112-64.ams2.redhat.com [10.36.112.64]) by smtp.corp.redhat.com (Postfix) with ESMTP id 15D2F5D97A; Wed, 30 Jan 2019 17:40:38 +0000 (UTC) From: =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= To: libvir-list@redhat.com Date: Wed, 30 Jan 2019 17:40:26 +0000 Message-Id: <20190130174026.20675-7-berrange@redhat.com> In-Reply-To: <20190130174026.20675-1-berrange@redhat.com> References: <20190130174026.20675-1-berrange@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 6/6] hyperv: use "is None" not "== None" for PEP-8 compliance X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="utf-8" 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.39]); Wed, 30 Jan 2019 17:41:30 +0000 (UTC) PEP 8 says: "Comparisons to singletons like None should always be done with 'is' or 'is not', never the equality operators." There are potentially semantics differences, though in the case of this libvirt code its merely a style change: http://jaredgrubb.blogspot.com/2009/04/python-is-none-vs-none.html Signed-off-by: Daniel P. Berrang=C3=A9 Reviewed-by: John Ferlan --- src/hyperv/hyperv_wmi_generator.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/hyperv/hyperv_wmi_generator.py b/src/hyperv/hyperv_wmi_gen= erator.py index fc1370955f..a9ece0ff00 100755 --- a/src/hyperv/hyperv_wmi_generator.py +++ b/src/hyperv/hyperv_wmi_generator.py @@ -65,7 +65,7 @@ class WmiClass: # because we'll generate "common" member and will be the "base" na= me if len(self.versions) > 1: first =3D self.versions[0] - if first.version =3D=3D None: + if first.version is None: first.version =3D "v1" first.name =3D "%s_%s" % (first.name, first.version) =20 --=20 2.20.1 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list