Received: from eggs.gnu.org ([2001:4830:134:3::10]:47865) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gAYfw-0008Hk-DU for qemu-devel@nongnu.org; Thu, 11 Oct 2018 06:58:41 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gAYfs-0007I4-EN for qemu-devel@nongnu.org; Thu, 11 Oct 2018 06:58:40 -0400 From: Alberto Garcia Date: Thu, 11 Oct 2018 13:58:02 +0300 Message-Id: <20181011105802.22665-1-berto@igalia.com> Subject: [Qemu-devel] [PATCH] qcow2: Get the request alignment for encrypted images from QCryptoBlock List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Alberto Garcia , qemu-block@nongnu.org, Kevin Wolf , Max Reitz , =?UTF-8?q?Daniel=20P=20=2E=20Berrang=C3=A9?= 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 --- block/qcow2.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/block/qcow2.c b/block/qcow2.c index 7277feda13..010a1b3924 100644 --- a/block/qcow2.c +++ b/block/qcow2.c @@ -1627,7 +1627,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; -- 2.11.0