From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:34212) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SwrGa-00049Y-Dv for qemu-devel@nongnu.org; Thu, 02 Aug 2012 05:00:30 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SwrGV-0004ua-S8 for qemu-devel@nongnu.org; Thu, 02 Aug 2012 05:00:24 -0400 Received: from mx1.redhat.com ([209.132.183.28]:50598) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SwrGV-0004uW-KK for qemu-devel@nongnu.org; Thu, 02 Aug 2012 05:00:19 -0400 Message-ID: <501A419D.2060307@redhat.com> Date: Thu, 02 Aug 2012 11:00:13 +0200 From: Paolo Bonzini MIME-Version: 1.0 References: <1343812186-11594-1-git-send-email-xiawenc@linux.vnet.ibm.com> <501A3B24.6000203@linux.vnet.ibm.com> In-Reply-To: <501A3B24.6000203@linux.vnet.ibm.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH] [RFC] libqblock draft code v1 List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Wenchao Xia Cc: Blue Swirl , aliguori@us.ibm.com, qemu-devel@nongnu.org, stefanha@linux.vnet.ibm.com Il 02/08/2012 10:32, Wenchao Xia ha scritto: >> >> ssize_t qb_read(struct QBlockState *qbs, void *buf, size_t len, off_t >> offset) >> > OK. > >>> +{ >>> + int ret; >>> + BlockDriverState *bs; >>> + >>> + bs = (BlockDriverState *)qbs->bdrvs; >>> + >>> + ret = bdrv_read(bs, start / 512, >>> + buf, len / 512); >> >> IIRC there is a constant for 512 somewhere. >> > will include that header. Also assert that start and len are aligned. Paolo