[Spice-devel] [PATCH spice-gtk] channel: fix critical warning on migration
Christophe Fergeau
cfergeau at redhat.com
Sun Nov 17 23:44:22 PST 2013
On Thu, Nov 14, 2013 at 08:17:06AM -0500, Marc-André Lureau wrote:
>
>
> ----- Original Message -----
> > 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?
>
> It's ok, since it should never happen.
Ok then, ACK.
Christophe
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/spice-devel/attachments/20131118/d21313aa/attachment.pgp>
More information about the Spice-devel
mailing list