---
src/vbox/vbox_common.c | 11 +++++++++++
src/vbox/vbox_tmpl.c | 16 ++++++----------
src/vbox/vbox_uniformed_api.h | 1 +
3 files changed, 18 insertions(+), 10 deletions(-)
diff --git a/src/vbox/vbox_common.c b/src/vbox/vbox_common.c
index 1c67eea..ed6597c 100644
--- a/src/vbox/vbox_common.c
+++ b/src/vbox/vbox_common.c
@@ -461,3 +461,14 @@ vboxConnectGetMaxVcpus(virConnectPtr conn, const char *type
ATTRIBUTE_UNUSED)
VBOX_RELEASE(systemProperties);
return ret;
}
+
+char *vboxConnectGetCapabilities(virConnectPtr conn)
+{
+ VBOX_OBJECT_CHECK(conn, char *, NULL);
+
+ vboxDriverLock(data);
+ ret = virCapabilitiesFormatXML(data->caps);
+ vboxDriverUnlock(data);
+
+ return ret;
+}
diff --git a/src/vbox/vbox_tmpl.c b/src/vbox/vbox_tmpl.c
index e17b06f..569ae29 100644
--- a/src/vbox/vbox_tmpl.c
+++ b/src/vbox/vbox_tmpl.c
@@ -253,6 +253,10 @@ static virDomainPtr vboxDomainDefineXML(virConnectPtr conn, const
char *xml);
static int vboxDomainCreate(virDomainPtr dom);
static int vboxDomainUndefineFlags(virDomainPtr dom, unsigned int flags);
+#if VBOX_API_VERSION > 2002000 && VBOX_API_VERSION < 4000000
+/* Since vboxConnectGetCapabilities has been rewriten,
+ * vboxDiverLock and Unlock only be used in 3.* */
+
static void vboxDriverLock(vboxGlobalData *data)
{
virMutexLock(&data->lock);
@@ -263,6 +267,8 @@ static void vboxDriverUnlock(vboxGlobalData *data)
virMutexUnlock(&data->lock);
}
+#endif
+
#if VBOX_API_VERSION == 2002000
static void nsIDtoChar(unsigned char *uuid, const nsID *iid)
@@ -911,16 +917,6 @@ vboxSocketParseAddrUtf16(vboxGlobalData *data, const PRUnichar
*utf16,
return result;
}
-static char *vboxConnectGetCapabilities(virConnectPtr conn) {
- VBOX_OBJECT_CHECK(conn, char *, NULL);
-
- vboxDriverLock(data);
- ret = virCapabilitiesFormatXML(data->caps);
- vboxDriverUnlock(data);
-
- return ret;
-}
-
static int vboxConnectListDomains(virConnectPtr conn, int *ids, int nids)
{
VBOX_OBJECT_CHECK(conn, int, -1);
diff --git a/src/vbox/vbox_uniformed_api.h b/src/vbox/vbox_uniformed_api.h
index 4bd0cf7..18f6870 100644
--- a/src/vbox/vbox_uniformed_api.h
+++ b/src/vbox/vbox_uniformed_api.h
@@ -230,6 +230,7 @@ int vboxConnectIsSecure(virConnectPtr conn);
int vboxConnectIsEncrypted(virConnectPtr conn);
int vboxConnectIsAlive(virConnectPtr conn);
int vboxConnectGetMaxVcpus(virConnectPtr conn, const char *type);
+char *vboxConnectGetCapabilities(virConnectPtr conn);
/* Version specified functions for installing uniformed API */
void vbox22InstallUniformedAPI(vboxUniformedAPI *pVBoxAPI);
--
1.7.9.5