On 04/10/2014 11:54 AM, Chunyan Liu wrote: > Add two temp conversion functions between QEMUOptionParameter to QemuOpts, > so that next patch can use it. It will simplify later patch for easier > review. And will be finally removed after all backend drivers switch to > QemuOpts. > > Signed-off-by: Chunyan Liu <[email protected]> > --- > include/qemu/option.h | 8 +++ > util/qemu-option.c | 153 > ++++++++++++++++++++++++++++++++++++++++++++++++++ > 2 files changed, 161 insertions(+) >
> +++ b/include/qemu/option.h
> @@ -103,6 +103,11 @@ typedef struct QemuOptDesc {
> } QemuOptDesc;
>
> struct QemuOptsList {
> + /* FIXME: Temp used for QEMUOptionParamter->QemuOpts conversion to
> + * indicate free memory. Will remove after all drivers switch to
> QemuOpts.
s/indicate free memory/indicate the need to free memory/
> +QemuOptsList *params_to_opts(QEMUOptionParameter *list)
> +{
> + QemuOptsList *opts = NULL;
> + size_t num_opts, i = 0;
> +
> + if (!list) {
> + return NULL;
> + }
> +
> + num_opts = count_option_parameters(list);
> + opts = g_malloc0(sizeof(QemuOptsList) +
> + (num_opts + 1) * sizeof(QemuOptDesc));
> + QTAILQ_INIT(&opts->head);
> + /* (const char *) members will point to malloced space and need to free
> */
s/need to free/need to be freed/
> +void qemu_opts_free(QemuOptsList *list)
> +{
> + /* List members point to new malloced space and need to free.
s/to free/to be freed/
Corrections limited to comment grammar (and in particular comments that
disappear later in the series), so:
Reviewed-by: Eric Blake <[email protected]>
--
Eric Blake eblake redhat com +1-919-301-3266
Libvirt virtualization library http://libvirt.org
signature.asc
Description: OpenPGP digital signature
