From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:49258) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Whz55-0002bW-Oo for qemu-devel@nongnu.org; Wed, 07 May 2014 06:28:13 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Whz4z-0005fR-5d for qemu-devel@nongnu.org; Wed, 07 May 2014 06:28:07 -0400 Received: from mx1.redhat.com ([209.132.183.28]:15091) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Whz4y-0005fE-LH for qemu-devel@nongnu.org; Wed, 07 May 2014 06:28:00 -0400 Received: from int-mx01.intmail.prod.int.phx2.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id s47AS0uT024980 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Wed, 7 May 2014 06:28:00 -0400 From: Stefan Hajnoczi Date: Wed, 7 May 2014 12:27:21 +0200 Message-Id: <1399458461-3997-6-git-send-email-stefanha@redhat.com> In-Reply-To: <1399458461-3997-1-git-send-email-stefanha@redhat.com> References: <1399458461-3997-1-git-send-email-stefanha@redhat.com> Subject: [Qemu-devel] [PATCH v2 05/25] blkdebug: use BlockDriverState's AioContext List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Kevin Wolf , Paolo Bonzini , Stefan Hajnoczi Drop the assumption that we're using the main AioContext. Convert qemu_bh_new() to aio_bh_new() so we use the BlockDriverState's AioContext. The .bdrv_detach_aio_context() and .bdrv_attach_aio_context() interfaces are not needed since no fd handlers, timers, or BHs stay registered when requests have been drained. Cc: Kevin Wolf Signed-off-by: Stefan Hajnoczi --- block/blkdebug.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/block/blkdebug.c b/block/blkdebug.c index 380c736..f51407d 100644 --- a/block/blkdebug.c +++ b/block/blkdebug.c @@ -471,7 +471,7 @@ static BlockDriverAIOCB *inject_error(BlockDriverState *bs, acb = qemu_aio_get(&blkdebug_aiocb_info, bs, cb, opaque); acb->ret = -error; - bh = qemu_bh_new(error_callback_bh, acb); + bh = aio_bh_new(bdrv_get_aio_context(bs), error_callback_bh, acb); acb->bh = bh; qemu_bh_schedule(bh); -- 1.9.0