[Spice-devel] [PATCH spice-gtk 01/13] migration: add a few more pre-conditions in migration code

Christophe Fergeau cfergeau at redhat.com
Wed Nov 12 03:35:25 PST 2014


ACK.

On Sun, Nov 09, 2014 at 05:31:33PM +0100, Marc-André Lureau wrote:
> Those preconditions help to figure out several issues related to
> migration.
> ---
>  gtk/channel-main.c  | 2 ++
>  gtk/spice-channel.c | 2 ++
>  2 files changed, 4 insertions(+)
> 
> diff --git a/gtk/channel-main.c b/gtk/channel-main.c
> index 1ad090f..62e8905 100644
> --- a/gtk/channel-main.c
> +++ b/gtk/channel-main.c
> @@ -2074,6 +2074,8 @@ static gboolean migrate_connect(gpointer data)
>      g_return_val_if_fail(c != NULL, FALSE);
>  
>      session = spice_channel_get_session(mig->src_channel);
> +    g_return_val_if_fail(session->priv->migration == NULL, FALSE);
> +
>      mig->session = spice_session_new_from_session(session);
>      mig->session->priv->migration_copy = true;
>  
> diff --git a/gtk/spice-channel.c b/gtk/spice-channel.c
> index 6c24bf5..ed18e09 100644
> --- a/gtk/spice-channel.c
> +++ b/gtk/spice-channel.c
> @@ -2495,6 +2495,7 @@ static gboolean channel_connect(SpiceChannel *channel)
>  gboolean spice_channel_connect(SpiceChannel *channel)
>  {
>      g_return_val_if_fail(SPICE_IS_CHANNEL(channel), FALSE);
> +    g_return_val_if_fail(channel->priv->fd == -1, FALSE);
>      SpiceChannelPrivate *c = channel->priv;
>  
>      if (c->state >= SPICE_CHANNEL_STATE_CONNECTING)
> @@ -2522,6 +2523,7 @@ gboolean spice_channel_open_fd(SpiceChannel *channel, int fd)
>  
>      g_return_val_if_fail(SPICE_IS_CHANNEL(channel), FALSE);
>      g_return_val_if_fail(channel->priv != NULL, FALSE);
> +    g_return_val_if_fail(channel->priv->fd == -1, FALSE);
>      g_return_val_if_fail(fd >= -1, FALSE);
>  
>      c = channel->priv;
> -- 
> 1.9.3
> 
> _______________________________________________
> Spice-devel mailing list
> Spice-devel at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/spice-devel
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/spice-devel/attachments/20141112/e4f37531/attachment.sig>


More information about the Spice-devel mailing list