From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:49032) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZPTMV-0005GI-9H for qemu-devel@nongnu.org; Wed, 12 Aug 2015 06:34:24 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZPTMR-0002SL-VJ for qemu-devel@nongnu.org; Wed, 12 Aug 2015 06:34:23 -0400 Received: from mx1.redhat.com ([209.132.183.28]:46391) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZPTMR-0002Rq-Lz for qemu-devel@nongnu.org; Wed, 12 Aug 2015 06:34:19 -0400 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by mx1.redhat.com (Postfix) with ESMTPS id 0ADC28E394 for ; Wed, 12 Aug 2015 10:34:18 +0000 (UTC) Date: Wed, 12 Aug 2015 13:34:16 +0300 From: "Michael S. Tsirkin" Message-ID: <20150812133148-mutt-send-email-mst@redhat.com> References: <1439374791-25879-1-git-send-email-marcel@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1439374791-25879-1-git-send-email-marcel@redhat.com> Subject: Re: [Qemu-devel] [PATCH] virtio/vhost: drop unnecessary VHOST_SET_VRING call List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Marcel Apfelbaum Cc: qemu-devel@nongnu.org On Wed, Aug 12, 2015 at 01:19:51PM +0300, Marcel Apfelbaum wrote: > No need to send VHOST_SET_VRING_CALL to backend > before the negotiation with the guest is finished. > > Signed-off-by: Marcel Apfelbaum Well - we do need to set it to the masked notifier initially to avoid losing events. You can't just drop it - need to move this call somewhere else. > --- > hw/virtio/vhost.c | 13 +------------ > 1 file changed, 1 insertion(+), 12 deletions(-) > > diff --git a/hw/virtio/vhost.c b/hw/virtio/vhost.c > index 2712c6f..b448542 100644 > --- a/hw/virtio/vhost.c > +++ b/hw/virtio/vhost.c > @@ -875,24 +875,13 @@ static void vhost_eventfd_del(MemoryListener *listener, > static int vhost_virtqueue_init(struct vhost_dev *dev, > struct vhost_virtqueue *vq, int n) > { > - struct vhost_vring_file file = { > - .index = n, > - }; > int r = event_notifier_init(&vq->masked_notifier, 0); > + > if (r < 0) { > return r; > } > > - file.fd = event_notifier_get_fd(&vq->masked_notifier); > - r = dev->vhost_ops->vhost_call(dev, VHOST_SET_VRING_CALL, &file); > - if (r) { > - r = -errno; > - goto fail_call; > - } > return 0; > -fail_call: > - event_notifier_cleanup(&vq->masked_notifier); > - return r; > } > > static void vhost_virtqueue_cleanup(struct vhost_virtqueue *vq) > -- > 2.1.0