From: Marc-André Lureau <marcandre.lureau@xxxxxxxxxx> Signed-off-by: Marc-André Lureau <marcandre.lureau@xxxxxxxxxx> --- 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 b7fcaab186..825c23aa26 100644 --- a/src/qemu/qemu_domain.c +++ b/src/qemu/qemu_domain.c @@ -1272,6 +1272,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 @@ -3089,6 +3127,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 20c5fbec09..7ab44d3c43 100644 --- a/src/qemu/qemu_domain.h +++ b/src/qemu/qemu_domain.h @@ -511,6 +511,18 @@ struct _qemuDomainGraphicsPrivate { }; +#define QEMU_DOMAIN_NETWORK_PRIVATE(dev) \ + ((qemuDomainNetworkPrivatePtr) (dev)->privateData) + +typedef struct _qemuDomainNetworkPrivate qemuDomainNetworkPrivate; +typedef qemuDomainNetworkPrivate *qemuDomainNetworkPrivatePtr; +struct _qemuDomainNetworkPrivate { + virObject parent; + + bool tmp_to_be_larger_than_parent; +}; + + typedef enum { QEMU_PROCESS_EVENT_WATCHDOG = 0, QEMU_PROCESS_EVENT_GUESTPANIC, -- 2.22.0.214.g8dca754b1e -- libvir-list mailing list libvir-list@xxxxxxxxxx https://www.redhat.com/mailman/listinfo/libvir-list