From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:60404) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YfRtN-0003ZV-5q for qemu-devel@nongnu.org; Tue, 07 Apr 2015 07:42:06 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YfRtG-0000nK-Nu for qemu-devel@nongnu.org; Tue, 07 Apr 2015 07:42:05 -0400 Received: from e06smtp15.uk.ibm.com ([195.75.94.111]:43784) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YfRtG-0000nG-EU for qemu-devel@nongnu.org; Tue, 07 Apr 2015 07:41:58 -0400 Received: from /spool/local by e06smtp15.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Tue, 7 Apr 2015 12:41:57 +0100 Received: from b06cxnps3074.portsmouth.uk.ibm.com (d06relay09.portsmouth.uk.ibm.com [9.149.109.194]) by d06dlp01.portsmouth.uk.ibm.com (Postfix) with ESMTP id 80D7517D805A for ; Tue, 7 Apr 2015 12:42:27 +0100 (BST) Received: from d06av05.portsmouth.uk.ibm.com (d06av05.portsmouth.uk.ibm.com [9.149.37.229]) by b06cxnps3074.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id t37BfsKQ9044368 for ; Tue, 7 Apr 2015 11:41:54 GMT Received: from d06av05.portsmouth.uk.ibm.com (localhost [127.0.0.1]) by d06av05.portsmouth.uk.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id t37Bfsb9001189 for ; Tue, 7 Apr 2015 05:41:54 -0600 Date: Tue, 7 Apr 2015 13:41:51 +0200 From: Cornelia Huck Message-ID: <20150407134151.1376c3b8.cornelia.huck@de.ibm.com> In-Reply-To: <1428403546-31914-4-git-send-email-mst@redhat.com> References: <1428403546-31914-1-git-send-email-mst@redhat.com> <1428403546-31914-4-git-send-email-mst@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH 3/3] dataplane/virtio-scsi: new API to enable host notifiers List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: "Michael S. Tsirkin" Cc: Paolo Bonzini , Jason Wang , qemu-devel@nongnu.org On Tue, 7 Apr 2015 12:46:01 +0200 "Michael S. Tsirkin" wrote: > Switch to new API. > > Signed-off-by: Michael S. Tsirkin > --- > include/hw/virtio/virtio.h | 1 - > hw/scsi/virtio-scsi-dataplane.c | 14 ++++---------- > hw/virtio/virtio.c | 8 +++++++- > 3 files changed, 11 insertions(+), 12 deletions(-) > > diff --git a/include/hw/virtio/virtio.h b/include/hw/virtio/virtio.h > index e1cff22..7e70193 100644 > --- a/include/hw/virtio/virtio.h > +++ b/include/hw/virtio/virtio.h > @@ -217,7 +217,6 @@ EventNotifier *virtio_queue_get_host_notifier(VirtQueue *vq); > void virtio_queue_set_host_notifier_fd_handler(VirtQueue *vq, bool assign, > bool set_handler); > void virtio_queue_notify_vq(VirtQueue *vq); > -void virtio_irq(VirtQueue *vq); Unrelated cleanup? > > int virtio_enable_host_notifiers(VirtIODevice *vdev, int startvq, int nvqs); > void virtio_disable_host_notifiers(VirtIODevice *vdev, int startvq, int nvqs); (...) > diff --git a/hw/virtio/virtio.c b/hw/virtio/virtio.c > index e7ee069..60d10cd 100644 > --- a/hw/virtio/virtio.c > +++ b/hw/virtio/virtio.c > @@ -84,6 +84,9 @@ struct VirtQueue > > int inuse; > > + /* Host notifier enabled? */ > + bool host_notifier_enabled; This looks to be write-only. Have you maybe mixed in some unrelated changes? > + > uint16_t vector; > void (*handle_output)(VirtIODevice *vdev, VirtQueue *vq); > VirtIODevice *vdev; > @@ -813,7 +816,7 @@ void virtio_del_queue(VirtIODevice *vdev, int n) > vdev->vq[n].vring.num = 0; > } > > -void virtio_irq(VirtQueue *vq) > +static void virtio_irq(VirtQueue *vq) > { > trace_virtio_irq(vq); > vq->vdev->isr |= 0x01; > @@ -1301,11 +1304,13 @@ int virtio_enable_host_notifiers(VirtIODevice *vdev, int startvq, int nvqs) > fprintf(stderr, "vhost VQ %d notifier binding failed: %d\n", i, -r); > goto fail_vq; > } > + vdev->vq[startvq + i].host_notifier_enabled = true; > } > > return 0; > fail_vq: > while (--i >= 0) { > + vdev->vq[startvq + i].host_notifier_enabled = false; > r = k->set_host_notifier(qbus->parent, startvq + i, false); > if (r < 0) { > fprintf(stderr, "vhost VQ %d notifier cleanup error: %d\n", i, -r); > @@ -1325,6 +1330,7 @@ void virtio_disable_host_notifiers(VirtIODevice *vdev, int startvq, int nvqs) > int i, r; > > for (i = 0; i < nvqs; ++i) { > + vdev->vq[startvq + i].host_notifier_enabled = false; > r = k->set_host_notifier(qbus->parent, startvq + i, false); > if (r < 0) { > fprintf(stderr, "vhost VQ %d notifier cleanup failed: %d\n", i, -r);