From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:36328) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bybBj-00081o-BV for qemu-devel@nongnu.org; Mon, 24 Oct 2016 05:05:01 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bybBg-0007ej-6u for qemu-devel@nongnu.org; Mon, 24 Oct 2016 05:04:59 -0400 Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]:48174 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 1bybBg-0007eX-0r for qemu-devel@nongnu.org; Mon, 24 Oct 2016 05:04:56 -0400 Received: from pps.filterd (m0098420.ppops.net [127.0.0.1]) by mx0b-001b2d01.pphosted.com (8.16.0.17/8.16.0.17) with SMTP id u9O94iSL104659 for ; Mon, 24 Oct 2016 05:04:54 -0400 Received: from e06smtp05.uk.ibm.com (e06smtp05.uk.ibm.com [195.75.94.101]) by mx0b-001b2d01.pphosted.com with ESMTP id 269eswsp4s-1 (version=TLSv1.2 cipher=AES256-SHA bits=256 verify=NOT) for ; Mon, 24 Oct 2016 05:04:52 -0400 Received: from localhost by e06smtp05.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Mon, 24 Oct 2016 10:04:38 +0100 Received: from b06cxnps4075.portsmouth.uk.ibm.com (d06relay12.portsmouth.uk.ibm.com [9.149.109.197]) by d06dlp03.portsmouth.uk.ibm.com (Postfix) with ESMTP id 115A01B0804B for ; Mon, 24 Oct 2016 10:06:42 +0100 (BST) Received: from d06av09.portsmouth.uk.ibm.com (d06av09.portsmouth.uk.ibm.com [9.149.37.250]) by b06cxnps4075.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id u9O94ab464553010 for ; Mon, 24 Oct 2016 09:04:36 GMT Received: from d06av09.portsmouth.uk.ibm.com (localhost [127.0.0.1]) by d06av09.portsmouth.uk.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id u9O94ZWT003958 for ; Mon, 24 Oct 2016 03:04:35 -0600 Date: Mon, 24 Oct 2016 11:04:34 +0200 From: Cornelia Huck In-Reply-To: <1477082896-26553-10-git-send-email-pbonzini@redhat.com> References: <1477082896-26553-1-git-send-email-pbonzini@redhat.com> <1477082896-26553-10-git-send-email-pbonzini@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Message-Id: <20161024110434.05dd028b.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, mst@redhat.com, stefanha@redhat.com, famz@redhat.com On Fri, 21 Oct 2016 22:48:12 +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 > Reviewed-by: Cornelia Huck > 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 1972b23..0e0bb46 100644 > --- a/hw/virtio/virtio.c > +++ b/hw/virtio/virtio.c > @@ -2138,11 +2138,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];; There's still an extra semicolon here. > + if (!vq->vring.num) { > + continue; > + } > + event_notifier_set(&vq->host_notifier); > } > return 0; >