mirror of https://github.com/xqemu/xqemu.git
blockdev: add note that block_job_cb() must be thread-safe
This function is correct but we should document the constraint that everything must be thread-safe. Emitting QMP events and scheduling BHs are both thread-safe so nothing needs to be done here. Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com> Reviewed-by: Max Reitz <mreitz@redhat.com> Message-id: 1413889440-32577-5-git-send-email-stefanha@redhat.com
This commit is contained in:
parent
91fddb0db6
commit
723c5d93c5
|
@ -1929,6 +1929,11 @@ out:
|
||||||
|
|
||||||
static void block_job_cb(void *opaque, int ret)
|
static void block_job_cb(void *opaque, int ret)
|
||||||
{
|
{
|
||||||
|
/* Note that this function may be executed from another AioContext besides
|
||||||
|
* the QEMU main loop. If you need to access anything that assumes the
|
||||||
|
* QEMU global mutex, use a BH or introduce a mutex.
|
||||||
|
*/
|
||||||
|
|
||||||
BlockDriverState *bs = opaque;
|
BlockDriverState *bs = opaque;
|
||||||
const char *msg = NULL;
|
const char *msg = NULL;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue