From nobody Mon Feb 9 22:03:46 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) client-ip=170.10.133.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.133.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=1636373898; cv=none; d=zohomail.com; s=zohoarc; b=Xh+HWqbSK5mK4zrwoAwT6643xx6sCw9ZwWZHXlF/D5AiaUb/p7bPn4upRG9W1XhIx72iacDP02SX50PO5+tkJZZ23Hm2ZgPpJx/OApUejvoLmomo49oCBBSaFfxAMvRezlMz8XVOaUn5j5jO007kGIoWGRH+l4Za9MvN3Vh8d3M= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1636373898; h=Content-Type:Content-Transfer-Encoding:Cc: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=ElQwrLYg1TV/4A5DpvAcBC/PfoUmQ0km+bBvQ+EfHJM=; b=FXgG5oabCgJ3PuxMur7tJrEnLGqiCjBO3Wecsz+HJtFgSnzqlPt3hPXy91ZOpwY/d/kpDHS4dYIiorTgmybhAQKDGlfn3KPCm2MCQuDiPxlZxHE3us5aV+vDgVCFrMszVLyz7VeMhzGY1rRpWjlimOjMEX8VKmIxUbHrURMcvW4= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.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.133.124]) by mx.zohomail.com with SMTPS id 1636373898867179.84594602625452; Mon, 8 Nov 2021 04:18:18 -0800 (PST) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-490-c6DfcfNAOh2-JNB18fcfkg-1; Mon, 08 Nov 2021 07:18:14 -0500 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 mimecast-mx01.redhat.com (Postfix) with ESMTPS id 46A958799EF; Mon, 8 Nov 2021 12:18:07 +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 D6C46101E59B; Mon, 8 Nov 2021 12:18:06 +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 9CB004EA29; Mon, 8 Nov 2021 12:18:06 +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 1A8CHuex011457 for ; Mon, 8 Nov 2021 07:17:56 -0500 Received: by smtp.corp.redhat.com (Postfix) id 818395E274; Mon, 8 Nov 2021 12:17:56 +0000 (UTC) Received: from work.redhat.com (unknown [10.39.193.223]) by smtp.corp.redhat.com (Postfix) with ESMTP id CB2F929676; Mon, 8 Nov 2021 12:17:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1636373897; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc: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=ElQwrLYg1TV/4A5DpvAcBC/PfoUmQ0km+bBvQ+EfHJM=; b=ZOSTn2H+ODYqvkAPOosWh+GQbwSENhqIqkNNjMkdD21iDK5qfEWf9TQW3yvyHxu6xJMTsb dGLOUZQyyX9peycinLaBMDkcpaxRdAV18x6BYHpZRhfXg1PQXOd+lzCODU6m/Szw3y1L9I knpsqhyYcOlwdX0yEi+2MaZCqfOy+fE= X-MC-Unique: c6DfcfNAOh2-JNB18fcfkg-1 From: Tim Wiederhake To: libvir-list@redhat.com Subject: [libvirt PATCH 04/10] virNetworkEventDispatchDefaultFunc: Cleanup Date: Mon, 8 Nov 2021 13:17:34 +0100 Message-Id: <20211108121740.98621-5-twiederh@redhat.com> In-Reply-To: <20211108121740.98621-1-twiederh@redhat.com> References: <20211108121740.98621-1-twiederh@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-loop: libvir-list@redhat.com Cc: Tim Wiederhake 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: , Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=libvir-list-bounces@redhat.com 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: 1636373900272100001 Content-Type: text/plain; charset="utf-8" Remove unnecessary label and goto. Signed-off-by: Tim Wiederhake --- src/conf/network_event.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/src/conf/network_event.c b/src/conf/network_event.c index a47bf4dd3e..6335cbf711 100644 --- a/src/conf/network_event.c +++ b/src/conf/network_event.c @@ -86,8 +86,8 @@ virNetworkEventDispatchDefaultFunc(virConnectPtr conn, virConnectObjectEventGenericCallback cb, void *cbopaque) { - virNetworkPtr net =3D virGetNetwork(conn, event->meta.name, event->met= a.uuid); - if (!net) + g_autoptr(virNetwork) net =3D NULL; + if (!(net =3D virGetNetwork(conn, event->meta.name, event->meta.uuid))) return; =20 switch ((virNetworkEventID)event->eventID) { @@ -100,16 +100,13 @@ virNetworkEventDispatchDefaultFunc(virConnectPtr conn, networkLifecycle= Event->type, networkLifecycle= Event->detail, cbopaque); - goto cleanup; + return; } =20 case VIR_NETWORK_EVENT_ID_LAST: break; } VIR_WARN("Unexpected event ID %d", event->eventID); - - cleanup: - virObjectUnref(net); } =20 =20 --=20 2.31.1