On 13/09/2018 14:52, Kevin Wolf wrote: > + if (qemu_get_current_aio_context() == qemu_get_aio_context()) { > + /* If we are in the main thread, the callback is allowed to unref > + * the BlockBackend, so we have to hold an additional reference */ > + blk_ref(acb->rwco.blk); > + } > acb->common.cb(acb->common.opaque, acb->rwco.ret); > + blk_dec_in_flight(acb->rwco.blk); > + if (qemu_get_current_aio_context() == qemu_get_aio_context()) { > + blk_unref(acb->rwco.blk); > + }
Is this something that happens only for some specific callers? That is, which callers are sure that the callback is invoked from the main thread? Thanks, Paolo