[PATCH 08/11] vz: remove close callback implementations

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

 



These methods are not necessary because vz becomes a stateful driver
and clients always work via daemon

Signed-off-by: Maxim Nestratov <mnestratov@xxxxxxxxxxxxx>
---
 src/vz/vz_driver.c | 52 ----------------------------------------------------
 src/vz/vz_sdk.c    |  2 --
 src/vz/vz_utils.h  |  2 --
 3 files changed, 56 deletions(-)

diff --git a/src/vz/vz_driver.c b/src/vz/vz_driver.c
index 4c30305..42b0c02 100644
--- a/src/vz/vz_driver.c
+++ b/src/vz/vz_driver.c
@@ -1537,56 +1537,6 @@ vzNodeGetFreeMemory(virConnectPtr conn ATTRIBUTE_UNUSED)
     return freeMem;
 }
 
-static int
-vzConnectRegisterCloseCallback(virConnectPtr conn,
-                               virConnectCloseFunc cb,
-                               void *opaque,
-                               virFreeCallback freecb)
-{
-    vzConnPtr privconn = conn->privateData;
-    int ret = -1;
-
-    vzDriverLock(privconn);
-
-    if (virConnectCloseCallbackDataGetCallback(privconn->closeCallback) != NULL) {
-        virReportError(VIR_ERR_OPERATION_INVALID, "%s",
-                       _("A close callback is already registered"));
-        goto cleanup;
-    }
-
-    virConnectCloseCallbackDataRegister(privconn->closeCallback, conn, cb,
-                                        opaque, freecb);
-    ret = 0;
-
- cleanup:
-    vzDriverUnlock(privconn);
-
-    return ret;
-}
-
-static int
-vzConnectUnregisterCloseCallback(virConnectPtr conn, virConnectCloseFunc cb)
-{
-    vzConnPtr privconn = conn->privateData;
-    int ret = -1;
-
-    vzDriverLock(privconn);
-
-    if (virConnectCloseCallbackDataGetCallback(privconn->closeCallback) != cb) {
-        virReportError(VIR_ERR_OPERATION_INVALID, "%s",
-                       _("A different callback was requested"));
-        goto cleanup;
-    }
-
-    virConnectCloseCallbackDataUnregister(privconn->closeCallback, cb);
-    ret = 0;
-
- cleanup:
-    vzDriverUnlock(privconn);
-
-    return ret;
-}
-
 static virHypervisorDriver vzDriver = {
     .name = "vz",
     .connectOpen = vzConnectOpen,            /* 0.10.0 */
@@ -1650,8 +1600,6 @@ static virHypervisorDriver vzDriver = {
     .domainBlockStatsFlags = vzDomainBlockStatsFlags, /* 1.2.17 */
     .domainInterfaceStats = vzDomainInterfaceStats, /* 1.2.17 */
     .domainMemoryStats = vzDomainMemoryStats, /* 1.2.17 */
-    .connectRegisterCloseCallback = vzConnectRegisterCloseCallback, /* 1.3.2 */
-    .connectUnregisterCloseCallback = vzConnectUnregisterCloseCallback, /* 1.3.2 */
 };
 
 static virConnectDriver vzConnectDriver = {
diff --git a/src/vz/vz_sdk.c b/src/vz/vz_sdk.c
index e6f6129..59bd89a 100644
--- a/src/vz/vz_sdk.c
+++ b/src/vz/vz_sdk.c
@@ -1956,8 +1956,6 @@ prlsdkEventsHandler(PRL_HANDLE prlEvent, PRL_VOID_PTR opaque)
         prlEvent = PRL_INVALID_HANDLE;
         break;
     case PET_DSP_EVT_DISP_CONNECTION_CLOSED:
-        virConnectCloseCallbackDataCall(privconn->closeCallback,
-                                        VIR_CONNECT_CLOSE_REASON_EOF);
         vzDestroyConnection();
         break;
     default:
diff --git a/src/vz/vz_utils.h b/src/vz/vz_utils.h
index a2b86c7..406ddd9 100644
--- a/src/vz/vz_utils.h
+++ b/src/vz/vz_utils.h
@@ -70,8 +70,6 @@ struct _vzConn {
     virCapsPtr caps;
     virDomainXMLOptionPtr xmlopt;
     virObjectEventStatePtr domainEventState;
-    /* Immutable pointer, self-locking APIs */
-    virConnectCloseCallbackDataPtr closeCallback;
     virSysinfoDefPtr hostsysinfo;
     unsigned long vzVersion;
     vzCapabilities vzCaps;
-- 
2.4.3

--
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]