提交 32845fd6 编写于 作者: D Dawid Zamirski 提交者: John Ferlan

vbox: Remove old unflexible macros

The VBOX_SESSION_OPEN/CLOSE macros are only called in
_vboxDomainSnapshotRestore and they are unflexible because:

* assume the caller will have variable named "data"
* can only create Write lock type

As per above, it's not that hard to simply use the VBOX API directly.
上级 f4973d1e
......@@ -144,12 +144,6 @@ if (strUtf16) {\
(unsigned)(iid)->m3[7]);\
}\
#define VBOX_SESSION_OPEN(/* unused */ iid_value, /* in */ machine) \
machine->vtbl->LockMachine(machine, data->vboxSession, LockType_Write)
#define VBOX_SESSION_CLOSE() \
data->vboxSession->vtbl->UnlockMachine(data->vboxSession)
#define VBOX_IID_INITIALIZER { NULL, true }
static void
......@@ -323,7 +317,7 @@ _vboxDomainSnapshotRestore(virDomainPtr dom,
goto cleanup;
}
rc = VBOX_SESSION_OPEN(domiid.value, machine);
rc = machine->vtbl->LockMachine(machine, data->vboxSession, LockType_Write);
#if VBOX_API_VERSION < 5000000
if (NS_SUCCEEDED(rc))
rc = data->vboxSession->vtbl->GetConsole(data->vboxSession, &console);
......@@ -368,7 +362,7 @@ _vboxDomainSnapshotRestore(virDomainPtr dom,
#if VBOX_API_VERSION < 5000000
VBOX_RELEASE(console);
#endif /*VBOX_API_VERSION < 5000000*/
VBOX_SESSION_CLOSE();
data->vboxSession->vtbl->UnlockMachine(data->vboxSession);
vboxIIDUnalloc(&domiid);
return ret;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册