]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
network: Separate private APIs declaration to bridge_driver_priv.h
authorMichal Privoznik <mprivozn@redhat.com>
Tue, 27 Jan 2026 19:38:21 +0000 (20:38 +0100)
committerMichal Privoznik <mprivozn@redhat.com>
Thu, 29 Jan 2026 12:38:16 +0000 (13:38 +0100)
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 <mprivozn@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
src/network/bridge_driver.c
src/network/bridge_driver.h
src/network/bridge_driver_priv.h [new file with mode: 0644]
tests/networkxml2conftest.c
tests/networkxml2xmltest.c

index 8b5dbb3ab76304386961f208439b64c7ffd66128..d7004771b7004d31472ea7ac08fecd19ddc8436f 100644 (file)
@@ -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"
index fddc3dc8cf80bd4c8ce2ce0252ac93f5727cb889..64af68c1e076771c2fb060932aa6c4e4e7b05f97 100644 (file)
 
 #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 (file)
index 0000000..7f21ed7
--- /dev/null
@@ -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);
index 40b9d07d31ef2043b1997c09aab56865b7ced713..70fb3a37b90d401140781446724cf0fc5fe3a633 100644 (file)
@@ -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"
 
index 59266defb670c9a9b2a9773877683e5901837c13..840bcaa83f59c0d1322d03897a709fb506faf4ed 100644 (file)
@@ -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