Received: from eggs.gnu.org ([140.186.70.92]:54218) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RPvu8-0008Ub-MV for qemu-devel@nongnu.org; Mon, 14 Nov 2011 07:44:58 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RPvu4-00049B-3F for qemu-devel@nongnu.org; Mon, 14 Nov 2011 07:44:52 -0500 Received: from mtagate2.uk.ibm.com ([194.196.100.162]:38134) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RPvu3-00048U-RC for qemu-devel@nongnu.org; Mon, 14 Nov 2011 07:44:48 -0500 Received: from d06nrmr1806.portsmouth.uk.ibm.com (d06nrmr1806.portsmouth.uk.ibm.com [9.149.39.193]) by mtagate2.uk.ibm.com (8.13.1/8.13.1) with ESMTP id pAECijPT032497 for ; Mon, 14 Nov 2011 12:44:45 GMT Received: from d06av11.portsmouth.uk.ibm.com (d06av11.portsmouth.uk.ibm.com [9.149.37.252]) by d06nrmr1806.portsmouth.uk.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id pAECij042494606 for ; Mon, 14 Nov 2011 12:44:45 GMT Received: from d06av11.portsmouth.uk.ibm.com (loopback [127.0.0.1]) by d06av11.portsmouth.uk.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id pAECiigG008615 for ; Mon, 14 Nov 2011 05:44:44 -0700 From: Stefan Hajnoczi Date: Mon, 14 Nov 2011 12:44:18 +0000 Message-Id: <1321274666-14041-2-git-send-email-stefanha@linux.vnet.ibm.com> In-Reply-To: <1321274666-14041-1-git-send-email-stefanha@linux.vnet.ibm.com> References: <1321274666-14041-1-git-send-email-stefanha@linux.vnet.ibm.com> Subject: [Qemu-devel] [PATCH v2 1/9] 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 d565cde..ab68e53 100644 --- a/block.c +++ b/block.c @@ -1013,7 +1013,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