@@ -73,6 +73,39 @@ VIR_ENUM_IMPL(virNetworkTaint,
"hook-script",
);
+static virClassPtr virNetworkXMLOptionClass;
+
+static void
+virNetworkXMLOptionDispose(void *obj ATTRIBUTE_UNUSED)
+{
+ return;
+}
+
+static int
+virNetworkXMLOnceInit(void)
+{
+ if (!VIR_CLASS_NEW(virNetworkXMLOption, virClassForObject()))
+ return -1;
+
+ return 0;
+}
+
+VIR_ONCE_GLOBAL_INIT(virNetworkXML);
+
+virNetworkXMLOptionPtr
+virNetworkXMLOptionNew(void)
+{
+ virNetworkXMLOptionPtr xmlopt;
+
+ if (virNetworkXMLInitialize() < 0)
+ return NULL;
+
+ if (!(xmlopt = virObjectNew(virNetworkXMLOptionClass)))
+ return NULL;
+
+ return xmlopt;
+}
+
static void
virPortGroupDefClear(virPortGroupDefPtr def)
{
@@ -41,6 +41,14 @@
#include "virmacmap.h"
#include "virenum.h"
+
+struct _virNetworkXMLOption {
+ virObject parent;
+};
+typedef struct _virNetworkXMLOption virNetworkXMLOption;
+typedef virNetworkXMLOption *virNetworkXMLOptionPtr;
+
+
typedef enum {
VIR_NETWORK_FORWARD_NONE = 0,
VIR_NETWORK_FORWARD_NAT,
@@ -289,6 +297,9 @@ enum {
VIR_NETWORK_OBJ_LIST_ADD_CHECK_LIVE = (1 << 1),
};
+virNetworkXMLOptionPtr
+virNetworkXMLOptionNew(void);
+
virNetworkDefPtr
virNetworkDefCopy(virNetworkDefPtr def, unsigned int flags);
@@ -730,6 +730,7 @@ virNetworkSaveConfig;
virNetworkSetBridgeMacAddr;
virNetworkTaintTypeFromString;
virNetworkTaintTypeToString;
+virNetworkXMLOptionNew;
virPortGroupFindByName;
@@ -136,6 +136,12 @@ networkDnsmasqCapsRefresh(virNetworkDriverStatePtr driver)
return 0;
}
+static virNetworkXMLOptionPtr
+networkDnsmasqCreateXMLConf(void)
+{
+ return virNetworkXMLOptionNew();
+}
+
static int
networkStateCleanup(void);
@@ -605,6 +611,9 @@ networkStateInitialize(bool privileged,
network_driver->privileged = privileged;
+ if (!(network_driver->xmlopt = networkDnsmasqCreateXMLConf()))
+ goto error;
+
/* configuration/state paths are one of
* ~/.config/libvirt/... (session/unprivileged)
* /etc/libvirt/... && /var/(run|lib)/libvirt/... (system/privileged).
@@ -766,6 +775,7 @@ networkStateCleanup(void)
return -1;
virObjectUnref(network_driver->networkEventState);
+ virObjectUnref(network_driver->xmlopt);
/* free inactive networks */
virObjectUnref(network_driver->networks);
@@ -55,6 +55,8 @@ struct _virNetworkDriverState {
/* Immutable pointer, self-locking APIs */
virObjectEventStatePtr networkEventState;
+
+ virNetworkXMLOptionPtr xmlopt;
};
typedef struct _virNetworkDriverState virNetworkDriverState;
Just a stub for now that is unused. Add init+cleanup plumbing and demostrate it in bridge_driver.c Signed-off-by: Cole Robinson <crobinso@redhat.com> --- src/conf/network_conf.c | 33 ++++++++++++++++++++++++++++ src/conf/network_conf.h | 11 ++++++++++ src/libvirt_private.syms | 1 + src/network/bridge_driver.c | 10 +++++++++ src/network/bridge_driver_platform.h | 2 ++ 5 files changed, 57 insertions(+) -- 2.21.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list