[Spice-devel] [PATCH spice-gtk v2 13/19] migration: don't check socket error

Marc-André Lureau marcandre.lureau at redhat.com
Thu Nov 13 15:32:36 PST 2014


During migration, the original socket is closed before the coroutine
finishes, so it's not guaranteed that c->sock will still be set when the
channel is in an error state in spice_channel_iterate().
---
 gtk/spice-channel.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/gtk/spice-channel.c b/gtk/spice-channel.c
index 4fbcb18..115efda 100644
--- a/gtk/spice-channel.c
+++ b/gtk/spice-channel.c
@@ -2140,6 +2140,10 @@ static gboolean spice_channel_iterate(SpiceChannel *channel)
 
     if (c->has_error) {
         GIOCondition ret;
+
+        if (!c->sock)
+            return FALSE;
+
         /* We don't want to report an error if the socket was closed gracefully
          * on the other end (VM shutdown) */
         ret = g_socket_condition_check(c->sock, G_IO_IN | G_IO_ERR | G_IO_HUP);
-- 
1.9.3



More information about the Spice-devel mailing list