]> git.proxmox.com Git - mirror_qemu.git/commit - blockdev.c
block: let commit blockjob run in BDS AioContext
authorStefan Hajnoczi <stefanha@redhat.com>
Tue, 21 Oct 2014 11:03:59 +0000 (12:03 +0100)
committerStefan Hajnoczi <stefanha@redhat.com>
Mon, 3 Nov 2014 11:41:49 +0000 (11:41 +0000)
commit9e85cd5ce0d3fc99d910428c9fd9d267764d341b
tree6874635d868df256fa3fc8145763b7558a74a61e
parent5a7e7a0bad17c96e03f55ed7019e2d7545e21a96
block: let commit blockjob run in BDS AioContext

The commit block job must run in the BlockDriverState AioContext so that
it works with dataplane.

Acquire the AioContext in blockdev.c so starting the block job is safe.
One detail here is that the bdrv_drain_all() must be moved inside the
aio_context_acquire() region so requests cannot sneak in between the
drain and acquire.

The completion code in block/commit.c must perform backing chain
manipulation and bdrv_reopen() from the main loop.  Use
block_job_defer_to_main_loop() to achieve that.

Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Reviewed-by: Max Reitz <mreitz@redhat.com>
Message-id: 1413889440-32577-11-git-send-email-stefanha@redhat.com
block/commit.c
blockdev.c