qemu-e2k/block/export
Kevin Wolf 520d8b40e8 block/export: Fix vhost-user-blk shutdown with requests in flight
The vhost-user-blk export runs requests asynchronously in their own
coroutine. When the vhost connection goes away and we want to stop the
vhost-user server, we need to wait for these coroutines to stop before
we can unmap the shared memory. Otherwise, they would still access the
unmapped memory and crash.

This introduces a refcount to VuServer which is increased when spawning
a new request coroutine and decreased before the coroutine exits. The
memory is only unmapped when the refcount reaches zero.

Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Message-Id: <20220125151435.48792-1-kwolf@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2022-02-01 13:49:15 +01:00
..
export.c block/export: Conditionally ignore set-context error 2021-07-20 16:49:31 +02:00
fuse.c aio-posix: split poll check from ready handler 2022-01-12 17:09:39 +00:00
meson.build fuse: Allow exporting BDSs via FUSE 2020-12-11 17:52:39 +01:00
vhost-user-blk-server.c block/export: Fix vhost-user-blk shutdown with requests in flight 2022-02-01 13:49:15 +01:00
vhost-user-blk-server.h block/export: convert vhost-user-blk server to block export API 2020-10-23 13:42:16 +01:00