[Spice-devel] [PATCH 2/2 v2] dispatcher: move channel final initialization to red-worker

Christophe Fergeau cfergeau at redhat.com
Fri Mar 25 13:09:23 UTC 2016


On Thu, Mar 24, 2016 at 04:24:04PM +0000, Frediano Ziglio wrote:
> CursorChannel and DisplayChannel was initialized half in red_worker_new
> and half in red_dispatcher_init using some accessor for RedWorker
> (red_worker_get_cursor_channel and red_worker_get_display_channel).
> Moving directly into red_worker_new make easier to follow code path.
> 
> Signed-off-by: Frediano Ziglio <fziglio at redhat.com>
> ---
>  server/red-qxl.c    | 33 ++++++++++++---------------------
>  server/red-worker.c | 30 +++++++++++++++---------------
>  server/red-worker.h |  6 +++---
>  3 files changed, 30 insertions(+), 39 deletions(-)
> 
> Changes from v1:
> - don't move functions to RedWorker.
> 
> diff --git a/server/red-qxl.c b/server/red-qxl.c
> index 8ba6fd6..1d4b044 100644
> --- a/server/red-qxl.c
> +++ b/server/red-qxl.c
> @@ -950,8 +950,8 @@ void red_qxl_gl_draw_async_complete(QXLInstance *qxl)
>  void red_qxl_init(RedsState *reds, QXLInstance *qxl)
>  {
>      QXLState *qxl_state;
> -    RedChannel *channel;
> -    ClientCbs client_cbs = { NULL, };
> +    ClientCbs client_cursor_cbs = { NULL, };
> +    ClientCbs client_display_cbs = { NULL, };
>  
>      spice_return_if_fail(qxl != NULL);
>  
> @@ -983,26 +983,17 @@ void red_qxl_init(RedsState *reds, QXLInstance *qxl)
>      qxl_state->max_monitors = UINT_MAX;
>      qxl->st = qxl_state;
>  
> +    client_cursor_cbs.connect = red_qxl_set_cursor_peer;
> +    client_cursor_cbs.disconnect = red_qxl_disconnect_cursor_peer;
> +    client_cursor_cbs.migrate = red_qxl_cursor_migrate;
> +
> +    client_display_cbs.connect = red_qxl_set_display_peer;
> +    client_display_cbs.disconnect = red_qxl_disconnect_display_peer;
> +    client_display_cbs.migrate = red_qxl_display_migrate;
> +
>      // TODO: reference and free
> -    RedWorker *worker = red_worker_new(qxl);
> -
> -    // TODO: move to their respective channel files

I'd keep that TODO (right before filling the
client_cursor_cbs/client_display_cbs structs).

Acked-by: Christophe Fergeau <cfergeau at redhat.com>

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


More information about the Spice-devel mailing list