From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:46648) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bwohI-0000oS-0i for qemu-devel@nongnu.org; Wed, 19 Oct 2016 07:06:17 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bwohD-0007I6-2K for qemu-devel@nongnu.org; Wed, 19 Oct 2016 07:06:12 -0400 Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]:51532 helo=mx0a-001b2d01.pphosted.com) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1bwohC-0007I2-Rz for qemu-devel@nongnu.org; Wed, 19 Oct 2016 07:06:06 -0400 Received: from pps.filterd (m0098416.ppops.net [127.0.0.1]) by mx0b-001b2d01.pphosted.com (8.16.0.17/8.16.0.17) with SMTP id u9JB3vtE134073 for ; Wed, 19 Oct 2016 07:06:06 -0400 Received: from e06smtp14.uk.ibm.com (e06smtp14.uk.ibm.com [195.75.94.110]) by mx0b-001b2d01.pphosted.com with ESMTP id 265kv3w647-1 (version=TLSv1.2 cipher=AES256-SHA bits=256 verify=NOT) for ; Wed, 19 Oct 2016 07:06:06 -0400 Received: from localhost by e06smtp14.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Wed, 19 Oct 2016 12:06:04 +0100 Received: from b06cxnps4076.portsmouth.uk.ibm.com (d06relay13.portsmouth.uk.ibm.com [9.149.109.198]) by d06dlp02.portsmouth.uk.ibm.com (Postfix) with ESMTP id D3BC4219006A for ; Wed, 19 Oct 2016 12:05:17 +0100 (BST) Received: from d06av02.portsmouth.uk.ibm.com (d06av02.portsmouth.uk.ibm.com [9.149.37.228]) by b06cxnps4076.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id u9JB61cD15073746 for ; Wed, 19 Oct 2016 11:06:01 GMT Received: from d06av02.portsmouth.uk.ibm.com (localhost [127.0.0.1]) by d06av02.portsmouth.uk.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id u9JB604a010150 for ; Wed, 19 Oct 2016 05:06:01 -0600 Date: Wed, 19 Oct 2016 13:05:59 +0200 From: Cornelia Huck In-Reply-To: <1476100421-28772-10-git-send-email-pbonzini@redhat.com> References: <1476100421-28772-1-git-send-email-pbonzini@redhat.com> <1476100421-28772-10-git-send-email-pbonzini@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Message-Id: <20161019130559.094d11c2.cornelia.huck@de.ibm.com> Subject: Re: [Qemu-devel] [PATCH 09/13] virtio: remove set_handler argument from set_host_notifier_internal List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Paolo Bonzini Cc: qemu-devel@nongnu.org, stefanha@redhat.com, borntraeger@de.ibm.com, famz@redhat.com, mst@redhat.com On Mon, 10 Oct 2016 13:53:37 +0200 Paolo Bonzini wrote: > Make virtio_device_start_ioeventfd_impl use the same logic as > dataplane to set up the host notifier. This removes the need > for the set_handler argument in set_host_notifier_internal. > > This is a first step towards using virtio_bus_set_host_notifier > as the sole entry point to set up ioeventfds. At least now > the functions have the same interface, but they still differ > in that virtio_bus_set_host_notifier sets ioeventfd_disabled. > > Reviewed-by: Stefan Hajnoczi > Signed-off-by: Paolo Bonzini > --- > hw/virtio/virtio-bus.c | 12 +++--------- > hw/virtio/virtio.c | 16 +++++++++++++--- > include/hw/virtio/virtio-bus.h | 2 +- > 3 files changed, 17 insertions(+), 13 deletions(-) > > diff --git a/hw/virtio/virtio.c b/hw/virtio/virtio.c > index 93eec83..2817d42 100644 > --- a/hw/virtio/virtio.c > +++ b/hw/virtio/virtio.c > @@ -2100,11 +2100,21 @@ static int virtio_device_start_ioeventfd_impl(VirtIODevice *vdev) > if (!virtio_queue_get_num(vdev, n)) { > continue; > } > - r = set_host_notifier_internal(proxy, qbus, n, true, true); > + r = set_host_notifier_internal(proxy, qbus, n, true); > if (r < 0) { > err = r; > goto assign_error; > } > + virtio_queue_set_host_notifier_fd_handler(&vdev->vq[n], true, true); > + } > + > + for (n = 0; n < VIRTIO_QUEUE_MAX; n++) { > + /* Kick right away to begin processing requests already in vring */ > + VirtQueue *vq = &vdev->vq[n];; Extra ';' > + if (!vq->vring.num) { > + continue; > + } > + event_notifier_set(&vq->host_notifier); > } > return 0; > Reviewed-by: Cornelia Huck