From nobody Mon Feb 9 18:19:43 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) client-ip=170.10.129.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.129.124 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=1661175134; cv=none; d=zohomail.com; s=zohoarc; b=eyr/Hxs03aoVr6TRHAhBM+lbgmRE83z8zD3iA1f97n3AX9sPZyku72fJCr7Iqnh+QMEG0LO03nltp65x5P+RMHfPpB27uZTNKhLobTPRUX9utLI7fHO6ERg3IcqpfHnBX4DS8xsUTKAkE/BYoxf2CYm30DRW3FZf2E8XDg36Ikc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1661175134; 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; bh=hBn/Fv18LganVXDuNGFTDrJCOAZ659CbHrtXNBr4bJ4=; b=MXG4+PON4Xga64KD3j+r8HAJe/Aa/AVfzxCmiVygYA3pDVhIk5zQr+o34EP/9qBVbXnxnxVechloamnMUlcy6VZq1hkttGxk5Lz+ZcuozvZzKCrfzriJTDo80QUWdCEUZVMO6yY/n/QYHgf8d/j8A8zFcsD4ueo5qFdQEk0+P3U= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by mx.zohomail.com with SMTPS id 1661175134254843.2806773853499; Mon, 22 Aug 2022 06:32:14 -0700 (PDT) Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-557-DVTXct58NUqwKOKiJc7Y1w-1; Mon, 22 Aug 2022 09:32:06 -0400 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.rdu2.redhat.com [10.11.54.1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 4BDBB1C01B25; Mon, 22 Aug 2022 13:31:58 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (unknown [10.30.29.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id 3899640D0168; Mon, 22 Aug 2022 13:31:58 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (localhost [IPv6:::1]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 0B5A91946A48; Mon, 22 Aug 2022 13:31:58 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.rdu2.redhat.com [10.11.54.1]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 3625C1946A54 for ; Mon, 22 Aug 2022 13:31:52 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id 228DF40CFD0B; Mon, 22 Aug 2022 13:31:52 +0000 (UTC) Received: from vhost3.router.laine.org (unknown [10.2.16.254]) by smtp.corp.redhat.com (Postfix) with ESMTP id 0E6C940CFD0A for ; Mon, 22 Aug 2022 13:31:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1661175132; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=hBn/Fv18LganVXDuNGFTDrJCOAZ659CbHrtXNBr4bJ4=; b=H0pxGepRhebhu/MIcaIrRIZ/pzN8iBcS8LKvX558qJtUng440ixwLMWY0z5BRn3pKhuLFJ klTXtKuJVduf5aFPk0HKqvHtOk2YbwstIDws9cbTlEVOTGOMUKcf8wHnYExb5+Ms41QbGl 7p9jlxa1Xr6UoIqu1wFrZQcqpBwnJ4c= X-MC-Unique: DVTXct58NUqwKOKiJc7Y1w-1 X-Original-To: libvir-list@listman.corp.redhat.com From: Laine Stump To: libvir-list@redhat.com Subject: [libvirt PATCH 09/16] qemu: remove superfluous cleanup: labels and ret return variables Date: Mon, 22 Aug 2022 09:31:43 -0400 Message-Id: <20220822133150.1098794-10-laine@redhat.com> In-Reply-To: <20220822133150.1098794-1-laine@redhat.com> References: <20220822133150.1098794-1-laine@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.11.54.1 X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libvir-list-bounces@redhat.com Sender: "libvir-list" X-Scanned-By: MIMEDefang 2.84 on 10.11.54.1 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1661175135275100001 Content-Type: text/plain; charset="utf-8"; x-default="true" After converting virNetworkDef * to g_autoptr(virNetworkDef) the cleanup codepath was empty, so it has been removed. Signed-off-by: Laine Stump --- src/qemu/qemu_process.c | 21 +++++++++------------ 1 file changed, 9 insertions(+), 12 deletions(-) diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c index 002eab43be..68c2f45535 100644 --- a/src/qemu/qemu_process.c +++ b/src/qemu/qemu_process.c @@ -4826,7 +4826,6 @@ qemuProcessGetNetworkAddress(const char *netname, char **netaddr) { g_autoptr(virConnect) conn =3D NULL; - int ret =3D -1; g_autoptr(virNetwork) net =3D NULL; g_autoptr(virNetworkDef) netdef =3D NULL; virNetworkIPDef *ipdef; @@ -4842,15 +4841,15 @@ qemuProcessGetNetworkAddress(const char *netname, =20 net =3D virNetworkLookupByName(conn, netname); if (!net) - goto cleanup; + return -1; =20 xml =3D virNetworkGetXMLDesc(net, 0); if (!xml) - goto cleanup; + return -1; =20 netdef =3D virNetworkDefParseString(xml, NULL, false); if (!netdef) - goto cleanup; + return -1; =20 switch ((virNetworkForwardType) netdef->forward.type) { case VIR_NETWORK_FORWARD_NONE: @@ -4862,7 +4861,7 @@ qemuProcessGetNetworkAddress(const char *netname, virReportError(VIR_ERR_INTERNAL_ERROR, _("network '%s' doesn't have an IP address"), netdef->name); - goto cleanup; + return -1; } addrptr =3D &ipdef->address; break; @@ -4886,7 +4885,7 @@ qemuProcessGetNetworkAddress(const char *netname, virReportError(VIR_ERR_INTERNAL_ERROR, _("network '%s' has no associated interface or = bridge"), netdef->name); - goto cleanup; + return -1; } break; =20 @@ -4896,23 +4895,21 @@ qemuProcessGetNetworkAddress(const char *netname, case VIR_NETWORK_FORWARD_LAST: default: virReportEnumRangeError(virNetworkForwardType, netdef->forward.typ= e); - goto cleanup; + return -1; } =20 if (dev_name) { if (virNetDevIPAddrGet(dev_name, &addr) < 0) - goto cleanup; + return -1; addrptr =3D &addr; } =20 if (!(addrptr && (*netaddr =3D virSocketAddrFormat(addrptr)))) { - goto cleanup; + return -1; } =20 - ret =3D 0; - cleanup: - return ret; + return 0; } =20 =20 --=20 2.37.1