qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH] iothread: Stop threads before main() quits


From: Stefan Hajnoczi
Subject: Re: [Qemu-devel] [PATCH] iothread: Stop threads before main() quits
Date: Tue, 13 Sep 2016 09:39:31 +0100
User-agent: Mutt/1.7.0 (2016-08-17)

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: address@hidden
> Signed-off-by: Fam Zheng <address@hidden>
> ---
>  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

[Prev in Thread] Current Thread [Next in Thread]