From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:54280) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ROuGU-0007qL-Ee for qemu-devel@nongnu.org; Fri, 11 Nov 2011 11:47:43 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ROuGQ-0000qJ-RC for qemu-devel@nongnu.org; Fri, 11 Nov 2011 11:47:42 -0500 Received: from mtagate3.uk.ibm.com ([194.196.100.163]:33869) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ROuGQ-0000pn-Et for qemu-devel@nongnu.org; Fri, 11 Nov 2011 11:47:38 -0500 Received: from d06nrmr1307.portsmouth.uk.ibm.com (d06nrmr1307.portsmouth.uk.ibm.com [9.149.38.129]) by mtagate3.uk.ibm.com (8.13.1/8.13.1) with ESMTP id pABGlacI029844 for ; Fri, 11 Nov 2011 16:47:36 GMT Received: from d06av12.portsmouth.uk.ibm.com (d06av12.portsmouth.uk.ibm.com [9.149.37.247]) by d06nrmr1307.portsmouth.uk.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id pABGlZJL2199766 for ; Fri, 11 Nov 2011 16:47:36 GMT Received: from d06av12.portsmouth.uk.ibm.com (loopback [127.0.0.1]) by d06av12.portsmouth.uk.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id pABGlZ8P006549 for ; Fri, 11 Nov 2011 09:47:35 -0700 From: Stefan Hajnoczi Date: Fri, 11 Nov 2011 16:47:19 +0000 Message-Id: <1321030042-20446-8-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 07/10] 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 523a640..1f2bc2c 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 = 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