[Spice-devel] [PATCH] server: red_dispatcher: check major/minor of qxl for client_monitors_config

Alon Levy alevy at redhat.com
Fri Oct 12 06:48:29 PDT 2012


> This solves a problem with new spice-server and old qemu-kvm, where
> spice thinks
> qif->client_monitors_config exists, while it does not exist in
> qemu-kvm.
> 
> Also "major > required_major" was added to the condition.
> Also only the specific RedDispatcher is checked (and not all
> dispatchers).

ACK

> ---
>  server/red_dispatcher.c |   21 +++++++--------------
>  1 files changed, 7 insertions(+), 14 deletions(-)
> 
> diff --git a/server/red_dispatcher.c b/server/red_dispatcher.c
> index 39d05ab..97e9737 100644
> --- a/server/red_dispatcher.c
> +++ b/server/red_dispatcher.c
> @@ -83,20 +83,13 @@ extern spice_wan_compression_t zlib_glz_state;
>  
>  static RedDispatcher *dispatchers = NULL;
>  
> -static int red_dispatcher_version_check(int major, int minor)
> +static int red_dispatcher_check_qxl_version(RedDispatcher *rd, int
> major, int minor)
>  {
> -    if (num_active_workers > 0) {
> -        RedDispatcher *now = dispatchers;
> -        while (now) {
> -            if (now->base.major_version != major ||
> -                now->base.minor_version < minor) {
> -                return FALSE;
> -            }
> -            now = now->next;
> -        }
> -        return TRUE;
> -    }
> -    return FALSE;
> +    int qxl_major = rd->qxl->st->qif->base.major_version;
> +    int qxl_minor = rd->qxl->st->qif->base.minor_version;
> +
> +    return ((qxl_major > major) ||
> +            ((qxl_major == major) && (qxl_minor >= minor)));
>  }
>  
>  static void red_dispatcher_set_display_peer(RedChannel *channel,
>  RedClient *client,
> @@ -320,7 +313,7 @@ int
> red_dispatcher_use_client_monitors_config(void)
>      }
>  
>      for (; now ; now = now->next) {
> -        if (!red_dispatcher_version_check(3, 3) ||
> +        if (!red_dispatcher_check_qxl_version(now, 3, 3) ||
>              !now->qxl->st->qif->client_monitors_config ||
>              !now->qxl->st->qif->client_monitors_config(now->qxl,
>              NULL)) {
>              return FALSE;
> --
> 1.7.1
> 
> _______________________________________________
> Spice-devel mailing list
> Spice-devel at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/spice-devel
> 


More information about the Spice-devel mailing list