Re: [PATCH spice-server 3/3] reds: Check QXL ID registering interface

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, Feb 13, 2019 at 02:53:16PM +0000, Frediano Ziglio wrote:
> Avoid to register multiple interface with the same ID.
> This would results in issue as 2 channels would have same

"This would result in issues as 2 channels would have the same"

> (channel_type, channel_id) which should be unique.

"which must be"

> Qemu always allocate QXL interface with IDs from 0.

"allocates", "starting from 0"

Acked-by: Christophe Fergeau <cfergeau@xxxxxxxxxx>

> 
> Signed-off-by: Frediano Ziglio <fziglio@xxxxxxxxxx>
> ---
>  server/reds.c | 8 ++++++++
>  1 file changed, 8 insertions(+)
> 
> diff --git a/server/reds.c b/server/reds.c
> index fbc21f7be..2e5c69e60 100644
> --- a/server/reds.c
> +++ b/server/reds.c
> @@ -3378,6 +3378,14 @@ SPICE_GNUC_VISIBLE int spice_server_add_interface(SpiceServer *reds,
>          }
>  
>          qxl = SPICE_UPCAST(QXLInstance, sin);
> +        if (qxl->id < 0) {
> +            spice_warning("invalid QXL ID");
> +            return -1;
> +        }
> +        if (reds_find_channel(reds, SPICE_CHANNEL_DISPLAY, qxl->id)) {
> +            spice_warning("QXL ID already allocated");
> +            return -1;
> +        }
>          red_qxl_init(reds, qxl);
>          reds->qxl_instances = g_list_prepend(reds->qxl_instances, qxl);
>  
> -- 
> 2.20.1
> 
> _______________________________________________
> Spice-devel mailing list
> Spice-devel@xxxxxxxxxxxxxxxxxxxxx
> https://lists.freedesktop.org/mailman/listinfo/spice-devel

Attachment: signature.asc
Description: PGP signature

_______________________________________________
Spice-devel mailing list
Spice-devel@xxxxxxxxxxxxxxxxxxxxx
https://lists.freedesktop.org/mailman/listinfo/spice-devel

[Index of Archives]     [Linux Virtualization]     [Linux Virtualization]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]     [Monitors]