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

[libvirt] [PATCH 02/66] vbox: Rewrite vboxConnectClose



---
 src/vbox/vbox_common.c        |   11 +++++++++++
 src/vbox/vbox_tmpl.c          |   29 -----------------------------
 src/vbox/vbox_uniformed_api.h |    1 +
 3 files changed, 12 insertions(+), 29 deletions(-)

diff --git a/src/vbox/vbox_common.c b/src/vbox/vbox_common.c
index 65a249f..06f1524 100644
--- a/src/vbox/vbox_common.c
+++ b/src/vbox/vbox_common.c
@@ -289,3 +289,14 @@ virDrvOpenStatus vboxConnectOpen(virConnectPtr conn,
 
     return VIR_DRV_OPEN_SUCCESS;
 }
+
+int vboxConnectClose(virConnectPtr conn)
+{
+    vboxGlobalData *data = conn->privateData;
+    VIR_DEBUG("%s: in vboxClose", conn->driver->name);
+
+    vboxUninitialize(data);
+    conn->privateData = NULL;
+
+    return 0;
+}
diff --git a/src/vbox/vbox_tmpl.c b/src/vbox/vbox_tmpl.c
index 6c13775..6315a64 100644
--- a/src/vbox/vbox_tmpl.c
+++ b/src/vbox/vbox_tmpl.c
@@ -834,35 +834,6 @@ vboxSocketParseAddrUtf16(vboxGlobalData *data, const PRUnichar *utf16,
     return result;
 }
 
-static void vboxUninitialize(vboxGlobalData *data)
-{
-    if (!data)
-        return;
-
-    if (data->pFuncs)
-        data->pFuncs->pfnComUninitialize();
-
-    virObjectUnref(data->caps);
-    virObjectUnref(data->xmlopt);
-#if VBOX_API_VERSION == 2002000
-    /* No domainEventCallbacks in 2.2.* version */
-#else  /* !(VBOX_API_VERSION == 2002000) */
-    virObjectEventStateFree(data->domainEvents);
-#endif /* !(VBOX_API_VERSION == 2002000) */
-    VIR_FREE(data);
-}
-
-static int vboxConnectClose(virConnectPtr conn)
-{
-    vboxGlobalData *data = conn->privateData;
-    VIR_DEBUG("%s: in vboxClose", conn->driver->name);
-
-    vboxUninitialize(data);
-    conn->privateData = NULL;
-
-    return 0;
-}
-
 static int vboxConnectGetVersion(virConnectPtr conn, unsigned long *version)
 {
     vboxGlobalData *data = conn->privateData;
diff --git a/src/vbox/vbox_uniformed_api.h b/src/vbox/vbox_uniformed_api.h
index 80abcbb..f424047 100644
--- a/src/vbox/vbox_uniformed_api.h
+++ b/src/vbox/vbox_uniformed_api.h
@@ -137,6 +137,7 @@ typedef struct {
 virDrvOpenStatus vboxConnectOpen(virConnectPtr conn,
                                  virConnectAuthPtr auth,
                                  unsigned int flags);
+int vboxConnectClose(virConnectPtr conn);
 
 /* 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]