From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:38394) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1T8niu-0006bU-Hw for qemu-devel@nongnu.org; Tue, 04 Sep 2012 03:39:06 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1T8niq-0004Y1-LZ for qemu-devel@nongnu.org; Tue, 04 Sep 2012 03:39:00 -0400 Received: from mx1.redhat.com ([209.132.183.28]:6715) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1T8niq-0004Xq-CB for qemu-devel@nongnu.org; Tue, 04 Sep 2012 03:38:56 -0400 Message-ID: <5045B00A.5030909@redhat.com> Date: Tue, 04 Sep 2012 09:38:50 +0200 From: Paolo Bonzini 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: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit 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, stefanha@gmail.com, aliguori@us.ibm.com, Eric Blake , qemu-devel@nongnu.org Il 04/09/2012 09:15, Wenchao Xia 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? Yes. It is not well supported yet by QEMU, either. Paolo