These are some ideas originated from analyzing the Christian's crash report on virtio-blk dataplane torture test:
https://lists.gnu.org/archive/html/qemu-devel/2016-03/msg02093.html The ideas are mostly inspired/suggested by Paolo. This doesn't fix the bug, but the first and the last patches seem to make the crash less frequent. Also thanks Cornelia Huck for reviewing the draft version posted in that thread. Fam Zheng (4): block: Use drained section in bdrv_set_aio_context block-backend: Introduce blk_drained_begin/end virtio-blk: Use blk_drained_begin/end around dataplane stop virtio-blk: Clean up start/stop with mutex and BH block.c | 4 ++- block/block-backend.c | 14 ++++++++++ hw/block/dataplane/virtio-blk.c | 58 +++++++++++++++++++++++++++++++---------- hw/block/virtio-blk.c | 3 ++- include/sysemu/block-backend.h | 2 ++ 5 files changed, 65 insertions(+), 16 deletions(-) -- 2.4.3