f6eac904f6
Detach event channels during drained sections to stop I/O submission from the ring. xen-block 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. Extend xen_device_set_event_channel_context() to allow ctx=NULL. The event channel still exists but the event loop does not monitor the file descriptor. Event channel processing can resume by calling xen_device_set_event_channel_context() with a non-NULL ctx. Factor out xen_device_set_event_channel_context() calls in hw/block/dataplane/xen-block.c into attach/detach helper functions. Incidentally, these don't require the AioContext lock because aio_set_fd_handler() is thread-safe. It's safer to register BlockDevOps after the dataplane instance has been created. The BlockDevOps .drained_begin/end() callbacks depend on the dataplane instance, so move the blk_set_dev_ops() call after xen_block_dataplane_create(). Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com> Reviewed-by: Kevin Wolf <kwolf@redhat.com> Message-Id: <20230516190238.8401-12-stefanha@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com> |
||
---|---|---|
.. | ||
dataplane | ||
block.c | ||
cdrom.c | ||
ecc.c | ||
fdc-internal.h | ||
fdc-isa.c | ||
fdc-sysbus.c | ||
fdc.c | ||
hd-geometry.c | ||
Kconfig | ||
m25p80_sfdp.c | ||
m25p80_sfdp.h | ||
m25p80.c | ||
meson.build | ||
nand.c | ||
onenand.c | ||
pflash_cfi01.c | ||
pflash_cfi02.c | ||
swim.c | ||
tc58128.c | ||
trace-events | ||
trace.h | ||
vhost-user-blk.c | ||
virtio-blk-common.c | ||
virtio-blk.c | ||
xen_blkif.h | ||
xen-block.c |