From nobody Sun Feb 8 10:29:48 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 15392555736974.49738184907369; Thu, 11 Oct 2018 03:59:33 -0700 (PDT) Received: from localhost ([::1]:33490 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gAYgm-0000By-Kw for importer@patchew.org; Thu, 11 Oct 2018 06:59:32 -0400 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 Received: from fanzine.igalia.com ([91.117.99.155]:53754) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1gAYfs-0007DS-1L; Thu, 11 Oct 2018 06:58:36 -0400 Received: from [194.100.51.2] (helo=perseus.local) by fanzine.igalia.com with esmtpsa (Cipher TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim) id 1gAYfo-0000cb-Tw; Thu, 11 Oct 2018 12:58:33 +0200 Received: from berto by perseus.local with local (Exim 4.89) (envelope-from ) id 1gAYfV-0005uJ-Lz; Thu, 11 Oct 2018 13:58:13 +0300 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=igalia.com; s=20170329; h=Message-Id:Date:Subject:Cc:To:From; bh=2had6ZGAvHK/nGCza+BXFrh9XZzNpc9dTtlgY6zCwvc=; b=fRA+YsxHpgcc/EekyaYx9730IsZGzPCSTUmX95NldwhJ+F1Z1Pc/wlPPQS3krmVQe+6/wBgrHCT9xm7Bna4Ems1CKyG1Rd+j++F+92QgD+a3tFyXEX0IOZalnbdBK6Yh6ONw/LDh40KGT2EO4RCASpMLY/Te8fWWyJw+32YyiY4eUAZrxkruHNoNJtZEaM53t5X/JFOT0j+cP+rsTU+BzS0z4KSPpz3fFpFY5vj2cV5FazwdaPgYCJTDmgVo81tdicfovjfKRaEanIKwEjadlLkr0wyx8L4T8AFT4QxUDobqDQHYLudrVHCxkBTQj4vysBywgZY/cGkxvuwuEYH0Qg==; From: Alberto Garcia To: qemu-devel@nongnu.org Date: Thu, 11 Oct 2018 13:58:02 +0300 Message-Id: <20181011105802.22665-1-berto@igalia.com> X-Mailer: git-send-email 2.11.0 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x (no timestamps) [generic] [fuzzy] X-Received-From: 91.117.99.155 Subject: [Qemu-devel] [PATCH] qcow2: Get the request alignment for encrypted images from QCryptoBlock X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Kevin Wolf , Alberto Garcia , qemu-block@nongnu.org, Max Reitz Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZohoMail: RDKM_2 RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" 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 Reviewed-by: Daniel P. Berrang=C3=A9 --- 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) =20 if (bs->encrypted) { /* Encryption works on a sector granularity */ - bs->bl.request_alignment =3D BDRV_SECTOR_SIZE; + bs->bl.request_alignment =3D qcrypto_block_get_sector_size(s->cryp= to); } bs->bl.pwrite_zeroes_alignment =3D s->cluster_size; bs->bl.pdiscard_alignment =3D s->cluster_size; --=20 2.11.0