From nobody Wed Dec 17 06:12:58 2025 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=1681733356; cv=none; d=zohomail.com; s=zohoarc; b=REJUij1HYSxEev/WgPzlG37hK/CABodKFgordVlxvKd6cUCFAgeC8XobmilzoBJWvSF5W/UtLToQ2ADRwacVj93GA0q4QH3lJHAbcUFBxJRKo9VQ8cRrbXE7yluKyGY2xV0DJeubPIwLZC/DBhk/LahciqMFNQ7rrpkmwk3ylrU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1681733356; 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=/L7+JagJbAnJPhmNW+ecW7tmoHFrIPoMMQMnSWYvSnM=; b=I/WwI7NRq++R80Q6/6iulH1qPiC9UGicxHuOLIWnKz79onJ3HszvgRW2PdhYs+MDh+M9UBFPmCr1819SmvKPuG/vD0x5GRYAX7mkzn+xk9oFwrzrP/ORnP/VQNp945Gad4LUssNQwOmYVF21JDqN6O2RLYGEFJgHBCrZ1/V+sIo= 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 1681733356622136.49470842875485; Mon, 17 Apr 2023 05:09:16 -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-191-pQ7UrmhiP4ecPE6NSUR_0g-1; Mon, 17 Apr 2023 08:09:11 -0400 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id E42CE299E76E; Mon, 17 Apr 2023 12:09:07 +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 CB19C2027063; Mon, 17 Apr 2023 12:09:07 +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 8191B1946A40; Mon, 17 Apr 2023 12:09:07 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx10.intmail.prod.int.rdu2.redhat.com [10.11.54.10]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id F28C2194658C for ; Mon, 17 Apr 2023 12:09:05 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id E4AFE492B10; Mon, 17 Apr 2023 12:09:05 +0000 (UTC) Received: from localhost.localdomain (unknown [10.43.2.39]) by smtp.corp.redhat.com (Postfix) with ESMTP id 89EA2492B03 for ; Mon, 17 Apr 2023 12:09:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1681733355; 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=/L7+JagJbAnJPhmNW+ecW7tmoHFrIPoMMQMnSWYvSnM=; b=CO/s8wZiV5IjGNOhOldTaLHFXB1avWAtPHS1ds6EE4rXz34VClpN/3h6BZRUZ5Zh+z3aCS pkPmD+GDZkuk0eK63sI89uj/JxUqo0CPPhhiupJ8yhjPe3okMduOF9o5Do7rF97nnE7s65 AaiPETWkPSzFF+jkHmhhQDl7Z0LVbok= X-MC-Unique: pQ7UrmhiP4ecPE6NSUR_0g-1 X-Original-To: libvir-list@listman.corp.redhat.com From: Michal Privoznik To: libvir-list@redhat.com Subject: [PATCH 2/3] conf: Initialize _virNetworkObj::dnsmasqPid to -1 in virNetworkObjNew() Date: Mon, 17 Apr 2023 14:09:02 +0200 Message-Id: <6a76e09cbd290bb63bb36dd2a333e87a5a629494.1681733319.git.mprivozn@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.10 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 3.1 on 10.11.54.4 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: 1681733357130100003 Content-Type: text/plain; charset="utf-8"; x-default="true" Throughout all of our network driver code we assume that dnsmasqPid of value -1 means the network has no dnsmasq process running. There are plenty of calls to: virNetworkObjSetDnsmasqPid(obj, -1); or: pid_t dnsmasqPid =3D virNetworkObjGetDnsmasqPid(obj); if (dnsmasqPid > 0) ...; Now, a virNetworkObj is created via virNetworkObjNew() which might as well set this de-facto default value. Signed-off-by: Michal Privoznik --- src/conf/virnetworkobj.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/conf/virnetworkobj.c b/src/conf/virnetworkobj.c index 1726fc381f..b8b86da06f 100644 --- a/src/conf/virnetworkobj.c +++ b/src/conf/virnetworkobj.c @@ -117,6 +117,7 @@ virNetworkObjNew(void) ignore_value(virBitmapSetBit(obj->classIdMap, 2)); =20 obj->ports =3D virHashNew(virNetworkObjPortFree); + obj->dnsmasqPid =3D (pid_t)-1; =20 virObjectLock(obj); =20 --=20 2.39.2