diff options
author | Alberto Garcia <berto@igalia.com> | 2020-02-13 18:16:46 +0100 |
---|---|---|
committer | Kevin Wolf <kwolf@redhat.com> | 2020-02-18 10:53:56 +0100 |
commit | 2d4b5256cf6a091bb6c3516661be11b9ec690f95 (patch) | |
tree | 1ba5dfd01193640a8c7e48a290d35d2718b1e93b /block/qcow2.c | |
parent | 7e6c4ff792734e196c8ca82564c56b5e7c6288ca (diff) | |
download | qemu-2d4b5256cf6a091bb6c3516661be11b9ec690f95.zip qemu-2d4b5256cf6a091bb6c3516661be11b9ec690f95.tar.gz qemu-2d4b5256cf6a091bb6c3516661be11b9ec690f95.tar.bz2 |
qcow2: Fix alignment checks in encrypted images
I/O requests to encrypted media should be aligned to the sector size
used by the underlying encryption method, not to BDRV_SECTOR_SIZE.
Fortunately this doesn't break anything at the moment because
both existing QCRYPTO_BLOCK_*_SECTOR_SIZE have the same value as
BDRV_SECTOR_SIZE.
The checks in qcow2_co_preadv_encrypted() are also unnecessary because
they are repeated immediately afterwards in qcow2_co_encdec().
Signed-off-by: Alberto Garcia <berto@igalia.com>
Message-Id: <20200213171646.15876-1-berto@igalia.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Diffstat (limited to 'block/qcow2.c')
-rw-r--r-- | block/qcow2.c | 2 |
1 files changed, 0 insertions, 2 deletions
diff --git a/block/qcow2.c b/block/qcow2.c index ef96606..8dcee5e 100644 --- a/block/qcow2.c +++ b/block/qcow2.c @@ -2068,8 +2068,6 @@ qcow2_co_preadv_encrypted(BlockDriverState *bs, goto fail; } - assert(QEMU_IS_ALIGNED(offset, BDRV_SECTOR_SIZE)); - assert(QEMU_IS_ALIGNED(bytes, BDRV_SECTOR_SIZE)); if (qcow2_co_decrypt(bs, file_cluster_offset + offset_into_cluster(s, offset), offset, buf, bytes) < 0) |