]> git.proxmox.com Git - mirror_qemu.git/commit - blockdev.c
block: acquire AioContext in do_drive_del()
authorStefan Hajnoczi <stefanha@redhat.com>
Mon, 18 Aug 2014 15:07:12 +0000 (16:07 +0100)
committerStefan Hajnoczi <stefanha@redhat.com>
Fri, 29 Aug 2014 15:01:10 +0000 (16:01 +0100)
commit8ad4202bf61bc1d124ff26016cfe17cb261cc392
tree3a3a924610494044c38c8aa3fd5289501671ab9b
parent2cdff7f620ebd3b5246cf0c0d1f6fa0eededa4ca
block: acquire AioContext in do_drive_del()

Make drive_del safe for dataplane where another thread may be running
the BlockDriverState's AioContext.

Note the assumption that AioContext's lifetime exceeds DriveInfo and
BlockDriverState.  We release AioContext after DriveInfo and
BlockDriverState are potentially freed.

This is clearly safe with the global AioContext but also with -object
iothread and implicit iothreads created by -device
virtio-blk-pci,x-data-plane=on (their lifetime is tied to DeviceState,
not BlockDriverState).

Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
blockdev.c