From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:58039) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WDgjn-00053B-Cx for qemu-devel@nongnu.org; Wed, 12 Feb 2014 15:49:00 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WDgji-0000AU-Fk for qemu-devel@nongnu.org; Wed, 12 Feb 2014 15:48:55 -0500 Received: from mx1.redhat.com ([209.132.183.28]:35919) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WDgji-0000AO-7H for qemu-devel@nongnu.org; Wed, 12 Feb 2014 15:48:50 -0500 Message-ID: <52FBDE2D.5090505@redhat.com> Date: Wed, 12 Feb 2014 13:48:45 -0700 From: Eric Blake MIME-Version: 1.0 References: <1390881230-14033-1-git-send-email-akong@redhat.com> <1390881230-14033-6-git-send-email-akong@redhat.com> <87wqh1rge3.fsf@blackfin.pond.sub.org> In-Reply-To: <87wqh1rge3.fsf@blackfin.pond.sub.org> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="C5fXfVv2qHXRNVJXQehqxPppHJqRUXR8X" Subject: Re: [Qemu-devel] [PATCH 5/5] query-command-line-options: return help message for legacy options List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Markus Armbruster , Amos Kong Cc: jyang@redhat.com, laine@redhat.com, libvir-list@redhat.com, qemu-devel@nongnu.org, rjones@redhat.com, anthony@codemonkey.ws, pbonzini@redhat.com, lcapitulino@redhat.com This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --C5fXfVv2qHXRNVJXQehqxPppHJqRUXR8X Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On 02/11/2014 05:19 AM, Markus Armbruster wrote: > [Note cc: Eric] >=20 > Amos Kong writes: >=20 >> Some legacy options that have arguments weren't added to >> vm_config_groups[], so query-command-line-options returns a >> NULL parameters infolist. This patch try to return help message >> for this kind of legacy options. >> >> Example: >> { >> "helpmsg": "\"-vnc display start a VNC server on display\\n\""= , >> "parameters": [ >> ], >> "option": "vnc" >> }, >=20 > Do we have prospective users for this feature? Libvirt probably won't care about helpmsg other than the fact that it gets logged as part of the QMP reply, and the log is more legible if human-readable text is included. I don't care if you add it or omit it; the REAL change here is... >> ## >> { 'type': 'CommandLineOptionInfo', >> - 'data': { 'option': 'str', 'parameters': ['CommandLineParameterInfo= '] } } >> + 'data': { 'option': 'str', >> + '*parameters': ['CommandLineParameterInfo'], changing parameters from mandatory to optional, and omitting it when supplying information on an arg-less option. And that is what libvirt wants, for learning about things like -enable-fips. >> + '*helpmsg': 'str' } } >> =20 >> ## >> # @query-command-line-options: >=20 > Aha, here's the schema change missing in PATCH 3/5. Indeed; please resubmit the series so that every patch builds on its own.= >=20 > The schema needs to cover these kinds of options: >=20 > 1. No argument >=20 > { 'option': OPT-NAME } This is newly allowed by your schema change. >=20 > 2. QemuOpts argument >=20 > 2a. with known parameters (QemuOptsList member desc[] not empty) >=20 > { 'option': OPT-NAME, > 'parameters': [ { 'name': PAR-NAME, 'type': PAR-TYPE }, ... ] } Existing before your patch. >=20 > 2b. with unknown parameters (desc[] empty) >=20 > { 'option': OPT-NAME, parameters: [] } Existing before your patch. >=20 > 3. Other argument >=20 > { 'option': OPT-NAME, ? } >=20 > This patch adds 3. We need to decide what we want there. >=20 > Any particular reason why we have to invent something new, and can't > simply fold it into 2b? Or even into 1? That is, the presence of 'parameters' is a witness of whether a flag is boolean (-enable-fips) or takes arguments (-device); then the length of the 'parameters' array is a witness of whether we know all option arguments (modern code) or have unknown parameters (older options that have not yet been converted to modern form). >=20 > Note that I completely left out help strings, both on the option and on= > the parameter level. Both for brevity of presentation, and because I'd= > like to see a use before we add them. Libvirt won't be hurt if you don't present help strings. --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --C5fXfVv2qHXRNVJXQehqxPppHJqRUXR8X Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 Comment: Public key at http://people.redhat.com/eblake/eblake.gpg Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iQEcBAEBCAAGBQJS+94tAAoJEKeha0olJ0NqvRUIAIiArVoIorE4AM6Npc/r9F5a tYHbICKqv1YwcaDxL1DFIigwk22FpkkXAqQfCjP2wCKQzqeoAE4k28nXwotDw2Gp am5LQkNBbeNNv+uC7IWMP19XiBXR/M/iGBV3C8UPGM2EWHu/lH+3gQ8D4bR5oOtD t3fZjFTumZs5jNpmjDhxxJ7FqqTymZLXE92wGZfYJpcPCUL7P0PaZnN8AoRjOef5 cPWPwfp/lvhI6ZCcUOUQIk6iQH04pvnUX//MkGNpE9nLQxm+6FSRdZabeCknihAk yb75NBqXBCcRFF70R9tbDGxM4oe2Zq+swGIqRHajn76rewoRteDq7IYHYmJnCcQ= =9PTe -----END PGP SIGNATURE----- --C5fXfVv2qHXRNVJXQehqxPppHJqRUXR8X--