From patchwork Mon Dec 5 14:21:02 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kevin Wolf X-Patchwork-Id: 129340 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [140.186.70.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 5BFB0B6F9C for ; Tue, 6 Dec 2011 02:50:04 +1100 (EST) Received: from localhost ([::1]:57033 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RXZOZ-0002ZJ-SN for incoming@patchwork.ozlabs.org; Mon, 05 Dec 2011 09:19:51 -0500 Received: from eggs.gnu.org ([140.186.70.92]:46476) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RXZNU-0000jH-Fv for qemu-devel@nongnu.org; Mon, 05 Dec 2011 09:18:54 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RXZNP-0000IX-EO for qemu-devel@nongnu.org; Mon, 05 Dec 2011 09:18:44 -0500 Received: from mx1.redhat.com ([209.132.183.28]:2163) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RXZNP-0000IE-4u for qemu-devel@nongnu.org; Mon, 05 Dec 2011 09:18:39 -0500 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id pB5EIbn5008120 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Mon, 5 Dec 2011 09:18:37 -0500 Received: from dhcp-5-188.str.redhat.com (dhcp-5-175.str.redhat.com [10.32.5.175]) by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id pB5EI5bG015214; Mon, 5 Dec 2011 09:18:36 -0500 From: Kevin Wolf To: anthony@codemonkey.ws Date: Mon, 5 Dec 2011 15:21:02 +0100 Message-Id: <1323094878-7967-26-git-send-email-kwolf@redhat.com> In-Reply-To: <1323094878-7967-1-git-send-email-kwolf@redhat.com> References: <1323094878-7967-1-git-send-email-kwolf@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.23 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-Received-From: 209.132.183.28 Cc: kwolf@redhat.com, qemu-devel@nongnu.org Subject: [Qemu-devel] [PATCH 25/41] vdi: convert to .bdrv_co_is_allocated() X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org From: 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 Signed-off-by: Kevin Wolf --- block/vdi.c | 6 +++--- 1 files changed, 3 insertions(+), 3 deletions(-) diff --git a/block/vdi.c b/block/vdi.c index 02da6b4..e1d8cff 100644 --- a/block/vdi.c +++ b/block/vdi.c @@ -472,8 +472,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; @@ -996,7 +996,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,