OSDN Git Service

virtio-blk: implement BlockDevOps->drained_begin()
authorStefan Hajnoczi <stefanha@redhat.com>
Tue, 16 May 2023 19:02:35 +0000 (15:02 -0400)
committerKevin Wolf <kwolf@redhat.com>
Tue, 30 May 2023 15:32:02 +0000 (17:32 +0200)
commit1665d9326fd2dd97f1f4061decd67702956ec53c
treeafd5f39ade36feebdc930fc30d6a84dc126e9290
parentbd58ab40c3fcfdd94f5524626ae13c43818bd23a
virtio-blk: implement BlockDevOps->drained_begin()

Detach ioeventfds during drained sections to stop I/O submission from
the guest. virtio-blk is no longer reliant on aio_disable_external()
after this patch. This will allow us to remove the
aio_disable_external() API once all other code that relies on it is
converted.

Take extra care to avoid attaching/detaching ioeventfds if the data
plane is started/stopped during a drained section. This should be rare,
but maybe the mirror block job can trigger it.

Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Message-Id: <20230516190238.8401-18-stefanha@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
hw/block/dataplane/virtio-blk.c
hw/block/virtio-blk.c