[PATCH] channel: support multiple clients for red_channel_is_waiting_for_migrate_data

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

 



Signed-off-by: Frediano Ziglio <fziglio@xxxxxxxxxx>
---
 server/red-channel.c | 21 ++++++++++++++-------
 1 file changed, 14 insertions(+), 7 deletions(-)

diff --git a/server/red-channel.c b/server/red-channel.c
index 7dfb9bf..18f890f 100644
--- a/server/red-channel.c
+++ b/server/red-channel.c
@@ -963,20 +963,27 @@ int red_channel_client_is_waiting_for_migrate_data(RedChannelClient *rcc)
     return rcc->wait_migrate_data;
 }
 
+/**
+ * Returns TRUE is at least one client is waiting for migration data
+ */
 int red_channel_is_waiting_for_migrate_data(RedChannel *channel)
 {
-    RedChannelClient *rcc;
+    RingItem *link, *next;
 
-    if (!red_channel_is_connected(channel)) {
+    if (!channel) {
         return FALSE;
     }
 
-    if (channel->clients_num > 1) {
-        return FALSE;
+    RING_FOREACH_SAFE(link, next, &channel->clients) {
+        RedChannelClient *rcc;
+
+        rcc = SPICE_CONTAINEROF(link, RedChannelClient, channel_link);
+        if (red_channel_client_is_waiting_for_migrate_data(rcc)) {
+            return TRUE;
+        }
     }
-    spice_assert(channel->clients_num == 1);
-    rcc = SPICE_CONTAINEROF(ring_get_head(&channel->clients), RedChannelClient, channel_link);
-    return red_channel_client_is_waiting_for_migrate_data(rcc);
+
+    return FALSE;
 }
 
 static void red_channel_client_default_connect(RedChannel *channel, RedClient *client,
-- 
2.4.3

_______________________________________________
Spice-devel mailing list
Spice-devel@xxxxxxxxxxxxxxxxxxxxx
http://lists.freedesktop.org/mailman/listinfo/spice-devel




[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]     [Monitors]