From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:38566) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aku8M-0003S0-9A for qemu-devel@nongnu.org; Tue, 29 Mar 2016 09:56:42 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aku8G-00077X-GJ for qemu-devel@nongnu.org; Tue, 29 Mar 2016 09:56:38 -0400 References: <1459258923-10319-1-git-send-email-mst@redhat.com> <1459258923-10319-3-git-send-email-mst@redhat.com> From: Paolo Bonzini Message-ID: <56FA8982.2000404@redhat.com> Date: Tue, 29 Mar 2016 15:56:18 +0200 MIME-Version: 1.0 In-Reply-To: <1459258923-10319-3-git-send-email-mst@redhat.com> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [PATCH 2/2] virtio-blk: use aio handler for data plane List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: "Michael S. Tsirkin" , qemu-devel@nongnu.org Cc: Cornelia Huck , Kevin Wolf , qemu-block@nongnu.org, Stefan Hajnoczi On 29/03/2016 15:42, Michael S. Tsirkin wrote: > @@ -262,6 +274,7 @@ void virtio_blk_data_plane_stop(VirtIOBlockDataPlan= e *s) > =20 > /* Stop notifications for new requests from guest */ > virtio_queue_aio_set_host_notifier_handler(s->vq, s->ctx, false, f= alse); 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); Thanks, Paolo > + virtio_set_queue_aio(s->vq, NULL); > =20 > /* Drain and switch bs back to the QEMU main loop */ > blk_set_aio_context(s->conf->conf.blk, qemu_get_aio_context());