aboutsummaryrefslogtreecommitdiff
path: root/block/qcow2.c
diff options
context:
space:
mode:
authorAlberto Garcia <berto@igalia.com>2018-10-11 13:58:02 +0300
committerKevin Wolf <kwolf@redhat.com>2018-11-05 15:09:54 +0100
commit6f8f015c0cd9f3ea44de4d73144db98beef97e3c (patch)
tree2dbf1b1a90417faf28f126b39c870baf0935faf4 /block/qcow2.c
parent07809a7fa8bad7f6255a4955e1520ad09ad738a4 (diff)
downloadqemu-6f8f015c0cd9f3ea44de4d73144db98beef97e3c.zip
qemu-6f8f015c0cd9f3ea44de4d73144db98beef97e3c.tar.gz
qemu-6f8f015c0cd9f3ea44de4d73144db98beef97e3c.tar.bz2
qcow2: Get the request alignment for encrypted images from QCryptoBlock
This doesn't have any practical effect at the moment because the values of BDRV_SECTOR_SIZE, QCRYPTO_BLOCK_LUKS_SECTOR_SIZE and QCRYPTO_BLOCK_QCOW_SECTOR_SIZE are all the same (512 bytes), but future encryption methods could have different requirements. Signed-off-by: Alberto Garcia <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.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/block/qcow2.c b/block/qcow2.c
index de94b29..991d6ac 100644
--- a/block/qcow2.c
+++ b/block/qcow2.c
@@ -1677,7 +1677,7 @@ static void qcow2_refresh_limits(BlockDriverState *bs, Error **errp)
if (bs->encrypted) {
/* Encryption works on a sector granularity */
- bs->bl.request_alignment = BDRV_SECTOR_SIZE;
+ bs->bl.request_alignment = qcrypto_block_get_sector_size(s->crypto);
}
bs->bl.pwrite_zeroes_alignment = s->cluster_size;
bs->bl.pdiscard_alignment = s->cluster_size;