From nobody Mon Feb 2 07:31:49 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.libvirt.org designates 8.43.85.245 as permitted sender) client-ip=8.43.85.245; envelope-from=devel-bounces@lists.libvirt.org; helo=lists.libvirt.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of lists.libvirt.org designates 8.43.85.245 as permitted sender) smtp.mailfrom=devel-bounces@lists.libvirt.org; dmarc=pass(p=reject dis=none) header.from=lists.libvirt.org ARC-Seal: i=1; a=rsa-sha256; t=1769610875; cv=none; d=zohomail.com; s=zohoarc; b=F/ZjKgo4hyytAY+04TmwUnWyMVC1vEHygz7EsqeongNEU+OKrgzy+kQyxP0LCwms3fypH4pfw/Qzxooxil4hNQeEZOVu8zkbZpwYbnp4lHGrXE3xGneqpLKm7gHaB56K0Vwt3oYhyEa2ZlAO6pB3qA4bKxr2y3KxgeJHslBlXe0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1769610875; h=Content-Type:Content-Transfer-Encoding:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Owner:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:Reply-To:References:Subject:Subject:To:To:Message-Id:Cc; bh=+087hq8fqmor7FEXTh013aqmLsifdqiHp6O0HP13WHI=; b=bnhAdSpxnnL8b6DEiRNHeX4Jvbxodzy98Dl69J+eXgKKymJR8MAy+WwnzMQwC4s2wcb3YILBzCnuK6Liam+Vwp8A2eVfNV8EwgI4+dcKK9DTGEqXC2O/91D5pLgbrgMKEOmjzwXS6PnhozyEl40T/hgRyJmebQ9zECKEZWQVIdU= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of lists.libvirt.org designates 8.43.85.245 as permitted sender) smtp.mailfrom=devel-bounces@lists.libvirt.org; dmarc=pass header.from= (p=reject dis=none) Return-Path: Received: from lists.libvirt.org (lists.libvirt.org [8.43.85.245]) by mx.zohomail.com with SMTPS id 1769610874993956.1667837191051; Wed, 28 Jan 2026 06:34:34 -0800 (PST) Received: by lists.libvirt.org (Postfix, from userid 993) id 2896941B94; Wed, 28 Jan 2026 09:34:34 -0500 (EST) Received: from [172.19.199.3] (lists.libvirt.org [8.43.85.245]) by lists.libvirt.org (Postfix) with ESMTP id 5646743E3C; Wed, 28 Jan 2026 09:31:04 -0500 (EST) Received: by lists.libvirt.org (Postfix, from userid 993) id C84613F88F; Wed, 28 Jan 2026 09:30:54 -0500 (EST) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (3072 bits) server-digest SHA256) (No client certificate requested) by lists.libvirt.org (Postfix) with ESMTPS id A835D3F88F for ; Wed, 28 Jan 2026 09:30:53 -0500 (EST) Received: from mx-prod-mc-05.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-407-q-q_0nOAM4yjBpEqpxTVEw-1; Wed, 28 Jan 2026 09:30:49 -0500 Received: from mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.17]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id D0A4A19775E8 for ; Wed, 28 Jan 2026 14:30:48 +0000 (UTC) Received: from moe (unknown [10.43.3.236]) by mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 359C2195419E for ; Wed, 28 Jan 2026 14:30:47 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-26) on lists.libvirt.org X-Spam-Level: X-Spam-Status: No, score=-5.0 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED, RCVD_IN_VALIDITY_CERTIFIED_BLOCKED,RCVD_IN_VALIDITY_RPBL_BLOCKED, RCVD_IN_VALIDITY_SAFE_BLOCKED,SPF_PASS autolearn=unavailable autolearn_force=no version=4.0.1 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1769610653; h=from:from: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; bh=+087hq8fqmor7FEXTh013aqmLsifdqiHp6O0HP13WHI=; b=H+ch+HFK1ZfgXR6r6iPTDNdjJA7aecnzXtMNpYWtwmlG1UQSsJZkyVcAb9MYrD+QvuKn3H vziVH+UlZUKUUlcKltBMnJzzAdBtsDJTz0IBVXaUD/ia2f+SbLLTQokTUImPDikxU6CHnN gJ3xuFudzrj7JH+z8inh5It0jGxjjBA= X-MC-Unique: q-q_0nOAM4yjBpEqpxTVEw-1 X-Mimecast-MFC-AGG-ID: q-q_0nOAM4yjBpEqpxTVEw_1769610649 To: devel@lists.libvirt.org Subject: [PATCH 02/20] network: Separate private APIs declaration to bridge_driver_priv.h Date: Wed, 28 Jan 2026 15:30:23 +0100 Message-ID: <281c259088252cec5113812b688194d2b0965d31.1769610369.git.mprivozn@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.0 on 10.30.177.17 X-Mimecast-Spam-Score: 0 X-Mimecast-MFC-PROC-ID: lTSEkMK13kbISl3wAfG8IzH2v13wFoo9nXw8tuQGwpk_1769610649 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Message-ID-Hash: EUDYCQDDMQ3X3CGR46SQPRSHMGZFOH2J X-Message-ID-Hash: EUDYCQDDMQ3X3CGR46SQPRSHMGZFOH2J X-MailFrom: mprivozn@redhat.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; header-match-devel.lists.libvirt.org-0; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.10 Precedence: list List-Id: Development discussions about the libvirt library & tools Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: From: Michal Privoznik via Devel Reply-To: Michal Privoznik X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1769610876915158500 Content-Type: text/plain; charset="utf-8"; x-default="true" From: Michal Privoznik There are two functions implemented in bridge_driver.c that are used in tests (networkDnsmasqCreateXMLConf() and networkDnsmasqConfContents()) but are declared in bridge_driver.h. This goes against our current practice where such APIs are declared in $name_priv.h. Therefore, move those APIs to bridge_driver_priv.h Signed-off-by: Michal Privoznik --- src/network/bridge_driver.c | 2 ++ src/network/bridge_driver.h | 15 ----------- .../{bridge_driver.h =3D> bridge_driver_priv.h} | 27 +++++-------------- tests/networkxml2conftest.c | 2 ++ tests/networkxml2xmltest.c | 2 ++ 5 files changed, 12 insertions(+), 36 deletions(-) copy src/network/{bridge_driver.h =3D> bridge_driver_priv.h} (32%) diff --git a/src/network/bridge_driver.c b/src/network/bridge_driver.c index 8b5dbb3ab7..d7004771b7 100644 --- a/src/network/bridge_driver.c +++ b/src/network/bridge_driver.c @@ -39,6 +39,8 @@ #include "virerror.h" #include "datatypes.h" #include "bridge_driver.h" +#define LIBVIRT_BRIDGE_DRIVER_PRIV_H_ALLOW +#include "bridge_driver_priv.h" #include "bridge_driver_platform.h" #include "driver.h" #include "virbuffer.h" diff --git a/src/network/bridge_driver.h b/src/network/bridge_driver.h index fddc3dc8cf..64af68c1e0 100644 --- a/src/network/bridge_driver.h +++ b/src/network/bridge_driver.h @@ -21,20 +21,5 @@ =20 #pragma once =20 -#include "internal.h" -#include "virdnsmasq.h" -#include "virnetworkobj.h" - -virNetworkXMLOption * -networkDnsmasqCreateXMLConf(void); - int networkRegister(void); - -int -networkDnsmasqConfContents(virNetworkObj *obj, - const char *pidfile, - char **configstr, - char **hostsfilestr, - dnsmasqContext *dctx, - dnsmasqCaps *caps); diff --git a/src/network/bridge_driver.h b/src/network/bridge_driver_priv.h similarity index 32% copy from src/network/bridge_driver.h copy to src/network/bridge_driver_priv.h index fddc3dc8cf..7f21ed7ad6 100644 --- a/src/network/bridge_driver.h +++ b/src/network/bridge_driver_priv.h @@ -1,36 +1,21 @@ /* - * bridge_driver.h: core driver methods for managing networks + * bridge_driver_priv.h: private declarations for network driver * - * Copyright (C) 2006-2016 Red Hat, Inc. - * Copyright (C) 2006 Daniel P. Berrange - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library. If not, see - * . + * SPDX-License-Identifier: LGPL-2.1-or-later */ =20 +#ifndef LIBVIRT_BRIDGE_DRIVER_PRIV_H_ALLOW +# error "bridge_driver_priv.h may only be included by bridge_driver.c or t= est suites" +#endif /* LIBVIRT_BRIDGE_DRIVER_PRIV_H_ALLOW */ + #pragma once =20 -#include "internal.h" #include "virdnsmasq.h" #include "virnetworkobj.h" =20 virNetworkXMLOption * networkDnsmasqCreateXMLConf(void); =20 -int -networkRegister(void); - int networkDnsmasqConfContents(virNetworkObj *obj, const char *pidfile, diff --git a/tests/networkxml2conftest.c b/tests/networkxml2conftest.c index 40b9d07d31..70fb3a37b9 100644 --- a/tests/networkxml2conftest.c +++ b/tests/networkxml2conftest.c @@ -10,6 +10,8 @@ #include "network_conf.h" #include "viralloc.h" #include "bridge_driver.h" +#define LIBVIRT_BRIDGE_DRIVER_PRIV_H_ALLOW +#include "bridge_driver_priv.h" #define LIBVIRT_VIRCOMMANDPRIV_H_ALLOW #include "vircommandpriv.h" =20 diff --git a/tests/networkxml2xmltest.c b/tests/networkxml2xmltest.c index 59266defb6..840bcaa83f 100644 --- a/tests/networkxml2xmltest.c +++ b/tests/networkxml2xmltest.c @@ -9,6 +9,8 @@ #include "testutils.h" #include "network_conf.h" #include "bridge_driver.h" +#define LIBVIRT_BRIDGE_DRIVER_PRIV_H_ALLOW +#include "bridge_driver_priv.h" =20 #define VIR_FROM_THIS VIR_FROM_NONE =20 --=20 2.52.0