Received: from eggs.gnu.org ([2001:4830:134:3::10]:45523) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YGXzC-00040W-A4 for qemu-devel@nongnu.org; Wed, 28 Jan 2015 14:09:11 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YGXz7-0004VQ-9Y for qemu-devel@nongnu.org; Wed, 28 Jan 2015 14:09:10 -0500 Received: from mx1.redhat.com ([209.132.183.28]:40744) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YGXz7-0004VK-2S for qemu-devel@nongnu.org; Wed, 28 Jan 2015 14:09:05 -0500 From: Markus Armbruster References: <1508539.cfTQauU1Ry@javinlg> <54C66A60.3000204@redhat.com> <87r3ug8w9o.fsf@blackfin.pond.sub.org> <1497737.FQv3Yx42uv@javinlg> Date: Wed, 28 Jan 2015 20:08:33 +0100 In-Reply-To: <1497737.FQv3Yx42uv@javinlg> (Javier Celaya's message of "Wed, 28 Jan 2015 17:54:45 +0100") Message-ID: <87vbjqvi32.fsf@blackfin.pond.sub.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [Spice-devel] [PATCH] [RFC] LZ4 compression option for SPICE List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Javier Celaya Cc: spice-devel , Gerd Hoffmann , qemu-devel@nongnu.org, Anthony Liguori , devel@flexvm.es Please don't top-quote. Javier Celaya writes: > El Martes, 27 de enero de 2015 09:26:11 Markus Armbruster escribi=C3=B3: >> 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. >> >>=20 >> >>>> Recently, SPICE included the lz4 compression algorithm. This patch = adds >> >>>> a command line option to select it. >> >>>=20 >> >>> 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? >> >=20 >> > 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 --he= lp >> > output; I'm just complaining that --help output alone is not enough). >>=20 >> 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 discover= ing=20 > whether the spice server supports LZ4 is not a matter of adding a new QMP= =20 > command. That would not scale very well with new command line options. I = would=20 > suggest something more general. For instance, having the command query- > command-line-options return also the allowed values for string parameters= .=20 > That would output "lz4" for parameter "image-compression" in option "spic= e",=20 > among the other compression methods. Another possibility would be a new Q= MP=20 > command that returns the capabilities of the spice server, as defined in = the=20 > spice protocol. They include the SPICE_DISPLAY_CAP_LZ4_COMPRESSION capabi= lity,=20 > if the spice server supports LZ4. In any case, I think it is out of the s= cope=20 > 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.