[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH v5 12/21] xen-block: implement BlockDevOps->drained_begin()


  • To: Stefan Hajnoczi <stefanha@xxxxxxxxxx>
  • From: Anthony PERARD <anthony.perard@xxxxxxxxxx>
  • Date: Tue, 16 May 2023 15:45:14 +0100
  • Authentication-results: esa5.hc3370-68.iphmx.com; dkim=none (message not signed) header.i=none
  • Cc: <qemu-devel@xxxxxxxxxx>, Ronnie Sahlberg <ronniesahlberg@xxxxxxxxx>, Aarushi Mehta <mehta.aaru20@xxxxxxxxx>, <qemu-block@xxxxxxxxxx>, Paul Durrant <paul@xxxxxxx>, Peter Lieven <pl@xxxxxxx>, Stefan Weil <sw@xxxxxxxxxxx>, Xie Yongji <xieyongji@xxxxxxxxxxxxx>, Kevin Wolf <kwolf@xxxxxxxxxx>, Paolo Bonzini <pbonzini@xxxxxxxxxx>, "Michael S. Tsirkin" <mst@xxxxxxxxxx>, Leonardo Bras <leobras@xxxxxxxxxx>, Peter Xu <peterx@xxxxxxxxxx>, Hanna Reitz <hreitz@xxxxxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Richard Henderson <richard.henderson@xxxxxxxxxx>, David Woodhouse <dwmw2@xxxxxxxxxxxxx>, Coiby Xu <Coiby.Xu@xxxxxxxxx>, Eduardo Habkost <eduardo@xxxxxxxxxxx>, Stefano Garzarella <sgarzare@xxxxxxxxxx>, Philippe Mathieu-Daudé <philmd@xxxxxxxxxx>, Daniel P. Berrangé <berrange@xxxxxxxxxx>, Julia Suvorova <jusual@xxxxxxxxxx>, <xen-devel@xxxxxxxxxxxxxxxxxxxx>, <eesposit@xxxxxxxxxx>, Juan Quintela <quintela@xxxxxxxxxx>, "Richard W.M. Jones" <rjones@xxxxxxxxxx>, Fam Zheng <fam@xxxxxxxxxx>, Marcel Apfelbaum <marcel.apfelbaum@xxxxxxxxx>
  • Delivery-date: Tue, 16 May 2023 14:45:37 +0000
  • Ironport-data: A9a23:whRt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LraB9dP8EKK Y=
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

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



 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.