Received: from eggs.gnu.org ([140.186.70.92]:54196) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RPvu7-0008UR-Au for qemu-devel@nongnu.org; Mon, 14 Nov 2011 07:44:53 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RPvu4-00049e-4M for qemu-devel@nongnu.org; Mon, 14 Nov 2011 07:44:51 -0500 Received: from mtagate2.uk.ibm.com ([194.196.100.162]:38146) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RPvu3-00048v-TE for qemu-devel@nongnu.org; Mon, 14 Nov 2011 07:44:48 -0500 Received: from d06nrmr1707.portsmouth.uk.ibm.com (d06nrmr1707.portsmouth.uk.ibm.com [9.149.39.225]) by mtagate2.uk.ibm.com (8.13.1/8.13.1) with ESMTP id pAECilhb032520 for ; Mon, 14 Nov 2011 12:44:47 GMT Received: from d06av02.portsmouth.uk.ibm.com (d06av02.portsmouth.uk.ibm.com [9.149.37.228]) by d06nrmr1707.portsmouth.uk.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id pAECikiK1863730 for ; Mon, 14 Nov 2011 12:44:46 GMT Received: from d06av02.portsmouth.uk.ibm.com (loopback [127.0.0.1]) by d06av02.portsmouth.uk.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id pAECikrK032642 for ; Mon, 14 Nov 2011 05:44:46 -0700 From: Stefan Hajnoczi Date: Mon, 14 Nov 2011 12:44:23 +0000 Message-Id: <1321274666-14041-7-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 6/9] vdi: convert to .bdrv_co_is_allocated() 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 It is trivial to switch from the synchronous .bdrv_is_allocated() interface to .bdrv_co_is_allocated() since vdi_is_allocated() does not block. Signed-off-by: Stefan Hajnoczi --- block/vdi.c | 6 +++--- 1 files changed, 3 insertions(+), 3 deletions(-) diff --git a/block/vdi.c b/block/vdi.c index 684a4a8..e852456 100644 --- a/block/vdi.c +++ b/block/vdi.c @@ -463,8 +463,8 @@ static int vdi_open(BlockDriverState *bs, int flags) return -1; } -static int vdi_is_allocated(BlockDriverState *bs, int64_t sector_num, - int nb_sectors, int *pnum) +static int coroutine_fn vdi_co_is_allocated(BlockDriverState *bs, + int64_t sector_num, int nb_sectors, int *pnum) { /* TODO: Check for too large sector_num (in bdrv_is_allocated or here). */ BDRVVdiState *s = (BDRVVdiState *)bs->opaque; @@ -981,7 +981,7 @@ static BlockDriver bdrv_vdi = { .bdrv_close = vdi_close, .bdrv_create = vdi_create, .bdrv_co_flush_to_disk = vdi_co_flush, - .bdrv_is_allocated = vdi_is_allocated, + .bdrv_co_is_allocated = vdi_co_is_allocated, .bdrv_make_empty = vdi_make_empty, .bdrv_aio_readv = vdi_aio_readv, -- 1.7.7.1