> From: Stefan Hajnoczi [mailto:stefa...@redhat.com] > On Thu, Mar 10, 2016 at 02:56:20PM +0300, Pavel Dovgalyuk wrote: > > +static void block_request_create(uint64_t reqid, BlockDriverState *bs, > > + Coroutine *co) > > +{ > > + Request *req = g_new(Request, 1); > > + *req = (Request) { > > + .co = co, > > + .bh = aio_bh_new(bdrv_get_aio_context(bs), blkreplay_bh_cb, req), > > + }; > > + replay_block_event(req->bh, reqid); > > Regarding thread safety: is replay_block_event() thread-safe?
It is. Replay module has its own mutex for file and data structures protection. > > If QEMU runs with IOThreads then this might not be called under the QEMU > global mutex. Pavel Dovgalyuk