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