From: Maxim Levitsky <mlevitsk@redhat.com>
To: Max Reitz <mreitz@redhat.com>, qemu-devel@nongnu.org
Cc: Kevin Wolf <kwolf@redhat.com>,
Markus Armbruster <armbru@redhat.com>,
qemu-block@nongnu.org
Subject: Re: [Qemu-devel] [PATCH v4] LUKS: support preallocation
Date: Tue, 16 Jul 2019 15:48:39 +0300 [thread overview]
Message-ID: <ad961906a5fe82fc7492b0346e9f33bb37e051d7.camel@redhat.com> (raw)
In-Reply-To: <ace970e5-7f1a-d693-952e-3d16da1d0bfe@redhat.com>
On Tue, 2019-07-16 at 14:41 +0200, Max Reitz wrote:
> On 16.07.19 10:15, Maxim Levitsky wrote:
> > preallocation=off and preallocation=metadata
> > both allocate luks header only, and preallocation=falloc/full
> > is passed to underlying file.
> >
> > Fixes: https://bugzilla.redhat.com/show_bug.cgi?id=1534951
> >
> > Signed-off-by: Maxim Levitsky <mlevitsk@redhat.com>
> > ---
> > block/crypto.c | 29 ++++++++++++++++++++++++++---
> > qapi/block-core.json | 5 ++++-
> > 2 files changed, 30 insertions(+), 4 deletions(-)
> >
> >
> > Changes from V3: updated the blockdev-create description
>
> Looks good functionally, but there is a syntax problem:
>
> > diff --git a/block/crypto.c b/block/crypto.c
> > index 8237424ae6..034a645652 100644
> > --- a/block/crypto.c
> > +++ b/block/crypto.c
>
> [...]
>
> > @@ -515,8 +523,11 @@ block_crypto_co_create_luks(BlockdevCreateOptions *create_options, Error **errp)
> > .u.luks = *qapi_BlockdevCreateOptionsLUKS_base(luks_opts),
> > };
> >
> > + if (luks_opts->has_preallocation)
> > + preallocation = luks_opts->preallocation;
>
> This lacks curly brackets.
In my defense, I am too much used to this due to kernel programming.
Eventually I will stop missing this.
>
> > +
> > ret = block_crypto_co_create_generic(bs, luks_opts->size, &create_opts,
> > - errp);
> > + preallocation, errp);
> > if (ret < 0) {
> > goto fail;
> > }
>
> [...]
>
> > diff --git a/qapi/block-core.json b/qapi/block-core.json
> > index 0d43d4f37c..9c04d83fa2 100644
> > --- a/qapi/block-core.json
> > +++ b/qapi/block-core.json
> > @@ -4205,13 +4205,16 @@
> > #
> > # @file Node to create the image format on
> > # @size Size of the virtual disk in bytes
> > +# @preallocation Preallocation mode for the new image (default: off;
> > +# allowed values: off/metadata/falloc/full (since: 4.2)
>
> Also, this lacks a closing parenthesis somewhere.
True, I need more coffee.
>
> Max
>
> > #
> > # Since: 2.12
> > ##
> > { 'struct': 'BlockdevCreateOptionsLUKS',
> > 'base': 'QCryptoBlockCreateOptionsLUKS',
> > 'data': { 'file': 'BlockdevRef',
> > - 'size': 'size' } }
> > + 'size': 'size',
> > + '*preallocation': 'PreallocMode' } }
> >
> > ##
> > # @BlockdevCreateOptionsNfs:
> >
>
>
Best regards,
Maxim Levitsky
next prev parent reply other threads:[~2019-07-16 12:49 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-07-16 8:15 [Qemu-devel] [PATCH v4] LUKS: support preallocation Maxim Levitsky
2019-07-16 12:41 ` Max Reitz
2019-07-16 12:48 ` Maxim Levitsky [this message]
2019-07-16 14:49 ` Kevin Wolf
2019-07-16 17:51 ` no-reply
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=ad961906a5fe82fc7492b0346e9f33bb37e051d7.camel@redhat.com \
--to=mlevitsk@redhat.com \
--cc=armbru@redhat.com \
--cc=kwolf@redhat.com \
--cc=mreitz@redhat.com \
--cc=qemu-block@nongnu.org \
--cc=qemu-devel@nongnu.org \
/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).