diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c index c4e91896c5..10f22b1cc2 100644 --- a/src/qemu/qemu_domain.c +++ b/src/qemu/qemu_domain.c @@ -1135,6 +1135,41 @@ qemuDomainChrSourcePrivateDispose(void *obj) } +static virClassPtr qemuDomainVsockPrivateClass; +static void qemuDomainVsockPrivateDispose(void *obj); + +static int +qemuDomainVsockPrivateOnceInit(void) +{ + if (!VIR_CLASS_NEW(qemuDomainVsockPrivate, virClassForObject())) + return -1; + + return 0; +} + +VIR_ONCE_GLOBAL_INIT(qemuDomainVsockPrivate) + +static virObjectPtr +qemuDomainVsockPrivateNew(void) +{ + qemuDomainVsockPrivatePtr priv; + + if (qemuDomainVsockPrivateInitialize() < 0) + return NULL; + + if (!(priv = virObjectNew(qemuDomainVsockPrivateClass))) + return NULL; + + return (virObjectPtr) priv; +} + + +static void +qemuDomainVsockPrivateDispose(void *obj ATTRIBUTE_UNUSED) +{ +} + + /* qemuDomainSecretPlainSetup: * @secinfo: Pointer to secret info * @usageType: The virSecretUsageType @@ -2816,6 +2851,7 @@ virDomainXMLPrivateDataCallbacks virQEMUDriverPrivateDataCallbacks = { .diskNew = qemuDomainDiskPrivateNew, .vcpuNew = qemuDomainVcpuPrivateNew, .chrSourceNew = qemuDomainChrSourcePrivateNew, + .vsockNew = qemuDomainVsockPrivateNew, .parse = qemuDomainObjPrivateXMLParse, .format = qemuDomainObjPrivateXMLFormat, .getParseOpaque = qemuDomainObjPrivateXMLGetParseOpaque, diff --git a/src/qemu/qemu_domain.h b/src/qemu/qemu_domain.h index 000d8fb8d7..f298ebf785 100644 --- a/src/qemu/qemu_domain.h +++ b/src/qemu/qemu_domain.h @@ -442,6 +442,15 @@ struct _qemuDomainChrSourcePrivate { }; +typedef struct _qemuDomainVsockPrivate qemuDomainVsockPrivate; +typedef qemuDomainVsockPrivate *qemuDomainVsockPrivatePtr; +struct _qemuDomainVsockPrivate { + virObject parent; + + virTristateBool maybe; +}; + + typedef enum { QEMU_PROCESS_EVENT_WATCHDOG = 0, QEMU_PROCESS_EVENT_GUESTPANIC,