From: Dawid Zamirski Date: Tue, 24 Oct 2017 21:09:15 +0000 (-0400) Subject: vbox: Remove old unflexible macros X-Git-Tag: v3.9.0-rc1~27 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=32845fd656aeab9125057fd11c0977aaba5b14f8;p=thirdparty%2Flibvirt.git 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. --- diff --git a/src/vbox/vbox_tmpl.c b/src/vbox/vbox_tmpl.c index dffeabde02..ce2ee90371 100644 --- a/src/vbox/vbox_tmpl.c +++ b/src/vbox/vbox_tmpl.c @@ -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; }