Introduce a structure and a class that will be used to store the private data. Signed-off-by: Ján Tomko <jtomko@xxxxxxxxxx> --- src/qemu/qemu_domain.c | 36 ++++++++++++++++++++++++++++++++++++ src/qemu/qemu_domain.h | 9 +++++++++ 2 files changed, 45 insertions(+) diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c index d3beee5d87..650909b739 100644 --- a/src/qemu/qemu_domain.c +++ b/src/qemu/qemu_domain.c @@ -1134,6 +1134,41 @@ qemuDomainChrSourcePrivateDispose(void *obj) } +static virClassPtr qemuDomainNetPrivateClass; +static void qemuDomainNetPrivateDispose(void *obj); + +static int +qemuDomainNetPrivateOnceInit(void) +{ + if (!VIR_CLASS_NEW(qemuDomainNetPrivate, virClassForObject())) + return -1; + + return 0; +} + +VIR_ONCE_GLOBAL_INIT(qemuDomainNetPrivate) + +static virObjectPtr +qemuDomainNetPrivateNew(void) +{ + qemuDomainNetPrivatePtr priv; + + if (qemuDomainNetPrivateInitialize() < 0) + return NULL; + + if (!(priv = virObjectNew(qemuDomainNetPrivateClass))) + return NULL; + + return (virObjectPtr) priv; +} + + +static void +qemuDomainNetPrivateDispose(void *obj ATTRIBUTE_UNUSED) +{ +} + + /* qemuDomainSecretPlainSetup: * @secinfo: Pointer to secret info * @usageType: The virSecretUsageType @@ -2636,6 +2671,7 @@ virDomainXMLPrivateDataCallbacks virQEMUDriverPrivateDataCallbacks = { .diskNew = qemuDomainDiskPrivateNew, .vcpuNew = qemuDomainVcpuPrivateNew, .chrSourceNew = qemuDomainChrSourcePrivateNew, + .netNew = qemuDomainNetPrivateNew, .parse = qemuDomainObjPrivateXMLParse, .format = qemuDomainObjPrivateXMLFormat, .storageParse = qemuStorageSourcePrivateDataParse, diff --git a/src/qemu/qemu_domain.h b/src/qemu/qemu_domain.h index 40d1d095a3..a04ded16ed 100644 --- a/src/qemu/qemu_domain.h +++ b/src/qemu/qemu_domain.h @@ -441,6 +441,15 @@ struct _qemuDomainChrSourcePrivate { }; +typedef struct _qemuDomainNetPrivate qemuDomainNetPrivate; +typedef qemuDomainNetPrivate *qemuDomainNetPrivatePtr; +struct _qemuDomainNetPrivate { + virObject parent; + + virTristateBool maybe; +}; + + typedef enum { QEMU_PROCESS_EVENT_WATCHDOG = 0, QEMU_PROCESS_EVENT_GUESTPANIC, -- 2.16.1 -- libvir-list mailing list libvir-list@xxxxxxxxxx https://www.redhat.com/mailman/listinfo/libvir-list