在 2023/7/21 02:14, Eugenio Pérez 写道:
Actually use vhost_reset_queue operation at queue reset.

Signed-off-by: Eugenio Pérez <epere...@redhat.com>
---
  hw/net/vhost_net.c | 4 +++-
  1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/hw/net/vhost_net.c b/hw/net/vhost_net.c
index 416b7d8132..5516b7a5aa 100644
--- a/hw/net/vhost_net.c
+++ b/hw/net/vhost_net.c
@@ -571,7 +571,9 @@ void vhost_net_virtqueue_reset(VirtIODevice *vdev, 
NetClientState *nc,
idx = vhost_ops->vhost_get_vq_index(&net->dev, vq_index); - if (net->nc->info->type == NET_CLIENT_DRIVER_TAP) {
+    if (vhost_ops->vhost_reset_queue) {
+        vhost_ops->vhost_reset_queue(&net->dev, idx);
+    } else if (net->nc->info->type == NET_CLIENT_DRIVER_TAP) {
          file.index = idx;
          int r = vhost_net_set_backend(&net->dev, &file);
          assert(r >= 0);


Let's move the TAP specific logic to vhost-net specific reset_queue function.

Thanks


Reply via email to