[Spice-devel] [PATCH spice-server v4 2/4] fixup! Improve MainChannel encapsulation

Frediano Ziglio fziglio at redhat.com
Tue Oct 18 17:05:59 UTC 2016


> 
> This looks basically the same as the fixup patch that I just sent, but
> mine also includes the change from _peek_ to _get_. Feel free to choose
> this one or mine.
> 
> Jonathon
> 

Got a mix (just space changes of your, there was a long line).

Frediano

> 
> On Tue, 2016-10-18 at 12:13 +0100, Frediano Ziglio wrote:
> > Revert back spice_assert changes.
> > Pass success to main_channel_on_migrate_connected to avoid
> > changing check behaviour.
> > 
> > Signed-off-by: Frediano Ziglio <fziglio at redhat.com>
> > ---
> >  server/main-channel-client.c | 2 +-
> >  server/main-channel.c        | 9 +++++----
> >  server/main-channel.h        | 3 ++-
> >  3 files changed, 8 insertions(+), 6 deletions(-)
> > 
> > diff --git a/server/main-channel-client.c b/server/main-channel-
> > client.c
> > index 28d2839..f74de07 100644
> > --- a/server/main-channel-client.c
> > +++ b/server/main-channel-client.c
> > @@ -439,7 +439,7 @@ void
> > main_channel_client_handle_migrate_connected(MainChannelClient *mcc,
> >  
> >          mcc->priv->mig_wait_connect = FALSE;
> >          mcc->priv->mig_connect_ok = success;
> > -        main_channel_on_migrate_connected(main_channel, seamless &&
> > success);
> > +        main_channel_on_migrate_connected(main_channel, success,
> > seamless);
> >      } else {
> >          if (success) {
> >              spice_printerr("client %p MIGRATE_CANCEL", client);
> > diff --git a/server/main-channel.c b/server/main-channel.c
> > index 2d2783d..fe98b9d 100644
> > --- a/server/main-channel.c
> > +++ b/server/main-channel.c
> > @@ -420,13 +420,14 @@ int
> > main_channel_migrate_src_complete(MainChannel *main_chan, int
> > success)
> >     return semi_seamless_count;
> >  }
> >  
> > -void main_channel_on_migrate_connected(MainChannel *main_channel,
> > gboolean seamless)
> > +void main_channel_on_migrate_connected(MainChannel *main_channel,
> > +                                       gboolean success, gboolean
> > seamless)
> >  {
> > -        g_return_if_fail(main_channel->num_clients_mig_wait);
> > -        g_warn_if_fail(!seamless || main_channel-
> > >num_clients_mig_wait == 1);
> > +        spice_assert(main_channel->num_clients_mig_wait);
> > +        spice_assert(!seamless || main_channel->num_clients_mig_wait
> > == 1);
> >          if (!--main_channel->num_clients_mig_wait) {
> >              reds_on_main_migrate_connected(red_channel_get_server(RE
> > D_CHANNEL(main_channel)),
> > -                                           seamless);
> > +                                           seamless && success);
> >          }
> >  }
> >  
> > diff --git a/server/main-channel.h b/server/main-channel.h
> > index 529e7be..4d0c070 100644
> > --- a/server/main-channel.h
> > +++ b/server/main-channel.h
> > @@ -81,6 +81,7 @@ void main_channel_migrate_cancel_wait(MainChannel
> > *main_chan);
> >  const RedsMigSpice* main_channel_peek_migration_target(MainChannel
> > *main_chan);
> >  /* returns the number of clients for which
> > SPICE_MSG_MAIN_MIGRATE_END was sent*/
> >  int main_channel_migrate_src_complete(MainChannel *main_chan, int
> > success);
> > -void main_channel_on_migrate_connected(MainChannel *main_channel,
> > gboolean seamless);
> > +void main_channel_on_migrate_connected(MainChannel *main_channel,
> > +                                       gboolean success, gboolean
> > seamless);
> >  
> >  #endif
> 


More information about the Spice-devel mailing list