[Spice-devel] [PATCH 4/4] channel: use iface parameter to distinguish interface context

Christophe Fergeau cfergeau at redhat.com
Wed Jan 6 09:09:24 PST 2016


On Mon, Dec 21, 2015 at 10:33:12AM +0000, Frediano Ziglio wrote:
> ---
>  server/red-worker.c | 12 +++++-------
>  1 file changed, 5 insertions(+), 7 deletions(-)
> 
> diff --git a/server/red-worker.c b/server/red-worker.c
> index b0b7df1..0347404 100644
> --- a/server/red-worker.c
> +++ b/server/red-worker.c
> @@ -71,6 +71,7 @@ struct RedWorker {
>      QXLInstance *qxl;
>      RedDispatcher *red_dispatcher;
>      int running;
> +    SpiceCoreInterfaceInternal core;
>      struct pollfd poll_fds[MAX_EVENT_SOURCES];
>      struct SpiceWatch watches[MAX_EVENT_SOURCES];
>      unsigned int event_timeout;
> @@ -534,16 +535,12 @@ static void worker_watch_update_mask(SpiceWatch *watch, int event_mask)
>  static SpiceWatch *worker_watch_add(const SpiceCoreInterfaceInternal *iface,
>                                      int fd, int event_mask, SpiceWatchFunc func, void *opaque)
>  {
> +    RedWorker *worker = SPICE_CONTAINEROF(iface, RedWorker, core);
>      /* Since we are a channel core implementation, we always get called from
>         red_channel_client_create(), so opaque always is our rcc */
>      RedChannelClient *rcc = opaque;

I would remove this, or at least move this to the block where it's used
(some debug statement in an error case).

Christophe
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/spice-devel/attachments/20160106/4ab2c786/attachment.sig>


More information about the Spice-devel mailing list