[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-block] [PATCH] block: implement the bdrv_reopen_prepare helper
From: |
Max Reitz |
Subject: |
Re: [Qemu-block] [PATCH] block: implement the bdrv_reopen_prepare helper for LUKS driver |
Date: |
Wed, 31 Jan 2018 19:27:38 +0100 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.5.2 |
On 2018-01-18 11:31, Daniel P. Berrange wrote:
> If the bdrv_reopen_prepare helper isn't provided, the qemu-img commit
> command fails to re-open the base layer after committing changes into
> it. Provide a no-op implementation for the LUKS driver, since there
> is not any custom work that needs doing to re-open it.
>
> Signed-off-by: Daniel P. Berrange <address@hidden>
> ---
> block/crypto.c | 7 +++++++
> 1 file changed, 7 insertions(+)
>
> diff --git a/block/crypto.c b/block/crypto.c
> index 60ddf8623e..bb9a8f5376 100644
> --- a/block/crypto.c
> +++ b/block/crypto.c
> @@ -382,6 +382,12 @@ static void block_crypto_close(BlockDriverState *bs)
> qcrypto_block_free(crypto->block);
> }
>
> +static int block_crypto_reopen_prepare(BDRVReopenState *state,
> + BlockReopenQueue *queue, Error **errp)
> +{
> + /* nothing needs checking */
> + return 0;
> +}
Unfortunately I have to admit I'm not quite an expert on reopen
myself... But generally it is used to change options, so in theory one
could provide a new key-secret here. It's up to you whether you want to
support that or not (with this implementation the user will get an error
when they want to change the key-secret).
Apart from that, I think a no-op should be OK.
Max
>
> /*
> * 1 MB bounce buffer gives good performance / memory tradeoff
> @@ -620,6 +626,7 @@ BlockDriver bdrv_crypto_luks = {
> .bdrv_truncate = block_crypto_truncate,
> .create_opts = &block_crypto_create_opts_luks,
>
> + .bdrv_reopen_prepare = block_crypto_reopen_prepare,
> .bdrv_refresh_limits = block_crypto_refresh_limits,
> .bdrv_co_preadv = block_crypto_co_preadv,
> .bdrv_co_pwritev = block_crypto_co_pwritev,
>
signature.asc
Description: OpenPGP digital signature