On Thu, Sep 08, 2016 at 05:28:51PM +0800, Fam Zheng wrote:
> Right after main_loop ends, we release various things but keep iothread
> alive. The latter is not prepared to the sudden change of resources.
> 
> Specifically, after bdrv_close_all(), virtio-scsi dataplane get a
> surprise at the empty BlockBackend:
> 
> (gdb) bt
>     at /usr/src/debug/qemu-2.6.0/hw/scsi/virtio-scsi.c:543
>     at /usr/src/debug/qemu-2.6.0/hw/scsi/virtio-scsi.c:577
> 
> It is because the d->conf.blk->root is set to NULL, then
> blk_get_aio_context() returns qemu_aio_context, whereas s->ctx is still
> pointing to the iothread:
> 
>     hw/scsi/virtio-scsi.c:543:
> 
>     if (s->dataplane_started) {
>         assert(blk_get_aio_context(d->conf.blk) == s->ctx);
>     }
> 
> To fix this, let's stop iothreads before doing bdrv_close_all().
> 
> Cc: qemu-sta...@nongnu.org
> Signed-off-by: Fam Zheng <f...@redhat.com>
> ---
>  include/sysemu/iothread.h |  1 +
>  iothread.c                | 24 ++++++++++++++++++++----
>  vl.c                      |  2 ++
>  3 files changed, 23 insertions(+), 4 deletions(-)

Thanks, applied to my block tree:
https://github.com/stefanha/qemu/commits/block

Stefan

Attachment: signature.asc
Description: PGP signature

Reply via email to