[Spice-devel] [PATCH] LZ4: warn if trying to set lz4 but not supported

Christophe Fergeau cfergeau at redhat.com
Fri Jan 23 07:16:52 PST 2015


On Fri, Jan 23, 2015 at 02:57:48PM +0100, Javier Celaya wrote:
> Warn the user if he tries to set lz4 but it is not supported. Then, fallback to auto-glz.
> 
> ---
>  server/reds.c | 6 ++++++
>  1 file changed, 6 insertions(+)
> 
> diff --git a/server/reds.c b/server/reds.c
> index e34433b..816c4c9 100644
> --- a/server/reds.c
> +++ b/server/reds.c
> @@ -3501,6 +3501,12 @@ SPICE_GNUC_VISIBLE int spice_server_set_image_compression(SpiceServer *s,
>                                                            spice_image_compression_t comp)
>  {
>      spice_assert(reds == s);
> +#ifndef USE_LZ4
> +    if (comp == SPICE_IMAGE_COMPRESS_LZ4) {
> +        spice_warning("LZ4 compression not supported, falling back to auto GLZ");
> +        comp = SPICE_IMAGE_COMPRESS_AUTO_GLZ;
> +    }

This should return -1 imo (after calling set_image_compression).

Christophe

> +#endif
>      set_image_compression(comp);
>      return 0;
>  }
> -- 
> 1.9.3
> 
> _______________________________________________
> Spice-devel mailing list
> Spice-devel at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/spice-devel
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/spice-devel/attachments/20150123/679ba822/attachment.sig>


More information about the Spice-devel mailing list