|
| From: | Paolo Bonzini |
| Subject: | Re: [Qemu-devel] [PATCH 12/18] iothread: detach all block devices before stopping them |
| Date: | Fri, 14 Oct 2016 16:59:28 +0200 |
| User-agent: | Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.3.0 |
On 14/10/2016 16:50, Fam Zheng wrote:
>> > + BdrvNextIterator it;
>> > +
>> > + for (bs = bdrv_first(&it); bs; bs = bdrv_next(&it)) {
>> > + AioContext *ctx = bdrv_get_aio_context(bs);
> I have a strong feeling that we should 'continue' if ctx ==
> qemu_get_aio_context() - otherwise a lot of unnecessary (and somehow
> complicated) code will always run, even if user has no iothread.
>
> Fam
>
>> > + aio_context_acquire(ctx);
>> > + bdrv_set_aio_context(bs, qemu_get_aio_context());
>> > + aio_context_release(ctx);
>> > + }
Sounds good.
Paolo
| [Prev in Thread] | Current Thread | [Next in Thread] |