[Spice-devel] [PATCH 01/15] Pass 'reds' as opaque data in vdi port char device

Pavel Grunt pgrunt at redhat.com
Tue Jan 19 00:59:29 PST 2016


On Mon, 2016-01-18 at 16:37 +0000, Frediano Ziglio wrote:
> From: Jonathon Jongsma <jjongsma at redhat.com>
> 
> This allows us to access the RedsState variable non-globally without
> changing the signature of the callback functions.

Acked-by: Pavel Grunt <pgrunt at redhat.com>

> ---
>  server/reds.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/server/reds.c b/server/reds.c
> index 9868928..25e9f90 100644
> --- a/server/reds.c
> +++ b/server/reds.c
> @@ -733,6 +733,7 @@ static void vdi_port_read_buf_unref(VDIReadBuf
> *buf)
>  static SpiceCharDeviceMsgToClient
> *vdi_port_read_one_msg_from_device(SpiceCharDeviceInstance *sin,
>                                                                      
>  void *opaque)
>  {
> +    RedsState *reds = opaque;
>      VDIPortState *state = &reds->agent_state;
>      SpiceCharDeviceInterface *sif;
>      VDIReadBuf *dispatch_buf;
> @@ -2987,7 +2988,7 @@ static SpiceCharDeviceState
> *attach_to_red_agent(SpiceCharDeviceInstance *sin)
>                                                       REDS_TOKENS_TO_
> SEND,
>                                                       REDS_NUM_INTERN
> AL_AGENT_MESSAGES,
>                                                       &char_dev_state
> _cbs,
> -                                                     NULL);
> +                                                     reds);
>      } else {
>          spice_char_device_state_reset_dev_instance(state->base,
> sin);
>      }


More information about the Spice-devel mailing list