[Spice-devel] [PATCH spice-server 08/10] red_channel: add spice_channel_client_error

Marc-André Lureau marcandre.lureau at gmail.com
Wed May 8 07:46:16 PDT 2013


ack


On Wed, May 8, 2013 at 4:06 PM, Yonit Halperin <yhalperi at redhat.com> wrote:

> spice_channel_client_error prints warning and shutdowns the
> channel_client that hit the error.
> This macro is useful for errors that are specific for one session
> and that are unrecoverable only with respect to this session.
> Prefer disconnecting a client over aborting when possible.
> ---
>  server/red_channel.h | 11 +++++++++++
>  1 file changed, 11 insertions(+)
>
> diff --git a/server/red_channel.h b/server/red_channel.h
> index f770510..ba299b6 100644
> --- a/server/red_channel.h
> +++ b/server/red_channel.h
> @@ -328,6 +328,17 @@ struct RedChannel {
>  #endif
>  };
>
> +/*
> + * When an error occurs over a channel, we treat it as a warning
> + * for spice-server and shutdown the channel.
> + */
> +#define spice_channel_client_error(rcc, format, ...)
>                 \
> +    do {
>                 \
> +        spice_warning("rcc %p type %u id %u: " format, rcc,
>                \
> +                    rcc->channel->type, rcc->channel->id, ##
> __VA_ARGS__);               \
> +        red_channel_client_shutdown(rcc);
>                \
> +    } while (0)
> +
>  /* if one of the callbacks should cause disconnect, use
> red_channel_shutdown and don't
>   * explicitly destroy the channel */
>  RedChannel *red_channel_create(int size,
> --
> 1.8.1.4
>
> _______________________________________________
> Spice-devel mailing list
> Spice-devel at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/spice-devel
>



-- 
Marc-André Lureau
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/spice-devel/attachments/20130508/d023fcd4/attachment.html>


More information about the Spice-devel mailing list