Received: from eggs.gnu.org ([2001:4830:134:3::10]:39539) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WSlop-00082f-2W for qemu-devel@nongnu.org; Wed, 26 Mar 2014 07:16:33 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WSloi-0004vZ-OV for qemu-devel@nongnu.org; Wed, 26 Mar 2014 07:16:26 -0400 Received: from mx1.redhat.com ([209.132.183.28]:26620) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WSloi-0004vR-HE for qemu-devel@nongnu.org; Wed, 26 Mar 2014 07:16:20 -0400 Received: from int-mx02.intmail.prod.int.phx2.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id s2QBGIGv002083 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Wed, 26 Mar 2014 07:16:19 -0400 Date: Wed, 26 Mar 2014 19:16:15 +0800 From: Amos Kong Message-ID: <20140326111615.GB645@amosk.info> References: <1394172567-19634-1-git-send-email-akong@redhat.com> <1394172567-19634-3-git-send-email-akong@redhat.com> <531FAE52.8010708@redhat.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="mYCpIKhGyMATD0i+" Content-Disposition: inline In-Reply-To: <531FAE52.8010708@redhat.com> Subject: Re: [Qemu-devel] [PATCH v5 2/2] query-command-line-options: query all the options in qemu-options.hx List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Eric Blake Cc: qemu-devel@nongnu.org, armbru@redhat.com, libvirt-list@redhat.com, lcapitulino@redhat.com, jyang@redhat.com, pbonzini@redhat.com --mYCpIKhGyMATD0i+ Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, Mar 11, 2014 at 06:46:10PM -0600, Eric Blake wrote: > On 03/06/2014 11:09 PM, Amos Kong wrote: > > vm_config_groups[] only contains part of the options which have > > parameters, and all options which have no parameter aren't added > > to vm_config_groups[]. Current query-command-line-options only > > checks options from vm_config_groups[], so some options will > > be lost. > >=20 > > We have macro in qemu-options.hx to generate a table that > > contains all the options. This patch tries to query options > > from the table. > >=20 > > Then we won't lose the legacy options that weren't added to > > vm_config_groups[] (eg: -vnc, -smbios). The options that have > > no parameter will also be returned (eg: -enable-fips) > >=20 > > Some options that have parameters have a NULL desc list, some > > options don't have parameters, and "parameters" is mandatory > > in the past. So we add a new field "unspecified-parameters" to > > present if the option takes unspecified parameters. > >=20 > > This patch also fixes options to match their actual command-line > > spelling rather than an alternate name associated with the > > option table in use by the command. > >=20 > > Signed-off-by: Amos Kong > > --- > > qapi-schema.json | 9 +++++++-- > > qemu-options.h | 12 ++++++++++++ > > util/qemu-config.c | 43 ++++++++++++++++++++++++++++++++++++------- > > vl.c | 19 ++----------------- > > 4 files changed, 57 insertions(+), 26 deletions(-) =20 > Based on the thread on v4, it sounds like this design is still not > finalized, and won't make 2.0. It sounds like once we start exposing > all options, it would also be nice to show which options are sugar for > other spellings. It's not good to check if one option is sugar for other spellings from help message. Does libvirt really need this information? As I mentioned in V4 thread, we can add a tri-state: +# @ArgumentStateType: +# +# Possible types for argument state. +# +# @no-argument: the option takes no argument +# +# @argument-with-parameters: the option takes argument with +# unspecified parameters +# +# @argument-without-parameters: the option takes argument without +# unspecified parameters +# +# Since 2.1 +## +{ 'enum': 'ArgumentStateType', + 'data': ['no-argument', 'argument-with-parameters', + 'argument-without-parameters'] +} I only implement the code by checking help message -option_name xxx,[xx=3Dxx]\n However, I will send a V6 later, let discuss based on it. Thanks, Amos > > diff --git a/qapi-schema.json b/qapi-schema.json > > index 193e7e4..fb7ca1b 100644 > > --- a/qapi-schema.json > > +++ b/qapi-schema.json > > @@ -4070,12 +4070,17 @@ > > # > > # @option: option name > > # > > -# @parameters: an array of @CommandLineParameterInfo > > +# @parameters: array of @CommandLineParameterInfo, possibly empty > > +# @unspecified-parameters: @optional present if the @parameters array = is empty. >=20 > Blank lines between the two parameters, for consistency. >=20 > > +# If true, then the option takes unspecified > > +# parameters, if false, then the option takes= no > > +# parameter (since 2.0) >=20 > So this will need to be changed to '(since 2.1)'. >=20 --=20 Amos. --mYCpIKhGyMATD0i+ Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQIcBAEBAgAGBQJTMrb+AAoJELxSv6I5vP9jguYP/3uVog3vCEMlaSFW+B2ZK4SP 5HvIKmU5JgvS+WHWRX2VzNDQbryjRGfJ+2LkLnQmANCBxn5ORKgIgYJ+R5EPvTMj rOnvW2qWQQ8rpsfoSIRX9g+QD6vao4E++8EBV7hSD2xuCvDQ/UPMueTpvvRiwCoR l29u+Uoo2HIoU8AS2I/u23vaLdTkcVP6jLkFCiyYLXKUJmvSIGKvlqlOqv5mK5XP Uy5ty/d18YS4Wp5iuJ2pP4qOHkbNzhgyPcljRH7oHFt6jTPMQeo60QfDbzmaO3oo BuTDanN/Y2oBSVAF+hvpIwyvT0YFxbCErC/L1dVNMCUz+3+H4PaJehI9a3gyUN86 PmUJs27uwU4W/gh1kbHuqlyStksTe4PQ2d5aDjf8e+YS+stIy/XgbffF/L42HCBC Ehctm3b70wFNXCzuyTnbuh+CF6Lj+rPgrCxMdtz/d2Fr786EmFq5tDSZcNRjGW6m VKZv/vffUi23JJzfbbGK3zSmUlH8W2ldBh+14cwrmNLvOI3td4oXW/OWid5tMu+k W+DEzbW3RszsfLqELvX6Y2v6yQ2X+X2d7NZuuNvb6N5NElyBS8zvSt20hgJtFkIs m5PpkC12uPZGfxzjENG5Wyujy39OHehsbsK6sRv2MaqA0ZibUjDjip9+61hTAb+9 21OvZWbzvCfSUu6xxseA =INEj -----END PGP SIGNATURE----- --mYCpIKhGyMATD0i+--