提交 d9253a02 编写于 作者: D Daniel P. Berrangé

vbox: add support for version 6.0 SDK

Reviewed-by: NMichal Privoznik <mprivozn@redhat.com>
Signed-off-by: NDaniel P. Berrangé <berrange@redhat.com>
上级 20b86581
......@@ -7,6 +7,8 @@ VBOX_DRIVER_SOURCES = \
vbox/vbox_snapshot_conf.h \
vbox/vbox_V5_2.c \
vbox/vbox_CAPI_v5_2.h \
vbox/vbox_CAPI_v6_0.h \
vbox/vbox_V6_0.c \
vbox/vbox_common.c \
vbox/vbox_common.h \
vbox/vbox_uniformed_api.h \
......
/** @file vbox_V6_0.c
* C file to include support for multiple versions of VirtualBox
* at runtime.
*/
#include <config.h>
/** The API Version */
#define VBOX_API_VERSION 6000000
/** Version specific prefix. */
#define NAME(name) vbox60##name
#include "vbox_tmpl.c"
......@@ -431,6 +431,8 @@ typedef nsISupports IKeyboard;
result = 0; \
if (uVersion >= 5001051 && uVersion < 5002051) { \
vbox52InstallUniformedAPI(&gVBoxAPI); \
} else if (uVersion >= 6000000 && uVersion < 6000051) { \
vbox60InstallUniformedAPI(&gVBoxAPI); \
} else { \
result = -1; \
} \
......
......@@ -882,6 +882,8 @@ virStorageDriverPtr vboxGetStorageDriver(uint32_t uVersion)
*/
if (uVersion >= 5001051 && uVersion < 5002051) {
vbox52InstallUniformedAPI(&gVBoxAPI);
} else if (uVersion >= 6000000 && uVersion < 6000051) {
vbox60InstallUniformedAPI(&gVBoxAPI);
} else {
return NULL;
}
......
......@@ -51,8 +51,10 @@
/* This one changes from version to version. */
#if VBOX_API_VERSION == 5002000
# include "vbox_CAPI_v5_2.h"
#elif VBOX_API_VERSION == 6000000
# include "vbox_CAPI_v6_0.h"
#else
# error "Unsupport VBOX_API_VERSION"
# error "Unsupported VBOX_API_VERSION"
#endif
/* Include this *last* or we'll get the wrong vbox_CAPI_*.h. */
......@@ -729,8 +731,13 @@ _machineCreateSharedFolder(IMachine *machine, PRUnichar *name,
PRUnichar *hostPath, PRBool writable,
PRBool automount G_GNUC_UNUSED)
{
#if VBOX_API_VERSION >= 6000000
return machine->vtbl->CreateSharedFolder(machine, name, hostPath,
writable, automount, NULL);
#else
return machine->vtbl->CreateSharedFolder(machine, name, hostPath,
writable, automount);
#endif
}
static nsresult
......
......@@ -556,3 +556,4 @@ virDomainPtr vboxDomainLookupByUUID(virConnectPtr conn,
/* Version specified functions for installing uniformed API */
void vbox52InstallUniformedAPI(vboxUniformedAPI *pVBoxAPI);
void vbox60InstallUniformedAPI(vboxUniformedAPI *pVBoxAPI);
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册