Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
hw/xen: do not set is_external=true on evtchn fds
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>
  • Loading branch information
Stefan Hajnoczi authored and Kevin Wolf committed May 30, 2023
1 parent f6eac90 commit fb5cba2
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions hw/xen/xen-bus.c
Expand Up @@ -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);
}
}

Expand Down Expand Up @@ -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) {
Expand Down

0 comments on commit fb5cba2

Please sign in to comment.