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

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

 



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

_______________________________________________
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]