Skip to content

Commit

Permalink
block: implement the bdrv_reopen_prepare helper for LUKS driver
Browse files Browse the repository at this point in the history
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 <berrange@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
  • Loading branch information
berrange authored and kevmw committed Mar 9, 2018
1 parent d9bbfea commit f87e08f
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions block/crypto.c
Expand Up @@ -384,6 +384,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;
}

/*
* 1 MB bounce buffer gives good performance / memory tradeoff
Expand Down Expand Up @@ -621,6 +627,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,
Expand Down

0 comments on commit f87e08f

Please sign in to comment.