qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH 2/5] introduce two marcos to dump the options in


From: Markus Armbruster
Subject: Re: [Qemu-devel] [PATCH 2/5] introduce two marcos to dump the options info
Date: Tue, 11 Feb 2014 11:55:02 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.2 (gnu/linux)

Amos Kong <address@hidden> writes:

> We will use the marocs to generate two tables, which contain
> the option name and argument information.
>
> Signed-off-by: Amos Kong <address@hidden>
> ---
>  qemu-options-wrapper.h | 18 ++++++++++++++++++
>  1 file changed, 18 insertions(+)
>
> diff --git a/qemu-options-wrapper.h b/qemu-options-wrapper.h
> index 13bfea0..c36a9ee 100644
> --- a/qemu-options-wrapper.h
> +++ b/qemu-options-wrapper.h
> @@ -18,6 +18,22 @@
>  
>  #define DEFHEADING(text) ARCHHEADING(text, QEMU_ARCH_ALL)
>  
> +#elif defined(QEMU_OPTIONS_GENERATE_NAME)
> +
> +#define DEF(option, opt_arg, opt_enum, opt_help, arch_mask)    \
> +    option,
> +
> +#define DEFHEADING(text)
> +#define ARCHHEADING(text, arch_mask)
> +
> +#elif defined(QEMU_OPTIONS_GENERATE_HASARG)
> +
> +#define DEF(option, opt_arg, opt_enum, opt_help, arch_mask)    \
> +    stringify(opt_arg),
> +
> +#define DEFHEADING(text)
> +#define ARCHHEADING(text, arch_mask)
> +
>  #elif defined(QEMU_OPTIONS_GENERATE_OPTIONS)
>  
>  #define DEF(option, opt_arg, opt_enum, opt_help, arch_mask)     \
> @@ -38,4 +54,6 @@
>  
>  #undef QEMU_OPTIONS_GENERATE_ENUM
>  #undef QEMU_OPTIONS_GENERATE_HELP
> +#undef QEMU_OPTIONS_GENERATE_NAME
> +#undef QEMU_OPTIONS_GENERATE_HASPARAM
>  #undef QEMU_OPTIONS_GENERATE_OPTIONS

Personally, I find this indirection through qemu-options-wrapper.h
silly.  The ultimate user could just as well define the necessary DEF
macros itself, instead of telling a wrapper what it wants defined by
defining yet another macro.

Not your fault, and I'm not demanding you change it.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]