[PATCH 04/66] vbox: Rewrite vboxConnectGetVersion

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

 



---
 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 28d8668..f4f0d6d 100644
--- a/src/vbox/vbox_common.c
+++ b/src/vbox/vbox_common.c
@@ -395,3 +395,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 0e9b6c8..60e6098 100644
--- a/src/vbox/vbox_tmpl.c
+++ b/src/vbox/vbox_tmpl.c
@@ -914,19 +914,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 8538754..5bb2e65 100644
--- a/src/vbox/vbox_uniformed_api.h
+++ b/src/vbox/vbox_uniformed_api.h
@@ -220,6 +220,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

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list




[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]