On 8/8/19 4:55 PM, marcandre.lureau(a)redhat.com wrote:
From: Marc-André Lureau <marcandre.lureau(a)redhat.com>
Signed-off-by: Marc-André Lureau <marcandre.lureau(a)redhat.com>
---
src/qemu/qemu_domain.c | 39 +++++++++++++++++++++++++++++++++++++++
src/qemu/qemu_domain.h | 12 ++++++++++++
2 files changed, 51 insertions(+)
diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c
index 806dbfd1f8..7315fe103e 100644
--- a/src/qemu/qemu_domain.c
+++ b/src/qemu/qemu_domain.c
@@ -1269,6 +1269,44 @@ qemuDomainGraphicsPrivateDispose(void *obj)
}
+static virClassPtr qemuDomainNetworkPrivateClass;
+static void qemuDomainNetworkPrivateDispose(void *obj);
+
+
+static int
+qemuDomainNetworkPrivateOnceInit(void)
+{
+ if (!VIR_CLASS_NEW(qemuDomainNetworkPrivate, virClassForObject()))
+ return -1;
+
+ return 0;
+}
+
+
+VIR_ONCE_GLOBAL_INIT(qemuDomainNetworkPrivate);
+
+
+static virObjectPtr
+qemuDomainNetworkPrivateNew(void)
+{
+ qemuDomainNetworkPrivatePtr priv;
+
+ if (qemuDomainNetworkPrivateInitialize() < 0)
+ return NULL;
+
+ if (!(priv = virObjectNew(qemuDomainNetworkPrivateClass)))
+ return NULL;
+
+ return (virObjectPtr) priv;
+}
+
+
+static void
+qemuDomainNetworkPrivateDispose(void *obj ATTRIBUTE_UNUSED)
+{
+}
+
+
/* qemuDomainSecretPlainSetup:
* @secinfo: Pointer to secret info
* @usageType: The virSecretUsageType
@@ -3428,6 +3466,7 @@ virDomainXMLPrivateDataCallbacks virQEMUDriverPrivateDataCallbacks
= {
.chrSourceNew = qemuDomainChrSourcePrivateNew,
.vsockNew = qemuDomainVsockPrivateNew,
.graphicsNew = qemuDomainGraphicsPrivateNew,
+ .networkNew = qemuDomainNetworkPrivateNew,
.parse = qemuDomainObjPrivateXMLParse,
.format = qemuDomainObjPrivateXMLFormat,
.getParseOpaque = qemuDomainObjPrivateXMLGetParseOpaque,
diff --git a/src/qemu/qemu_domain.h b/src/qemu/qemu_domain.h
index 851fb98f42..560b01d80a 100644
--- a/src/qemu/qemu_domain.h
+++ b/src/qemu/qemu_domain.h
@@ -509,6 +509,18 @@ struct _qemuDomainGraphicsPrivate {
};
+#define QEMU_DOMAIN_NETWORK_PRIVATE(dev) \
+ ((qemuDomainNetworkPrivatePtr) (dev)->privateData)
We don't try to align backslashes anymore.
Reviewed-by: Michal Privoznik <mprivozn(a)redhat.com>
Michal