From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:46018) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bFU8D-0008Jq-5G for qemu-devel@nongnu.org; Tue, 21 Jun 2016 18:26:54 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bFU8A-00060b-TJ for qemu-devel@nongnu.org; Tue, 21 Jun 2016 18:26:52 -0400 References: <1465939839-30097-1-git-send-email-eblake@redhat.com> <1465939839-30097-18-git-send-email-eblake@redhat.com> <20160621141600.GJ4520@noname.redhat.com> From: Eric Blake Message-ID: <5769BF22.8020907@redhat.com> Date: Tue, 21 Jun 2016 16:26:42 -0600 MIME-Version: 1.0 In-Reply-To: <20160621141600.GJ4520@noname.redhat.com> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="6DiRrNOJnwapAvloATSDoe2mSoJb0HR6F" Subject: Re: [Qemu-devel] [PATCH v2 17/17] block: Move request_alignment into BlockLimit List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Kevin Wolf Cc: qemu-devel@nongnu.org, qemu-block@nongnu.org, Max Reitz , Stefan Hajnoczi , Fam Zheng , Ronnie Sahlberg , Paolo Bonzini , Peter Lieven This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --6DiRrNOJnwapAvloATSDoe2mSoJb0HR6F From: Eric Blake To: Kevin Wolf Cc: qemu-devel@nongnu.org, qemu-block@nongnu.org, Max Reitz , Stefan Hajnoczi , Fam Zheng , Ronnie Sahlberg , Paolo Bonzini , Peter Lieven Message-ID: <5769BF22.8020907@redhat.com> Subject: Re: [PATCH v2 17/17] block: Move request_alignment into BlockLimit References: <1465939839-30097-1-git-send-email-eblake@redhat.com> <1465939839-30097-18-git-send-email-eblake@redhat.com> <20160621141600.GJ4520@noname.redhat.com> In-Reply-To: <20160621141600.GJ4520@noname.redhat.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 06/21/2016 08:16 AM, Kevin Wolf wrote: > Am 14.06.2016 um 23:30 hat Eric Blake geschrieben: >> It makes more sense to have ALL block size limit constraints >> in the same struct. Improve the documentation while at it. >> >> Signed-off-by: Eric Blake >> >> --- >> struct BlockLimits { >> + /* Alignment requirement, in bytes, for offset/length of I/O >> + * requests. Must be a power of 2 less than INT_MAX. A value of 0= >> + * defaults to 1 for drivers with modern byte interfaces, and to >> + * 512 otherwise. */ >=20 > No, a value of zero probably crashes qemu. The defaults apply when they= > aren't overridden by the driver, but this field is always non-zero. >=20 Then why does block.c have: --- a/block.c +++ b/block.c @@ -1016,7 +1016,7 @@ static int bdrv_open_common(BlockDriverState *bs, BdrvChild *file, assert(bdrv_opt_mem_align(bs) !=3D 0); assert(bdrv_min_mem_align(bs) !=3D 0); - assert(is_power_of_2(bs->request_alignment) || bdrv_is_sg(bs)); + assert(is_power_of_2(bs->bl.request_alignment) || bdrv_is_sg(bs)); That says that if bdrv_is_sg(bs), we can indeed have request_alignment be 0. Should I track that down and fix it first, so that request_alignment is always nonzero? If so, is using '1' for bdrv_is_sg(bs) the ideal solution? --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --6DiRrNOJnwapAvloATSDoe2mSoJb0HR6F Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 Comment: Public key at http://people.redhat.com/eblake/eblake.gpg Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iQEcBAEBCAAGBQJXab8iAAoJEKeha0olJ0NqMxYIAJfFLDeOnz40v8UoMx4ZdFsQ EnLb/SkbDVwil+bljhOAvhdDUxhFvteKmWpYhm0Jj5J5r0x/u2NkQWcoOXy+sdrv AnZn1RI7Y6f5ljzijcEeGpGVFXCvTNyvLIUAJ19ddW/4G9pDyTL1WkjuzJaqiMaX xIry//OU1dEmZTAN7+U7Gd6nkv6BqWEydbj24+2zjNQ2V8t4zAo9KnNlH95tMsRv taF/W5MMIc82AitY+jMIAatZi0Mzk1X4Tl5DRXuW+g823PDsiAekGd8gHQ29Tj3U 8i7CVn/Yn90a2op2x2wOdNhQjGQh6Hl0juoBeN8qvh9Pk0mYGsrVzUtyapu81LA= =5+d3 -----END PGP SIGNATURE----- --6DiRrNOJnwapAvloATSDoe2mSoJb0HR6F--