[Spice-devel] [PATCH spice-server 3/3] red-worker: Reuse code to process display command

Christophe Fergeau cfergeau at redhat.com
Fri Jan 20 09:55:03 UTC 2017


On Tue, Jan 10, 2017 at 03:59:38PM +0000, Frediano Ziglio wrote:
> Code to read and process display commands were the same
> so use a common function for better reuse.
> 
> Signed-off-by: Frediano Ziglio <fziglio at redhat.com>
> ---
>  server/red-worker.c | 38 ++++++++++++++++++--------------------
>  1 file changed, 18 insertions(+), 20 deletions(-)
> 
> diff --git a/server/red-worker.c b/server/red-worker.c
> index 394a935..49ec8e8 100644
> --- a/server/red-worker.c
> +++ b/server/red-worker.c
> @@ -169,6 +169,19 @@ static RedDrawable *red_drawable_new(QXLInstance *qxl)
>      return red;
>  }
>  
> +static gboolean red_process_surface_cmd(RedWorker *worker, QXLCommandExt *ext, gboolean loadvm)
> +{
> +    RedSurfaceCmd surface_cmd;
> +
> +    if (red_get_surface_cmd(&worker->mem_slots, ext->group_id, &surface_cmd, ext->cmd.data)) {
> +        return FALSE;
> +    }
> +    display_channel_process_surface_cmd(worker->display_channel, &surface_cmd, loadvm);
> +    // do not release resource as is released inside display_channel_process_surface_cmd

I'd use this as an opportunity to improve that comment to something
like:

// do not release resource ('release_info_ext') as it will be released inside
// display_channel_surface_unref() once the last reference is dropped


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: 801 bytes
Desc: not available
URL: <https://lists.freedesktop.org/archives/spice-devel/attachments/20170120/e99f7949/attachment.sig>


More information about the Spice-devel mailing list