Blame SOURCES/libvirt-remote-Move-the-call-to-remoteClientFreePrivateCallbacks-from-FreeFunc-to-CloseFunc.patch

c54141
From e58f9ff38cdf81aec5cb627575b0203ce41ab29b Mon Sep 17 00:00:00 2001
c54141
Message-Id: <e58f9ff38cdf81aec5cb627575b0203ce41ab29b@dist-git>
c54141
From: "xinhua.Cao" <caoxinhua@huawei.com>
c54141
Date: Mon, 20 Aug 2018 10:09:00 -0400
c54141
Subject: [PATCH] remote: Move the call to remoteClientFreePrivateCallbacks
c54141
 from FreeFunc to CloseFunc
c54141
c54141
RHEL 7.6 https://bugzilla.redhat.com/show_bug.cgi?id=1610612
c54141
RHEL 7.5.z https://bugzilla.redhat.com/show_bug.cgi?id=1619206
c54141
c54141
Still because of commit id 'fe8f1c8b' where we generate a REF for the
c54141
Register and that's transparent to the consumer (e.g. how would they
c54141
know they need to ensure that Deregister is called), thus the purpose of
c54141
this patch is to find a way to Deregister if it's determined that the
c54141
consumer hasn't by the time of the "last" REF we'd have.
c54141
c54141
This solution to this problem is to alter the processing to have the
c54141
remoteClientCloseFunc handle performing the Deregister calls instead of
c54141
the remoteClientFreeFunc because there's no way FreeFunc would be called
c54141
unless the Deregister was already called.
c54141
c54141
(cherry picked from commit 1fd1b7661055577071aab36653eb8f2c2ddda804)
c54141
Signed-off-by: John Ferlan <jferlan@redhat.com>
c54141
Reviewed-by: Jiri Denemark <jdenemar@redhat.com>
c54141
---
c54141
 daemon/remote.c | 10 ++++++----
c54141
 1 file changed, 6 insertions(+), 4 deletions(-)
c54141
c54141
diff --git a/daemon/remote.c b/daemon/remote.c
c54141
index 70e1227f13..eb2f95f375 100644
c54141
--- a/daemon/remote.c
c54141
+++ b/daemon/remote.c
c54141
@@ -1737,11 +1737,9 @@ void remoteClientFreeFunc(void *data)
c54141
 {
c54141
     struct daemonClientPrivate *priv = data;
c54141
 
c54141
-    /* Deregister event delivery callback */
c54141
-    if (priv->conn) {
c54141
-        remoteClientFreePrivateCallbacks(priv);
c54141
+    if (priv->conn)
c54141
         virConnectClose(priv->conn);
c54141
-    }
c54141
+
c54141
     VIR_FREE(priv);
c54141
 }
c54141
 
c54141
@@ -1751,6 +1749,10 @@ static void remoteClientCloseFunc(virNetServerClientPtr client)
c54141
     struct daemonClientPrivate *priv = virNetServerClientGetPrivateData(client);
c54141
 
c54141
     daemonRemoveAllClientStreams(priv->streams);
c54141
+
c54141
+    /* Deregister event delivery callback */
c54141
+    if (priv->conn)
c54141
+        remoteClientFreePrivateCallbacks(priv);
c54141
 }
c54141
 
c54141
 
c54141
-- 
c54141
2.18.0
c54141