From nobody Sun Feb 8 07:58:04 2026 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=1562684637; cv=none; d=zoho.com; s=zohoarc; b=gShwHdH+uWTWbZ2aMoGnC3QWoXAFyftBK68Ash1MkcPk+EqNKhP3zW6PjYY3CFFswbdpnRM4H+qdD/kaB+Je400F8rynZ+Ydjzk53H9OB2jQUb7jyz+aZJkEFR03YT5RBA2fY2M/upGLFmc3qgf2oC14EojfzkeMGMdbUOhET9M= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1562684637; 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=Ae1w/JYdyYCWlUSRgbtJsJkiTjL2Cr2QPsZchvjAcE8=; b=bUKNQLXed6zeQOr/gXYSkkaTayNyFVMG/K5ffE9ghH8lTPsUsosWQ9t91qLE4BNrx/U4GsQrV0MgH1R4Xk+ljyp8CrAcKBdtqUJl3HNKJQUlsnEeKMoqB71pOXLP5aPEZy/HEGYWm2/+P4TShSrRJj+rrfWWGk/NgkGFD/hVdfY= 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 1562684637242741.1042076074773; Tue, 9 Jul 2019 08:03:57 -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 680C2309265A; Tue, 9 Jul 2019 15:03:48 +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 4082B1001B29; Tue, 9 Jul 2019 15:03:44 +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 C10061833006; Tue, 9 Jul 2019 15:03:39 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id x69F2F2i028509 for ; Tue, 9 Jul 2019 11:02:15 -0400 Received: by smtp.corp.redhat.com (Postfix) id 85A075D70D; Tue, 9 Jul 2019 15:02:15 +0000 (UTC) Received: from moe.brq.redhat.com (unknown [10.43.2.30]) by smtp.corp.redhat.com (Postfix) with ESMTP id 10EA687034 for ; Tue, 9 Jul 2019 15:02:14 +0000 (UTC) From: Michal Privoznik To: libvir-list@redhat.com Date: Tue, 9 Jul 2019 17:01:57 +0200 Message-Id: <5121c9967f862a739749570acaa0fb7bfb498902.1562684480.git.mprivozn@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 2/3] virnetworkobj: Drop needless cleanup label in virNetworkObjAddPort 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-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.43]); Tue, 09 Jul 2019 15:03:55 +0000 (UTC) Content-Type: text/plain; charset="utf-8" The cleanup label in virNetworkObjAddPort() function serves no purpose. Drop it and thus simplify the function a bit. Signed-off-by: Michal Privoznik --- src/conf/virnetworkobj.c | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/src/conf/virnetworkobj.c b/src/conf/virnetworkobj.c index 45726e4016..37580b4e76 100644 --- a/src/conf/virnetworkobj.c +++ b/src/conf/virnetworkobj.c @@ -1625,7 +1625,6 @@ virNetworkObjAddPort(virNetworkObjPtr net, virNetworkPortDefPtr portdef, const char *stateDir) { - int ret =3D -1; char uuidstr[VIR_UUID_STRING_BUFLEN]; VIR_AUTOFREE(char *) dir =3D NULL; =20 @@ -1635,24 +1634,21 @@ virNetworkObjAddPort(virNetworkObjPtr net, virReportError(VIR_ERR_NETWORK_PORT_EXIST, _("Network port with UUID %s already exists"), uuidstr); - goto cleanup; + return -1; } =20 if (!(dir =3D virNetworkObjGetPortStatusDir(net, stateDir))) - goto cleanup; + return -1; =20 if (virHashAddEntry(net->ports, uuidstr, portdef) < 0) - goto cleanup; + return -1; =20 if (virNetworkPortDefSaveStatus(portdef, dir) < 0) { virHashRemoveEntry(net->ports, uuidstr); - goto cleanup; + return -1; } =20 - ret =3D 0; - - cleanup: - return ret; + return 0; } =20 =20 --=20 2.21.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list