From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:50910) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UV2pH-0001Ba-J0 for qemu-devel@nongnu.org; Wed, 24 Apr 2013 12:45:48 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UV2pG-0005sI-4n for qemu-devel@nongnu.org; Wed, 24 Apr 2013 12:45:47 -0400 Received: from e23smtp05.au.ibm.com ([202.81.31.147]:60817) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UV2pF-0005s2-C0 for qemu-devel@nongnu.org; Wed, 24 Apr 2013 12:45:45 -0400 Received: from /spool/local by e23smtp05.au.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Thu, 25 Apr 2013 02:40:39 +1000 Received: from d23relay04.au.ibm.com (d23relay04.au.ibm.com [9.190.234.120]) by d23dlp02.au.ibm.com (Postfix) with ESMTP id 7A8302BB004F for ; Thu, 25 Apr 2013 02:45:37 +1000 (EST) Received: from d23av03.au.ibm.com (d23av03.au.ibm.com [9.190.234.97]) by d23relay04.au.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id r3OGW10l12976128 for ; Thu, 25 Apr 2013 02:32:02 +1000 Received: from d23av03.au.ibm.com (loopback [127.0.0.1]) by d23av03.au.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id r3OGja0D001526 for ; Thu, 25 Apr 2013 02:45:36 +1000 From: Anthony Liguori In-Reply-To: <5177EE61.7030909@redhat.com> References: <1366807646-8473-1-git-send-email-akong@redhat.com> <1366807646-8473-2-git-send-email-akong@redhat.com> <5177EE61.7030909@redhat.com> Date: Wed, 24 Apr 2013 11:45:28 -0500 Message-ID: <87a9onlvx3.fsf@codemonkey.ws> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Subject: Re: [Qemu-devel] [PATCH 2/2] monitor: introduce query-config-schema command List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Eric Blake , Amos Kong Cc: pbonzini@redhat.com, qemu-devel@nongnu.org, jyang@redhat.com, lcapitulino@redhat.com Eric Blake writes: > On 04/24/2013 06:47 AM, Amos Kong wrote: >> Libvirt has no way to probe if an option or property is supported, >> This patch introdues a new qmp command to query configuration schema >> information. hmp command isn't added because it's not needed. > > Agreed that no HMP counterpart is needed. However, I don't think we > have quite the right interface yet. > >> >> Signed-off-by: Amos Kong >> CC: Osier Yang >> CC: Anthony Liguori >> --- >> qapi-schema.json | 29 +++++++++++++++++++++++++++++ >> qmp-commands.hx | 40 ++++++++++++++++++++++++++++++++++++++++ >> util/qemu-config.c | 40 ++++++++++++++++++++++++++++++++++++++++ >> 3 files changed, 109 insertions(+), 0 deletions(-) >> >> diff --git a/qapi-schema.json b/qapi-schema.json >> index 751d3c2..aeab057 100644 >> --- a/qapi-schema.json >> +++ b/qapi-schema.json >> @@ -3505,3 +3505,32 @@ >> '*asl_compiler_rev': 'uint32', >> '*file': 'str', >> '*data': 'str' }} >> + >> +## >> +# @ConfigSchemaInfo: >> +# >> +# Configration schema information. >> +# >> +# @option: option name >> +# >> +# @params: parameters strList of one option > > Why just a strList? That only tells me option names. But we already > know so much more than that - we know the type and the help string. > >> +# >> +# Since 1.5 >> +## >> +{ 'type': 'ConfigSchemaInfo', 'data': {'option': 'str', 'params': ['str']} } > > I'd rather see an array of structs, more closely mirroring what > include/qemu/option.h gives us: > > # JSON representation of values of QEMUOptionParType, may grow in future > { 'enum': 'ConfigParamType', > 'data': [ 'flag', 'number', 'size', 'string' ] } > > # JSON representation of QEMUOptionParameter, may grow in future > # @help is optional if no text was present > { 'type': 'ConfigParamInfo', > 'data': { 'name': 'str', 'type': 'ConfigParamType', '*help':'str' } } > > # Each command line option, and its list of parameters > { 'type': 'ConfigSchemaInfo', > 'data': { 'option':'str', 'params': ['ConfigParamInfo'] } } > > And that means we no longer have ['str'], which bypasses the need for > your patch 1/2. Strong Ack on this schema. Regards, Anthony Liguori