Received: from eggs.gnu.org ([140.186.70.92]:54224) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ROuGR-0007hR-6W for qemu-devel@nongnu.org; Fri, 11 Nov 2011 11:47:40 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ROuGO-0000pD-9P for qemu-devel@nongnu.org; Fri, 11 Nov 2011 11:47:39 -0500 Received: from mtagate2.uk.ibm.com ([194.196.100.162]:39062) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ROuGO-0000oG-2V for qemu-devel@nongnu.org; Fri, 11 Nov 2011 11:47:36 -0500 Received: from d06nrmr1507.portsmouth.uk.ibm.com (d06nrmr1507.portsmouth.uk.ibm.com [9.149.38.233]) by mtagate2.uk.ibm.com (8.13.1/8.13.1) with ESMTP id pABGlXua017479 for ; Fri, 11 Nov 2011 16:47:33 GMT Received: from d06av01.portsmouth.uk.ibm.com (d06av01.portsmouth.uk.ibm.com [9.149.37.212]) by d06nrmr1507.portsmouth.uk.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id pABGlXKg2195474 for ; Fri, 11 Nov 2011 16:47:33 GMT Received: from d06av01.portsmouth.uk.ibm.com (loopback [127.0.0.1]) by d06av01.portsmouth.uk.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id pABGlWRZ013750 for ; Fri, 11 Nov 2011 09:47:33 -0700 From: Stefan Hajnoczi Date: Fri, 11 Nov 2011 16:47:13 +0000 Message-Id: <1321030042-20446-2-git-send-email-stefanha@linux.vnet.ibm.com> In-Reply-To: <1321030042-20446-1-git-send-email-stefanha@linux.vnet.ibm.com> References: <1321030042-20446-1-git-send-email-stefanha@linux.vnet.ibm.com> Subject: [Qemu-devel] [PATCH 01/10] block: use public bdrv_is_allocated() interface List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Kevin Wolf , Paolo Bonzini , Marcelo Tosatti , Stefan Hajnoczi There is no need for bdrv_commit() to use the BlockDriver .bdrv_is_allocated() interface directly. Converting to the public interface gives us the freedom to drop .bdrv_is_allocated() entirely in favor of a new .bdrv_co_is_allocated() in the future. Signed-off-by: Stefan Hajnoczi --- block.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/block.c b/block.c index 9bb236c..e6ac6d3 100644 --- a/block.c +++ b/block.c @@ -915,7 +915,7 @@ int bdrv_commit(BlockDriverState *bs) buf = g_malloc(COMMIT_BUF_SECTORS * BDRV_SECTOR_SIZE); for (sector = 0; sector < total_sectors; sector += n) { - if (drv->bdrv_is_allocated(bs, sector, COMMIT_BUF_SECTORS, &n)) { + if (bdrv_is_allocated(bs, sector, COMMIT_BUF_SECTORS, &n)) { if (bdrv_read(bs, sector, buf, n) != 0) { ret = -EIO; -- 1.7.7.1