From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:50925) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1T8nMQ-0007Dz-4H for qemu-devel@nongnu.org; Tue, 04 Sep 2012 03:15:50 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1T8nML-0006QY-Vq for qemu-devel@nongnu.org; Tue, 04 Sep 2012 03:15:46 -0400 Received: from e28smtp06.in.ibm.com ([122.248.162.6]:41579) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1T8nML-0006QJ-72 for qemu-devel@nongnu.org; Tue, 04 Sep 2012 03:15:41 -0400 Received: from /spool/local by e28smtp06.in.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Tue, 4 Sep 2012 12:45:38 +0530 Received: from d28av03.in.ibm.com (d28av03.in.ibm.com [9.184.220.65]) by d28relay02.in.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id q847FXAP33357962 for ; Tue, 4 Sep 2012 12:45:34 +0530 Received: from d28av03.in.ibm.com (loopback [127.0.0.1]) by d28av03.in.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id q847FWXM018335 for ; Tue, 4 Sep 2012 17:15:33 +1000 Message-ID: <5045AA90.4050001@linux.vnet.ibm.com> Date: Tue, 04 Sep 2012 15:15:28 +0800 From: Wenchao Xia 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> In-Reply-To: <5044CA2F.8000505@redhat.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Subject: Re: [Qemu-devel] [PATCH 4/6] libqblock internal used functions List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Paolo Bonzini Cc: kwolf@redhat.com, stefanha@gmail.com, aliguori@us.ibm.com, Eric Blake , qemu-devel@nongnu.org 于 2012-9-3 23:18, Paolo Bonzini 写道: > 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? -- Best Regards Wenchao Xia