[Spice-devel] [PATCH 3.8/12] CursorChannel* arg in cursor_channel_client_new()

Frediano Ziglio fziglio at redhat.com
Fri Oct 30 04:43:18 PDT 2015


> 
> On Fri, Oct 30, 2015 at 03:30:40AM -0400, Frediano Ziglio wrote:
> > 
> > > 
> > > From: Marc-André Lureau <marcandre.lureau at gmail.com>
> > > 
> > > Instead of passing a CommonChannel* argument, use CursorChannel* since
> > > this function is only valid for CursorChannels.
> > > 
> > > Signed-off-by: Jonathon Jongsma <jjongsma at redhat.com>
> > > ---
> > >  server/cursor-channel.c | 5 ++---
> > >  server/cursor-channel.h | 2 +-
> > >  server/red_worker.c     | 2 +-
> > >  3 files changed, 4 insertions(+), 5 deletions(-)
> > > 
> > > diff --git a/server/cursor-channel.c b/server/cursor-channel.c
> > > index 9c4bf1e..4811b79 100644
> > > --- a/server/cursor-channel.c
> > > +++ b/server/cursor-channel.c
> > > @@ -385,14 +385,13 @@ CursorChannel* cursor_channel_new(RedWorker
> > > *worker)
> > >      return cursor;
> > >  }
> > >  
> > > -CursorChannelClient *cursor_channel_client_new(CommonChannel *common,
> > > -                                               RedClient *client,
> > > RedsStream
> > > *stream,
> > > +CursorChannelClient* cursor_channel_client_new(CursorChannel *cursor,
> > > RedClient *client, RedsStream *stream,
> > >                                                 int mig_target,
> > >                                                 uint32_t *common_caps,
> > >                                                 int
> > >                                                 num_common_caps,
> > >                                                 uint32_t *caps, int
> > >                                                 num_caps)
> > >  {
> > >      CursorChannelClient *ccc =
> > > -        (CursorChannelClient*)common_channel_new_client(common,
> > > +        (CursorChannelClient*)common_channel_new_client(&cursor->common,
> > >                                                          sizeof(CursorChannelClient),
> > >                                                          client, stream,
> > >                                                          mig_target,
> > > diff --git a/server/cursor-channel.h b/server/cursor-channel.h
> > > index 213f124..9a22c19 100644
> > > --- a/server/cursor-channel.h
> > > +++ b/server/cursor-channel.h
> > > @@ -84,7 +84,7 @@ void                 cursor_channel_reset
> > > (CursorChannel *cursor);
> > >  void                 cursor_channel_process_cmd (CursorChannel *cursor,
> > >  RedCursorCmd *cursor_cmd,
> > >                                                   uint32_t group_id);
> > >  
> > > -CursorChannelClient *cursor_channel_client_new(CommonChannel *common,
> > > +CursorChannelClient* cursor_channel_client_new(CursorChannel *cursor,
> > >                                                 RedClient *client,
> > >                                                 RedsStream
> > >                                                 *stream,
> > >                                                 int mig_target,
> > >                                                 uint32_t *common_caps,
> > >                                                 int
> > >                                                 num_common_caps,
> > > diff --git a/server/red_worker.c b/server/red_worker.c
> > > index 52fe132..495e452 100644
> > > --- a/server/red_worker.c
> > > +++ b/server/red_worker.c
> > > @@ -9921,7 +9921,7 @@ static void red_connect_cursor(RedWorker *worker,
> > > RedClient *client, RedsStream
> > >      }
> > >      channel = worker->cursor_channel;
> > >      spice_info("add cursor channel client");
> > > -    ccc = cursor_channel_client_new(&channel->common, client, stream,
> > > +    ccc = cursor_channel_client_new(channel, client, stream,
> > >                                      migrate,
> > >                                      common_caps, num_common_caps,
> > >                                      caps, num_caps);
> > > --
> > > 2.4.3
> > > 
> > 
> > Acked
> 
> NB: This adds a 'CursorChannel *cursor' which you commented on in other
> patches.
> 
> Christophe
> 

Opps... not a good reason to repeat same mistake again...

Frediano


More information about the Spice-devel mailing list