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

Christophe Fergeau cfergeau at redhat.com
Tue Nov 18 05:07:54 PST 2014


Hey,

On Fri, Nov 14, 2014 at 12:32:24AM +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 | 3 +++
>  2 files changed, 5 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..fd52683 100644
> --- a/gtk/spice-channel.c
> +++ b/gtk/spice-channel.c
> @@ -2500,6 +2500,8 @@ gboolean spice_channel_connect(SpiceChannel *channel)
>      if (c->state >= SPICE_CHANNEL_STATE_CONNECTING)
>          return TRUE;
>  
> +    g_return_val_if_fail(channel->priv->fd == -1, FALSE);
> +

For the record, this part of te patch was changed since v1, which is
good as with v1, this check was triggered with virt-viewer -c
qemu+ssh://

Christophe
-------------- 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/20141118/c772ae5d/attachment.sig>


More information about the Spice-devel mailing list