Re: [Qemu-devel] [Spice-devel] [PATCH] [RFC] LZ4 compression option for SPICE
Il 27/01/2015 09:26, Markus Armbruster ha scritto: > Eric Blake writes: > >> On 01/26/2015 01:48 AM, Javier Celaya wrote: >>> Sorry, I forgot to patch the command-line help. Hope it helps. >>> > Recently, SPICE included the lz4 compression algorithm. This patch adds > a command line option to select it. How is libvirt going to introspect whether the command line supports this option? Is there some QMP command that lists the set of valid compression formats understood by a given qemu binary? >> No, patching the command line --help does NOT help libvirt. It needs to >> be discoverable via QMP to be introspectible, as scraping --help output >> is not machine-friendly. (That said, you DO want to expose it in --help >> output; I'm just complaining that --help output alone is not enough). > We should really, really, really provide access to (the relevant subset > of) the QAPI schema over QMP! Until we get that, useful progress is > delayed by problems like this one, and we keep growing special-purpose > solutions to problems like this one. > ___ > Spice-devel mailing list > spice-de...@lists.freedesktop.org > http://lists.freedesktop.org/mailman/listinfo/spice-devel > Hi, spice 0.12.6 with lz4 support has been released, is there any possibility to add it also in qemu upstream to make possible selecting it "Out of the box" please? smime.p7s Description: Firma crittografica S/MIME
Re: [Qemu-devel] [Spice-devel] [PATCH] [RFC] LZ4 compression option for SPICE
Fabio Fantoni writes: > Il 27/01/2015 09:26, Markus Armbruster ha scritto: >> Eric Blake writes: >> >>> On 01/26/2015 01:48 AM, Javier Celaya wrote: Sorry, I forgot to patch the command-line help. Hope it helps. >> Recently, SPICE included the lz4 compression algorithm. This patch adds >> a command line option to select it. > How is libvirt going to introspect whether the command line supports > this option? Is there some QMP command that lists the set of valid > compression formats understood by a given qemu binary? >>> No, patching the command line --help does NOT help libvirt. It needs to >>> be discoverable via QMP to be introspectible, as scraping --help output >>> is not machine-friendly. (That said, you DO want to expose it in --help >>> output; I'm just complaining that --help output alone is not enough). >> We should really, really, really provide access to (the relevant subset >> of) the QAPI schema over QMP! Until we get that, useful progress is >> delayed by problems like this one, and we keep growing special-purpose >> solutions to problems like this one. >> ___ >> Spice-devel mailing list >> spice-de...@lists.freedesktop.org >> http://lists.freedesktop.org/mailman/listinfo/spice-devel >> >> >> > > Hi, any news about spice lz4 support still missed in qemu upstream? > > Thanks for any reply. I'm committed to delivering QMP introspection in the next development cycle. That'll answer "does this version support X in QMP" questions, which may in turn be a usable indicator for "does it support X' on the command line", at least for some X. If the SPICE LZ4 feature is such an X, the patch can then go in without further work.
Re: [Qemu-devel] [Spice-devel] [PATCH] [RFC] LZ4 compression option for SPICE
Il 27/01/2015 09:26, Markus Armbruster ha scritto: > Eric Blake writes: > >> On 01/26/2015 01:48 AM, Javier Celaya wrote: >>> Sorry, I forgot to patch the command-line help. Hope it helps. >>> > Recently, SPICE included the lz4 compression algorithm. This patch adds > a command line option to select it. How is libvirt going to introspect whether the command line supports this option? Is there some QMP command that lists the set of valid compression formats understood by a given qemu binary? >> No, patching the command line --help does NOT help libvirt. It needs to >> be discoverable via QMP to be introspectible, as scraping --help output >> is not machine-friendly. (That said, you DO want to expose it in --help >> output; I'm just complaining that --help output alone is not enough). > We should really, really, really provide access to (the relevant subset > of) the QAPI schema over QMP! Until we get that, useful progress is > delayed by problems like this one, and we keep growing special-purpose > solutions to problems like this one. > ___ > Spice-devel mailing list > spice-de...@lists.freedesktop.org > http://lists.freedesktop.org/mailman/listinfo/spice-devel > > > Hi, any news about spice lz4 support still missed in qemu upstream? Thanks for any reply. smime.p7s Description: Firma crittografica S/MIME
Re: [Qemu-devel] [Spice-devel] [PATCH] [RFC] LZ4 compression option for SPICE
Please don't top-quote. Javier Celaya writes: > El Martes, 27 de enero de 2015 09:26:11 Markus Armbruster escribió: >> Eric Blake writes: >> > On 01/26/2015 01:48 AM, Javier Celaya wrote: >> >> Sorry, I forgot to patch the command-line help. Hope it helps. >> >> >> Recently, SPICE included the lz4 compression algorithm. This patch adds >> a command line option to select it. >> >>> >> >>> How is libvirt going to introspect whether the command line supports >> >>> this option? Is there some QMP command that lists the set of valid >> >>> compression formats understood by a given qemu binary? >> > >> > No, patching the command line --help does NOT help libvirt. It needs to >> > be discoverable via QMP to be introspectible, as scraping --help output >> > is not machine-friendly. (That said, you DO want to expose it in --help >> > output; I'm just complaining that --help output alone is not enough). >> >> We should really, really, really provide access to (the relevant subset >> of) the QAPI schema over QMP! Until we get that, useful progress is >> delayed by problems like this one, and we keep growing special-purpose >> solutions to problems like this one. > >>From what I've seen in QEMU and libvirt's code, I would say that discovering > whether the spice server supports LZ4 is not a matter of adding a new QMP > command. That would not scale very well with new command line options. I > would > suggest something more general. For instance, having the command query- > command-line-options return also the allowed values for string parameters. > That would output "lz4" for parameter "image-compression" in option "spice", > among the other compression methods. Another possibility would be a new QMP > command that returns the capabilities of the spice server, as defined in the > spice protocol. They include the SPICE_DISPLAY_CAP_LZ4_COMPRESSION > capability, > if the spice server supports LZ4. In any case, I think it is out of the scope > of this patch. We already have a language to describe interfaces: QAPI schema. It already covers QMP. I propose to reuse it for QMP introspection instead of inventing yet another language. Unfortunately, it doesn't cover the command line. Recasting the command line in QAPI sounds sensible to me, but it's non-trivial, and so far nobody has volunteered to try. So we'll likely need a stop-gap, like extending query-command-line-options. I don't like growing more external interface languages, but I don't have better ideas.
Re: [Qemu-devel] [Spice-devel] [PATCH] [RFC] LZ4 compression option for SPICE
>From what I've seen in QEMU and libvirt's code, I would say that discovering whether the spice server supports LZ4 is not a matter of adding a new QMP command. That would not scale very well with new command line options. I would suggest something more general. For instance, having the command query- command-line-options return also the allowed values for string parameters. That would output "lz4" for parameter "image-compression" in option "spice", among the other compression methods. Another possibility would be a new QMP command that returns the capabilities of the spice server, as defined in the spice protocol. They include the SPICE_DISPLAY_CAP_LZ4_COMPRESSION capability, if the spice server supports LZ4. In any case, I think it is out of the scope of this patch. El Martes, 27 de enero de 2015 09:26:11 Markus Armbruster escribió: > Eric Blake writes: > > On 01/26/2015 01:48 AM, Javier Celaya wrote: > >> Sorry, I forgot to patch the command-line help. Hope it helps. > >> > Recently, SPICE included the lz4 compression algorithm. This patch adds > a command line option to select it. > >>> > >>> How is libvirt going to introspect whether the command line supports > >>> this option? Is there some QMP command that lists the set of valid > >>> compression formats understood by a given qemu binary? > > > > No, patching the command line --help does NOT help libvirt. It needs to > > be discoverable via QMP to be introspectible, as scraping --help output > > is not machine-friendly. (That said, you DO want to expose it in --help > > output; I'm just complaining that --help output alone is not enough). > > We should really, really, really provide access to (the relevant subset > of) the QAPI schema over QMP! Until we get that, useful progress is > delayed by problems like this one, and we keep growing special-purpose > solutions to problems like this one.
Re: [Qemu-devel] [Spice-devel] [PATCH] [RFC] LZ4 compression option for SPICE
Eric Blake writes: > On 01/26/2015 01:48 AM, Javier Celaya wrote: >> Sorry, I forgot to patch the command-line help. Hope it helps. >> > Recently, SPICE included the lz4 compression algorithm. This patch adds a command line option to select it. > >>> >>> How is libvirt going to introspect whether the command line supports >>> this option? Is there some QMP command that lists the set of valid >>> compression formats understood by a given qemu binary? > > No, patching the command line --help does NOT help libvirt. It needs to > be discoverable via QMP to be introspectible, as scraping --help output > is not machine-friendly. (That said, you DO want to expose it in --help > output; I'm just complaining that --help output alone is not enough). We should really, really, really provide access to (the relevant subset of) the QAPI schema over QMP! Until we get that, useful progress is delayed by problems like this one, and we keep growing special-purpose solutions to problems like this one.
Re: [Qemu-devel] [Spice-devel] [PATCH] [RFC] LZ4 compression option for SPICE
On 01/26/2015 01:48 AM, Javier Celaya wrote: > Sorry, I forgot to patch the command-line help. Hope it helps. > >>> >>> Recently, SPICE included the lz4 compression algorithm. This patch adds >>> a command line option to select it. >> >> How is libvirt going to introspect whether the command line supports >> this option? Is there some QMP command that lists the set of valid >> compression formats understood by a given qemu binary? No, patching the command line --help does NOT help libvirt. It needs to be discoverable via QMP to be introspectible, as scraping --help output is not machine-friendly. (That said, you DO want to expose it in --help output; I'm just complaining that --help output alone is not enough). -- Eric Blake eblake redhat com+1-919-301-3266 Libvirt virtualization library http://libvirt.org signature.asc Description: OpenPGP digital signature
Re: [Qemu-devel] [Spice-devel] [PATCH] [RFC] LZ4 compression option for SPICE
Sorry, I forgot to patch the command-line help. Hope it helps. El Viernes, 23 de enero de 2015 09:25:38 Eric Blake escribió: > On 01/23/2015 07:06 AM, Javier Celaya wrote: > > Hello, this is the patch with the version check. Christophe, can you check > > that the version is the correct one? > > > > > > > > Recently, SPICE included the lz4 compression algorithm. This patch adds > > a command line option to select it. > > --- > > > > ui/spice-core.c | 3 +++ > > 1 file changed, 3 insertions(+) > > > > diff --git a/ui/spice-core.c b/ui/spice-core.c > > index 6467fa4..dadcae9 100644 > > --- a/ui/spice-core.c > > +++ b/ui/spice-core.c > > @@ -359,6 +359,9 @@ static const char *compression_names[] = { > > > > [ SPICE_IMAGE_COMPRESS_QUIC ] = "quic", > > [ SPICE_IMAGE_COMPRESS_GLZ ] = "glz", > > [ SPICE_IMAGE_COMPRESS_LZ ] = "lz", > > > > +#if SPICE_SERVER_VERSION >= 0x000c07 > > +[ SPICE_IMAGE_COMPRESS_LZ4 ] = "lz4", > > How is libvirt going to introspect whether the command line supports > this option? Is there some QMP command that lists the set of valid > compression formats understood by a given qemu binary? >From 26864da931603791c70c570b9b46f21657ebcaec Mon Sep 17 00:00:00 2001 From: Javier Celaya Date: Wed, 7 Jan 2015 11:53:24 +0100 Subject: [PATCH] Add lz4 compression option for SPICE. Recently, SPICE included the lz4 compression algorithm. This patch adds a command line option to select it. --- qemu-options.hx | 4 ++-- ui/spice-core.c | 3 +++ 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/qemu-options.hx b/qemu-options.hx index 22cf3b9..f5c54ba 100644 --- a/qemu-options.hx +++ b/qemu-options.hx @@ -953,7 +953,7 @@ DEF("spice", HAS_ARG, QEMU_OPTION_spice, " [,tls-channel=[main|display|cursor|inputs|record|playback]]\n" " [,plaintext-channel=[main|display|cursor|inputs|record|playback]]\n" " [,sasl][,password=][,disable-ticketing]\n" -" [,image-compression=[auto_glz|auto_lz|quic|glz|lz|off]]\n" +" [,image-compression=[auto_glz|auto_lz|quic|glz|lz|lz4|off]]\n" " [,jpeg-wan-compression=[auto|never|always]]\n" " [,zlib-glz-wan-compression=[auto|never|always]]\n" " [,streaming-video=[off|all|filter]][,disable-copy-paste]\n" @@ -1028,7 +1028,7 @@ channels. The special name "default" can be used to set the default mode. For channels which are not explicitly forced into one mode the spice client is allowed to pick tls/plaintext as he pleases. -@item image-compression=[auto_glz|auto_lz|quic|glz|lz|off] +@item image-compression=[auto_glz|auto_lz|quic|glz|lz|lz4|off] Configure image compression (lossless). Default is auto_glz. diff --git a/ui/spice-core.c b/ui/spice-core.c index 6467fa4..dadcae9 100644 --- a/ui/spice-core.c +++ b/ui/spice-core.c @@ -359,6 +359,9 @@ static const char *compression_names[] = { [ SPICE_IMAGE_COMPRESS_QUIC ] = "quic", [ SPICE_IMAGE_COMPRESS_GLZ ] = "glz", [ SPICE_IMAGE_COMPRESS_LZ ] = "lz", +#if SPICE_SERVER_VERSION >= 0x000c07 +[ SPICE_IMAGE_COMPRESS_LZ4 ] = "lz4", +#endif }; #define parse_compression(_name)\ parse_name(_name, "image compression", \ -- 1.9.3
Re: [Qemu-devel] [Spice-devel] [PATCH] [RFC] LZ4 compression option for SPICE
On 01/23/2015 07:06 AM, Javier Celaya wrote: > Hello, this is the patch with the version check. Christophe, can you check > that the version is the correct one? > > > Recently, SPICE included the lz4 compression algorithm. This patch adds > a command line option to select it. > --- > ui/spice-core.c | 3 +++ > 1 file changed, 3 insertions(+) > > diff --git a/ui/spice-core.c b/ui/spice-core.c > index 6467fa4..dadcae9 100644 > --- a/ui/spice-core.c > +++ b/ui/spice-core.c > @@ -359,6 +359,9 @@ static const char *compression_names[] = { > [ SPICE_IMAGE_COMPRESS_QUIC ] = "quic", > [ SPICE_IMAGE_COMPRESS_GLZ ] = "glz", > [ SPICE_IMAGE_COMPRESS_LZ ] = "lz", > +#if SPICE_SERVER_VERSION >= 0x000c07 > +[ SPICE_IMAGE_COMPRESS_LZ4 ] = "lz4", How is libvirt going to introspect whether the command line supports this option? Is there some QMP command that lists the set of valid compression formats understood by a given qemu binary? -- Eric Blake eblake redhat com+1-919-301-3266 Libvirt virtualization library http://libvirt.org signature.asc Description: OpenPGP digital signature
Re: [Qemu-devel] [Spice-devel] [PATCH] [RFC] LZ4 compression option for SPICE
Hello, this is the patch with the version check. Christophe, can you check that the version is the correct one? El Martes, 20 de enero de 2015 17:08:07 Christophe Fergeau escribió: > Hey, > > Version check seems good, we probably can raise spice-server version in > git preemptively so that you can have a working version check now. > > Given that lz4 support is optional, spice_server_set_image_compression > should probably error out if we try to set lz4 but it's not supported. Ack > > Christophe >From 896a3ea776ee95653a7cb8a0c90111a89b57c73f Mon Sep 17 00:00:00 2001 From: Javier Celaya Date: Wed, 7 Jan 2015 11:53:24 +0100 Subject: [PATCH] Add lz4 compression option for SPICE. Recently, SPICE included the lz4 compression algorithm. This patch adds a command line option to select it. --- ui/spice-core.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/ui/spice-core.c b/ui/spice-core.c index 6467fa4..dadcae9 100644 --- a/ui/spice-core.c +++ b/ui/spice-core.c @@ -359,6 +359,9 @@ static const char *compression_names[] = { [ SPICE_IMAGE_COMPRESS_QUIC ] = "quic", [ SPICE_IMAGE_COMPRESS_GLZ ] = "glz", [ SPICE_IMAGE_COMPRESS_LZ ] = "lz", +#if SPICE_SERVER_VERSION >= 0x000c07 +[ SPICE_IMAGE_COMPRESS_LZ4 ] = "lz4", +#endif }; #define parse_compression(_name)\ parse_name(_name, "image compression", \ -- 1.9.3
Re: [Qemu-devel] [Spice-devel] [PATCH] [RFC] LZ4 compression option for SPICE
Hey, On Thu, Jan 08, 2015 at 11:50:13AM +0100, Javier Celaya wrote: > Hello > > Recently, SPICE included the lz4 compression algorithm. This patch adds > a command line option to select it. However, SPICE_IMAGE_COMPRESS_LZ4 did not > exist before the commit that added this compression algorithm, so it should > be > guarded with conditional compilation. How do you think this should be done? > Wait for the next stable version of spice-server and check for > SPICE_SERVER_VERSION? Or add a specific flag? Version check seems good, we probably can raise spice-server version in git preemptively so that you can have a working version check now. Given that lz4 support is optional, spice_server_set_image_compression should probably error out if we try to set lz4 but it's not supported. Christophe pgpsFFLRNycov.pgp Description: PGP signature
Re: [Qemu-devel] [Spice-devel] [PATCH] [RFC] LZ4 compression option for SPICE
Sure, for the help text of the image-compression option, thanks. El Jueves, 8 de enero de 2015 12:48:57 Fabio Fantoni escribió: > Il 08/01/2015 11:50, Javier Celaya ha scritto: > > Hello > > > > Recently, SPICE included the lz4 compression algorithm. This patch adds > > a command line option to select it. However, SPICE_IMAGE_COMPRESS_LZ4 did > > not exist before the commit that added this compression algorithm, so it > > should be guarded with conditional compilation. How do you think this > > should be done? Wait for the next stable version of spice-server and > > check for > > SPICE_SERVER_VERSION? Or add a specific flag? > > > > Thank you > > --- > > > > ui/spice-core.c | 1 + > > 1 file changed, 1 insertion(+) > > > > diff --git a/ui/spice-core.c b/ui/spice-core.c > > index 6467fa4..fb6534e 100644 > > --- a/ui/spice-core.c > > +++ b/ui/spice-core.c > > @@ -359,6 +359,7 @@ static const char *compression_names[] = { > > > > [ SPICE_IMAGE_COMPRESS_QUIC ] = "quic", > > [ SPICE_IMAGE_COMPRESS_GLZ ] = "glz", > > [ SPICE_IMAGE_COMPRESS_LZ ] = "lz", > > > > +[ SPICE_IMAGE_COMPRESS_LZ4 ] = "lz4", > > > > }; > > #define parse_compression(_name)\ > > > > parse_name(_name, "image compression", \ > > > > -- > > 1.9.3 > > I did a small search now and seems that also other small change to > qemu-options.hx file should be done, search this line: > @item image-compression=[auto_glz|auto_lz|quic|glz|lz|off] > > > ___ > > Spice-devel mailing list > > spice-de...@lists.freedesktop.org > > http://lists.freedesktop.org/mailman/listinfo/spice-devel
Re: [Qemu-devel] [Spice-devel] [PATCH] [RFC] LZ4 compression option for SPICE
Il 08/01/2015 11:50, Javier Celaya ha scritto: > Hello > > Recently, SPICE included the lz4 compression algorithm. This patch adds > a command line option to select it. However, SPICE_IMAGE_COMPRESS_LZ4 did not > exist before the commit that added this compression algorithm, so it should > be > guarded with conditional compilation. How do you think this should be done? > Wait for the next stable version of spice-server and check for > SPICE_SERVER_VERSION? Or add a specific flag? > > Thank you > --- > ui/spice-core.c | 1 + > 1 file changed, 1 insertion(+) > > diff --git a/ui/spice-core.c b/ui/spice-core.c > index 6467fa4..fb6534e 100644 > --- a/ui/spice-core.c > +++ b/ui/spice-core.c > @@ -359,6 +359,7 @@ static const char *compression_names[] = { > [ SPICE_IMAGE_COMPRESS_QUIC ] = "quic", > [ SPICE_IMAGE_COMPRESS_GLZ ] = "glz", > [ SPICE_IMAGE_COMPRESS_LZ ] = "lz", > +[ SPICE_IMAGE_COMPRESS_LZ4 ] = "lz4", > }; > #define parse_compression(_name)\ > parse_name(_name, "image compression", \ > -- > 1.9.3 I did a small search now and seems that also other small change to qemu-options.hx file should be done, search this line: @item image-compression=[auto_glz|auto_lz|quic|glz|lz|off] > > ___ > Spice-devel mailing list > spice-de...@lists.freedesktop.org > http://lists.freedesktop.org/mailman/listinfo/spice-devel > > > smime.p7s Description: Firma crittografica S/MIME