提交 37cf7594 编写于 作者: T Taowei 提交者: Michal Privoznik

vbox: Add registerDomainEvent

上级 1eda86b0
......@@ -1493,6 +1493,16 @@ _vboxDomainSnapshotRestore(virDomainPtr dom,
#if VBOX_API_VERSION <= 2002000 || VBOX_API_VERSION >= 4000000
/* No Callback support for VirtualBox 2.2.* series */
/* No Callback support for VirtualBox 4.* series */
static void
_registerDomainEvent(virDriverPtr driver)
{
driver->connectDomainEventRegister = NULL;
driver->connectDomainEventDeregister = NULL;
driver->connectDomainEventRegisterAny = NULL;
driver->connectDomainEventDeregisterAny = NULL;
}
#else /* !(VBOX_API_VERSION == 2002000 || VBOX_API_VERSION >= 4000000) */
/* Functions needed for Callbacks */
......@@ -2035,6 +2045,15 @@ vboxConnectDomainEventDeregisterAny(virConnectPtr conn,
return ret;
}
static void
_registerDomainEvent(virDriverPtr driver)
{
driver->connectDomainEventRegister = vboxConnectDomainEventRegister; /* 0.7.0 */
driver->connectDomainEventDeregister = vboxConnectDomainEventDeregister; /* 0.7.0 */
driver->connectDomainEventRegisterAny = vboxConnectDomainEventRegisterAny; /* 0.8.0 */
driver->connectDomainEventDeregisterAny = vboxConnectDomainEventDeregisterAny; /* 0.8.0 */
}
#endif /* !(VBOX_API_VERSION == 2002000 || VBOX_API_VERSION >= 4000000) */
/**
......@@ -6382,6 +6401,7 @@ void NAME(InstallUniformedAPI)(vboxUniformedAPI *pVBoxAPI)
pVBoxAPI->attachFloppy = _attachFloppy;
pVBoxAPI->detachFloppy = _detachFloppy;
pVBoxAPI->snapshotRestore = _vboxDomainSnapshotRestore;
pVBoxAPI->registerDomainEvent = _registerDomainEvent;
pVBoxAPI->UPFN = _UPFN;
pVBoxAPI->UIID = _UIID;
pVBoxAPI->UArray = _UArray;
......
......@@ -493,6 +493,7 @@ typedef struct {
int (*attachFloppy)(vboxGlobalData *data, IMachine *machine, const char *src);
int (*detachFloppy)(IMachine *machine);
int (*snapshotRestore)(virDomainPtr dom, IMachine *machine, ISnapshot *snapshot);
void (*registerDomainEvent)(virDriverPtr driver);
vboxUniformedPFN UPFN;
vboxUniformedIID UIID;
vboxUniformedArray UArray;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册