[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

[libvirt] [PATCH 05/29] vbox: Rewrite vboxConnectGetVersion



---
 src/vbox/vbox_common.c        |   22 ++++++++++++++++++++++
 src/vbox/vbox_tmpl.c          |   13 -------------
 src/vbox/vbox_uniformed_api.h |    1 +
 3 files changed, 23 insertions(+), 13 deletions(-)

diff --git a/src/vbox/vbox_common.c b/src/vbox/vbox_common.c
index a74a1de..3edadce 100644
--- a/src/vbox/vbox_common.c
+++ b/src/vbox/vbox_common.c
@@ -393,3 +393,25 @@ vboxDomainSave(virDomainPtr dom, const char *path ATTRIBUTE_UNUSED)
     vboxIIDUnalloc(&iid);
     return ret;
 }
+
+static void vboxDriverLock(vboxGlobalData *data)
+{
+    virMutexLock(&data->lock);
+}
+
+static void vboxDriverUnlock(vboxGlobalData *data)
+{
+    virMutexUnlock(&data->lock);
+}
+
+int vboxConnectGetVersion(virConnectPtr conn, unsigned long *version)
+{
+    vboxGlobalData *data = conn->privateData;
+    VIR_DEBUG("%s: in vboxGetVersion", conn->driver->name);
+
+    vboxDriverLock(data);
+    *version = data->version;
+    vboxDriverUnlock(data);
+
+    return 0;
+}
diff --git a/src/vbox/vbox_tmpl.c b/src/vbox/vbox_tmpl.c
index 54a84bb..34ac5fc 100644
--- a/src/vbox/vbox_tmpl.c
+++ b/src/vbox/vbox_tmpl.c
@@ -911,19 +911,6 @@ vboxSocketParseAddrUtf16(vboxGlobalData *data, const PRUnichar *utf16,
     return result;
 }
 
-static int vboxConnectGetVersion(virConnectPtr conn, unsigned long *version)
-{
-    vboxGlobalData *data = conn->privateData;
-    VIR_DEBUG("%s: in vboxGetVersion", conn->driver->name);
-
-    vboxDriverLock(data);
-    *version = data->version;
-    vboxDriverUnlock(data);
-
-    return 0;
-}
-
-
 static char *vboxConnectGetHostname(virConnectPtr conn ATTRIBUTE_UNUSED)
 {
     return virGetHostname();
diff --git a/src/vbox/vbox_uniformed_api.h b/src/vbox/vbox_uniformed_api.h
index 44bb3bc..94afe16 100644
--- a/src/vbox/vbox_uniformed_api.h
+++ b/src/vbox/vbox_uniformed_api.h
@@ -217,6 +217,7 @@ virDrvOpenStatus vboxConnectOpen(virConnectPtr conn,
                                  unsigned int flags);
 int vboxConnectClose(virConnectPtr conn);
 int vboxDomainSave(virDomainPtr dom, const char *path);
+int vboxConnectGetVersion(virConnectPtr conn, unsigned long *version);
 
 /* Version specified functions for installing uniformed API */
 void vbox22InstallUniformedAPI(vboxUniformedAPI *pVBoxAPI);
-- 
1.7.9.5


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]