aboutsummaryrefslogtreecommitdiff
path: root/block/qcow2-threads.c
diff options
context:
space:
mode:
Diffstat (limited to 'block/qcow2-threads.c')
-rw-r--r--block/qcow2-threads.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/block/qcow2-threads.c b/block/qcow2-threads.c
index 8f5a0d1ebe..77bb578cdf 100644
--- a/block/qcow2-threads.c
+++ b/block/qcow2-threads.c
@@ -246,12 +246,15 @@ qcow2_co_encdec(BlockDriverState *bs, uint64_t host_offset,
.len = len,
.func = func,
};
+ uint64_t sector_size;
- assert(QEMU_IS_ALIGNED(guest_offset, BDRV_SECTOR_SIZE));
- assert(QEMU_IS_ALIGNED(host_offset, BDRV_SECTOR_SIZE));
- assert(QEMU_IS_ALIGNED(len, BDRV_SECTOR_SIZE));
assert(s->crypto);
+ sector_size = qcrypto_block_get_sector_size(s->crypto);
+ assert(QEMU_IS_ALIGNED(guest_offset, sector_size));
+ assert(QEMU_IS_ALIGNED(host_offset, sector_size));
+ assert(QEMU_IS_ALIGNED(len, sector_size));
+
return len == 0 ? 0 : qcow2_co_process(bs, qcow2_encdec_pool_func, &arg);
}
@@ -270,7 +273,8 @@ qcow2_co_encdec(BlockDriverState *bs, uint64_t host_offset,
* will be written to the underlying storage device at
* @host_offset
*
- * @len - length of the buffer (must be a BDRV_SECTOR_SIZE multiple)
+ * @len - length of the buffer (must be a multiple of the encryption
+ * sector size)
*
* Depending on the encryption method, @host_offset and/or @guest_offset
* may be used for generating the initialization vector for