[Spice-devel] [PATCH 09/15] Change reds_find_channel() to take RedsState arg

Frediano Ziglio fziglio at redhat.com
Fri Jan 15 03:46:45 PST 2016


> 
> From: Jonathon Jongsma <jjongsma at redhat.com>
> 
> ---
>  server/reds.c | 8 ++++----
>  1 file changed, 4 insertions(+), 4 deletions(-)
> 
> diff --git a/server/reds.c b/server/reds.c
> index c3df9df..ffc9d4e 100644
> --- a/server/reds.c
> +++ b/server/reds.c
> @@ -393,7 +393,7 @@ void reds_unregister_channel(RedsState *reds, RedChannel
> *channel)
>      }
>  }
>  
> -static RedChannel *reds_find_channel(uint32_t type, uint32_t id)
> +static RedChannel *reds_find_channel(RedsState *reds, uint32_t type,
> uint32_t id)
>  {
>      RingItem *now;
>  
> @@ -1422,7 +1422,7 @@ static int reds_send_link_ack(RedLinkInfo *link)
>  
>      ack.error = GUINT32_TO_LE(SPICE_LINK_ERR_OK);
>  
> -    channel = reds_find_channel(link->link_mess->channel_type,
> +    channel = reds_find_channel(reds, link->link_mess->channel_type,
>                                  link->link_mess->channel_id);
>      if (!channel) {
>          if (link->link_mess->channel_type != SPICE_CHANNEL_MAIN) {
> @@ -1804,7 +1804,7 @@ static int reds_link_mig_target_channels(RedClient
> *client)
>          RedChannel *channel;
>  
>          mig_link = SPICE_CONTAINEROF(item, RedsMigPendingLink, ring_link);
> -        channel = reds_find_channel(mig_link->link_msg->channel_type,
> +        channel = reds_find_channel(reds, mig_link->link_msg->channel_type,
>                                      mig_link->link_msg->channel_id);
>          if (!channel) {
>              spice_warning("client %p channel (%d, %d) (type, id) wasn't
>              found",
> @@ -1885,7 +1885,7 @@ static void reds_handle_other_links(RedLinkInfo *link)
>      }
>  
>      // TODO: MC: be less lenient. Tally connections from same connection_id
>      (by same client).
> -    if (!(channel = reds_find_channel(link_mess->channel_type,
> +    if (!(channel = reds_find_channel(reds, link_mess->channel_type,
>                                        link_mess->channel_id))) {
>          reds_send_link_result(link, SPICE_LINK_ERR_CHANNEL_NOT_AVAILABLE);
>          reds_link_free(link);

Acked-by: Frediano Ziglio <fziglio at redhat.com>

Frediano


More information about the Spice-devel mailing list