Wire up the allocation and disposal of private data.
Signed-off-by: Ján Tomko <jtomko(a)redhat.com>
---
src/qemu/qemu_domain.c | 38 ++++++++++++++++++++++++++++++++++++++
src/qemu/qemu_domain.h | 12 ++++++++++++
2 files changed, 50 insertions(+)
diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c
index 065c9e97a9..87741659ad 100644
--- a/src/qemu/qemu_domain.c
+++ b/src/qemu/qemu_domain.c
@@ -1407,6 +1407,43 @@ qemuDomainNetworkPrivateDispose(void *obj G_GNUC_UNUSED)
}
+static virClassPtr qemuDomainFSPrivateClass;
+static void qemuDomainFSPrivateDispose(void *obj);
+
+
+static int
+qemuDomainFSPrivateOnceInit(void)
+{
+ if (!VIR_CLASS_NEW(qemuDomainFSPrivate, virClassForObject()))
+ return -1;
+
+ return 0;
+}
+
+
+VIR_ONCE_GLOBAL_INIT(qemuDomainFSPrivate);
+
+
+static virObjectPtr
+qemuDomainFSPrivateNew(void)
+{
+ qemuDomainFSPrivatePtr priv;
+
+ if (qemuDomainFSPrivateInitialize() < 0)
+ return NULL;
+
+ if (!(priv = virObjectNew(qemuDomainFSPrivateClass)))
+ return NULL;
+
+ return (virObjectPtr) priv;
+}
+
+
+static void
+qemuDomainFSPrivateDispose(void *obj G_GNUC_UNUSED)
+{
+}
+
static virClassPtr qemuDomainVideoPrivateClass;
static void qemuDomainVideoPrivateDispose(void *obj);
@@ -3865,6 +3902,7 @@ virDomainXMLPrivateDataCallbacks virQEMUDriverPrivateDataCallbacks =
{
.graphicsNew = qemuDomainGraphicsPrivateNew,
.networkNew = qemuDomainNetworkPrivateNew,
.videoNew = qemuDomainVideoPrivateNew,
+ .fsNew = qemuDomainFSPrivateNew,
.parse = qemuDomainObjPrivateXMLParse,
.format = qemuDomainObjPrivateXMLFormat,
.getParseOpaque = qemuDomainObjPrivateXMLGetParseOpaque,
diff --git a/src/qemu/qemu_domain.h b/src/qemu/qemu_domain.h
index c93bdf4099..c6afc484f6 100644
--- a/src/qemu/qemu_domain.h
+++ b/src/qemu/qemu_domain.h
@@ -560,6 +560,18 @@ struct _qemuDomainNetworkPrivate {
};
+#define QEMU_DOMAIN_FS_PRIVATE(dev) \
+ ((qemuDomainFSPrivatePtr) (dev)->privateData)
+
+typedef struct _qemuDomainFSPrivate qemuDomainFSPrivate;
+typedef qemuDomainFSPrivate *qemuDomainFSPrivatePtr;
+struct _qemuDomainFSPrivate {
+ virObject parent;
+
+ int dummy;
+};
+
+
typedef enum {
QEMU_PROCESS_EVENT_WATCHDOG = 0,
QEMU_PROCESS_EVENT_GUESTPANIC,
--
2.21.0