[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 24/32] hw/xen: do not set is_external=true on evtchn fds
From: |
Kevin Wolf |
Subject: |
[PULL 24/32] hw/xen: do not set is_external=true on evtchn fds |
Date: |
Tue, 30 May 2023 18:32:31 +0200 |
From: Stefan Hajnoczi <stefanha@redhat.com>
is_external=true suspends fd handlers between aio_disable_external() and
aio_enable_external(). The block layer's drain operation uses this
mechanism to prevent new I/O from sneaking in between
bdrv_drained_begin() and bdrv_drained_end().
The previous commit converted the xen-block device to use BlockDevOps
.drained_begin/end() callbacks. It no longer relies on is_external=true
so it is safe to pass is_external=false.
This is part of ongoing work to remove the aio_disable_external() API.
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Reviewed-by: Kevin Wolf <kwolf@redhat.com>
Message-Id: <20230516190238.8401-13-stefanha@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
---
hw/xen/xen-bus.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/hw/xen/xen-bus.c b/hw/xen/xen-bus.c
index b8f408c9ed..bf256d4da2 100644
--- a/hw/xen/xen-bus.c
+++ b/hw/xen/xen-bus.c
@@ -842,14 +842,14 @@ void xen_device_set_event_channel_context(XenDevice
*xendev,
}
if (channel->ctx)
- aio_set_fd_handler(channel->ctx, qemu_xen_evtchn_fd(channel->xeh),
true,
+ aio_set_fd_handler(channel->ctx, qemu_xen_evtchn_fd(channel->xeh),
false,
NULL, NULL, NULL, NULL, NULL);
channel->ctx = ctx;
if (ctx) {
aio_set_fd_handler(channel->ctx, qemu_xen_evtchn_fd(channel->xeh),
- true, xen_device_event, NULL, xen_device_poll, NULL,
- channel);
+ false, xen_device_event, NULL, xen_device_poll,
+ NULL, channel);
}
}
@@ -923,7 +923,7 @@ void xen_device_unbind_event_channel(XenDevice *xendev,
QLIST_REMOVE(channel, list);
- aio_set_fd_handler(channel->ctx, qemu_xen_evtchn_fd(channel->xeh), true,
+ aio_set_fd_handler(channel->ctx, qemu_xen_evtchn_fd(channel->xeh), false,
NULL, NULL, NULL, NULL, NULL);
if (qemu_xen_evtchn_unbind(channel->xeh, channel->local_port) < 0) {
--
2.40.1
- [PULL 08/32] copy-before-write: Fix open with child in iothread, (continued)
- [PULL 08/32] copy-before-write: Fix open with child in iothread, Kevin Wolf, 2023/05/30
- [PULL 03/32] block: Take main AioContext lock when calling bdrv_open(), Kevin Wolf, 2023/05/30
- [PULL 02/32] block: Clarify locking rules for bdrv_open(_inherit)(), Kevin Wolf, 2023/05/30
- [PULL 01/32] block-coroutine-wrapper: Take AioContext lock in no_co_wrappers, Kevin Wolf, 2023/05/30
- [PULL 04/32] block-backend: Fix blk_new_open() for iothreads, Kevin Wolf, 2023/05/30
- [PULL 19/32] block/export: stop using is_external in vhost-user-blk server, Kevin Wolf, 2023/05/30
- [PULL 16/32] virtio-scsi: stop using aio_disable_external() during unplug, Kevin Wolf, 2023/05/30
- [PULL 15/32] virtio-scsi: avoid race between unplug and transport event, Kevin Wolf, 2023/05/30
- [PULL 17/32] util/vhost-user-server: rename refcount to in_flight counter, Kevin Wolf, 2023/05/30
- [PULL 18/32] block/export: wait for vhost-user-blk requests when draining, Kevin Wolf, 2023/05/30
- [PULL 24/32] hw/xen: do not set is_external=true on evtchn fds,
Kevin Wolf <=
- [PULL 26/32] block/export: don't require AioContext lock around blk_exp_ref/unref(), Kevin Wolf, 2023/05/30
- [PULL 22/32] block: drain from main loop thread in bdrv_co_yield_to_drain(), Kevin Wolf, 2023/05/30
- [PULL 30/32] virtio-scsi: implement BlockDevOps->drained_begin(), Kevin Wolf, 2023/05/30
- [PULL 07/32] raw-format: Fix open with 'file' in iothread, Kevin Wolf, 2023/05/30
- [PULL 11/32] iotests: Make verify_virtio_scsi_pci_or_ccw() public, Kevin Wolf, 2023/05/30
- [PULL 09/32] block: Take AioContext lock in bdrv_open_driver(), Kevin Wolf, 2023/05/30
- [PULL 14/32] hw/qdev: introduce qdev_is_realized() helper, Kevin Wolf, 2023/05/30
- [PULL 12/32] iotests: Test blockdev-create in iothread, Kevin Wolf, 2023/05/30
- [PULL 10/32] block: Fix AioContext locking in bdrv_insert_node(), Kevin Wolf, 2023/05/30
- [PULL 23/32] xen-block: implement BlockDevOps->drained_begin(), Kevin Wolf, 2023/05/30