[Top][All Lists]

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

Re: [Qemu-block] [PATCH 2/2] virtio-blk: use aio handler for data plane

From: Paolo Bonzini
Subject: Re: [Qemu-block] [PATCH 2/2] virtio-blk: use aio handler for data plane
Date: Tue, 29 Mar 2016 15:56:18 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.6.0

On 29/03/2016 15:42, Michael S. Tsirkin wrote:
> @@ -262,6 +274,7 @@ void virtio_blk_data_plane_stop(VirtIOBlockDataPlane *s)
>      /* Stop notifications for new requests from guest */
>      virtio_queue_aio_set_host_notifier_handler(s->vq, s->ctx, false, false);

I think that this should have been ", true, false" even before your
patch; I'd prefer to fix it even if the problem is latent.

The patch looks good, and it might even be an API improvement
independent of Conny's patches.  The reentrancy _is_ hard to understand,
and eliminating it makes the new API not just a hack.

In that case I would unify the new function with
virtio_queue_aio_set_host_notifier_handler.  In other words

- virtio_queue_aio_set_host_notifier_handler(vq, ctx, NULL) is
the same as

     virtio_set_queue_aio(s->vq, NULL);
     virtio_queue_aio_set_host_notifier_handler(vq, ctx, true, false);

- virtio_queue_aio_set_host_notifier_handler(vq, ctx, fn) is the same as

     virtio_queue_aio_set_host_notifier_handler(vq, ctx, true, true);
     virtio_set_queue_aio(vq, fn);



> +    virtio_set_queue_aio(s->vq, NULL);
>      /* Drain and switch bs back to the QEMU main loop */
>      blk_set_aio_context(s->conf->conf.blk, qemu_get_aio_context());

reply via email to

[Prev in Thread] Current Thread [Next in Thread]