From nobody Sun Feb 8 20:23:19 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=1660050852; cv=none; d=zohomail.com; s=zohoarc; b=V3k4ev27EfapJMXnwL2/zgsqyUJzL3oeAQdJkBFuQ5oEa6ihmp2s6Ucos3mi+wZQbnIx8EEf2AOzOgH0CLW19/+yk6X98eExFYzIhy6vz9qVFCnAgLWqfQRNKVnqLOTy2tnaLMvRDr8ew5BYY228qiJcx9Cg/fwtAX/YPRAL628= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1660050852; 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=/IxGmcVAq1wlJq5/92GJYZEY1wUqByr6WFzyXFFKPfc=; b=QixG6z/Lp60NGGGQpEFZUPGm6sQBsZT4I+nuRmehWGfLzbusdHXtl0/l1ukxmInHOUBeTqXvRBXpdGml4vsatTZGiIwx/BEqH4Owgydfb8UbSBl3F4ZN2T2NyqQLYIcUZtPPm/QoEljRHHcW2hnV13bEetk/wuiUsZ836GAi8LE= 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 1660050852540259.4595096074635; Tue, 9 Aug 2022 06:14:12 -0700 (PDT) Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-623-Z_D3TcRMNJKmnu8vcir-eA-1; Tue, 09 Aug 2022 09:14:06 -0400 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 7D2E982406E; Tue, 9 Aug 2022 13:14:00 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com [10.30.29.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id 638492166B26; Tue, 9 Aug 2022 13:14:00 +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 E24D51946A69; Tue, 9 Aug 2022 13:13:59 +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 198661946A41 for ; Tue, 9 Aug 2022 13:13:59 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id 04BC2400DFA6; Tue, 9 Aug 2022 13:13:59 +0000 (UTC) Received: from maggie.redhat.com (unknown [10.43.2.39]) by smtp.corp.redhat.com (Postfix) with ESMTP id A4AEA40CFD0A for ; Tue, 9 Aug 2022 13:13:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1660050851; 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=/IxGmcVAq1wlJq5/92GJYZEY1wUqByr6WFzyXFFKPfc=; b=gkG3KRQ9xshCxVCe6S80F1zjuxjwgN1Naswui8HKiNrd5lX4RmDpKikvk2lbG5PInSUg+S ssy84GkYt2zEZlQ5Hq/7hzW+lel+eeeHH88qFKziIcoZuf1gr4PAeLt+2C1curXcy7yHKp +85G1v5xmIsqDQeGqK++cunDox91JDk= X-MC-Unique: Z_D3TcRMNJKmnu8vcir-eA-1 X-Original-To: libvir-list@listman.corp.redhat.com From: Michal Privoznik To: libvir-list@redhat.com Subject: [PATCH 1/5] bridge_driver: Set @dnsmasqStarted only after successful dnsmasq spawn Date: Tue, 9 Aug 2022 15:13:53 +0200 Message-Id: <0629f482c143b7de0d66c15b00ca19131be897f5.1660050814.git.mprivozn@redhat.com> In-Reply-To: References: 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.78 on 10.11.54.6 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: 1660050853475100001 Content-Type: text/plain; charset="utf-8"; x-default="true" The networkStartNetworkVirtual() function handles starting of networks of different forward types (none, nat, route, open). And as a part of startup process dnsmasq might be spawned but doesn't have to be (depending on the network configuration). The @dnsmasqStarted variable is supposed to track whether dnsmasq was started or not (so that it can be killed when starting network fails after it was started). But the variable is set even when the code decided not to start it. Signed-off-by: Michal Privoznik --- src/network/bridge_driver.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/network/bridge_driver.c b/src/network/bridge_driver.c index 11696a9459..7ad9f278a2 100644 --- a/src/network/bridge_driver.c +++ b/src/network/bridge_driver.c @@ -2052,11 +2052,12 @@ networkStartNetworkVirtual(virNetworkDriverState *d= river, =20 =20 /* start dnsmasq if there are any IP addresses (v4 or v6) */ - if ((v4present || v6present) && - networkStartDhcpDaemon(driver, obj) < 0) - goto error; + if (v4present || v6present) { + if (networkStartDhcpDaemon(driver, obj) < 0) + goto error; =20 - dnsmasqStarted =3D true; + dnsmasqStarted =3D true; + } =20 if (virNetDevBandwidthSet(def->bridge, def->bandwidth, true, true) < 0) goto error; --=20 2.35.1