From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:40772) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WwmwO-0004Lv-7z for qemu-devel@nongnu.org; Tue, 17 Jun 2014 02:32:26 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WwmwI-0006YB-3D for qemu-devel@nongnu.org; Tue, 17 Jun 2014 02:32:20 -0400 Received: from mx1.redhat.com ([209.132.183.28]:61512) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WwmwH-0006Y5-Qy for qemu-devel@nongnu.org; Tue, 17 Jun 2014 02:32:14 -0400 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 s5H6WCwQ012597 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Tue, 17 Jun 2014 02:32:13 -0400 From: Fam Zheng Date: Tue, 17 Jun 2014 14:32:08 +0800 Message-Id: <1402986730-25642-6-git-send-email-famz@redhat.com> In-Reply-To: <1402986730-25642-1-git-send-email-famz@redhat.com> References: <1402986730-25642-1-git-send-email-famz@redhat.com> Subject: [Qemu-devel] [PATCH v2 5/7] virtio-blk: Schedule BH in the right context List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Kevin Wolf , Paolo Bonzini , Stefan Hajnoczi The BH must be called in the AioContext of bs. Currently it is only the main loop, but with coming changes, it could also be a dataplane IOThread. Signed-off-by: Fam Zheng --- hw/block/virtio-blk.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/hw/block/virtio-blk.c b/hw/block/virtio-blk.c index 25c3812..ca09bb4 100644 --- a/hw/block/virtio-blk.c +++ b/hw/block/virtio-blk.c @@ -469,7 +469,8 @@ static void virtio_blk_dma_restart_cb(void *opaque, int running, } if (!s->bh) { - s->bh = qemu_bh_new(virtio_blk_dma_restart_bh, s); + s->bh = aio_bh_new(bdrv_get_aio_context(s->blk.conf.bs), + virtio_blk_dma_restart_bh, s); qemu_bh_schedule(s->bh); } } -- 2.0.0