[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH 7/7] vhost-user: add a new message to disable/en
From: |
Yuanhan Liu |
Subject: |
Re: [Qemu-devel] [PATCH 7/7] vhost-user: add a new message to disable/enable a specific virt queue. |
Date: |
Mon, 14 Sep 2015 15:36:57 +0800 |
User-agent: |
Mutt/1.5.21 (2010-09-15) |
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.
- Re: [Qemu-devel] [PATCH 5/7] vhost_net: move vhost_net_set_vq_index ahead at vhost_net_init, (continued)
[Qemu-devel] [PATCH 1/7] vhost-user: use VHOST_USER_XXX macro for switch statement, Yuanhan Liu, 2015/09/08
[Qemu-devel] [PATCH 7/7] vhost-user: add a new message to disable/enable a specific virt queue., Yuanhan Liu, 2015/09/08
[Qemu-devel] [PATCH 2/7] vhost-user: add protocol feature negotiation, Yuanhan Liu, 2015/09/08
[Qemu-devel] [PATCH 6/7] vhost-user: add multiple queue support, Yuanhan Liu, 2015/09/08
- Re: [Qemu-devel] [PATCH 6/7] vhost-user: add multiple queue support, Eric Blake, 2015/09/08
- Re: [Qemu-devel] [PATCH 6/7] vhost-user: add multiple queue support, Ouyang, Changchun, 2015/09/09
- Re: [Qemu-devel] [PATCH 6/7] vhost-user: add multiple queue support, Michael S. Tsirkin, 2015/09/09
- Re: [Qemu-devel] [PATCH 6/7] vhost-user: add multiple queue support, Michael S. Tsirkin, 2015/09/09
- Re: [Qemu-devel] [PATCH 6/7] vhost-user: add multiple queue support, Jason Wang, 2015/09/14