From nobody Sat May 4 15:52:28 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 ARC-Seal: i=1; a=rsa-sha256; t=1566852319; cv=none; d=zoho.com; s=zohoarc; b=UDYPeRwUfE8PtH9m2rbaGvY+EN8IJmVy+pt1vHg2M/KzwHRb219ksxwws+vD1MM0yzpiOxUzcco6UYpCGkx/1CU/q2W5l5Nng1tEJcldKtB+NDxOiVpQgNCHiOo79MC8jsfsS3cpi8j6PpRzHzgtlWGlyz/3DJxeYKqNUoJifAc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1566852319; h=Content-Type:Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To:ARC-Authentication-Results; bh=uC+QyloLCNLzlGq7/YStNEHksz9N2ALs3B8od2JcswE=; b=WeBkNXaq/aqfP9rl0rmPeTXX8SV8ojOS/3kaQRM/dFGvrYZzUZ7jrAwch7yqYOwsP2Y0SO+uuYip82pw5/D9bYeociZHMV/QnnPbvnqggW9JbfNbcwsitCFSri6kjtS7wPJUuTbv8y49r14sRHqEGZ+D+El7e3Ztfv463eoU9dw= ARC-Authentication-Results: i=1; mx.zoho.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 header.from= (p=none dis=none) header.from= Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1566852319344660.1341614115306; Mon, 26 Aug 2019 13:45:19 -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 1195A793C4; Mon, 26 Aug 2019 20:45:18 +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 D911E60619; Mon, 26 Aug 2019 20:45:17 +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 9E72D180221D; Mon, 26 Aug 2019 20:45:17 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id x7QKjGbg020182 for ; Mon, 26 Aug 2019 16:45:16 -0400 Received: by smtp.corp.redhat.com (Postfix) id 4970A60F86; Mon, 26 Aug 2019 20:45:16 +0000 (UTC) Received: from icr.brq.redhat.com (unknown [10.43.2.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id C5C3860CC0 for ; Mon, 26 Aug 2019 20:45:15 +0000 (UTC) From: =?UTF-8?q?J=C3=A1n=20Tomko?= To: libvir-list@redhat.com Date: Mon, 26 Aug 2019 22:44:50 +0200 Message-Id: <1fb47cfed5be1bf745ad2bfd1f5e1506b2ff8302.1566852239.git.jtomko@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 1/7] qemuBuildHostNetStr: remove unused cfg 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]); Mon, 26 Aug 2019 20:45:18 +0000 (UTC) As of commit 2d80fbb14dffa45fe3fcd2c3f29ce54857bb766c this variable is unused. Signed-off-by: J=C3=A1n Tomko Reviewed-by: Cole Robinson --- src/qemu/qemu_command.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c index c3931b6744..fbc9a73035 100644 --- a/src/qemu/qemu_command.c +++ b/src/qemu/qemu_command.c @@ -3904,7 +3904,7 @@ qemuBuildNicDevStr(virDomainDefPtr def, =20 char * qemuBuildHostNetStr(virDomainNetDefPtr net, - virQEMUDriverPtr driver, + virQEMUDriverPtr driver ATTRIBUTE_UNUSED, char **tapfd, size_t tapfdSize, char **vhostfd, @@ -3913,7 +3913,6 @@ qemuBuildHostNetStr(virDomainNetDefPtr net, bool is_tap =3D false; VIR_AUTOCLEAN(virBuffer) buf =3D VIR_BUFFER_INITIALIZER; virDomainNetType netType =3D virDomainNetGetActualType(net); - virQEMUDriverConfigPtr cfg =3D virQEMUDriverGetConfig(driver); size_t i; char *ret =3D NULL; =20 @@ -4045,7 +4044,6 @@ qemuBuildHostNetStr(virDomainNetDefPtr net, =20 ret =3D virBufferContentAndReset(&buf); cleanup: - virObjectUnref(cfg); return ret; } =20 --=20 2.19.2 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Sat May 4 15:52:28 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 ARC-Seal: i=1; a=rsa-sha256; t=1566852324; cv=none; d=zoho.com; s=zohoarc; b=nGJfpbfwSFghyL/zZOLfRDKEHSsFmtdhWXsMzqYHQ4KQJ598G3oSDDNcDzbR8zUK7ROUuu1Wfwp4STS27hLFAC7TzF2RxKeg0bI7b3zf7THEjbF024bNmWurK7a66kotkKdr0AT4yMe0b9JdenAK0HWrGYOWgoT5rTp6csGrmpk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1566852324; h=Content-Type:Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To:ARC-Authentication-Results; bh=cQyUXgScqEboBARf8RKvtnIpNkiis52XEPTg/FX4R9I=; b=P65YNVF9H3SM7rtg1lr5cw8g7CrDrXUu54AuSVo8ZLIt4LuLfYInLLzhec9VeWFA1/uZA7VwF52HGRQQ8oVk78/e5BXEtR5gz8WI62N0SHYdtv+jkjqOqa40aDWERhxsH8RR8+vvAXIUTFWEhCKjyL45c2TG+454u7w4qbEOtWM= ARC-Authentication-Results: i=1; mx.zoho.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 header.from= (p=none dis=none) header.from= Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1566852324663439.898292411204; Mon, 26 Aug 2019 13:45:24 -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 3FC3710F23F8; Mon, 26 Aug 2019 20:45:23 +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 17FC2600CE; Mon, 26 Aug 2019 20:45: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 C5D5E89CF; Mon, 26 Aug 2019 20:45:22 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id x7QKjHS2020190 for ; Mon, 26 Aug 2019 16:45:17 -0400 Received: by smtp.corp.redhat.com (Postfix) id 193F460CC0; Mon, 26 Aug 2019 20:45:17 +0000 (UTC) Received: from icr.brq.redhat.com (unknown [10.43.2.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id 9603560F86 for ; Mon, 26 Aug 2019 20:45:16 +0000 (UTC) From: =?UTF-8?q?J=C3=A1n=20Tomko?= To: libvir-list@redhat.com Date: Mon, 26 Aug 2019 22:44:51 +0200 Message-Id: In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 2/7] qemuBuildHostNetStr: remove unused 'driver' argument 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.11 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.6.2 (mx1.redhat.com [10.5.110.66]); Mon, 26 Aug 2019 20:45:23 +0000 (UTC) Signed-off-by: J=C3=A1n Tomko Reviewed-by: Cole Robinson --- src/qemu/qemu_command.c | 3 +-- src/qemu/qemu_command.h | 1 - src/qemu/qemu_hotplug.c | 2 +- 3 files changed, 2 insertions(+), 4 deletions(-) diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c index fbc9a73035..7c48a21c23 100644 --- a/src/qemu/qemu_command.c +++ b/src/qemu/qemu_command.c @@ -3904,7 +3904,6 @@ qemuBuildNicDevStr(virDomainDefPtr def, =20 char * qemuBuildHostNetStr(virDomainNetDefPtr net, - virQEMUDriverPtr driver ATTRIBUTE_UNUSED, char **tapfd, size_t tapfdSize, char **vhostfd, @@ -8589,7 +8588,7 @@ qemuBuildInterfaceCommandLine(virQEMUDriverPtr driver, if (chardev) virCommandAddArgList(cmd, "-chardev", chardev, NULL); =20 - if (!(host =3D qemuBuildHostNetStr(net, driver, + if (!(host =3D qemuBuildHostNetStr(net, tapfdName, tapfdSize, vhostfdName, vhostfdSize))) goto cleanup; diff --git a/src/qemu/qemu_command.h b/src/qemu/qemu_command.h index 6f97e7bc0c..1569eac284 100644 --- a/src/qemu/qemu_command.h +++ b/src/qemu/qemu_command.h @@ -83,7 +83,6 @@ qemuBuildChrDeviceStr(char **deviceStr, virQEMUCapsPtr qemuCaps); =20 char *qemuBuildHostNetStr(virDomainNetDefPtr net, - virQEMUDriverPtr driver, char **tapfd, size_t tapfdSize, char **vhostfd, diff --git a/src/qemu/qemu_hotplug.c b/src/qemu/qemu_hotplug.c index 63acb9c451..b0e2febad7 100644 --- a/src/qemu/qemu_hotplug.c +++ b/src/qemu/qemu_hotplug.c @@ -1296,7 +1296,7 @@ qemuDomainAttachNetDevice(virQEMUDriverPtr driver, goto cleanup; } =20 - if (!(netstr =3D qemuBuildHostNetStr(net, driver, + if (!(netstr =3D qemuBuildHostNetStr(net, tapfdName, tapfdSize, vhostfdName, vhostfdSize))) goto cleanup; --=20 2.19.2 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Sat May 4 15:52:28 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 ARC-Seal: i=1; a=rsa-sha256; t=1566852321; cv=none; d=zoho.com; s=zohoarc; b=RnYG+ZrmcSATkvjwKSVT8nwDKzWh4u/jHJWedXIqeaZhzIl6BuCu9y/p/Uf+rNGTCO+D+P5pdytpegTbqYKBKnm2DnrFdvg5dkOekHWXCDqJshZhKTo8703pzH7wI+QNONo0E+PtOtE/luWIKq7m4LCkESaKGEyp4ohHI/pTl/E= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1566852321; h=Content-Type:Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To:ARC-Authentication-Results; bh=1NfAL7P8ddFUwOhR4TytTVV1xK0nlVt7q6TvfSZchas=; b=iB/CtJKQepaAm8+Bvu40GOd7EEHwV6wdagB0sgDV7DslYkRxJIsKRXZbLB4IuOlNIKE4d2qQGuE39sZ4dG6rgPM1XrgslAcfJBg9FJQ0ubi+36c9Xol2LpwrCybdgCqoMp/Lzq1tQxBx198PsP41NXo1xrTuU5HCb4szwV9YHFE= ARC-Authentication-Results: i=1; mx.zoho.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 header.from= (p=none dis=none) header.from= Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1566852321611147.0105278516619; Mon, 26 Aug 2019 13:45:21 -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 2A0893084045; Mon, 26 Aug 2019 20:45:20 +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 F175260619; Mon, 26 Aug 2019 20:45: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 AC1B2180221F; Mon, 26 Aug 2019 20:45:19 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id x7QKjHr3020201 for ; Mon, 26 Aug 2019 16:45:17 -0400 Received: by smtp.corp.redhat.com (Postfix) id DBFBE60F86; Mon, 26 Aug 2019 20:45:17 +0000 (UTC) Received: from icr.brq.redhat.com (unknown [10.43.2.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id 65A7460CC0 for ; Mon, 26 Aug 2019 20:45:17 +0000 (UTC) From: =?UTF-8?q?J=C3=A1n=20Tomko?= To: libvir-list@redhat.com Date: Mon, 26 Aug 2019 22:44:52 +0200 Message-Id: In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 3/7] qemuBuildHostNetStr: remove unnecessary cleanup label 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.40]); Mon, 26 Aug 2019 20:45:20 +0000 (UTC) Signed-off-by: J=C3=A1n Tomko Reviewed-by: Cole Robinson --- src/qemu/qemu_command.c | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c index 7c48a21c23..06ac184f0d 100644 --- a/src/qemu/qemu_command.c +++ b/src/qemu/qemu_command.c @@ -3913,13 +3913,12 @@ qemuBuildHostNetStr(virDomainNetDefPtr net, VIR_AUTOCLEAN(virBuffer) buf =3D VIR_BUFFER_INITIALIZER; virDomainNetType netType =3D virDomainNetGetActualType(net); size_t i; - char *ret =3D NULL; =20 if (net->script && netType !=3D VIR_DOMAIN_NET_TYPE_ETHERNET) { virReportError(VIR_ERR_CONFIG_UNSUPPORTED, _("scripts are not supported on interfaces of type = %s"), virDomainNetTypeToString(netType)); - goto cleanup; + return NULL; } =20 switch (netType) { @@ -3983,7 +3982,7 @@ qemuBuildHostNetStr(virDomainNetDefPtr net, const char *prefix =3D ""; =20 if (!(addr =3D virSocketAddrFormat(&ip->address))) - goto cleanup; + return NULL; =20 if (VIR_SOCKET_ADDR_IS_FAMILY(&ip->address, AF_INET)) prefix =3D "net=3D"; @@ -4039,11 +4038,9 @@ qemuBuildHostNetStr(virDomainNetDefPtr net, =20 virBufferTrim(&buf, ",", -1); if (virBufferCheckError(&buf) < 0) - goto cleanup; + return NULL; =20 - ret =3D virBufferContentAndReset(&buf); - cleanup: - return ret; + return virBufferContentAndReset(&buf); } =20 =20 --=20 2.19.2 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Sat May 4 15:52:28 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 ARC-Seal: i=1; a=rsa-sha256; t=1566852323; cv=none; d=zoho.com; s=zohoarc; b=mddbxSu4K1eCPF5v8qDlAGeYR9KnUGXtQaRe+jFADsIbfivZqsS+UpmWjxSLOkmxi8EX6aZ3O68xDBkF5yqG+c/nm4OoDGqDFPAiHwDovGJ9TgZM/iFZhHsq6KwfxQm9BK3L3On11QzRbNNtEyQVLax16S0bZlvCVjCXQqhGD+w= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1566852323; h=Content-Type:Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To:ARC-Authentication-Results; bh=xaeI2mF8zteokkomboNqiiuENkzcYy8/Ze+WaGIs9to=; b=MLBqIhMWm8yOKQSBQVkOk7d73X6tAHAmZp/th7GgEIGgUju7bz0NNPhKLaQaIQm+nMAh1lxNEI0/XXuTaOhW098CCH33uQVE21F2VT7aCom8a1S1lhBB2Ml1VxfCGyish3J+/GtVFOtLdVCgPgMKkyQA/rkXbEcL0CWEcknQjUM= ARC-Authentication-Results: i=1; mx.zoho.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 header.from= (p=none dis=none) header.from= Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1566852323896462.035669787076; Mon, 26 Aug 2019 13:45:23 -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 B6EA38980F8; Mon, 26 Aug 2019 20:45:22 +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 8A7E85C22F; Mon, 26 Aug 2019 20:45: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 40909180BA98; Mon, 26 Aug 2019 20:45:22 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id x7QKjLsd020216 for ; Mon, 26 Aug 2019 16:45:21 -0400 Received: by smtp.corp.redhat.com (Postfix) id 175D56CE5B; Mon, 26 Aug 2019 20:45:21 +0000 (UTC) Received: from icr.brq.redhat.com (unknown [10.43.2.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id 929B46CE58 for ; Mon, 26 Aug 2019 20:45:18 +0000 (UTC) From: =?UTF-8?q?J=C3=A1n=20Tomko?= To: libvir-list@redhat.com Date: Mon, 26 Aug 2019 22:44:53 +0200 Message-Id: <781b9f6af341ac5f2dadd2747d02ef44822be829.1566852239.git.jtomko@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 4/7] qemuBuildSoundCommandLine: reduce scope of codecstr 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.6.2 (mx1.redhat.com [10.5.110.67]); Mon, 26 Aug 2019 20:45:23 +0000 (UTC) Copy the declaration into the smallest blocks it's used in and mark it as VIR_AUTOFREE. Signed-off-by: J=C3=A1n Tomko Reviewed-by: Cole Robinson --- src/qemu/qemu_command.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c index 06ac184f0d..bd6beb0e52 100644 --- a/src/qemu/qemu_command.c +++ b/src/qemu/qemu_command.c @@ -4471,9 +4471,9 @@ qemuBuildSoundCommandLine(virCommandPtr cmd, virCommandAddArg(cmd, str); if (sound->model =3D=3D VIR_DOMAIN_SOUND_MODEL_ICH6 || sound->model =3D=3D VIR_DOMAIN_SOUND_MODEL_ICH9) { - char *codecstr =3D NULL; =20 for (j =3D 0; j < sound->ncodecs; j++) { + VIR_AUTOFREE(char *) codecstr =3D NULL; virCommandAddArg(cmd, "-device"); if (!(codecstr =3D qemuBuildSoundCodecStr(sound, sound->codecs[j], @@ -4482,9 +4482,9 @@ qemuBuildSoundCommandLine(virCommandPtr cmd, =20 } virCommandAddArg(cmd, codecstr); - VIR_FREE(codecstr); } if (j =3D=3D 0) { + VIR_AUTOFREE(char *) codecstr =3D NULL; virDomainSoundCodecDef codec =3D { VIR_DOMAIN_SOUND_CODEC_TYPE_DUPLEX, 0 @@ -4497,7 +4497,6 @@ qemuBuildSoundCommandLine(virCommandPtr cmd, =20 } virCommandAddArg(cmd, codecstr); - VIR_FREE(codecstr); } } } --=20 2.19.2 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Sat May 4 15:52:28 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 ARC-Seal: i=1; a=rsa-sha256; t=1566852329; cv=none; d=zoho.com; s=zohoarc; b=kp6hbawixhC6bOa3+KwHYhaVCrzFk62hMj4h4kf84hkw1VFgPHe8ZXLTbLn4FhratGm2d7x0VbwsJ1wxLOVlaloac0+LWvUppXyWOVsbRZFUnIBRtra0Yq1Si355kYX/gSlXwFlOrH8ruAj9c6iNZrKfak4N2HXwvBiOUxG3t74= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1566852329; h=Content-Type:Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To:ARC-Authentication-Results; bh=/5NRUwCeD4j8tWD+GPKO20WLnsgLJwTS5m79ZOiwihA=; b=aLmDOtU8iuwCWcANLn5yQcPAbIXrcMIjITx1Xb13jtSTOqhS65IlGkxQejn4yMHEFSBUL3p/LPfx1JBMPJwcQWBsKEqCx46+lWNVJi/xXHw08bVaiFZ9XhYj9vVn3lR2lXfDbvodiC56r1APshSpt/+ToyaBDMnfs0BcaFFWKTI= ARC-Authentication-Results: i=1; mx.zoho.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 header.from= (p=none dis=none) header.from= Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1566852329932229.03652505884565; Mon, 26 Aug 2019 13:45:29 -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 99E7410576DE; Mon, 26 Aug 2019 20:45:28 +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 71D895C22F; Mon, 26 Aug 2019 20:45: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 2A8E9180BA9C; Mon, 26 Aug 2019 20:45:28 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id x7QKjNRP020230 for ; Mon, 26 Aug 2019 16:45:23 -0400 Received: by smtp.corp.redhat.com (Postfix) id C3E883783; Mon, 26 Aug 2019 20:45:23 +0000 (UTC) Received: from icr.brq.redhat.com (unknown [10.43.2.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id 4CD2860F86 for ; Mon, 26 Aug 2019 20:45:21 +0000 (UTC) From: =?UTF-8?q?J=C3=A1n=20Tomko?= To: libvir-list@redhat.com Date: Mon, 26 Aug 2019 22:44:54 +0200 Message-Id: <2c28a914903a93614074db2403c2ad0a4ef91d43.1566852239.git.jtomko@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 5/7] qemuBuildMemoryBackendProps: remove useless cleanup label 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.6.2 (mx1.redhat.com [10.5.110.64]); Mon, 26 Aug 2019 20:45:29 +0000 (UTC) Signed-off-by: J=C3=A1n Tomko Reviewed-by: Cole Robinson --- src/qemu/qemu_command.c | 43 ++++++++++++++++++++--------------------- 1 file changed, 21 insertions(+), 22 deletions(-) diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c index bd6beb0e52..262f4d0594 100644 --- a/src/qemu/qemu_command.c +++ b/src/qemu/qemu_command.c @@ -3429,7 +3429,7 @@ qemuBuildMemoryBackendProps(virJSONValuePtr *backendP= rops, useHugepage =3D false; } else if (useHugepage && pagesize =3D=3D 0) { if (qemuBuildMemoryGetDefaultPagesize(cfg, &pagesize) < 0) - goto cleanup; + return -1; } =20 if (!(props =3D virJSONValueNewObject())) @@ -3441,70 +3441,70 @@ qemuBuildMemoryBackendProps(virJSONValuePtr *backen= dProps, if (useHugepage && (virJSONValueObjectAdd(props, "b:hugetlb", useHugepage, NULL) = < 0 || virJSONValueObjectAdd(props, "U:hugetlbsize", pagesize << 10,= NULL) < 0)) { - goto cleanup; + return -1; } =20 if (qemuBuildMemoryBackendPropsShare(props, memAccess) < 0) - goto cleanup; + return -1; =20 } else if (useHugepage || mem->nvdimmPath || memAccess || def->mem.source =3D=3D VIR_DOMAIN_MEMORY_SOURCE_FILE) { =20 if (mem->nvdimmPath) { if (VIR_STRDUP(memPath, mem->nvdimmPath) < 0) - goto cleanup; + return -1; if (!priv->memPrealloc) prealloc =3D true; } else if (useHugepage) { if (qemuGetDomainHupageMemPath(def, cfg, pagesize, &memPath) <= 0) - goto cleanup; + return -1; if (!priv->memPrealloc) prealloc =3D true; } else { /* We can have both pagesize and mem source. If that's the cas= e, * prefer hugepages as those are more specific. */ if (qemuGetMemoryBackingPath(def, cfg, mem->info.alias, &memPa= th) < 0) - goto cleanup; + return -1; } =20 if (virJSONValueObjectAdd(props, "B:prealloc", prealloc, "s:mem-path", memPath, NULL) < 0) - goto cleanup; + return -1; =20 if (!mem->nvdimmPath && discard =3D=3D VIR_TRISTATE_BOOL_YES) { if (!virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_OBJECT_MEMORY_FI= LE_DISCARD)) { virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", _("this QEMU doesn't support memory discard= ")); - goto cleanup; + return -1; } =20 if (virJSONValueObjectAdd(props, "B:discard-data", true, NULL) < 0) - goto cleanup; + return -1; } =20 if (qemuBuildMemoryBackendPropsShare(props, memAccess) < 0) - goto cleanup; + return -1; } else { backendType =3D "memory-backend-ram"; } =20 if (virJSONValueObjectAdd(props, "U:size", mem->size * 1024, NULL) < 0) - goto cleanup; + return -1; =20 if (mem->alignsize) { if (!virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_OBJECT_MEMORY_FILE_A= LIGN)) { virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", _("nvdimm align property is not available " "with this QEMU binary")); - goto cleanup; + return -1; } if (virJSONValueObjectAdd(props, "U:align", mem->alignsize * 1024,= NULL) < 0) - goto cleanup; + return -1; } =20 if (mem->nvdimmPmem) { @@ -3512,10 +3512,10 @@ qemuBuildMemoryBackendProps(virJSONValuePtr *backen= dProps, virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", _("nvdimm pmem property is not available " "with this QEMU binary")); - goto cleanup; + return -1; } if (virJSONValueObjectAdd(props, "s:pmem", "on", NULL) < 0) - goto cleanup; + return -1; } =20 if (mem->sourceNodes) { @@ -3523,17 +3523,17 @@ qemuBuildMemoryBackendProps(virJSONValuePtr *backen= dProps, } else { if (virDomainNumatuneMaybeGetNodeset(def->numa, priv->autoNodeset, &nodemask, mem->targetNode) <= 0) - goto cleanup; + return -1; } =20 if (nodemask) { if (!virNumaNodesetIsAvailable(nodemask)) - goto cleanup; + return -1; if (virJSONValueObjectAdd(props, "m:host-nodes", nodemask, "S:policy", qemuNumaPolicyTypeToString(m= ode), NULL) < 0) - goto cleanup; + return -1; } =20 /* If none of the following is requested... */ @@ -3553,19 +3553,19 @@ qemuBuildMemoryBackendProps(virJSONValuePtr *backen= dProps, virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", _("this qemu doesn't support the " "memory-backend-file object")); - goto cleanup; + return -1; } else if (STREQ(backendType, "memory-backend-ram") && !virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_OBJECT_MEMORY= _RAM)) { virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", _("this qemu doesn't support the " "memory-backend-ram object")); - goto cleanup; + return -1; } else if (STREQ(backendType, "memory-backend-memory") && !virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_OBJECT_MEMORY= _MEMFD)) { virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", _("this qemu doesn't support the " "memory-backend-memfd object")); - goto cleanup; + return -1; } =20 ret =3D 0; @@ -3575,7 +3575,6 @@ qemuBuildMemoryBackendProps(virJSONValuePtr *backendP= rops, &props))) ret =3D -1; =20 - cleanup: return ret; } =20 --=20 2.19.2 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Sat May 4 15:52:28 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 ARC-Seal: i=1; a=rsa-sha256; t=1566852329; cv=none; d=zoho.com; s=zohoarc; b=cX2grY2lB83Td8SW58dtaWXSpWQ0sO/Iv2azvtA6SZWuslJTqjhbfIuJlUqC7TkqbFf0rmVjS7lx2Jtdx7rpwNL/qjx/PcPDDcVMmkkmBqtkotxiQkYR6AsPmkcO+6HzSh9je5RpIRkAeha0LFqDmtmnkRJWaZgbxpA15OxMbKw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1566852329; h=Content-Type:Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To:ARC-Authentication-Results; bh=d6qKZtVrGLKJSzqaQY3AhHQNpkeC3EwZuNz1540C3gw=; b=jMOsUYeEY55NLY5D5FZhJdunK3Q8EF09YNb+ib77sIgPqxVmeMzMjJYLH1lgjkFy4yBfgbjYGhVcb1+pUL2VizXi1nBaNxmFiyJtqyckRQUCF07D5hduA5wcuEWWkM/j3uvq8w02jUu3ONGQN2PrNsI1Tja2YT8XA7+ZD0KvAXI= ARC-Authentication-Results: i=1; mx.zoho.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 header.from= (p=none dis=none) header.from= Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 156685232964288.4904801271698; Mon, 26 Aug 2019 13:45:29 -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 4A4FD86679; Mon, 26 Aug 2019 20:45: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 1E56A1001938; Mon, 26 Aug 2019 20:45: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 C6F4424FDE; Mon, 26 Aug 2019 20:45:27 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id x7QKjQTp020240 for ; Mon, 26 Aug 2019 16:45:26 -0400 Received: by smtp.corp.redhat.com (Postfix) id 9725560F88; Mon, 26 Aug 2019 20:45:26 +0000 (UTC) Received: from icr.brq.redhat.com (unknown [10.43.2.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id 1F63760F86 for ; Mon, 26 Aug 2019 20:45:23 +0000 (UTC) From: =?UTF-8?q?J=C3=A1n=20Tomko?= To: libvir-list@redhat.com Date: Mon, 26 Aug 2019 22:44:55 +0200 Message-Id: In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 6/7] qemuBuildMemoryBackendProps: use 'rc' instead of ret. 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.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.26]); Mon, 26 Aug 2019 20:45:28 +0000 (UTC) Do not overwrite the 'ret' value more than once. Signed-off-by: J=C3=A1n Tomko Reviewed-by: Cole Robinson --- src/qemu/qemu_command.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c index 262f4d0594..528e11d5a0 100644 --- a/src/qemu/qemu_command.c +++ b/src/qemu/qemu_command.c @@ -3331,7 +3331,7 @@ qemuBuildMemoryBackendProps(virJSONValuePtr *backendP= rops, VIR_AUTOFREE(char *) memPath =3D NULL; bool prealloc =3D false; virBitmapPtr nodemask =3D NULL; - int ret =3D -1; + int rc; VIR_AUTOPTR(virJSONValue) props =3D NULL; bool nodeSpecified =3D virDomainNumatuneNodeSpecified(def->numa, mem->= targetNode); unsigned long long pagesize =3D mem->pagesize; @@ -3545,7 +3545,7 @@ qemuBuildMemoryBackendProps(virJSONValuePtr *backendP= rops, !force) { /* report back that using the new backend is not necessary * to achieve the desired configuration */ - ret =3D 1; + rc =3D 1; } else { /* otherwise check the required capability */ if (STREQ(backendType, "memory-backend-file") && @@ -3568,14 +3568,14 @@ qemuBuildMemoryBackendProps(virJSONValuePtr *backen= dProps, return -1; } =20 - ret =3D 0; + rc =3D 0; } =20 if (!(*backendProps =3D qemuMonitorCreateObjectPropsWrap(backendType, = alias, &props))) - ret =3D -1; + return -1; =20 - return ret; + return rc; } =20 =20 --=20 2.19.2 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Sat May 4 15:52:28 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 ARC-Seal: i=1; a=rsa-sha256; t=1566852331; cv=none; d=zoho.com; s=zohoarc; b=Ed4bCOEmxBs2uvGbrnoLFaehYBvlQYqXsZlSj9XIi/NWA7gZalZUY/3eKxIbLnSHtgnbLFpxMOOebs4mNrJqO/KFaecG/QbA837oTv64o5xGyFMfVCjB5M5XQ3AzGvZaSkE6AeWv/LLE54Jz1N+AnIriq8Lqs5/z29udY6idDn8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1566852331; h=Content-Type:Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To:ARC-Authentication-Results; bh=IeefUUwYkSLSknznjpA7WngnAzRNta8UunSxETIM0yw=; b=MVO1/gn7Nal166ZF0TajBK3e9yMcEVULPMbPGaZGEoRnMKnKgeiwb87fph25wVPKzzL+sRcOGBGZoro189bFhpWA61Q1H/aRVYMONR6/kHfooc2am6FaIxpZ2Y3v5PmqLkbCC+J39i+igw7wd6zMyHfRUioo5KN0t0nzK6cHHIA= ARC-Authentication-Results: i=1; mx.zoho.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 header.from= (p=none dis=none) header.from= Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1566852331194783.7865293681648; Mon, 26 Aug 2019 13:45:31 -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 2882E109EFD1; Mon, 26 Aug 2019 20:45:30 +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 004945C207; Mon, 26 Aug 2019 20:45:29 +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 B8F2A180BA9D; Mon, 26 Aug 2019 20:45:29 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id x7QKjTTE020251 for ; Mon, 26 Aug 2019 16:45:29 -0400 Received: by smtp.corp.redhat.com (Postfix) id 4781C60F88; Mon, 26 Aug 2019 20:45:29 +0000 (UTC) Received: from icr.brq.redhat.com (unknown [10.43.2.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id C519660F86 for ; Mon, 26 Aug 2019 20:45:26 +0000 (UTC) From: =?UTF-8?q?J=C3=A1n=20Tomko?= To: libvir-list@redhat.com Date: Mon, 26 Aug 2019 22:44:56 +0200 Message-Id: In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 7/7] qemuBuildMemoryCellBackendStr: remove useless ret 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.16 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.6.2 (mx1.redhat.com [10.5.110.65]); Mon, 26 Aug 2019 20:45:30 +0000 (UTC) Signed-off-by: J=C3=A1n Tomko Reviewed-by: Cole Robinson --- src/qemu/qemu_command.c | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c index 528e11d5a0..18b3914ca9 100644 --- a/src/qemu/qemu_command.c +++ b/src/qemu/qemu_command.c @@ -3588,14 +3588,13 @@ qemuBuildMemoryCellBackendStr(virDomainDefPtr def, { VIR_AUTOPTR(virJSONValue) props =3D NULL; VIR_AUTOFREE(char *) alias =3D NULL; - int ret =3D -1; int rc; virDomainMemoryDef mem =3D { 0 }; unsigned long long memsize =3D virDomainNumaGetNodeMemorySize(def->num= a, cell); =20 if (virAsprintf(&alias, "ram-node%zu", cell) < 0) - goto cleanup; + return -1; =20 mem.size =3D memsize; mem.targetNode =3D cell; @@ -3603,16 +3602,12 @@ qemuBuildMemoryCellBackendStr(virDomainDefPtr def, =20 if ((rc =3D qemuBuildMemoryBackendProps(&props, alias, cfg, priv, def, &mem, false)) < 0) - goto cleanup; + return -1; =20 if (virQEMUBuildObjectCommandlineFromJSON(buf, props) < 0) - goto cleanup; - - ret =3D rc; - - cleanup: + return -1; =20 - return ret; + return rc; } =20 =20 --=20 2.19.2 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list