|
From: | Chunyan Liu |
Subject: | Re: [Qemu-devel] [PATCH v23 07/32] add qemu_opts_print_help to replace print_option_help |
Date: | Wed, 26 Mar 2014 10:58:13 +0800 |
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)Similar to print_option_help(), this prints "Supported options:\n" on a
> +{
> + int i;
> +
> + printf("Supported options:\n");
> + for (i = 0; list && list->desc[i].name; i++) {
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
[Prev in Thread] | Current Thread | [Next in Thread] |