[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH v23 07/32] add qemu_opts_print_help to replace p
From: |
Eric Blake |
Subject: |
Re: [Qemu-devel] [PATCH v23 07/32] add qemu_opts_print_help to replace print_option_help |
Date: |
Tue, 25 Mar 2014 14:43:46 -0600 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.3.0 |
On 03/21/2014 04:12 AM, Chunyan Liu wrote:
> print_option_help takes QEMUOptionParameter as parameter, add
> qemu_opts_print_help to take QemuOptsList as parameter for later
> replace work.
>
> Signed-off-by: Dong Xu Wang <address@hidden>
> Signed-off-by: Chunyan Liu <address@hidden>
> ---
> include/qemu/option.h | 1 +
> util/qemu-option.c | 11 +++++++++++
> 2 files changed, 12 insertions(+)
>
> +void qemu_opts_print_help(QemuOptsList *list)
> +{
> + int i;
> +
> + printf("Supported options:\n");
> + for (i = 0; list && list->desc[i].name; i++) {
Similar to print_option_help(), this prints "Supported options:\n" on a
line by itself if list is NULL. But do any of the drivers/protocols
actually lack options? Is it worth guaranteeing that this is only used
on non-empty lists? What would happen if you wrote this as:
assert(list);
for (i = 0; list->desc[i].name; i++) { ...
or even
QemuOptDesc *desc;
assert(list);
desc = list->desc;
while (desc->name) {
...
desc++;
}
--
Eric Blake eblake redhat com +1-919-301-3266
Libvirt virtualization library http://libvirt.org
signature.asc
Description: OpenPGP digital signature
- Re: [Qemu-devel] [PATCH v23 03/32] qapi: output def_value_str when query command line options, (continued)
- [Qemu-devel] [PATCH v23 01/32] move find_desc_by_name ahead for later calling, Chunyan Liu, 2014/03/21
- [Qemu-devel] [PATCH v23 06/32] add qemu_opt_get_*_del functions for replace work, Chunyan Liu, 2014/03/21
- [Qemu-devel] [PATCH v23 05/32] move qemu_opt_del ahead for later calling, Chunyan Liu, 2014/03/21
- [Qemu-devel] [PATCH v23 07/32] add qemu_opts_print_help to replace print_option_help, Chunyan Liu, 2014/03/21
- [Qemu-devel] [PATCH v23 04/32] change opt->name and opt->str from (const char *) to (char *), Chunyan Liu, 2014/03/21
- [Qemu-devel] [PATCH v23 08/32] add convert functions between QEMUOptionParameter to QemuOpts, Chunyan Liu, 2014/03/21
- [Qemu-devel] [PATCH v23 10/32] check NULL input for qemu_opts_del, Chunyan Liu, 2014/03/21