aboutsummaryrefslogtreecommitdiff
path: root/crypto/block-qcow.c
diff options
context:
space:
mode:
authorDaniel P. Berrangé <berrange@redhat.com>2018-10-16 11:31:05 +0100
committerKevin Wolf <kwolf@redhat.com>2018-11-05 15:09:54 +0100
commit07809a7fa8bad7f6255a4955e1520ad09ad738a4 (patch)
tree598c39cc74658ae7e8803194bfd46baabdf2f735 /crypto/block-qcow.c
parentcaacea4b2ed7ccf3f32ad03b810146f56125626b (diff)
downloadqemu-07809a7fa8bad7f6255a4955e1520ad09ad738a4.zip
qemu-07809a7fa8bad7f6255a4955e1520ad09ad738a4.tar.gz
qemu-07809a7fa8bad7f6255a4955e1520ad09ad738a4.tar.bz2
crypto: initialize sector size even when opening with no IO flag
The qcow2 block driver expects to see a valid sector size even when it has opened the crypto layer with QCRYPTO_BLOCK_OPEN_NO_IO. Signed-off-by: Daniel P. Berrangé <berrange@redhat.com> Reviewed-by: Alberto Garcia <berto@igalia.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Diffstat (limited to 'crypto/block-qcow.c')
-rw-r--r--crypto/block-qcow.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/crypto/block-qcow.c b/crypto/block-qcow.c
index 4284e05..7606231 100644
--- a/crypto/block-qcow.c
+++ b/crypto/block-qcow.c
@@ -102,6 +102,8 @@ qcrypto_block_qcow_open(QCryptoBlock *block,
Error **errp)
{
if (flags & QCRYPTO_BLOCK_OPEN_NO_IO) {
+ block->sector_size = QCRYPTO_BLOCK_QCOW_SECTOR_SIZE;
+ block->payload_offset = 0;
return 0;
} else {
if (!options->u.qcow.key_secret) {