[Spice-devel] [PATCH 01/22] display: replace some dubious asserts

Frediano Ziglio fziglio at redhat.com
Wed Dec 2 08:19:44 PST 2015


From: Marc-André Lureau <marcandre.lureau at gmail.com>

Signed-off-by: Marc-André Lureau <marcandre.lureau at gmail.com>
Signed-off-by: Frediano Ziglio <fziglio at redhat.com>
Acked-by: Jonathon Jongsma <jjongsma at redhat.com>
uri ???
---
 server/display-channel.c | 7 +++++--
 server/red_worker.c      | 4 +---
 2 files changed, 6 insertions(+), 5 deletions(-)

diff --git a/server/display-channel.c b/server/display-channel.c
index a37e651..cecbd44 100644
--- a/server/display-channel.c
+++ b/server/display-channel.c
@@ -944,11 +944,14 @@ int display_channel_wait_for_migrate_data(DisplayChannel *display)
     RedChannel *channel = &display->common.base;
     RedChannelClient *rcc;
 
+    if (!red_channel_waits_for_migrate_data(&display->common.base)) {
+        return FALSE;
+    }
+
     spice_debug(NULL);
-    spice_assert(channel->clients_num == 1);
+    spice_warn_if_fail(channel->clients_num == 1);
 
     rcc = SPICE_CONTAINEROF(ring_get_head(&channel->clients), RedChannelClient, channel_link);
-    spice_assert(red_channel_client_waits_for_migrate_data(rcc));
 
     for (;;) {
         red_channel_client_receive(rcc);
diff --git a/server/red_worker.c b/server/red_worker.c
index ffd1508..f14aaff 100644
--- a/server/red_worker.c
+++ b/server/red_worker.c
@@ -1219,9 +1219,7 @@ static void handle_dev_start(void *opaque, void *payload)
     }
     if (worker->display_channel) {
         worker->display_channel->common.during_target_migrate = FALSE;
-        if (red_channel_waits_for_migrate_data(&worker->display_channel->common.base)) {
-            display_channel_wait_for_migrate_data(worker->display_channel);
-        }
+        display_channel_wait_for_migrate_data(worker->display_channel);
     }
     worker->running = TRUE;
     guest_set_client_capabilities(worker);
-- 
2.4.3



More information about the Spice-devel mailing list