[Spice-devel] [PATCH 19/23] remove release_item callback

Jonathon Jongsma jjongsma at redhat.com
Tue May 17 20:08:45 UTC 2016


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

On Mon, 2016-05-16 at 14:31 +0100, Frediano Ziglio wrote:
> Just a call to red_pipe_item_unref.
> 
> Signed-off-by: Frediano Ziglio <fziglio at redhat.com>
> ---
>  server/red-channel.c | 19 +------------------
>  server/red-channel.h |  3 ---
>  2 files changed, 1 insertion(+), 21 deletions(-)
> 
> diff --git a/server/red-channel.c b/server/red-channel.c
> index 0d35fc0..4d7c1b1 100644
> --- a/server/red-channel.c
> +++ b/server/red-channel.c
> @@ -583,16 +583,7 @@ static void red_channel_client_send_item(RedChannelClient
> *rcc, RedPipeItem *ite
>  
>  static void red_channel_client_release_item(RedChannelClient *rcc,
> RedPipeItem *item, int item_pushed)
>  {
> -    switch (item->type) {
> -        case RED_PIPE_ITEM_TYPE_SET_ACK:
> -        case RED_PIPE_ITEM_TYPE_EMPTY_MSG:
> -        case RED_PIPE_ITEM_TYPE_MIGRATE:
> -        case RED_PIPE_ITEM_TYPE_PING:
> -            free(item);
> -            break;
> -        default:
> -            rcc->channel->channel_cbs.release_item(rcc, item, item_pushed);
> -    }
> +    red_pipe_item_unref(item);
>  }
>  
>  static inline void red_channel_client_release_sent_item(RedChannelClient
> *rcc)
> @@ -1016,11 +1007,6 @@ void
> red_channel_client_default_migrate(RedChannelClient *rcc)
>      red_channel_client_pipe_add_type(rcc, RED_PIPE_ITEM_TYPE_MIGRATE);
>  }
>  
> -static void red_channel_release_item(RedChannelClient *rcc, RedPipeItem
> *item, int item_pushed)
> -{
> -    red_pipe_item_unref(item);
> -}
> -
>  RedChannel *red_channel_create(int size,
>                                 RedsState *reds,
>                                 const SpiceCoreInterfaceInternal *core,
> @@ -1045,9 +1031,6 @@ RedChannel *red_channel_create(int size,
>      channel->handle_acks = handle_acks;
>      channel->migration_flags = migration_flags;
>      memcpy(&channel->channel_cbs, channel_cbs, sizeof(ChannelCbs));
> -    if (!channel->channel_cbs.release_item) {
> -        channel->channel_cbs.release_item = red_channel_release_item;
> -    }
>  
>      channel->reds = reds;
>      channel->core = core;
> diff --git a/server/red-channel.h b/server/red-channel.h
> index 03e6407..63cb2d9 100644
> --- a/server/red-channel.h
> +++ b/server/red-channel.h
> @@ -159,8 +159,6 @@ typedef void (*channel_disconnect_proc)(RedChannelClient
> *rcc);
>  typedef int (*channel_configure_socket_proc)(RedChannelClient *rcc);
>  typedef void (*channel_send_pipe_item_proc)(RedChannelClient *rcc,
> RedPipeItem *item);
>  typedef void (*channel_hold_pipe_item_proc)(RedChannelClient *rcc,
> RedPipeItem *item);
> -typedef void (*channel_release_pipe_item_proc)(RedChannelClient *rcc,
> -                                               RedPipeItem *item, int
> item_pushed);
>  typedef void (*channel_on_incoming_error_proc)(RedChannelClient *rcc);
>  typedef void (*channel_on_outgoing_error_proc)(RedChannelClient *rcc);
>  
> @@ -188,7 +186,6 @@ typedef struct {
>      channel_disconnect_proc on_disconnect;
>      channel_send_pipe_item_proc send_item;
>      channel_hold_pipe_item_proc hold_item;
> -    channel_release_pipe_item_proc release_item;
>      channel_alloc_msg_recv_buf_proc alloc_recv_buf;
>      channel_release_msg_recv_buf_proc release_recv_buf;
>      channel_handle_migrate_flush_mark_proc handle_migrate_flush_mark;


More information about the Spice-devel mailing list