From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:46931) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RBUA4-0003l7-60 for qemu-devel@nongnu.org; Wed, 05 Oct 2011 12:17:37 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RBUA2-0002Ps-UI for qemu-devel@nongnu.org; Wed, 05 Oct 2011 12:17:36 -0400 Received: from mtagate3.uk.ibm.com ([194.196.100.163]:45521) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RBUA2-0002Lg-Kl for qemu-devel@nongnu.org; Wed, 05 Oct 2011 12:17:34 -0400 Received: from d06nrmr1707.portsmouth.uk.ibm.com (d06nrmr1707.portsmouth.uk.ibm.com [9.149.39.225]) by mtagate3.uk.ibm.com (8.13.1/8.13.1) with ESMTP id p95GHJsA000422 for ; Wed, 5 Oct 2011 16:17:19 GMT Received: from d06av12.portsmouth.uk.ibm.com (d06av12.portsmouth.uk.ibm.com [9.149.37.247]) by d06nrmr1707.portsmouth.uk.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id p95GHJDs1667154 for ; Wed, 5 Oct 2011 17:17:19 +0100 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 p95GHIi7030257 for ; Wed, 5 Oct 2011 10:17:19 -0600 From: Stefan Hajnoczi Date: Wed, 5 Oct 2011 17:17:02 +0100 Message-Id: <1317831427-477-2-git-send-email-stefanha@linux.vnet.ibm.com> In-Reply-To: <1317831427-477-1-git-send-email-stefanha@linux.vnet.ibm.com> References: <1317831427-477-1-git-send-email-stefanha@linux.vnet.ibm.com> Subject: [Qemu-devel] [PATCH 1/6] block: directly invoke .bdrv_aio_*() in bdrv_co_io_em() List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Kevin Wolf , Anthony Liguori , Stefan Hajnoczi , Marcelo Tosatti , Zhi Yong Wu , Avi Kivity , Christoph Hellwig We will unify block layer request processing across sync, aio, and coroutines and this means a .bdrv_co_*() emulation function should not call back into the public interface. There's no need here, just call .bdrv_aio_*() directly. The gory details: bdrv_co_io_em() cannot call back into the public bdrv_aio_*() interface since that will be handled using coroutines, which causes us to call into bdrv_co_io_em() again in an infinite loop :). Signed-off-by: Stefan Hajnoczi --- block.c | 8 ++++---- 1 files changed, 4 insertions(+), 4 deletions(-) diff --git a/block.c b/block.c index e3fe97f..dc36b2b 100644 --- a/block.c +++ b/block.c @@ -2990,11 +2990,11 @@ static int coroutine_fn bdrv_co_io_em(BlockDriverState *bs, int64_t sector_num, BlockDriverAIOCB *acb; if (is_write) { - acb = bdrv_aio_writev(bs, sector_num, iov, nb_sectors, - bdrv_co_io_em_complete, &co); + acb = bs->drv->bdrv_aio_writev(bs, sector_num, iov, nb_sectors, + bdrv_co_io_em_complete, &co); } else { - acb = bdrv_aio_readv(bs, sector_num, iov, nb_sectors, - bdrv_co_io_em_complete, &co); + acb = bs->drv->bdrv_aio_readv(bs, sector_num, iov, nb_sectors, + bdrv_co_io_em_complete, &co); } trace_bdrv_co_io(is_write, acb); -- 1.7.6.3