Re: [Qemu-devel] [PATCH 05/11] blockjob: add block_job_defer_to_main_loop()

2014-10-02 Thread Stefan Hajnoczi
On Wed, Oct 01, 2014 at 09:06:36PM +0200, Max Reitz wrote: > On 01.10.2014 19:01, Stefan Hajnoczi wrote: > >+typedef struct { > >+BlockJob *job; > >+QEMUBH *bh; > >+AioContext *aio_context; > >+BlockJobDeferToMainLoopFn *fn; > >+void *opaque; > >+} BlockJobDeferToMainLoopData; >

Re: [Qemu-devel] [PATCH 05/11] blockjob: add block_job_defer_to_main_loop()

2014-10-01 Thread Max Reitz
On 01.10.2014 19:01, Stefan Hajnoczi wrote: Block jobs will run in the BlockDriverState's AioContext, which may not always be the QEMU main loop. There are some block layer APIs that are either not thread-safe or risk lock ordering problems. This includes bdrv_unref(), bdrv_close(), and anythin

[Qemu-devel] [PATCH 05/11] blockjob: add block_job_defer_to_main_loop()

2014-10-01 Thread Stefan Hajnoczi
Block jobs will run in the BlockDriverState's AioContext, which may not always be the QEMU main loop. There are some block layer APIs that are either not thread-safe or risk lock ordering problems. This includes bdrv_unref(), bdrv_close(), and anything that calls bdrv_drain_all(). The block_job_