mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-12-23 21:34:54 +03:00
qemu: add private data to virDomainFSDef
Wire up the allocation and disposal of private data. Signed-off-by: Ján Tomko <jtomko@redhat.com> Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
This commit is contained in:
parent
5120577ed7
commit
801e6da29c
@ -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,
|
||||
|
@ -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,
|
||||
|
Loading…
Reference in New Issue
Block a user