From: Daniel P. Berrangé Date: Tue, 16 Oct 2018 10:31:05 +0000 (+0100) Subject: crypto: initialize sector size even when opening with no IO flag X-Git-Tag: v3.1.0-rc0~8^2~29 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=07809a7fa8bad7f6255a4955e1520ad09ad738a4;p=thirdparty%2Fqemu.git 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é Reviewed-by: Alberto Garcia Signed-off-by: Kevin Wolf --- diff --git a/crypto/block-qcow.c b/crypto/block-qcow.c index 4284e05167e..7606231e79c 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) {