From nobody Sat May 4 02:21:49 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=1558355920; cv=none; d=zoho.com; s=zohoarc; b=Fohv39YZEmsRacx6MI07UAP1pJrBYVu90pe23/orCCqvsmnHZSv+wvT1U8I0YaJ/GRmDBd43WiAJDpstv0QpSATwtkI+GjOJwQVQFkcPwTpOc2pp3DfHIPKTaYEAt8aaToTXDsmIn5WwrYMzbCKGj5UrwUgSAIgjTCobCD+3ILc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1558355920; 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=YHNhVYNUcMlP+iNXVALanief+TPiRaRLTpXGHx4zYpo=; b=kApMHkhlL/02vn6C0s4wsUlGYp6D1cDL0XAHek4XiG9u62wcgmU6J2wTjynYMGtx97bFbfazYn2usan7jg59MZeSgN5StXM01RFpWPoXhv05d7DuMtZK5tzAGzz1q1wZtE7b1s91zppQue6OZOQQGtUQJ9olTFnlomQOawofJWc= 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 1558355920350258.7568934147183; Mon, 20 May 2019 05:38:40 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 6D306308222E; Mon, 20 May 2019 12:38: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 45F7C60FB8; Mon, 20 May 2019 12:38:18 +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 F196B1843661; Mon, 20 May 2019 12:38:09 +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 x4KCc8sd031900 for ; Mon, 20 May 2019 08:38:08 -0400 Received: by smtp.corp.redhat.com (Postfix) id A92245D704; Mon, 20 May 2019 12:38:08 +0000 (UTC) Received: from moe.brq.redhat.com (unknown [10.43.2.30]) by smtp.corp.redhat.com (Postfix) with ESMTP id 32F5F2FC58 for ; Mon, 20 May 2019 12:38:08 +0000 (UTC) From: Michal Privoznik To: libvir-list@redhat.com Date: Mon, 20 May 2019 14:37:57 +0200 Message-Id: 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 1/6] networkStartNetworkVirtual: s/err5/error 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.79 on 10.5.11.12 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.47]); Mon, 20 May 2019 12:38:29 +0000 (UTC) Content-Type: text/plain; charset="utf-8" In attempt to getting rid of errN labels let's start with the most upper one and rename it to 'error'. Signed-off-by: Michal Privoznik --- src/network/bridge_driver.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/network/bridge_driver.c b/src/network/bridge_driver.c index 26f7f80418..ef82a3e310 100644 --- a/src/network/bridge_driver.c +++ b/src/network/bridge_driver.c @@ -2485,14 +2485,14 @@ networkStartNetworkVirtual(virNetworkDriverStatePtr= driver, } =20 if (virNetDevBandwidthSet(def->bridge, def->bandwidth, true, true) < 0) - goto err5; + goto error; =20 VIR_FREE(macTapIfName); VIR_FREE(macMapFile); =20 return 0; =20 - err5: + error: virErrorPreserveLast(&save_err); if (def->bandwidth) virNetDevBandwidthClear(def->bridge); --=20 2.21.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Sat May 4 02:21:49 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=1558355923; cv=none; d=zoho.com; s=zohoarc; b=kdIZVXDopj8uFYpamqWia9dVpsHy+TsPk110r/kuAWQtASzjRQIt9SbAviC42mV5xhHb2zD8z7gamMCulfIO5wT8OCwCNxu1EVYTDSefqHbvtfkAj+DDTV/GCKmwCuSr5tOMSkOZzzDUN6vVbD5ol/JIuFFO46HiEv/LOD49J7E= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1558355923; 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=2rtduFHuXvivbUCWQ7JcxJsaWC8YaJVLJ+pwAmwzBK8=; b=NKmb8F2CBV45mepWd/IGWZaDy/sGKtcYHKloPw/5z51796Npgj7m3AjB3zmjxK8lNrK0u5qyJL9IUQBvlZLLH+TDBycoMrg2HaJnC6WKc2lOrOBnjGD5jmwIVfCKtkkTPbm7Fw/au4Mll5wKnS5BY4CjvSy/x5izhE75jjUwygc= 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 1558355923233823.8061443355704; Mon, 20 May 2019 05:38:43 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 2BB47308FEC6; Mon, 20 May 2019 12:38:21 +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 5DEB160CD1; Mon, 20 May 2019 12:38:16 +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 D59685B424; Mon, 20 May 2019 12:38:11 +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 x4KCcAqr031915 for ; Mon, 20 May 2019 08:38:10 -0400 Received: by smtp.corp.redhat.com (Postfix) id 46BAE2FC58; Mon, 20 May 2019 12:38:10 +0000 (UTC) Received: from moe.brq.redhat.com (unknown [10.43.2.30]) by smtp.corp.redhat.com (Postfix) with ESMTP id C4F7F5D704 for ; Mon, 20 May 2019 12:38:09 +0000 (UTC) From: Michal Privoznik To: libvir-list@redhat.com Date: Mon, 20 May 2019 14:37:59 +0200 Message-Id: <62b57112432c2d99af7ae73e75b4131505096f11.1558355839.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/6] networkStartNetworkVirtual: Dissolve 'err4' label in 'error' 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.79 on 10.5.11.12 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.49]); Mon, 20 May 2019 12:38:36 +0000 (UTC) Content-Type: text/plain; charset="utf-8" Signed-off-by: Michal Privoznik --- src/network/bridge_driver.c | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/src/network/bridge_driver.c b/src/network/bridge_driver.c index ef82a3e310..88e49969b5 100644 --- a/src/network/bridge_driver.c +++ b/src/network/bridge_driver.c @@ -2335,7 +2335,7 @@ networkStartNetworkVirtual(virNetworkDriverStatePtr d= river, virMacMapPtr macmap; char *macMapFile =3D NULL; int tapfd =3D -1; - pid_t dnsmasqPid; + bool dnsmasqStarted =3D false; =20 /* Check to see if any network IP collides with an existing route */ if (networkCheckRouteCollision(def) < 0) @@ -2465,22 +2465,24 @@ networkStartNetworkVirtual(virNetworkDriverStatePtr= driver, networkStartDhcpDaemon(driver, obj) < 0) goto err3; =20 + dnsmasqStarted =3D true; + /* start radvd if there are any ipv6 addresses */ if (v6present && networkStartRadvd(driver, obj) < 0) - goto err4; + goto error; =20 /* dnsmasq does not wait for DAD to complete before daemonizing, * so we need to wait for it ourselves. */ if (v6present && networkWaitDadFinish(obj) < 0) - goto err4; + goto error; =20 /* DAD has finished, dnsmasq is now bound to the * bridge's IPv6 address, so we can set the dummy tun down. */ if (tapfd >=3D 0) { if (virNetDevSetOnline(macTapIfName, false) < 0) - goto err4; + goto error; VIR_FORCE_CLOSE(tapfd); } =20 @@ -2497,12 +2499,8 @@ networkStartNetworkVirtual(virNetworkDriverStatePtr = driver, if (def->bandwidth) virNetDevBandwidthClear(def->bridge); =20 - err4: - if (!save_err) - virErrorPreserveLast(&save_err); - - dnsmasqPid =3D virNetworkObjGetDnsmasqPid(obj); - if (dnsmasqPid > 0) { + if (dnsmasqStarted) { + pid_t dnsmasqPid =3D virNetworkObjGetDnsmasqPid(obj); kill(dnsmasqPid, SIGTERM); virNetworkObjSetDnsmasqPid(obj, -1); } --=20 2.21.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Sat May 4 02:21:49 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=1558355940; cv=none; d=zoho.com; s=zohoarc; b=SLjpmMAOc2UULRSYvBdZXMlk2nJU++b5W4uk1zWYp+zXvn9mY7wGQyKorCX9MQ6O4tCepPTISeBR9ztskNij5J8zI00bkT7G0lkpBWGYYqHJ+5s8edRDRHmJJsY1JnwkHejqT9g4NAbJxBe716E2JW6s0hviX21V0axF7nqBtfk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1558355940; 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=BO5SZLg5XFxYszD02vMbiKi+CbmtnRZE+NrMFyX/2Js=; b=C2K/7dh+3c4dOjBkx8GdOvXId5gpaK7/ZHhvqH5wUqo6K8YJbiQ4eD6JVv/sV0dGqhmqmdbQXnAUH+oJ8LL3PNDjnxyTDuwH8pL8sQSG0PoeXVvtSxoiQKXOYEsBdS8JwNdPxFanKFrBpirRQIVPOZhNg0utKjiZnKtuHTRGmOI= 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 1558355940581871.8382059256431; Mon, 20 May 2019 05:39:00 -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 2057C30832E1; Mon, 20 May 2019 12:38:54 +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 EB2B779800; Mon, 20 May 2019 12:38:52 +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 9BBB75B427; Mon, 20 May 2019 12:38:49 +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 x4KCcBGK031930 for ; Mon, 20 May 2019 08:38:11 -0400 Received: by smtp.corp.redhat.com (Postfix) id 151625D704; Mon, 20 May 2019 12:38:11 +0000 (UTC) Received: from moe.brq.redhat.com (unknown [10.43.2.30]) by smtp.corp.redhat.com (Postfix) with ESMTP id 931232FC58 for ; Mon, 20 May 2019 12:38:10 +0000 (UTC) From: Michal Privoznik To: libvir-list@redhat.com Date: Mon, 20 May 2019 14:38:00 +0200 Message-Id: <23882361009ee59b601423131aa0dd54e1ac7fb9.1558355839.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 3/6] networkStartNetworkVirtual: Dissolve 'err3' label in 'error' 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.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.44]); Mon, 20 May 2019 12:38:59 +0000 (UTC) Content-Type: text/plain; charset="utf-8" Signed-off-by: Michal Privoznik --- src/network/bridge_driver.c | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/src/network/bridge_driver.c b/src/network/bridge_driver.c index 88e49969b5..cd59039bdb 100644 --- a/src/network/bridge_driver.c +++ b/src/network/bridge_driver.c @@ -2336,6 +2336,7 @@ networkStartNetworkVirtual(virNetworkDriverStatePtr d= river, char *macMapFile =3D NULL; int tapfd =3D -1; bool dnsmasqStarted =3D false; + bool devOnline =3D false; =20 /* Check to see if any network IP collides with an existing route */ if (networkCheckRouteCollision(def) < 0) @@ -2430,6 +2431,8 @@ networkStartNetworkVirtual(virNetworkDriverStatePtr d= river, if (virNetDevSetOnline(def->bridge, 1) < 0) goto err2; =20 + devOnline =3D true; + for (i =3D 0; i < def->nroutes; i++) { virSocketAddrPtr gateway =3D NULL; =20 @@ -2450,12 +2453,12 @@ networkStartNetworkVirtual(virNetworkDriverStatePtr= driver, /* If forward.type !=3D NONE, turn on global IP forwarding */ if (def->forward.type !=3D VIR_NETWORK_FORWARD_NONE) { if (v6present && !virNetDevIPCheckIPv6Forwarding()) - goto err3; /* Precise error message already provided */ + goto error; /* Precise error message already provided */ =20 if (networkEnableIPForwarding(v4present, v6present) < 0) { virReportSystemError(errno, "%s", _("failed to enable IP forwarding")); - goto err3; + goto error; } } =20 @@ -2463,7 +2466,7 @@ networkStartNetworkVirtual(virNetworkDriverStatePtr d= river, /* start dnsmasq if there are any IP addresses (v4 or v6) */ if ((v4present || v6present) && networkStartDhcpDaemon(driver, obj) < 0) - goto err3; + goto error; =20 dnsmasqStarted =3D true; =20 @@ -2505,10 +2508,8 @@ networkStartNetworkVirtual(virNetworkDriverStatePtr = driver, virNetworkObjSetDnsmasqPid(obj, -1); } =20 - err3: - if (!save_err) - virErrorPreserveLast(&save_err); - ignore_value(virNetDevSetOnline(def->bridge, 0)); + if (devOnline) + ignore_value(virNetDevSetOnline(def->bridge, 0)); =20 err2: if (!save_err) --=20 2.21.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Sat May 4 02:21:49 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=1558355944; cv=none; d=zoho.com; s=zohoarc; b=CMRr79snIkucWwuXvtSe+ohr08l1X1n6J5LYcK9p8L60uznS3Qo+SyI0ym+wQcMUXeWbCkIXR12l5NCd+JJL060uHbB4r6gOEBP3hy+QuZLwHsDqOHDS9p+PqEj//K1PrgCh1TLdBZvdeFoQrn58uwHcYWhUt3Xmr120KilveeY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1558355944; 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=o/ouH1CZbcOuSLflsROgbPkuuQm8KJ6Yj7uqC4YqMfc=; b=RWXWm6a51DYcZd5h2H2VkMjIGZg44pegnBM6RUKlDFCmzM0X+VS6vFCDn8tj4DOzA7TNK1SiewdiK6OLm8Yo6rYWa9RH/3ad8DyGAtRfQDR+w1iWA0pt+2TXrYora2s/VPdKA6lMNSty4G7lZbo7V9cEzgSnbzMWLNR4Uvrh7Pw= 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 1558355944904427.4005066044724; Mon, 20 May 2019 05:39:04 -0700 (PDT) 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 2970A356E7; Mon, 20 May 2019 12:39:03 +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 677875DE8A; Mon, 20 May 2019 12:39:02 +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 2446D5B429; Mon, 20 May 2019 12:39:01 +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 x4KCcBdY031935 for ; Mon, 20 May 2019 08:38:11 -0400 Received: by smtp.corp.redhat.com (Postfix) id D9AFA5D6A6; Mon, 20 May 2019 12:38:11 +0000 (UTC) Received: from moe.brq.redhat.com (unknown [10.43.2.30]) by smtp.corp.redhat.com (Postfix) with ESMTP id 619B95D704 for ; Mon, 20 May 2019 12:38:11 +0000 (UTC) From: Michal Privoznik To: libvir-list@redhat.com Date: Mon, 20 May 2019 14:38:01 +0200 Message-Id: <5d2c80b4b7b96229390b0be26596961d9018cfc8.1558355839.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 4/6] networkStartNetworkVirtual: Dissolve 'err2' label in 'error' 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.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.30]); Mon, 20 May 2019 12:39:03 +0000 (UTC) Content-Type: text/plain; charset="utf-8" Signed-off-by: Michal Privoznik --- src/network/bridge_driver.c | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/src/network/bridge_driver.c b/src/network/bridge_driver.c index cd59039bdb..4c920d1fdd 100644 --- a/src/network/bridge_driver.c +++ b/src/network/bridge_driver.c @@ -2337,6 +2337,7 @@ networkStartNetworkVirtual(virNetworkDriverStatePtr d= river, int tapfd =3D -1; bool dnsmasqStarted =3D false; bool devOnline =3D false; + bool firewalRulesAdded =3D false; =20 /* Check to see if any network IP collides with an existing route */ if (networkCheckRouteCollision(def) < 0) @@ -2413,6 +2414,8 @@ networkStartNetworkVirtual(virNetworkDriverStatePtr d= river, networkAddFirewallRules(def) < 0) goto err1; =20 + firewalRulesAdded =3D true; + for (i =3D 0; (ipdef =3D virNetworkDefGetIPByIndex(def, AF_UNSPEC, i))= ; i++) { if (VIR_SOCKET_ADDR_IS_FAMILY(&ipdef->address, AF_INET)) v4present =3D true; @@ -2421,15 +2424,15 @@ networkStartNetworkVirtual(virNetworkDriverStatePtr= driver, =20 /* Add the IP address/netmask to the bridge */ if (networkAddAddrToBridge(obj, ipdef) < 0) - goto err2; + goto error; } =20 if (networkStartHandleMACTableManagerMode(obj, macTapIfName) < 0) - goto err2; + goto error; =20 /* Bring up the bridge interface */ if (virNetDevSetOnline(def->bridge, 1) < 0) - goto err2; + goto error; =20 devOnline =3D true; =20 @@ -2511,10 +2514,8 @@ networkStartNetworkVirtual(virNetworkDriverStatePtr = driver, if (devOnline) ignore_value(virNetDevSetOnline(def->bridge, 0)); =20 - err2: - if (!save_err) - virErrorPreserveLast(&save_err); - if (def->forward.type !=3D VIR_NETWORK_FORWARD_OPEN) + if (firewalRulesAdded && + def->forward.type !=3D VIR_NETWORK_FORWARD_OPEN) networkRemoveFirewallRules(def); =20 err1: --=20 2.21.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Sat May 4 02:21:49 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=1558355944; cv=none; d=zoho.com; s=zohoarc; b=lKxgJJ2XPva8U9sB/7/p2upvhjRPdgY60fki8wRxw4Hk/m4fJvckWp4nJ6QPhTLRmear/PtcTORZ8TJ25gIXjl5WUa4OtTL2+IiHunjAloXt4L5d4UQZ2H22Pgq8WjihgICRGPdas9Kd8Er1fV4qNXTTeTEKUQ3qM4FHnxNLI7I= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1558355944; 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=oDYUHaLWcfwVj4MW5JuajhgOHj0Su9N3/iTT4ui6nDA=; b=kssyIZtdNUJR4S7j6PYXKdLQ2Z6joBWM9zMR1lUiKzXFqqlFRKGXq+DuHpab03ioXa+nkxBA+I9VaL6zqTBbKT3quM+JohjguoJvuZElyijZM9iHPYfeFWUzeKga7qCldlIbboaNCp/ASEQXZyq1lb2hhRQHopOWvDRsUtUxdb0= 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 1558355944084179.87560324272897; Mon, 20 May 2019 05:39:04 -0700 (PDT) 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 248A83689B; Mon, 20 May 2019 12:39:01 +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 EEDE75DE88; Mon, 20 May 2019 12:39:00 +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 42B031843662; Mon, 20 May 2019 12:39:00 +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 x4KCcCHl031948 for ; Mon, 20 May 2019 08:38:12 -0400 Received: by smtp.corp.redhat.com (Postfix) id A567C5D704; Mon, 20 May 2019 12:38:12 +0000 (UTC) Received: from moe.brq.redhat.com (unknown [10.43.2.30]) by smtp.corp.redhat.com (Postfix) with ESMTP id 2FEC05D6A6 for ; Mon, 20 May 2019 12:38:12 +0000 (UTC) From: Michal Privoznik To: libvir-list@redhat.com Date: Mon, 20 May 2019 14:38:02 +0200 Message-Id: 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 5/6] networkStartNetworkVirtual: Dissolve 'err1' label in 'error' 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.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.30]); Mon, 20 May 2019 12:39:03 +0000 (UTC) Content-Type: text/plain; charset="utf-8" Signed-off-by: Michal Privoznik --- src/network/bridge_driver.c | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/src/network/bridge_driver.c b/src/network/bridge_driver.c index 4c920d1fdd..59c9780a7e 100644 --- a/src/network/bridge_driver.c +++ b/src/network/bridge_driver.c @@ -2387,7 +2387,7 @@ networkStartNetworkVirtual(virNetworkDriverStatePtr d= river, if (!(macMapFile =3D virMacMapFileName(driver->dnsmasqStateDir, def->bridge)) || !(macmap =3D virMacMapNew(macMapFile))) - goto err1; + goto error; =20 virNetworkObjSetMacMap(obj, macmap); macmap =3D NULL; @@ -2398,21 +2398,21 @@ networkStartNetworkVirtual(virNetworkDriverStatePtr= driver, * expects milliseconds */ if (virNetDevBridgeSetSTPDelay(def->bridge, def->delay * 1000) < 0) - goto err1; + goto error; =20 if (virNetDevBridgeSetSTP(def->bridge, def->stp ? true : false) < 0) - goto err1; + goto error; =20 /* Disable IPv6 on the bridge if there are no IPv6 addresses * defined, and set other IPv6 sysctl tunables appropriately. */ if (networkSetIPv6Sysctls(obj) < 0) - goto err1; + goto error; =20 /* Add "once per network" rules */ if (def->forward.type !=3D VIR_NETWORK_FORWARD_OPEN && networkAddFirewallRules(def) < 0) - goto err1; + goto error; =20 firewalRulesAdded =3D true; =20 @@ -2518,10 +2518,6 @@ networkStartNetworkVirtual(virNetworkDriverStatePtr = driver, def->forward.type !=3D VIR_NETWORK_FORWARD_OPEN) networkRemoveFirewallRules(def); =20 - err1: - if (!save_err) - virErrorPreserveLast(&save_err); - if (macTapIfName) { VIR_FORCE_CLOSE(tapfd); ignore_value(virNetDevTapDelete(macTapIfName, NULL)); --=20 2.21.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Sat May 4 02:21:49 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=1558355949; cv=none; d=zoho.com; s=zohoarc; b=CiHgeBdLeeFN7mb2dOGHE8+zaeo0IcilG8LXdYQDPa5r5SOor0vXjRg6/v5N6bA83KBdeoTiLJa2QOLYt80kU2qwL9koi92m7FL4DbHmgCN61Vk2kXO89SzJ+oAJO7X7x/sxTM46PPyOj5gDDZbgNx1l67VeDpSsj2v+CNPy9hM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1558355949; 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=CDbjX42oarC1Mjehm8AONR/RgmaS0EKyAPEf7osl15E=; b=ZBU6vI/5WNCXh8/P6lc9T4mA19+rZ0C8YAFYFvLN9dl4O/ffaT/Ybx3JlPik1/ESlQ+hPbMNd595LWZlXyC8pKjhv1FDgIQK9eoyUW1cv8gQbTxcr0dLfKak8iVKdEe5Aube728T2XOw2MsBlmtb8WzftKzV14/psur2N7MPWJc= 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 1558355949929188.96672280682333; Mon, 20 May 2019 05:39:09 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 8253E756; Mon, 20 May 2019 12:39:08 +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 5C1B760F9C; Mon, 20 May 2019 12:39:08 +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 238EB184366A; Mon, 20 May 2019 12:39:08 +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 x4KCcDtF031955 for ; Mon, 20 May 2019 08:38:13 -0400 Received: by smtp.corp.redhat.com (Postfix) id 73AD15D704; Mon, 20 May 2019 12:38:13 +0000 (UTC) Received: from moe.brq.redhat.com (unknown [10.43.2.30]) by smtp.corp.redhat.com (Postfix) with ESMTP id F1C835D6A6 for ; Mon, 20 May 2019 12:38:12 +0000 (UTC) From: Michal Privoznik To: libvir-list@redhat.com Date: Mon, 20 May 2019 14:38:03 +0200 Message-Id: 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 6/6] networkStartNetworkVirtual: Dissolve 'err0' label in 'error' 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.79 on 10.5.11.12 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.29]); Mon, 20 May 2019 12:39:09 +0000 (UTC) Content-Type: text/plain; charset="utf-8" Signed-off-by: Michal Privoznik --- src/network/bridge_driver.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/src/network/bridge_driver.c b/src/network/bridge_driver.c index 59c9780a7e..0e9bb78c32 100644 --- a/src/network/bridge_driver.c +++ b/src/network/bridge_driver.c @@ -2370,7 +2370,7 @@ networkStartNetworkVirtual(virNetworkDriverStatePtr d= river, */ macTapIfName =3D networkBridgeDummyNicName(def->bridge); if (!macTapIfName) - goto err0; + goto error; /* Keep tun fd open and interface up to allow for IPv6 DAD to happ= en */ if (virNetDevTapCreateInBridgePort(def->bridge, &macTapIfName, &def->mac, @@ -2380,7 +2380,7 @@ networkStartNetworkVirtual(virNetworkDriverStatePtr d= river, VIR_NETDEV_TAP_CREATE_IFUP | VIR_NETDEV_TAP_CREATE_PERSIST) = < 0) { VIR_FREE(macTapIfName); - goto err0; + goto error; } } =20 @@ -2526,9 +2526,6 @@ networkStartNetworkVirtual(virNetworkDriverStatePtr d= river, virNetworkObjUnrefMacMap(obj); VIR_FREE(macMapFile); =20 - err0: - if (!save_err) - virErrorPreserveLast(&save_err); ignore_value(virNetDevBridgeDelete(def->bridge)); =20 virErrorRestore(&save_err); --=20 2.21.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list