Blame SOURCES/0003-main_dispatcher-add-ref-count-protection-to-RedClien.patch

4c08dd
From 06ba03b7b32a2f0c7f78c82d8f399242526a0b45 Mon Sep 17 00:00:00 2001
4c08dd
From: Yonit Halperin <yhalperi@redhat.com>
4c08dd
Date: Fri, 26 Jul 2013 13:49:24 -0400
4c08dd
Subject: [PATCH 3/8] main_dispatcher: add ref count protection to RedClient
4c08dd
 instances
4c08dd
4c08dd
---
4c08dd
 server/main_dispatcher.c | 6 ++++--
4c08dd
 1 file changed, 4 insertions(+), 2 deletions(-)
4c08dd
4c08dd
diff --git a/server/main_dispatcher.c b/server/main_dispatcher.c
4c08dd
index e7a451a..bf160dd 100644
4c08dd
--- a/server/main_dispatcher.c
4c08dd
+++ b/server/main_dispatcher.c
4c08dd
@@ -97,6 +97,7 @@ static void main_dispatcher_handle_migrate_complete(void *opaque,
4c08dd
     MainDispatcherMigrateSeamlessDstCompleteMessage *mig_complete = payload;
4c08dd
 
4c08dd
     reds_on_client_seamless_migrate_complete(mig_complete->client);
4c08dd
+    red_client_unref(mig_complete->client);
4c08dd
 }
4c08dd
 
4c08dd
 static void main_dispatcher_handle_mm_time_latency(void *opaque,
4c08dd
@@ -104,6 +105,7 @@ static void main_dispatcher_handle_mm_time_latency(void *opaque,
4c08dd
 {
4c08dd
     MainDispatcherMmTimeLatencyMessage *msg = payload;
4c08dd
     reds_set_client_mm_time_latency(msg->client, msg->latency);
4c08dd
+    red_client_unref(msg->client);
4c08dd
 }
4c08dd
 
4c08dd
 void main_dispatcher_seamless_migrate_dst_complete(RedClient *client)
4c08dd
@@ -115,7 +117,7 @@ void main_dispatcher_seamless_migrate_dst_complete(RedClient *client)
4c08dd
         return;
4c08dd
     }
4c08dd
 
4c08dd
-    msg.client = client;
4c08dd
+    msg.client = red_client_ref(client);
4c08dd
     dispatcher_send_message(&main_dispatcher.base, MAIN_DISPATCHER_MIGRATE_SEAMLESS_DST_COMPLETE,
4c08dd
                             &msg;;
4c08dd
 }
4c08dd
@@ -129,7 +131,7 @@ void main_dispatcher_set_mm_time_latency(RedClient *client, uint32_t latency)
4c08dd
         return;
4c08dd
     }
4c08dd
 
4c08dd
-    msg.client = client;
4c08dd
+    msg.client = red_client_ref(client);
4c08dd
     msg.latency = latency;
4c08dd
     dispatcher_send_message(&main_dispatcher.base, MAIN_DISPATCHER_SET_MM_TIME_LATENCY,
4c08dd
                             &msg;;
4c08dd
-- 
4c08dd
1.8.3.1
4c08dd