It is not safe to call bdrv_set_aio_context outside BQL (see patch 1), so move the call to main thread (patch 3). And as a bonus, the two loops in virtio-scsi.c and virtio-scsi-dataplane.c for cmd queue handling are converged (patch 2).
Fam Zheng (3): block: Forbid bdrv_set_aio_context outside BQL virtio-scsi: Deduplicate cmd queue handling code of dataplane virtio-scsi-dataplane: Use main thread BH to set BDS' aio context hw/scsi/virtio-scsi-dataplane.c | 26 +++---- hw/scsi/virtio-scsi.c | 153 ++++++++++++++++++++++++++++++++++------ include/block/block.h | 3 +- include/hw/virtio/virtio-scsi.h | 11 ++- 4 files changed, 156 insertions(+), 37 deletions(-) -- 1.9.3