From: Amos Kong <akong@redhat.com>
To: Eric Blake <eblake@redhat.com>
Cc: libvir-list@redhat.com, armbru@redhat.com, qemu-devel@nongnu.org,
lcapitulino@redhat.com, jyang@redhat.com, pbonzini@redhat.com
Subject: Re: [Qemu-devel] [PCTCH v2 2/2] query-command-line-options: query all the options in qemu-options.hx
Date: Tue, 4 Mar 2014 13:51:49 +0800 [thread overview]
Message-ID: <20140304055149.GA15528@amosk.info> (raw)
In-Reply-To: <53152065.7090606@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.
prev parent reply other threads:[~2014-03-04 5:52 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-03-03 17:41 [Qemu-devel] [PCTCH v2 0/2] fix query-command-line-options Amos Kong
2014-03-03 17:41 ` [Qemu-devel] [PCTCH v2 1/2] qmp: rename query_option_descs() to get_param_infolist() Amos Kong
2014-03-04 0:27 ` Eric Blake
2014-03-03 17:41 ` [Qemu-devel] [PCTCH v2 2/2] query-command-line-options: query all the options in qemu-options.hx Amos Kong
2014-03-04 0:37 ` Eric Blake
2014-03-04 5:51 ` Amos Kong [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20140304055149.GA15528@amosk.info \
--to=akong@redhat.com \
--cc=armbru@redhat.com \
--cc=eblake@redhat.com \
--cc=jyang@redhat.com \
--cc=lcapitulino@redhat.com \
--cc=libvir-list@redhat.com \
--cc=pbonzini@redhat.com \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).