[Spice-devel] [PATCH 1/5] Add red_channel_client_get_channel()

Frediano Ziglio fziglio at redhat.com
Tue Aug 30 15:59:20 UTC 2016


> 
> Don't poke into the structure to get the channel
> 
> This prepares for encapsulating RedChannelClient a bit more and
> separating it into its own source file.
> ---
>  server/cursor-channel.c        |  4 ++--
>  server/dcc-send.c              | 10 +++++----
>  server/dcc.c                   |  4 ++--
>  server/dcc.h                   |  2 +-
>  server/display-channel.c       |  3 +--
>  server/inputs-channel-client.c |  2 +-
>  server/inputs-channel.c        | 14 ++++++-------
>  server/main-channel-client.c   | 47
>  ++++++++++++++++++++++++++----------------
>  server/main-channel.c          | 29 +++++++++++++++-----------
>  server/red-channel.c           | 17 ++++++++++++---
>  server/red-channel.h           |  1 +
>  server/red-qxl.c               | 24 ++++++++++++---------
>  server/red-worker.c            |  3 ++-
>  server/sound.c                 | 27 ++++++++++++++----------
>  server/spicevmc.c              |  6 ++++--
>  server/stream.c                |  6 ++++--
>  16 files changed, 121 insertions(+), 78 deletions(-)
> 

...

> diff --git a/server/dcc-send.c b/server/dcc-send.c
> index 406907b..0a41020 100644
> --- a/server/dcc-send.c
> +++ b/server/dcc-send.c
...

> @@ -2227,11 +2228,12 @@ static void marshall_upgrade(RedChannelClient *rcc,
> SpiceMarshaller *m,
>                               RedUpgradeItem *item)
>  {
>      DisplayChannelClient *dcc = RCC_TO_DCC(rcc);
> +    RedChannel *channel = red_channel_client_get_channel(rcc);
>      RedDrawable *red_drawable;
>      SpiceMsgDisplayDrawCopy copy;
>      SpiceMarshaller *src_bitmap_out, *mask_bitmap_out;
>  
> -    spice_assert(rcc && rcc->channel && item && item->drawable);
> +    spice_assert(rcc && channel && item && item->drawable);

The test for rcc after the call to red_channel_client_get_channel
is now useless.

>      red_channel_client_init_send_data(rcc, SPICE_MSG_DISPLAY_DRAW_COPY,
>      &item->base);
>  
>      red_drawable = item->drawable->red_drawable;

...

Other then that the patch is fine.

Frediano


More information about the Spice-devel mailing list