[Spice-devel] Patch to support LZ4 compression algorithm‏‏

Javier Celaya javier.celaya at flexvm.es
Wed Jan 7 00:22:52 PST 2015


Hello

To enable LZ4 from the qemu command line, you have to add this to ui/spice-
core.c:

 static const char *compression_names[] = {
     [ SPICE_IMAGE_COMPRESS_OFF ]      = "off",
     [ SPICE_IMAGE_COMPRESS_AUTO_GLZ ] = "auto_glz",
     [ SPICE_IMAGE_COMPRESS_AUTO_LZ ]  = "auto_lz",
     [ SPICE_IMAGE_COMPRESS_QUIC ]     = "quic",
     [ SPICE_IMAGE_COMPRESS_GLZ ]      = "glz",
     [ SPICE_IMAGE_COMPRESS_LZ ]       = "lz",
+    [ SPICE_IMAGE_COMPRESS_LZ4 ]      = "lz4",
 };

Build qemu, and then you can use --spice image-compression=lz4.

About the problem with SPICE_BITMAP_FLAGS_TOP_DOWN, I'll have a look at it 
ASAP.

Thanks for your feedback.

El Miércoles, 7 de enero de 2015 15:48:43 LgDoor escribió:
> i'm not sure but it seems lz4 won't be enabled unless adding a new value of
> the image_compress parameter in QEMU. 
> so i just replace lz with lz4, at red_compress_image() in red_worker.c, 
6680:
> > if (image_compression == SPICE_IMAGE_COMPRESS_LZ4 &&
> >    red_channel_client_test_remote_cap(&dcc->common.base,
> >    SPICE_DISPLAY_CAP_LZ4_COMPRESSION)) {
> 
> changes to 
> 
> > if (true && .......
> 
> and launch qemu with --spice image-compression=auto_lz.
> 
> ----------------------------------------
> 
> > Date: Wed, 7 Jan 2015 08:15:07 +0100
> > From: fantonifabio at tiscali.it
> > To: lgdoor at outlook.com; spice-devel at lists.freedesktop.org
> > Subject: Re: [Spice-devel] Patch to support LZ4 compression algorithm‏‏
> > 
> > Il 07/01/2015 08:01, LgDoor ha scritto:
> >> has anybody tried this feature and encountered the displaying problems?
> >> 
> >> I just made a small change to enable lz4, but the image turns out to be
> >> broken (see the screenshots). And I observed that it goes wrong only for
> >> the SpiceBitmap w/o SPICE_BITMAP_FLAGS_TOP_DOWN flag in the
> >> red_compress_image() function from red_worker.c .> 
> > What change you did?
> > I tried it only using both server and client compiled with it and FWIK
> > should be used automatically if no image compression specified.
> > 
> >> 2014-11-14 0:11 GMT+08:00 Javier Celaya <javier.celaya at flexvm.es>:
> >>> Hello
> >>> 
> >>> There they go.
> >>> 
> >>> However, don't forget that, since spice-protocol is a submodule of
> >>> spice-
> >>> common, once you push the commit for spice-protocol, the commit for
> >>> spice-
> >>> common should point to it. The same with spice and spice-gtk in relation
> >>> to
> >>> spice-common.
> >>> 
> >>> Regards
> >>> 
> >>> El Jueves, 13 de noviembre de 2014 16:04:00 Christophe Fergeau escribió:
> >>>> Hey,
> >>>> 
> >>>> On Fri, Nov 07, 2014 at 10:17:11AM +0100, Javier Celaya wrote:
> >>>>> Hello
> >>>>> 
> >>>>> I resend the patch for the spice repository. I just realized I forgot
> >>>>> to
> >>>>> remove a debug message from red_worker.c, sorry.
> >>>> 
> >>>> Thanks for the updated patches, they look good to me. There are 2 blank
> >>>> lines at the end of lz4_encoder.[ch] which should be removed.
> >>>> Can you resend these patches generated with git-format-patch so that
> >>>> they contain a commit log, and an author name/address? Then they can be
> >>>> pushed upstream.
> >>>> 
> >>>> Christophe
> >>> 
> >>> _______________________________________________
> >>> Spice-devel mailing list
> >>> Spice-devel at lists.freedesktop.org
> >>> http://lists.freedesktop.org/mailman/listinfo/spice-devel
> 
> _______________________________________________
> 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