[Spice-devel] [PATCH 13/18] display: replace some dubious asserts
Frediano Ziglio
fziglio at redhat.com
Wed Nov 25 08:51:59 PST 2015
Signed-off-by: Marc-André Lureau <marcandre.lureau at gmail.com>
Signed-off-by: Frediano Ziglio <fziglio at redhat.com>
---
server/display-channel.c | 7 +++++--
server/red_worker.c | 4 +---
2 files changed, 6 insertions(+), 5 deletions(-)
Changes:
- move checks from worker to display;
- remove the assert, it's now redundant.
diff --git a/server/display-channel.c b/server/display-channel.c
index 1be3334..3044ead 100644
--- a/server/display-channel.c
+++ b/server/display-channel.c
@@ -860,11 +860,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 678b581..e14318e 100644
--- a/server/red_worker.c
+++ b/server/red_worker.c
@@ -4047,9 +4047,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