Re: [Qemu-devel] [PCTCH v2 2/2] query-command-line-options: query all the options in qemu-options.hx

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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.

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list




[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]