[Spice-devel] [PATCH 6/9] remove CommonGraphicsChannelClient structure

Jonathon Jongsma jjongsma at redhat.com
Fri Aug 5 20:49:47 UTC 2016


Acked-by: Jonathon Jongsma <jjongsma at redhat.com>


On Thu, 2016-08-04 at 16:17 -0500, Jonathon Jongsma wrote:
> From: Frediano Ziglio <fziglio at redhat.com>
> 
> Was just containing a RedChannelClient field
> 
> Signed-off-by: Frediano Ziglio <fziglio at redhat.com>
> ---
>  server/cache-item.tmpl.c |  2 +-
>  server/cursor-channel.c  |  4 ++--
>  server/dcc-private.h     |  2 +-
>  server/dcc.c             | 10 +++++-----
>  server/red-worker.h      |  4 ----
>  server/stream.c          |  2 +-
>  6 files changed, 10 insertions(+), 14 deletions(-)
> 
> diff --git a/server/cache-item.tmpl.c b/server/cache-item.tmpl.c
> index 2e6f5ca..d1310a5 100644
> --- a/server/cache-item.tmpl.c
> +++ b/server/cache-item.tmpl.c
> @@ -78,7 +78,7 @@ static void FUNC_NAME(remove)(CHANNELCLIENT
> *channel_client, RedCacheItem *item)
>      channel_client->VAR_NAME(available) += item->u.cache_data.size;
>  
>      red_pipe_item_init(&item->u.pipe_data,
> RED_PIPE_ITEM_TYPE_INVAL_ONE);
> -    red_channel_client_pipe_add_tail_and_push(&channel_client-
> >common.base, &item->u.pipe_data); // for now
> +    red_channel_client_pipe_add_tail_and_push(&channel_client->base, 
> &item->u.pipe_data); // for now
>  }
>  
>  static int FUNC_NAME(add)(CHANNELCLIENT *channel_client, uint64_t
> id, size_t size)
> diff --git a/server/cursor-channel.c b/server/cursor-channel.c
> index ce1ea97..dac929a 100644
> --- a/server/cursor-channel.c
> +++ b/server/cursor-channel.c
> @@ -68,7 +68,7 @@ struct CursorChannel {
>  };
>  
>  struct CursorChannelClient {
> -    CommonGraphicsChannelClient common;
> +    RedChannelClient base;
>  
>      RedCacheItem *cursor_cache[CURSOR_CACHE_HASH_SIZE];
>      Ring cursor_cache_lru;
> @@ -77,7 +77,7 @@ struct CursorChannelClient {
>  };
>  
>  
> -#define RCC_TO_CCC(rcc) SPICE_CONTAINEROF((rcc),
> CursorChannelClient, common.base)
> +#define RCC_TO_CCC(rcc) SPICE_CONTAINEROF((rcc),
> CursorChannelClient, base)
>  
>  #define CLIENT_CURSOR_CACHE
>  #include "cache-item.tmpl.c"
> diff --git a/server/dcc-private.h b/server/dcc-private.h
> index dbe88aa..02b51dd 100644
> --- a/server/dcc-private.h
> +++ b/server/dcc-private.h
> @@ -24,7 +24,7 @@
>  #include "stream.h"
>  
>  struct DisplayChannelClient {
> -    CommonGraphicsChannelClient common;
> +    RedChannelClient base;
>      int is_low_bandwidth;
>      uint32_t id;
>      SpiceImageCompression image_compression;
> diff --git a/server/dcc.c b/server/dcc.c
> index fe9551e..d387e8b 100644
> --- a/server/dcc.c
> +++ b/server/dcc.c
> @@ -544,15 +544,15 @@ void
> dcc_push_monitors_config(DisplayChannelClient *dcc)
>          return;
>      }
>  
> -    if (!red_channel_client_test_remote_cap(&dcc->common.base,
> +    if (!red_channel_client_test_remote_cap(&dcc->base,
>                                              SPICE_DISPLAY_CAP_MONITO
> RS_CONFIG)) {
>          return;
>      }
>  
> -    mci = red_monitors_config_item_new(dcc->common.base.channel,
> +    mci = red_monitors_config_item_new(dcc->base.channel,
>                                         monitors_config_ref(dc-
> >monitors_config));
> -    red_channel_client_pipe_add(&dcc->common.base, &mci->pipe_item);
> -    red_channel_client_push(&dcc->common.base);
> +    red_channel_client_pipe_add(&dcc->base, &mci->pipe_item);
> +    red_channel_client_push(&dcc->base);
>  }
>  
>  static RedSurfaceDestroyItem
> *red_surface_destroy_item_new(RedChannel *channel,
> @@ -747,7 +747,7 @@ int dcc_compress_image(DisplayChannelClient *dcc,
>          goto lz_compress;
>  #ifdef USE_LZ4
>      case SPICE_IMAGE_COMPRESSION_LZ4:
> -        if (red_channel_client_test_remote_cap(&dcc->common.base,
> +        if (red_channel_client_test_remote_cap(&dcc->base,
>                                                 SPICE_DISPLAY_CAP_LZ4
> _COMPRESSION)) {
>              success = image_encoders_compress_lz4(&dcc->encoders,
> dest, src, o_comp_data);
>              break;
> diff --git a/server/red-worker.h b/server/red-worker.h
> index 60bdbec..368bfa1 100644
> --- a/server/red-worker.h
> +++ b/server/red-worker.h
> @@ -24,10 +24,6 @@
>  
>  typedef struct RedWorker RedWorker;
>  
> -typedef struct CommonGraphicsChannelClient {
> -    RedChannelClient base;
> -} CommonGraphicsChannelClient;
> -
>  int common_channel_config_socket(RedChannelClient *rcc);
>  
>  #define COMMON_CLIENT_TIMEOUT (NSEC_PER_SEC * 30)
> diff --git a/server/stream.c b/server/stream.c
> index 547ce5b..e3c4ff6 100644
> --- a/server/stream.c
> +++ b/server/stream.c
> @@ -691,7 +691,7 @@ static void update_client_playback_delay(void
> *opaque, uint32_t delay_ms)
>  {
>      StreamAgent *agent = opaque;
>      DisplayChannelClient *dcc = agent->dcc;
> -    RedsState *reds =
> red_channel_get_server(((RedChannelClient*)dcc)->channel);
> +    RedsState *reds =
> red_channel_get_server(RED_CHANNEL_CLIENT(dcc)->channel);
>  
>      dcc_update_streams_max_latency(dcc, agent);
>  


More information about the Spice-devel mailing list