From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:51901) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WKiGo-0002eA-4e for qemu-devel@nongnu.org; Tue, 04 Mar 2014 00:52:07 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WKiGj-0001Ex-3L for qemu-devel@nongnu.org; Tue, 04 Mar 2014 00:52:02 -0500 Received: from mx1.redhat.com ([209.132.183.28]:36964) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WKiGi-0001Es-R5 for qemu-devel@nongnu.org; Tue, 04 Mar 2014 00:51:57 -0500 Received: from int-mx11.intmail.prod.int.phx2.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id s245pq12007560 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Tue, 4 Mar 2014 00:51:54 -0500 Date: Tue, 4 Mar 2014 13:51:49 +0800 From: Amos Kong Message-ID: <20140304055149.GA15528@amosk.info> References: <1393868508-21236-1-git-send-email-akong@redhat.com> <1393868508-21236-3-git-send-email-akong@redhat.com> <53152065.7090606@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <53152065.7090606@redhat.com> Subject: Re: [Qemu-devel] [PCTCH v2 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: libvir-list@redhat.com, armbru@redhat.com, qemu-devel@nongnu.org, lcapitulino@redhat.com, jyang@redhat.com, pbonzini@redhat.com On Mon, Mar 03, 2014 at 05:37:57PM -0700, Eric Blake wrote: > > --- > > qapi-schema.json | 8 ++++++-- > > util/qemu-config.c | 52 ++++++++++++++++++++++++++++++++++++++++++++++------ > > 2 files changed, 52 insertions(+), 8 deletions(-) > > > > diff --git a/qapi-schema.json b/qapi-schema.json > > index 05ced9d..0bd8e12 100644 > > --- a/qapi-schema.json > > +++ b/qapi-schema.json > > @@ -3944,12 +3944,16 @@ > > # > > # @option: option name > > # > > -# @parameters: an array of @CommandLineParameterInfo > > +# @parameters: array of @CommandLineParameterInfo, possibly empty > > +# @argument: @optional present if the @parameters array is empty. If > > +# true, then the option takes unspecified arguments, if > > +# false, then the option is merely a boolean flag (since 2.0) > > I like it. > > > > > +#define HAS_ARG 0x0001 > > + > > +typedef struct QEMUOption { > > + const char *name; > > + int flags; > > + int index; > > + uint32_t arch_mask; > > Where is arch_mask used by this patch? We want to re-use existed Macro QEMU_OPTIONS_GENERATE_OPTIONS. > > +} QEMUOption; > > + > > CommandLineOptionInfoList *qmp_query_command_line_options(bool has_option, > > const char *option, > > Error **errp) > > @@ -139,15 +161,33 @@ CommandLineOptionInfoList *qmp_query_command_line_options(bool has_option, > > CommandLineOptionInfo *info; > > int i; > > > > - for (i = 0; vm_config_groups[i] != NULL; i++) { > > - if (!has_option || !strcmp(option, vm_config_groups[i]->name)) { > > + static const QEMUOption qemu_options[] = { > > + { "h", 0, QEMU_OPTION_h, QEMU_ARCH_ALL }, > > +#define QEMU_OPTIONS_GENERATE_OPTIONS > > +#include "qemu-options-wrapper.h" > > + { NULL }, > > + }; > > This looks identical to what is already in vl.c. Why do we need two > static tables with identical contents? Can't you just export the > existing table and have it just once? Ok. I will export the qemu_options table to qemu-options.h > -- > Eric Blake eblake redhat com +1-919-301-3266 > Libvirt virtualization library http://libvirt.org > -- Amos.