[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v5 12/21] xen-block: implement BlockDevOps->drained_begin()
From: |
Anthony PERARD |
Subject: |
Re: [PATCH v5 12/21] xen-block: implement BlockDevOps->drained_begin() |
Date: |
Tue, 16 May 2023 15:45:14 +0100 |
On Thu, May 04, 2023 at 03:53:18PM -0400, Stefan Hajnoczi wrote:
> @@ -819,11 +841,9 @@ void xen_block_dataplane_start(XenBlockDataPlane
> *dataplane,
> blk_set_aio_context(dataplane->blk, dataplane->ctx, NULL);
> aio_context_release(old_context);
>
> - /* Only reason for failure is a NULL channel */
> - aio_context_acquire(dataplane->ctx);
> - xen_device_set_event_channel_context(xendev, dataplane->event_channel,
> - dataplane->ctx, &error_abort);
> - aio_context_release(dataplane->ctx);
> + if (!blk_in_drain(dataplane->blk)) {
There's maybe something missing in the patch.
xen_block_dataplane_start() calls xen_device_bind_event_channel() just
before xen_block_dataplane_attach().
And xen_device_bind_event_channel() sets the event context to
qemu_get_aio_context() instead of NULL.
So, even if we don't call xen_block_dataplane_attach() while in drain,
there's already a fd_handler attach to the fd. So should
xen_device_bind_event_channel() be changed as well? Or maybe a call to
xen_block_dataplane_detach() would be enough.
(There's only one user of xen_device_bind_event_channel() at the moment
so I don't know if other implementation making use of this API will want
to call set_event_channel_context or not.)
> + xen_block_dataplane_attach(dataplane);
> + }
>
> return;
>
--
Anthony PERARD
- Re: [PATCH v5 05/21] virtio-scsi: stop using aio_disable_external() during unplug, (continued)
- [PATCH v5 06/21] util/vhost-user-server: rename refcount to in_flight counter, Stefan Hajnoczi, 2023/05/04
- [PATCH v5 07/21] block/export: wait for vhost-user-blk requests when draining, Stefan Hajnoczi, 2023/05/04
- [PATCH v5 08/21] block/export: stop using is_external in vhost-user-blk server, Stefan Hajnoczi, 2023/05/04
- [PATCH v5 09/21] hw/xen: do not use aio_set_fd_handler(is_external=true) in xen_xenstore, Stefan Hajnoczi, 2023/05/04
- [PATCH v5 10/21] block: add blk_in_drain() API, Stefan Hajnoczi, 2023/05/04
- [PATCH v5 11/21] block: drain from main loop thread in bdrv_co_yield_to_drain(), Stefan Hajnoczi, 2023/05/04
- [PATCH v5 12/21] xen-block: implement BlockDevOps->drained_begin(), Stefan Hajnoczi, 2023/05/04
- [PATCH v5 14/21] block/export: rewrite vduse-blk drain code, Stefan Hajnoczi, 2023/05/04
- [PATCH v5 16/21] block/fuse: do not set is_external=true on FUSE fd, Stefan Hajnoczi, 2023/05/04
- [PATCH v5 15/21] block/export: don't require AioContext lock around blk_exp_ref/unref(), Stefan Hajnoczi, 2023/05/04
- [PATCH v5 13/21] hw/xen: do not set is_external=true on evtchn fds, Stefan Hajnoczi, 2023/05/04
- [PATCH v5 17/21] virtio: make it possible to detach host notifier from any thread, Stefan Hajnoczi, 2023/05/04
- [PATCH v5 19/21] virtio-scsi: implement BlockDevOps->drained_begin(), Stefan Hajnoczi, 2023/05/04
- [PATCH v5 18/21] virtio-blk: implement BlockDevOps->drained_begin(), Stefan Hajnoczi, 2023/05/04
- [PATCH v5 20/21] virtio: do not set is_external=true on host notifiers, Stefan Hajnoczi, 2023/05/04
- [PATCH v5 21/21] aio: remove aio_disable_external() API, Stefan Hajnoczi, 2023/05/04