qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH 1/7] parallels: Support .bdrv_co_create


From: Max Reitz
Subject: Re: [Qemu-devel] [PATCH 1/7] parallels: Support .bdrv_co_create
Date: Mon, 12 Mar 2018 17:40:08 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.6.0

On 2018-03-09 22:46, Kevin Wolf wrote:
> This adds the .bdrv_co_create driver callback to parallels, which
> enables image creation over QMP.
> 
> Signed-off-by: Kevin Wolf <address@hidden>
> ---
>  qapi/block-core.json |  18 ++++-
>  block/parallels.c    | 199 
> ++++++++++++++++++++++++++++++++++++++-------------
>  2 files changed, 168 insertions(+), 49 deletions(-)

[...]

> diff --git a/block/parallels.c b/block/parallels.c
> index c13cb619e6..2da5e56a9d 100644
> --- a/block/parallels.c
> +++ b/block/parallels.c

[...]

> @@ -542,24 +580,107 @@ static int coroutine_fn parallels_co_create_opts(const 
> char *filename,

[...]

> +static int coroutine_fn parallels_co_create_opts(const char *filename,
> +                                                 QemuOpts *opts,
> +                                                 Error **errp)
> +{

[...]

> +    /* Now get the QAPI type BlockdevCreateOptions */
> +    qdict_put_str(qdict, "driver", "parallels");
> +    qdict_put_str(qdict, "file", bs->node_name);
> +
> +    qobj = qdict_crumple(qdict, errp);

Any reason for this crumpling other than because it doesn't change
anything and if it did, it would be for the better?

The rest looks OK to me, and I just think this creates an exact copy of
qdict, so I guess:

Reviewed-by: Max Reitz <address@hidden>

> +    QDECREF(qdict);
> +    qdict = qobject_to_qdict(qobj);
> +    if (qdict == NULL) {
> +        ret = -EINVAL;
> +        goto done;
> +    }
> +
> +    v = qobject_input_visitor_new_keyval(QOBJECT(qdict));
> +    visit_type_BlockdevCreateOptions(v, NULL, &create_options, &local_err);
> +    visit_free(v);

Attachment: signature.asc
Description: OpenPGP digital signature


reply via email to

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