From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:46644) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZbOJN-0004FW-8U for qemu-devel@nongnu.org; Mon, 14 Sep 2015 03:36:26 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZbOJK-0001II-2f for qemu-devel@nongnu.org; Mon, 14 Sep 2015 03:36:25 -0400 Received: from mga11.intel.com ([192.55.52.93]:42981) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZbOJJ-0001H6-UE for qemu-devel@nongnu.org; Mon, 14 Sep 2015 03:36:22 -0400 Date: Mon, 14 Sep 2015 15:36:57 +0800 From: Yuanhan Liu Message-ID: <20150914073657.GA2468@yliu-dev.sh.intel.com> References: <1441697927-16456-1-git-send-email-yuanhan.liu@linux.intel.com> <1441697927-16456-8-git-send-email-yuanhan.liu@linux.intel.com> <20150909133642-mutt-send-email-mst@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20150909133642-mutt-send-email-mst@redhat.com> Subject: Re: [Qemu-devel] [PATCH 7/7] vhost-user: add a new message to disable/enable a specific virt queue. List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: "Michael S. Tsirkin" Cc: qemu-devel@nongnu.org, changchun.ouyang@intel.com On Wed, Sep 09, 2015 at 01:45:50PM +0300, Michael S. Tsirkin wrote: > On Tue, Sep 08, 2015 at 03:38:47PM +0800, Yuanhan Liu wrote: [snip ....] > > diff --git a/hw/virtio/vhost-user.c b/hw/virtio/vhost-user.c > > index 11e46b5..ca6f7fa 100644 > > --- a/hw/virtio/vhost-user.c > > +++ b/hw/virtio/vhost-user.c > > @@ -25,9 +25,10 @@ [snip ....] > > static int vhost_user_cleanup(struct vhost_dev *dev) > > { > > assert(dev->vhost_ops->backend_type == VHOST_BACKEND_TYPE_USER); > > In fact, it's a per VQ pair call the way it's coded. > So pls fix it, call it for all VQs. I'm trying to address this comment, and I'm a bit confused now: this call is based on one 'vhost_net' structure, which is related to one 'vhost_dev' structure. One 'vhost_dev', on the other hand, represents two VQs. So, you are suggesting to call vhost_user_cleanup() twice at it's upper level? --yliu --- diff --git a/hw/virtio/vhost.c b/hw/virtio/vhost.c index 2712c6f..6944543 100644 --- a/hw/virtio/vhost.c +++ b/hw/virtio/vhost.c @@ -988,7 +988,10 @@ void vhost_dev_cleanup(struct vhost_dev *hdev) } g_free(hdev->mem); g_free(hdev->mem_sections); - hdev->vhost_ops->vhost_backend_cleanup(hdev); + + for (i = 0; i < hdev->nvqs; i++) { + hdev->vhost_ops->vhost_backend_cleanup(hdev, i); + } } /* Stop processing guest IO notifications in qemu.