From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:45938) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1T8rT9-0005ZG-AB for qemu-devel@nongnu.org; Tue, 04 Sep 2012 07:39:00 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1T8rT7-0006Do-WE for qemu-devel@nongnu.org; Tue, 04 Sep 2012 07:38:59 -0400 Received: from mx1.redhat.com ([209.132.183.28]:55191) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1T8rT7-0006Dj-Nh for qemu-devel@nongnu.org; Tue, 04 Sep 2012 07:38:57 -0400 Message-ID: <5045E84C.6030902@redhat.com> Date: Tue, 04 Sep 2012 05:38:52 -0600 From: Eric Blake MIME-Version: 1.0 References: <1346663926-20188-1-git-send-email-xiawenc@linux.vnet.ibm.com> <1346663926-20188-5-git-send-email-xiawenc@linux.vnet.ibm.com> <5044BE96.7080701@redhat.com> <5044CA2F.8000505@redhat.com> <5045AA90.4050001@linux.vnet.ibm.com> In-Reply-To: <5045AA90.4050001@linux.vnet.ibm.com> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="------------enigFBC99B9BD47C98B35E7867D9" Subject: Re: [Qemu-devel] [PATCH 4/6] libqblock internal used functions List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Wenchao Xia Cc: kwolf@redhat.com, Paolo Bonzini , aliguori@us.ibm.com, qemu-devel@nongnu.org, stefanha@gmail.com This is an OpenPGP/MIME signed message (RFC 2440 and 3156) --------------enigFBC99B9BD47C98B35E7867D9 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On 09/04/2012 01:15 AM, Wenchao Xia wrote: > =E4=BA=8E 2012-9-3 23:18, Paolo Bonzini =E5=86=99=E9=81=93: >> Il 03/09/2012 16:28, Eric Blake ha scritto: >>>>> +/* this file contains helper function used internally. */ >>>>> +#define SECTOR_SIZE (512) >>> Hard-coding this feels wrong, in this day and age of disks with 4096 >>> sectors. Why isn't this a per-image property? >> >> In this day and age of disks with 4096 sectors, Linux does not provide= a >> way to query the required alignment for O_DIRECT... >> >> Paolo >> > in block.h: > #define BDRV_SECTOR_BITS 9 > #define BDRV_SECTOR_SIZE (1ULL << BDRV_SECTOR_BITS) > #define BDRV_SECTOR_MASK ~(BDRV_SECTOR_SIZE - 1) > it seems block size is always 512 in qemu block layer, so I can > ignore the 4096 case, do you think so? Since qemu does not support it now, yes, you can ignore it for now. But please make sure that you aren't hard-coding it into the API - that is, make sure that the API can someday grow to support larger sector sizes with minimal impact to library clients (that is, that new clients aware of the new API can target larger sector size once qemu has been patched to support larger sector size). --=20 Eric Blake eblake@redhat.com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --------------enigFBC99B9BD47C98B35E7867D9 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.12 (GNU/Linux) Comment: Public key at http://people.redhat.com/eblake/eblake.gpg Comment: Using GnuPG with Mozilla - http://www.enigmail.net/ iQEcBAEBCAAGBQJQRehMAAoJEKeha0olJ0NqEF8IAJtMiLsB9yB9FxmLcSNwD1DV yBbQBJsSu5ybsnwTJq2cQgXOdodiXb/zxDcIccikYD4leWnqqASSoRQVbsirjEA2 O8AkiD3Yzuu8OMpwZmxJBQh/Y1up76Zj9aAYhDn58o+gS5lc7mE4rGVK6W8BqxqO M/QilTXrpJLdYkB9q04A3MC3ydBDzV5AJreTcgiS9yj+kNW1yyk6or+lfv4Yx+dq SKB9A849zLl97oxg4p3JJCgyu+hJnPEVLqdMIeAev4YoQgWezfe8pXOWXWuUQ6nN mLm2HWfS3T7ObenV/u/FwLpc9hHQ6qpFkr71T4Y1G42ms+COvIX46dUpC1s4Y7c= =9PY9 -----END PGP SIGNATURE----- --------------enigFBC99B9BD47C98B35E7867D9--