qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Max Reitz <mreitz@redhat.com>
To: Stefan Hajnoczi <stefanha@redhat.com>, qemu-devel@nongnu.org
Cc: "Kevin Wolf" <kwolf@redhat.com>,
	"Daniel P. Berrangé" <berrange@redhat.com>,
	qemu-block@nongnu.org
Subject: Re: [PATCH v3 2/4] luks: implement .bdrv_measure()
Date: Wed, 19 Feb 2020 16:46:34 +0100	[thread overview]
Message-ID: <f93c484a-39e6-2745-e493-a9c2ed0a83c2@redhat.com> (raw)
In-Reply-To: <20200211160318.453650-3-stefanha@redhat.com>


[-- Attachment #1.1: Type: text/plain, Size: 1403 bytes --]

On 11.02.20 17:03, Stefan Hajnoczi wrote:
> Add qemu-img measure support in the "luks" block driver.
> 
> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
> ---
>  block/crypto.c | 62 ++++++++++++++++++++++++++++++++++++++++++++++++++
>  1 file changed, 62 insertions(+)
> 
> diff --git a/block/crypto.c b/block/crypto.c
> index 24823835c1..453119875e 100644
> --- a/block/crypto.c
> +++ b/block/crypto.c
> @@ -484,6 +484,67 @@ static int64_t block_crypto_getlength(BlockDriverState *bs)

[...]

> +    cryptoopts = qemu_opts_to_qdict_filtered(opts, NULL,
> +            &block_crypto_create_opts_luks, true);
> +    qdict_put_str(cryptoopts, "format", "luks");
> +    create_opts = block_crypto_create_opts_init(cryptoopts, errp);

It looks a bit weird to me to use errp here...

> +    qobject_unref(cryptoopts);
> +    if (!create_opts) {
> +        goto err;
> +    }
> +
> +    if (!qcrypto_block_calculate_payload_offset(create_opts, NULL,
> +                                                &luks_payload_size,
> +                                                &local_err)) {

...and local_err here.  Either works, but consistent style would be a
bit nicer.

But not more correct, so:

Reviewed-by: Max Reitz <mreitz@redhat.com>

> +        goto err;
> +    }

[...]

> +err:
> +    error_propagate(errp, local_err);
> +    return NULL;
> +}


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

  reply	other threads:[~2020-02-19 15:47 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-02-11 16:03 [PATCH v3 0/4] luks: add qemu-img measure support Stefan Hajnoczi
2020-02-11 16:03 ` [PATCH v3 1/4] luks: extract qcrypto_block_calculate_payload_offset() Stefan Hajnoczi
2020-02-19 13:03   ` Max Reitz
2020-02-21 11:17     ` Stefan Hajnoczi
2020-02-11 16:03 ` [PATCH v3 2/4] luks: implement .bdrv_measure() Stefan Hajnoczi
2020-02-19 15:46   ` Max Reitz [this message]
2020-02-21 11:18     ` Stefan Hajnoczi
2020-02-11 16:03 ` [PATCH v3 3/4] qemu-img: allow qemu-img measure --object without a filename Stefan Hajnoczi
2020-02-19 15:48   ` Max Reitz
2020-02-11 16:03 ` [PATCH v3 4/4] iotests: add 282 luks qemu-img measure test Stefan Hajnoczi
2020-02-19 15:52   ` Max Reitz

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=f93c484a-39e6-2745-e493-a9c2ed0a83c2@redhat.com \
    --to=mreitz@redhat.com \
    --cc=berrange@redhat.com \
    --cc=kwolf@redhat.com \
    --cc=qemu-block@nongnu.org \
    --cc=qemu-devel@nongnu.org \
    --cc=stefanha@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).