[Spice-devel] [PATCH spice-gtk] channel: fix critical warning on migration

Marc-André Lureau marcandre.lureau at gmail.com
Wed Nov 13 13:13:10 PST 2013


When migrating a channel, all channels are disconnected during reset()
after MAIN_MIGRATED_END. The channel swap on destination will happen
only after MAIN_INIT is completed. During that time, the channel
coroutine can be waiting for socket events, and will have its socket
closed and cleared.

Add a missing channel state check to fix a warning. (fwiw, the coroutine
is then blocked in wait_migration() until migration is fully completed)

(remote-viewer:7061): GLib-GIO-CRITICAL **: g_socket_condition_check:
assertion `G_IS_SOCKET (socket)' failed
---
 gtk/spice-channel.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/gtk/spice-channel.c b/gtk/spice-channel.c
index 41d5eab..9eb7ce5 100644
--- a/gtk/spice-channel.c
+++ b/gtk/spice-channel.c
@@ -2106,6 +2106,9 @@ static gboolean spice_channel_iterate(SpiceChannel *channel)
     SPICE_CHANNEL_GET_CLASS(channel)->iterate_write(channel);
     SPICE_CHANNEL_GET_CLASS(channel)->iterate_read(channel);
 
+    if (c->state == SPICE_CHANNEL_STATE_MIGRATING)
+        return TRUE;
+
     ret = g_socket_condition_check(c->sock, G_IO_IN | G_IO_ERR | G_IO_HUP);
     if (c->state > SPICE_CHANNEL_STATE_CONNECTING &&
         ret & (G_IO_ERR|G_IO_HUP)) {
-- 
1.8.3.1



More information about the Spice-devel mailing list