qemu/hw/xen
Stefan Hajnoczi f6eac904f6 xen-block: implement BlockDevOps->drained_begin()
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>
2023-05-30 17:32:02 +02:00
..
Kconfig xen: add CONFIG_XEN_BUS and CONFIG_XEN_EMU options for Xen emulation 2023-03-01 08:22:49 +00:00
meson.build hw/xen: Build PV backend drivers for CONFIG_XEN_BUS 2023-03-07 17:04:30 +00:00
trace-events hw/xen: Rename xen_common.h to xen_native.h 2023-03-07 17:04:30 +00:00
trace.h trace: switch position of headers to what Meson requires 2020-08-21 06:18:24 -04:00
xen-backend.c xen-bus: reduce scope of backend watch 2020-10-19 16:32:41 +01:00
xen-bus-helper.c hw/xen: Add xenstore operations to allow redirection to internal emulation 2023-03-07 17:04:30 +00:00
xen-bus.c xen-block: implement BlockDevOps->drained_begin() 2023-05-30 17:32:02 +02:00
xen-host-pci-device.c xen: Use ERRP_GUARD() 2020-07-10 15:18:09 +02:00
xen-host-pci-device.h Clean up decorations and whitespace around header guards 2016-07-12 16:20:46 +02:00
xen-legacy-backend.c hw/xen: Add xenstore operations to allow redirection to internal emulation 2023-03-07 17:04:30 +00:00
xen-operations.c hw/xen: Rename xen_common.h to xen_native.h 2023-03-07 17:04:30 +00:00
xen_devconfig.c hw/xen: Add xenstore operations to allow redirection to internal emulation 2023-03-07 17:04:30 +00:00
xen_pt.c pci: avoid accessing slot_reserved_mask directly outside of pci.c 2023-04-21 04:25:52 -04:00
xen_pt.h hw/xen: Rename xen_common.h to xen_native.h 2023-03-07 17:04:30 +00:00
xen_pt_config_init.c hw/xen: Rename xen_common.h to xen_native.h 2023-03-07 17:04:30 +00:00
xen_pt_graphics.c hw/xen: Add xenstore operations to allow redirection to internal emulation 2023-03-07 17:04:30 +00:00
xen_pt_load_rom.c pci: add romsize property 2021-02-05 08:52:58 -05:00
xen_pt_msi.c hw/xen: Rename xen_common.h to xen_native.h 2023-03-07 17:04:30 +00:00
xen_pt_stub.c xen/pt: reserve PCI slot 2 for Intel igd-passthru 2023-03-06 11:27:37 +00:00
xen_pvdev.c hw/xen: Add xenstore operations to allow redirection to internal emulation 2023-03-07 17:04:30 +00:00