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

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

 



On Wed, Nov 13, 2013 at 10:13:10PM +0100, Marc-André Lureau wrote:
> 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;
> +

spice_channel_iterate_read() which may be called right before the check you
add is calling
g_coroutine_socket_wait(&c->coroutine, c->sock, G_IO_IN);
Is it ok to do in the situation you describe?

Christophe

Attachment: pgpiNc_le7FfL.pgp
Description: PGP signature

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