[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH V16 3/7] Create four QemuOptsList related functi
From: |
Eric Blake |
Subject: |
Re: [Qemu-devel] [PATCH V16 3/7] Create four QemuOptsList related functions |
Date: |
Wed, 10 Jul 2013 10:07:18 -0600 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130625 Thunderbird/17.0.7 |
On 06/18/2013 03:31 AM, Dong Xu Wang wrote:
> This patch creates 4 functions, count_opts_list, qemu_opts_append,
> qemu_opts_free and qemu_opts_print_help, they are used in following
> commits.
>
>
>
> Signed-off-by: Dong Xu Wang <address@hidden>
> ---
> +
> +/* Create a new QemuOptsList and make its desc to the merge of first
> + * and second. It will allocate space for one new QemuOptsList plus
s/make its desc to the merge of/with a desc of the merge of the/
> + * enough space for QemuOptDesc in first and second QemuOptsList.
> + * First argument's QemuOptDesc members take precedence over second's.
> + * The result's name and implied_opt_name are not copied from them.
> + * Both merge_lists should not be set. Both list can be NULL.
s/list/lists/
> + dest->name = "append_opts_list";
> + dest->implied_opt_name = NULL;
> + assert((!first || !first->merge_lists)
> + && (!second || !second->merge_lists));
Indentation - usually, an operator is intended to the column after the
containing ( on the line above.
> +
> +/* free a QemuOptsList, can accept NULL as arguments */
> +void qemu_opts_free(QemuOptsList *list)
> +{
> + g_free(list);
> +}
Do we really need a function for this, or can callers just call g_free
directly? But it doesn't hurt to have the layer of indirection,
especially if we might be freeing more than one thing in the future.
> +
> +void qemu_opts_print_help(QemuOptsList *list)
> +{
> + int i;
> + printf("Supported options:\n");
> + for (i = 0; list && list->desc[i].name; i++) {
> + printf("%-16s %s\n", list->desc[i].name,
> + list->desc[i].help ?
Indentation - 'list' should start on the column after the containing (
on the line above.
> + list->desc[i].help : "No description available");
> + }
> +}
>
None of my findings are fatal to the algorithm, so I leave it up to the
maintainer whether to touch this up as part of preparing for a pull
request, or whether to request a v17 respin.
--
Eric Blake eblake redhat com +1-919-301-3266
Libvirt virtualization library http://libvirt.org
signature.asc
Description: OpenPGP digital signature
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- Re: [Qemu-devel] [PATCH V16 3/7] Create four QemuOptsList related functions,
Eric Blake <=