[{"id":1761088,"web_url":"http://patchwork.ozlabs.org/comment/1761088/","msgid":"<dc675dcb-63f6-1cd5-5267-bd9f6743fdad@redhat.com>","list_archive_url":null,"date":"2017-08-31T14:54:23","subject":"Re: [Qemu-devel] [PATCH v2 2/4] block: use BDRV_SECTOR_SIZE in\n\tcrypto driver","submitter":{"id":6591,"url":"http://patchwork.ozlabs.org/api/people/6591/","name":"Eric Blake","email":"eblake@redhat.com"},"content":"On 08/31/2017 06:05 AM, Daniel P. Berrange wrote:\n> Signed-off-by: Daniel P. Berrange <berrange@redhat.com>\n> ---\n>  block/crypto.c | 32 ++++++++++++++++----------------\n>  1 file changed, 16 insertions(+), 16 deletions(-)\n> \nReviewed-by: Eric Blake <eblake@redhat.com>","headers":{"Return-Path":"<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>","X-Original-To":"incoming@patchwork.ozlabs.org","Delivered-To":"patchwork-incoming@bilbo.ozlabs.org","Authentication-Results":["ozlabs.org;\n\tspf=pass (mailfrom) smtp.mailfrom=nongnu.org\n\t(client-ip=2001:4830:134:3::11; helo=lists.gnu.org;\n\tenvelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org;\n\treceiver=<UNKNOWN>)","ext-mx05.extmail.prod.ext.phx2.redhat.com;\n\tdmarc=none (p=none dis=none) header.from=redhat.com","ext-mx05.extmail.prod.ext.phx2.redhat.com;\n\tspf=fail smtp.mailfrom=eblake@redhat.com"],"Received":["from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11])\n\t(using TLSv1 with cipher AES256-SHA (256/256 bits))\n\t(No client certificate requested)\n\tby ozlabs.org (Postfix) with ESMTPS id 3xjlll5DDZz9sD9\n\tfor <incoming@patchwork.ozlabs.org>;\n\tFri,  1 Sep 2017 00:54:59 +1000 (AEST)","from localhost ([::1]:56195 helo=lists.gnu.org)\n\tby lists.gnu.org with esmtp (Exim 4.71) (envelope-from\n\t<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>)\n\tid 1dnQrx-0004js-UL\n\tfor incoming@patchwork.ozlabs.org; Thu, 31 Aug 2017 10:54:57 -0400","from eggs.gnu.org ([2001:4830:134:3::10]:53837)\n\tby lists.gnu.org with esmtp (Exim 4.71)\n\t(envelope-from <eblake@redhat.com>) id 1dnQra-0004gW-8z\n\tfor qemu-devel@nongnu.org; Thu, 31 Aug 2017 10:54:39 -0400","from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)\n\t(envelope-from <eblake@redhat.com>) id 1dnQrZ-00030i-F7\n\tfor qemu-devel@nongnu.org; Thu, 31 Aug 2017 10:54:34 -0400","from mx1.redhat.com ([209.132.183.28]:54818)\n\tby eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32)\n\t(Exim 4.71) (envelope-from <eblake@redhat.com>)\n\tid 1dnQrT-0002yS-2c; Thu, 31 Aug 2017 10:54:27 -0400","from smtp.corp.redhat.com\n\t(int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16])\n\t(using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits))\n\t(No client certificate requested)\n\tby mx1.redhat.com (Postfix) with ESMTPS id D8409461D9;\n\tThu, 31 Aug 2017 14:54:25 +0000 (UTC)","from [10.10.122.186] (ovpn-122-186.rdu2.redhat.com [10.10.122.186])\n\tby smtp.corp.redhat.com (Postfix) with ESMTP id AB72417194;\n\tThu, 31 Aug 2017 14:54:24 +0000 (UTC)"],"DMARC-Filter":"OpenDMARC Filter v1.3.2 mx1.redhat.com D8409461D9","To":"\"Daniel P. Berrange\" <berrange@redhat.com>, qemu-devel@nongnu.org","References":"<20170831110518.10741-1-berrange@redhat.com>\n\t<20170831110518.10741-3-berrange@redhat.com>","From":"Eric Blake <eblake@redhat.com>","Openpgp":"url=http://people.redhat.com/eblake/eblake.gpg","Organization":"Red Hat, Inc.","Message-ID":"<dc675dcb-63f6-1cd5-5267-bd9f6743fdad@redhat.com>","Date":"Thu, 31 Aug 2017 09:54:23 -0500","User-Agent":"Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101\n\tThunderbird/52.3.0","MIME-Version":"1.0","In-Reply-To":"<20170831110518.10741-3-berrange@redhat.com>","Content-Type":"multipart/signed; micalg=pgp-sha256;\n\tprotocol=\"application/pgp-signature\";\n\tboundary=\"QJKhomTkwvsrikxcxDO8KXulhi9LiJb92\"","X-Scanned-By":"MIMEDefang 2.79 on 10.5.11.16","X-Greylist":"Sender IP whitelisted, not delayed by milter-greylist-4.5.16\n\t(mx1.redhat.com [10.5.110.29]);\n\tThu, 31 Aug 2017 14:54:26 +0000 (UTC)","X-detected-operating-system":"by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]\n\t[fuzzy]","X-Received-From":"209.132.183.28","X-Content-Filtered-By":"Mailman/MimeDel 2.1.21","Subject":"Re: [Qemu-devel] [PATCH v2 2/4] block: use BDRV_SECTOR_SIZE in\n\tcrypto driver","X-BeenThere":"qemu-devel@nongnu.org","X-Mailman-Version":"2.1.21","Precedence":"list","List-Id":"<qemu-devel.nongnu.org>","List-Unsubscribe":"<https://lists.nongnu.org/mailman/options/qemu-devel>,\n\t<mailto:qemu-devel-request@nongnu.org?subject=unsubscribe>","List-Archive":"<http://lists.nongnu.org/archive/html/qemu-devel/>","List-Post":"<mailto:qemu-devel@nongnu.org>","List-Help":"<mailto:qemu-devel-request@nongnu.org?subject=help>","List-Subscribe":"<https://lists.nongnu.org/mailman/listinfo/qemu-devel>,\n\t<mailto:qemu-devel-request@nongnu.org?subject=subscribe>","Cc":"Kevin Wolf <kwolf@redhat.com>, Stefan Hajnoczi <stefanha@gmail.com>,\n\tqemu-block@nongnu.org, Max Reitz <mreitz@redhat.com>","Errors-To":"qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org","Sender":"\"Qemu-devel\"\n\t<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>"}},{"id":1763158,"web_url":"http://patchwork.ozlabs.org/comment/1763158/","msgid":"<20170905095215.GF4633@localhost.localdomain>","list_archive_url":null,"date":"2017-09-05T09:52:15","subject":"Re: [Qemu-devel] [PATCH v2 2/4] block: use BDRV_SECTOR_SIZE in\n\tcrypto driver","submitter":{"id":2714,"url":"http://patchwork.ozlabs.org/api/people/2714/","name":"Kevin Wolf","email":"kwolf@redhat.com"},"content":"Am 31.08.2017 um 13:05 hat Daniel P. Berrange geschrieben:\n> Signed-off-by: Daniel P. Berrange <berrange@redhat.com>\n> ---\n>  block/crypto.c | 32 ++++++++++++++++----------------\n>  1 file changed, 16 insertions(+), 16 deletions(-)\n\nI'm actually not sure about this one. Anything that is left after\npatch 3 is probably not the arbitrary unit that qemu uses internally\nfor some interfaces, but the unit in which data is encrypted.\n\nBasically, if just for fun we ever changed the unit of things like\nbdrv_write() from 512 to 4096, then everything that needs to or at least\ncan be changed to use 4096 is BDRV_SECTOR_SIZE. But everything that\nneeds to stay on 512 (like I suspect most of the occurrences in the\ncrypto driver) is a different constant really (QCRYPTO_SECTOR_SIZE?).\n\nKevin","headers":{"Return-Path":"<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>","X-Original-To":"incoming@patchwork.ozlabs.org","Delivered-To":"patchwork-incoming@bilbo.ozlabs.org","Authentication-Results":["ozlabs.org;\n\tspf=pass (mailfrom) smtp.mailfrom=nongnu.org\n\t(client-ip=2001:4830:134:3::11; helo=lists.gnu.org;\n\tenvelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org;\n\treceiver=<UNKNOWN>)","ext-mx04.extmail.prod.ext.phx2.redhat.com;\n\tdmarc=none (p=none dis=none) header.from=redhat.com","ext-mx04.extmail.prod.ext.phx2.redhat.com;\n\tspf=fail smtp.mailfrom=kwolf@redhat.com"],"Received":["from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11])\n\t(using TLSv1 with cipher AES256-SHA (256/256 bits))\n\t(No client certificate requested)\n\tby ozlabs.org (Postfix) with ESMTPS id 3xmhqL1xssz9s9Y\n\tfor <incoming@patchwork.ozlabs.org>;\n\tTue,  5 Sep 2017 19:53:18 +1000 (AEST)","from localhost ([::1]:57813 helo=lists.gnu.org)\n\tby lists.gnu.org with esmtp (Exim 4.71) (envelope-from\n\t<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>)\n\tid 1dpAXk-0001EK-CE\n\tfor incoming@patchwork.ozlabs.org; Tue, 05 Sep 2017 05:53:16 -0400","from eggs.gnu.org ([2001:4830:134:3::10]:60307)\n\tby lists.gnu.org with esmtp (Exim 4.71)\n\t(envelope-from <kwolf@redhat.com>) id 1dpAX3-00019s-Hz\n\tfor qemu-devel@nongnu.org; Tue, 05 Sep 2017 05:52:38 -0400","from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)\n\t(envelope-from <kwolf@redhat.com>) id 1dpAWz-0000PC-18\n\tfor qemu-devel@nongnu.org; Tue, 05 Sep 2017 05:52:33 -0400","from mx1.redhat.com ([209.132.183.28]:54982)\n\tby eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32)\n\t(Exim 4.71) (envelope-from <kwolf@redhat.com>)\n\tid 1dpAWp-0000Ku-KS; Tue, 05 Sep 2017 05:52:19 -0400","from smtp.corp.redhat.com\n\t(int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14])\n\t(using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits))\n\t(No client certificate requested)\n\tby mx1.redhat.com (Postfix) with ESMTPS id 9C88980467;\n\tTue,  5 Sep 2017 09:52:18 +0000 (UTC)","from localhost.localdomain (ovpn-117-102.ams2.redhat.com\n\t[10.36.117.102])\n\tby smtp.corp.redhat.com (Postfix) with ESMTPS id 3A0DA7D3FA;\n\tTue,  5 Sep 2017 09:52:17 +0000 (UTC)"],"DMARC-Filter":"OpenDMARC Filter v1.3.2 mx1.redhat.com 9C88980467","Date":"Tue, 5 Sep 2017 11:52:15 +0200","From":"Kevin Wolf <kwolf@redhat.com>","To":"\"Daniel P. Berrange\" <berrange@redhat.com>","Message-ID":"<20170905095215.GF4633@localhost.localdomain>","References":"<20170831110518.10741-1-berrange@redhat.com>\n\t<20170831110518.10741-3-berrange@redhat.com>","MIME-Version":"1.0","Content-Type":"text/plain; charset=us-ascii","Content-Disposition":"inline","In-Reply-To":"<20170831110518.10741-3-berrange@redhat.com>","User-Agent":"Mutt/1.8.3 (2017-05-23)","X-Scanned-By":"MIMEDefang 2.79 on 10.5.11.14","X-Greylist":"Sender IP whitelisted, not delayed by milter-greylist-4.5.16\n\t(mx1.redhat.com [10.5.110.28]);\n\tTue, 05 Sep 2017 09:52:18 +0000 (UTC)","X-detected-operating-system":"by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]\n\t[fuzzy]","X-Received-From":"209.132.183.28","Subject":"Re: [Qemu-devel] [PATCH v2 2/4] block: use BDRV_SECTOR_SIZE in\n\tcrypto driver","X-BeenThere":"qemu-devel@nongnu.org","X-Mailman-Version":"2.1.21","Precedence":"list","List-Id":"<qemu-devel.nongnu.org>","List-Unsubscribe":"<https://lists.nongnu.org/mailman/options/qemu-devel>,\n\t<mailto:qemu-devel-request@nongnu.org?subject=unsubscribe>","List-Archive":"<http://lists.nongnu.org/archive/html/qemu-devel/>","List-Post":"<mailto:qemu-devel@nongnu.org>","List-Help":"<mailto:qemu-devel-request@nongnu.org?subject=help>","List-Subscribe":"<https://lists.nongnu.org/mailman/listinfo/qemu-devel>,\n\t<mailto:qemu-devel-request@nongnu.org?subject=subscribe>","Cc":"Stefan Hajnoczi <stefanha@gmail.com>, qemu-devel@nongnu.org,\n\tqemu-block@nongnu.org, Max Reitz <mreitz@redhat.com>","Errors-To":"qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org","Sender":"\"Qemu-devel\"\n\t<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>"}},{"id":1763172,"web_url":"http://patchwork.ozlabs.org/comment/1763172/","msgid":"<20170905100538.GC311@redhat.com>","list_archive_url":null,"date":"2017-09-05T10:05:38","subject":"Re: [Qemu-devel] [PATCH v2 2/4] block: use BDRV_SECTOR_SIZE in\n\tcrypto driver","submitter":{"id":2694,"url":"http://patchwork.ozlabs.org/api/people/2694/","name":"Daniel P. Berrangé","email":"berrange@redhat.com"},"content":"On Tue, Sep 05, 2017 at 11:52:15AM +0200, Kevin Wolf wrote:\n> Am 31.08.2017 um 13:05 hat Daniel P. Berrange geschrieben:\n> > Signed-off-by: Daniel P. Berrange <berrange@redhat.com>\n> > ---\n> >  block/crypto.c | 32 ++++++++++++++++----------------\n> >  1 file changed, 16 insertions(+), 16 deletions(-)\n> \n> I'm actually not sure about this one. Anything that is left after\n> patch 3 is probably not the arbitrary unit that qemu uses internally\n> for some interfaces, but the unit in which data is encrypted.\n> \n> Basically, if just for fun we ever changed the unit of things like\n> bdrv_write() from 512 to 4096, then everything that needs to or at least\n> can be changed to use 4096 is BDRV_SECTOR_SIZE. But everything that\n> needs to stay on 512 (like I suspect most of the occurrences in the\n> crypto driver) is a different constant really (QCRYPTO_SECTOR_SIZE?).\n\nYeah for sure LUKSv1 & legacy qcow2 encryption need to stay 512\nforever, so if BDRV_SECTOR_SIZE were to change that would be a\nproblem.\n\nI wrote this on the assumption that we would never change BDRV_SECTOR_SIZE\nthough. If we did need different sector sizes in the block layer I figured\nit would surely end up being a dynamic property per disk, rather than just\nchanging the compile time constant. So from that POV I thought it ok to\nuse BDRV_SECTOR_SIZE.\n\nPerhaps I should instead add a qcrypto_block_get_sector_size() API though\nand use that, so we can fetch the sector size per encryption scheme in\ncase we ever get a scheme using a non-512 sector size for encryption.\n\nRegards,\nDaniel","headers":{"Return-Path":"<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>","X-Original-To":"incoming@patchwork.ozlabs.org","Delivered-To":"patchwork-incoming@bilbo.ozlabs.org","Authentication-Results":["ozlabs.org;\n\tspf=pass (mailfrom) smtp.mailfrom=nongnu.org\n\t(client-ip=2001:4830:134:3::11; helo=lists.gnu.org;\n\tenvelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org;\n\treceiver=<UNKNOWN>)","ext-mx06.extmail.prod.ext.phx2.redhat.com;\n\tdmarc=none (p=none dis=none) header.from=redhat.com","ext-mx06.extmail.prod.ext.phx2.redhat.com;\n\tspf=fail smtp.mailfrom=berrange@redhat.com"],"Received":["from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11])\n\t(using TLSv1 with cipher AES256-SHA (256/256 bits))\n\t(No client certificate requested)\n\tby ozlabs.org (Postfix) with ESMTPS id 3xmj6p5KZCz9s9Y\n\tfor <incoming@patchwork.ozlabs.org>;\n\tTue,  5 Sep 2017 20:06:42 +1000 (AEST)","from localhost ([::1]:57879 helo=lists.gnu.org)\n\tby lists.gnu.org with esmtp (Exim 4.71) (envelope-from\n\t<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>)\n\tid 1dpAki-0002hn-JP\n\tfor incoming@patchwork.ozlabs.org; Tue, 05 Sep 2017 06:06:40 -0400","from eggs.gnu.org ([2001:4830:134:3::10]:40110)\n\tby lists.gnu.org with esmtp (Exim 4.71)\n\t(envelope-from <berrange@redhat.com>) id 1dpAk5-0002dl-2Z\n\tfor qemu-devel@nongnu.org; Tue, 05 Sep 2017 06:06:06 -0400","from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)\n\t(envelope-from <berrange@redhat.com>) id 1dpAk0-00044n-4n\n\tfor qemu-devel@nongnu.org; Tue, 05 Sep 2017 06:06:01 -0400","from mx1.redhat.com ([209.132.183.28]:40986)\n\tby eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32)\n\t(Exim 4.71) (envelope-from <berrange@redhat.com>)\n\tid 1dpAjm-0003gV-Ll; Tue, 05 Sep 2017 06:05:42 -0400","from smtp.corp.redhat.com\n\t(int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14])\n\t(using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits))\n\t(No client certificate requested)\n\tby mx1.redhat.com (Postfix) with ESMTPS id 8E49E356C2;\n\tTue,  5 Sep 2017 10:05:41 +0000 (UTC)","from redhat.com (unknown [10.33.36.63])\n\tby smtp.corp.redhat.com (Postfix) with ESMTPS id 594597DED2;\n\tTue,  5 Sep 2017 10:05:40 +0000 (UTC)"],"DMARC-Filter":"OpenDMARC Filter v1.3.2 mx1.redhat.com 8E49E356C2","Date":"Tue, 5 Sep 2017 11:05:38 +0100","From":"\"Daniel P. Berrange\" <berrange@redhat.com>","To":"Kevin Wolf <kwolf@redhat.com>","Message-ID":"<20170905100538.GC311@redhat.com>","References":"<20170831110518.10741-1-berrange@redhat.com>\n\t<20170831110518.10741-3-berrange@redhat.com>\n\t<20170905095215.GF4633@localhost.localdomain>","MIME-Version":"1.0","Content-Type":"text/plain; charset=utf-8","Content-Disposition":"inline","In-Reply-To":"<20170905095215.GF4633@localhost.localdomain>","User-Agent":"Mutt/1.8.3 (2017-05-23)","X-Scanned-By":"MIMEDefang 2.79 on 10.5.11.14","X-Greylist":"Sender IP whitelisted, not delayed by milter-greylist-4.5.16\n\t(mx1.redhat.com [10.5.110.30]);\n\tTue, 05 Sep 2017 10:05:41 +0000 (UTC)","X-detected-operating-system":"by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]\n\t[fuzzy]","X-Received-From":"209.132.183.28","Subject":"Re: [Qemu-devel] [PATCH v2 2/4] block: use BDRV_SECTOR_SIZE in\n\tcrypto driver","X-BeenThere":"qemu-devel@nongnu.org","X-Mailman-Version":"2.1.21","Precedence":"list","List-Id":"<qemu-devel.nongnu.org>","List-Unsubscribe":"<https://lists.nongnu.org/mailman/options/qemu-devel>,\n\t<mailto:qemu-devel-request@nongnu.org?subject=unsubscribe>","List-Archive":"<http://lists.nongnu.org/archive/html/qemu-devel/>","List-Post":"<mailto:qemu-devel@nongnu.org>","List-Help":"<mailto:qemu-devel-request@nongnu.org?subject=help>","List-Subscribe":"<https://lists.nongnu.org/mailman/listinfo/qemu-devel>,\n\t<mailto:qemu-devel-request@nongnu.org?subject=subscribe>","Reply-To":"\"Daniel P. Berrange\" <berrange@redhat.com>","Cc":"Stefan Hajnoczi <stefanha@gmail.com>, qemu-devel@nongnu.org,\n\tqemu-block@nongnu.org, Max Reitz <mreitz@redhat.com>","Errors-To":"qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org","Sender":"\"Qemu-devel\"\n\t<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>"}},{"id":1763181,"web_url":"http://patchwork.ozlabs.org/comment/1763181/","msgid":"<20170905102348.GG4633@localhost.localdomain>","list_archive_url":null,"date":"2017-09-05T10:23:48","subject":"Re: [Qemu-devel] [PATCH v2 2/4] block: use BDRV_SECTOR_SIZE in\n\tcrypto driver","submitter":{"id":2714,"url":"http://patchwork.ozlabs.org/api/people/2714/","name":"Kevin Wolf","email":"kwolf@redhat.com"},"content":"Am 05.09.2017 um 12:05 hat Daniel P. Berrange geschrieben:\n> On Tue, Sep 05, 2017 at 11:52:15AM +0200, Kevin Wolf wrote:\n> > Am 31.08.2017 um 13:05 hat Daniel P. Berrange geschrieben:\n> > > Signed-off-by: Daniel P. Berrange <berrange@redhat.com>\n> > > ---\n> > >  block/crypto.c | 32 ++++++++++++++++----------------\n> > >  1 file changed, 16 insertions(+), 16 deletions(-)\n> > \n> > I'm actually not sure about this one. Anything that is left after\n> > patch 3 is probably not the arbitrary unit that qemu uses internally\n> > for some interfaces, but the unit in which data is encrypted.\n> > \n> > Basically, if just for fun we ever changed the unit of things like\n> > bdrv_write() from 512 to 4096, then everything that needs to or at least\n> > can be changed to use 4096 is BDRV_SECTOR_SIZE. But everything that\n> > needs to stay on 512 (like I suspect most of the occurrences in the\n> > crypto driver) is a different constant really (QCRYPTO_SECTOR_SIZE?).\n> \n> Yeah for sure LUKSv1 & legacy qcow2 encryption need to stay 512\n> forever, so if BDRV_SECTOR_SIZE were to change that would be a\n> problem.\n> \n> I wrote this on the assumption that we would never change BDRV_SECTOR_SIZE\n> though. If we did need different sector sizes in the block layer I figured\n> it would surely end up being a dynamic property per disk, rather than just\n> changing the compile time constant. So from that POV I thought it ok to\n> use BDRV_SECTOR_SIZE.\n\nYes, I agree that we'll never BDRV_SECTOR_SIZE in practice. I just use\nthis as a way to check whether this is really BDRV_SECTOR_SIZE, or\nwhether we have two different quantities that just happen to be both\n512.\n\nFor example, QDICT_BUCKET_MAX is also 512, but that doesn't make it\nright to use here, even though it works and is unlikely to change.\n\nWhat we may actually want to do at some point (won't be in the near\nfuture, though) is removing BDRV_SECTOR_SIZE because it refers to an\narbitrary unit in APIs and we're in the process of making everything\nbyte-based instead. This is another way to check whether some value is\nBDRV_SECTOR_SIZE: If it will remain even after removing APIs with\nsector-based parameters, it's probably something different.\n\n> Perhaps I should instead add a qcrypto_block_get_sector_size() API though\n> and use that, so we can fetch the sector size per encryption scheme in\n> case we ever get a scheme using a non-512 sector size for encryption.\n\nIf you have a use for it, sure. Otherwise, I'd just suggest introducing\nanother constant for now.\n\nKevin","headers":{"Return-Path":"<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>","X-Original-To":"incoming@patchwork.ozlabs.org","Delivered-To":"patchwork-incoming@bilbo.ozlabs.org","Authentication-Results":["ozlabs.org;\n\tspf=pass (mailfrom) smtp.mailfrom=nongnu.org\n\t(client-ip=2001:4830:134:3::11; helo=lists.gnu.org;\n\tenvelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org;\n\treceiver=<UNKNOWN>)","ext-mx06.extmail.prod.ext.phx2.redhat.com;\n\tdmarc=none (p=none dis=none) header.from=redhat.com","ext-mx06.extmail.prod.ext.phx2.redhat.com;\n\tspf=fail smtp.mailfrom=kwolf@redhat.com"],"Received":["from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11])\n\t(using TLSv1 with cipher AES256-SHA (256/256 bits))\n\t(No client certificate requested)\n\tby ozlabs.org (Postfix) with ESMTPS id 3xmjWl1qSmz9s3w\n\tfor <incoming@patchwork.ozlabs.org>;\n\tTue,  5 Sep 2017 20:24:50 +1000 (AEST)","from localhost ([::1]:57963 helo=lists.gnu.org)\n\tby lists.gnu.org with esmtp (Exim 4.71) (envelope-from\n\t<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>)\n\tid 1dpB2E-0002vW-CO\n\tfor incoming@patchwork.ozlabs.org; Tue, 05 Sep 2017 06:24:46 -0400","from eggs.gnu.org ([2001:4830:134:3::10]:49242)\n\tby lists.gnu.org with esmtp (Exim 4.71)\n\t(envelope-from <kwolf@redhat.com>) id 1dpB1h-0002v4-Ji\n\tfor qemu-devel@nongnu.org; Tue, 05 Sep 2017 06:24:23 -0400","from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)\n\t(envelope-from <kwolf@redhat.com>) id 1dpB1c-0003LP-Q6\n\tfor qemu-devel@nongnu.org; Tue, 05 Sep 2017 06:24:13 -0400","from mx1.redhat.com ([209.132.183.28]:48786)\n\tby eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32)\n\t(Exim 4.71) (envelope-from <kwolf@redhat.com>)\n\tid 1dpB1S-0003Do-Mc; Tue, 05 Sep 2017 06:23:58 -0400","from smtp.corp.redhat.com\n\t(int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15])\n\t(using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits))\n\t(No client certificate requested)\n\tby mx1.redhat.com (Postfix) with ESMTPS id C8F91356C2;\n\tTue,  5 Sep 2017 10:23:56 +0000 (UTC)","from localhost.localdomain (ovpn-117-102.ams2.redhat.com\n\t[10.36.117.102])\n\tby smtp.corp.redhat.com (Postfix) with ESMTPS id 41ADA6BE4A;\n\tTue,  5 Sep 2017 10:23:55 +0000 (UTC)"],"DMARC-Filter":"OpenDMARC Filter v1.3.2 mx1.redhat.com C8F91356C2","Date":"Tue, 5 Sep 2017 12:23:48 +0200","From":"Kevin Wolf <kwolf@redhat.com>","To":"\"Daniel P. Berrange\" <berrange@redhat.com>","Message-ID":"<20170905102348.GG4633@localhost.localdomain>","References":"<20170831110518.10741-1-berrange@redhat.com>\n\t<20170831110518.10741-3-berrange@redhat.com>\n\t<20170905095215.GF4633@localhost.localdomain>\n\t<20170905100538.GC311@redhat.com>","MIME-Version":"1.0","Content-Type":"text/plain; charset=us-ascii","Content-Disposition":"inline","In-Reply-To":"<20170905100538.GC311@redhat.com>","User-Agent":"Mutt/1.8.3 (2017-05-23)","X-Scanned-By":"MIMEDefang 2.79 on 10.5.11.15","X-Greylist":"Sender IP whitelisted, not delayed by milter-greylist-4.5.16\n\t(mx1.redhat.com [10.5.110.30]);\n\tTue, 05 Sep 2017 10:23:56 +0000 (UTC)","X-detected-operating-system":"by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]\n\t[fuzzy]","X-Received-From":"209.132.183.28","Subject":"Re: [Qemu-devel] [PATCH v2 2/4] block: use BDRV_SECTOR_SIZE in\n\tcrypto driver","X-BeenThere":"qemu-devel@nongnu.org","X-Mailman-Version":"2.1.21","Precedence":"list","List-Id":"<qemu-devel.nongnu.org>","List-Unsubscribe":"<https://lists.nongnu.org/mailman/options/qemu-devel>,\n\t<mailto:qemu-devel-request@nongnu.org?subject=unsubscribe>","List-Archive":"<http://lists.nongnu.org/archive/html/qemu-devel/>","List-Post":"<mailto:qemu-devel@nongnu.org>","List-Help":"<mailto:qemu-devel-request@nongnu.org?subject=help>","List-Subscribe":"<https://lists.nongnu.org/mailman/listinfo/qemu-devel>,\n\t<mailto:qemu-devel-request@nongnu.org?subject=subscribe>","Cc":"Stefan Hajnoczi <stefanha@gmail.com>, qemu-devel@nongnu.org,\n\tqemu-block@nongnu.org, Max Reitz <mreitz@redhat.com>","Errors-To":"qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org","Sender":"\"Qemu-devel\"\n\t<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>"}}]