From: Michal Privoznik Date: Tue, 27 Jan 2026 19:38:21 +0000 (+0100) Subject: network: Separate private APIs declaration to bridge_driver_priv.h X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e047ae9ec3bc9476b167a3b1ba0bc983d27daad0;p=thirdparty%2Flibvirt.git network: Separate private APIs declaration to bridge_driver_priv.h 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 Reviewed-by: Ján Tomko --- 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 @@ #pragma once -#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_priv.h b/src/network/bridge_driver_priv.h new file mode 100644 index 0000000000..7f21ed7ad6 --- /dev/null +++ b/src/network/bridge_driver_priv.h @@ -0,0 +1,25 @@ +/* + * bridge_driver_priv.h: private declarations for network driver + * + * SPDX-License-Identifier: LGPL-2.1-or-later + */ + +#ifndef LIBVIRT_BRIDGE_DRIVER_PRIV_H_ALLOW +# error "bridge_driver_priv.h may only be included by bridge_driver.c or test suites" +#endif /* LIBVIRT_BRIDGE_DRIVER_PRIV_H_ALLOW */ + +#pragma once + +#include "virdnsmasq.h" +#include "virnetworkobj.h" + +virNetworkXMLOption * +networkDnsmasqCreateXMLConf(void); + +int +networkDnsmasqConfContents(virNetworkObj *obj, + const char *pidfile, + char **configstr, + char **hostsfilestr, + dnsmasqContext *dctx, + dnsmasqCaps *caps); 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" 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" #define VIR_FROM_THIS VIR_FROM_NONE