scsi: create restart bottom half in the right AioContext
authorPaolo Bonzini <pbonzini@redhat.com>
Wed, 22 Jul 2015 14:38:17 +0000 (16:38 +0200)
committerPaolo Bonzini <pbonzini@redhat.com>
Fri, 14 Aug 2015 21:40:32 +0000 (23:40 +0200)
This matches commit 4407c1c (virtio-blk: Schedule BH in the right context,
2014-06-17), which did the same thing for virtio-blk.

Reviewed-by: Fam Zheng <famz@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
hw/scsi/scsi-bus.c

index f0ae4625ff6988237e15bf198568b8ac21c07b90..ffac8f4bb6b16e5ac1ab5579b54c3decc0ae01dd 100644 (file)
@@ -136,7 +136,8 @@ static void scsi_dma_restart_cb(void *opaque, int running, RunState state)
         return;
     }
     if (!s->bh) {
-        s->bh = qemu_bh_new(scsi_dma_restart_bh, s);
+        AioContext *ctx = blk_get_aio_context(s->conf.blk);
+        s->bh = aio_bh_new(ctx, scsi_dma_restart_bh, s);
         qemu_bh_schedule(s->bh);
     }
 }