All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v4 0/3] Fix the virtio features negotiation flaw
@ 2022-11-17 16:51 huangy81
  2022-11-17 16:51 ` [PATCH v4 1/3] vhost-user: Refactor vhost acked features saving huangy81
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: huangy81 @ 2022-11-17 16:51 UTC (permalink / raw)
  To: qemu-devel
  Cc: Michael S . Tsirkin, Jason Wang, Eric Blake, Markus Armbruster,
	Dr. David Alan Gilbert, Thomas Huth, Laurent Vivier,
	Paolo Bonzini, Stefano Garzarella, Raphael Norwitz,
	Hyman Huang(黄勇)

From: Hyman Huang(黄勇) <huangy81@chinatelecom.cn>

v4:
-rebase on master
-add stub function to fix build errors
-code clean on [PATCH v2 1/2]: drop 'cleanup' parameter in
 vhost_user_save_acked_features.
-code clean on [PATCH v2 2/2]: make refactor of chr_closed_bh
 a standalone patch.

Above changes are suggested by Michael and thanks very much.

Please review,

Yong

v3:
-rebase on master
-code clean on [PATCH v2 1/2]: keep the commit self-consistent and
 do not modify the logic of saving acked_features. Just abstract the
 util function.
-modify the [PATCH v2 2/2] logic: change the behavior of saving
 acked_features in chr_closed_bh: saving acked_features only if
 features aren't 0. For the case of 0, we implement it in
 virtio_net_set_features function, which will save the acked_features
 in advance, including assign 0 to acked_features.

v2:
Fix the typo in subject of [PATCH v2 2/2] 

v1:
This is the version 1 of the series and it is exactly the same as
RFC version, but fixing a typo in subject, which is reported by Michael. 

As for test for the behavior suggested by Michael, IMHO, it could be
post in another series, since i found that testing the negotiation
behavior using QGraph Test Framework requires more work than i thought.

The test patch may implement the following logic...
1. Introduce a fresh new qmp command to query netdev info, which show
   the NetClient status including guest features and acked_features.
2. Using vhost-user QGraph Test to check the behavior of the vhost user
   protocol cmd VHOST_USER_SET_FEATURES. 
3. Adding acked_features into TestServer, which receive the features
   set by QEMU.
4. Compare the acked_feature in TestServer with the acked_features 
   in the output of qmp query command.

Patch for RFC can be found in the following:
https://patchew.org/QEMU/20220926063641.25038-1-huangy81@chinatelecom.cn/

This patchset aim to fix the unexpected negotiation features for
vhost-user netdev interface. 

Steps to reproduce the issue:
Prepare a vm (CentOS 8 in my work scenario) with vhost-user
backend interface and configure qemu as server mode. So dpdk
would connect qemu's unix socket periodically.

1. start vm in background and restart openvswitch service 
   concurrently and repeatedly in the process of vm start. 

2. check if negotiated virtio features of port is "0x40000000" at
   dpdk side by executing:
   ovs-vsctl list interface | grep features | grep {port_socket_path}
       
3. if features equals "0x40000000", go to the vm and check if sending 
   arp package works, executing:
   arping {IP_ADDR}
   if vm interface is configured to boot with dhcp protocol, it
   would get no ip. 

After doing above steps, we'll find the arping not work, the ovs on
host side has forwarded unexpected arp packages, which be added 0x0000
in the head of ethenet frame.  Though qemu report some error when
read/write cmd of vhost protocol during the process of vm start,
like the following:

"Failed to set msg fds"
"vhost VQ 0 ring restore failed: -22: Invalid argument (22)"

The vm does not stop or report more suggestive error message, it
seems that everthing is ok. 

The root cause is that dpdk port negotiated nothing but only one
VHOST_USER_F_PROTOCOL_FEATURES feature with vhost-user interface at
qemu side, which is an unexpected behavior. qemu only load the
VHOST_USER_F_PROTOCOL_FEATURES when VHOST_USER_SET_FEATURES and loss
the guest features configured by front-end virtio driver using the
VIRTIO_PCI_COMMON_GF addr, which is stored in acked_features field
of struct vhost_dev.

To explain how the acked_features disappear, we may need to know the
lifecyle of acked_features in vhost_dev during feature negotiation. 

1. qemu init acked_features field of struct vhost_dev in vhost_net_init()
   by calling vhost_net_ack_features(), the init value fetched from
   acked_features field of struct NetVhostUserState, which is the backup
   role after vhost stopping or unix socket closed.
   In the first time, the acked_features of struct NetVhostUserState is 0
   so the init value of vhost_dev's acked_features also 0. 

2. when guest virtio driver set features, qemu accept the features and
   call virtio_set_features to store the features as acked_features in
   vhost_dev.

3. when unix socket closed or vhost_dev device doesn't work and be
   stopped unexpectedly, qemu will call chr_closed_bh or vhost_user_stop,
   which will copy acked_features from vhost_dev to NetVhostUserState and
   cleanup the vhost_dev. Since virtio driver not allowed to set features
   once status of virtio device changes to VIRTIO_CONFIG_S_FEATURE_OK,
   qemu need to backup it in case of loss. 
    
4. once unix socket return to normal and get connected, qemu will
   call vhost_user_start to restore the vhost_dev and fetch the
   acked_features stored in NetVhostUserState previously. 

The above flow works fine in the normal scenarios, but it doesn't cover
the scenario that openvswitch service restart in the same time of
virtio features negotiation.

Let's analyze such scenario: 
       qemu                                 dpdk

   vhost_net_init()                          
         |                      systemctl stop openvswitch.service
   virtio_set_features()                     | 
         |                      systemctl start openvswitch.service
   virtio_set_status()                      

Ovs stop service before guset setting virtio features, chr_closed_bh()
be called and fetch acked_features in vhost_dev, if may store the
incomplete features to NetVhostUserState since it doesn't include
guest features, eg "0x40000000". 

Guest set virtio features with another features, eg "0x7060a782",
this value will store in acked_features of vhost_dev, which is the
right and up-to-date features.

After ovs service show up, qemu unix socket get connected and call
vhost_user_start(), which will restore acked_features of vhost_dev
using NetVhostUserState and "0x40000000" be loaded, which is obsolete.

Guest set virtio device status and therefore qemu call 
virtio_net_vhost_status finally, checking if vhost-net device has
started, start it if not, consequently the obsolete acked_features
"0x40000000" be negotiated after calling vhost_dev_set_features(). 

So the key point of solving this issue making the acked_features 
in NetVhostUserState up-to-date, these patchset provide this
solution.  

[PATCH 1/2]: Abstract the existing code of saving acked_features
             into vhost_user_save_acked_features so the next
             patch seems clean. 

[PATCH 2/2]: Save the acked_features to NetVhostUserState once
             Guest virtio driver configured. This step makes
             acked_features in NetVhostUserState up-to-date. 

Please review, any comments and suggestions are welcome. 

Best regard.

Yong

*** BLURB HERE ***

Hyman Huang (3):
  vhost-user: Refactor vhost acked features saving
  vhost-user: Refactor the chr_closed_bh
  vhost-user: Fix the virtio features negotiation flaw

 hw/net/vhost_net-stub.c  |  5 +++++
 hw/net/vhost_net.c       |  6 ++++++
 hw/net/virtio-net.c      |  6 ++++++
 include/net/vhost-user.h |  1 +
 include/net/vhost_net.h  |  2 ++
 net/vhost-user.c         | 27 ++++++++++++++++-----------
 6 files changed, 36 insertions(+), 11 deletions(-)

-- 
1.8.3.1



^ permalink raw reply	[flat|nested] 6+ messages in thread

* [PATCH v4 1/3] vhost-user: Refactor vhost acked features saving
  2022-11-17 16:51 [PATCH v4 0/3] Fix the virtio features negotiation flaw huangy81
@ 2022-11-17 16:51 ` huangy81
  2022-11-17 16:51 ` [PATCH v4 2/3] vhost-user: Refactor the chr_closed_bh huangy81
  2022-11-17 16:51 ` [PATCH v4 3/3] vhost-user: Fix the virtio features negotiation flaw huangy81
  2 siblings, 0 replies; 6+ messages in thread
From: huangy81 @ 2022-11-17 16:51 UTC (permalink / raw)
  To: qemu-devel
  Cc: Michael S . Tsirkin, Jason Wang, Eric Blake, Markus Armbruster,
	Dr. David Alan Gilbert, Thomas Huth, Laurent Vivier,
	Paolo Bonzini, Stefano Garzarella, Raphael Norwitz,
	Hyman Huang(黄勇),
	Guoyi Tu

From: Hyman Huang(黄勇) <huangy81@chinatelecom.cn>

Abstract vhost acked features saving into
vhost_user_save_acked_features, export it as util function.

Signed-off-by: Hyman Huang(黄勇) <huangy81@chinatelecom.cn>
Signed-off-by: Guoyi Tu <tugy@chinatelecom.cn>
---
 include/net/vhost-user.h |  1 +
 net/vhost-user.c         | 21 +++++++++++++++------
 2 files changed, 16 insertions(+), 6 deletions(-)

diff --git a/include/net/vhost-user.h b/include/net/vhost-user.h
index 5bcd8a6..35bf619 100644
--- a/include/net/vhost-user.h
+++ b/include/net/vhost-user.h
@@ -14,5 +14,6 @@
 struct vhost_net;
 struct vhost_net *vhost_user_get_vhost_net(NetClientState *nc);
 uint64_t vhost_user_get_acked_features(NetClientState *nc);
+void vhost_user_save_acked_features(NetClientState *nc);
 
 #endif /* VHOST_USER_H */
diff --git a/net/vhost-user.c b/net/vhost-user.c
index 3a6b90d..f5cb095 100644
--- a/net/vhost-user.c
+++ b/net/vhost-user.c
@@ -45,10 +45,23 @@ uint64_t vhost_user_get_acked_features(NetClientState *nc)
     return s->acked_features;
 }
 
-static void vhost_user_stop(int queues, NetClientState *ncs[])
+void vhost_user_save_acked_features(NetClientState *nc)
 {
     NetVhostUserState *s;
+
+    s = DO_UPCAST(NetVhostUserState, nc, nc);
+    if (s->vhost_net) {
+        uint64_t features = vhost_net_get_acked_features(s->vhost_net);
+        if (features) {
+            s->acked_features = features;
+        }
+    }
+}
+
+static void vhost_user_stop(int queues, NetClientState *ncs[])
+{
     int i;
+    NetVhostUserState *s;
 
     for (i = 0; i < queues; i++) {
         assert(ncs[i]->info->type == NET_CLIENT_DRIVER_VHOST_USER);
@@ -56,11 +69,7 @@ static void vhost_user_stop(int queues, NetClientState *ncs[])
         s = DO_UPCAST(NetVhostUserState, nc, ncs[i]);
 
         if (s->vhost_net) {
-            /* save acked features */
-            uint64_t features = vhost_net_get_acked_features(s->vhost_net);
-            if (features) {
-                s->acked_features = features;
-            }
+            vhost_user_save_acked_features(ncs[i]);
             vhost_net_cleanup(s->vhost_net);
         }
     }
-- 
1.8.3.1



^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [PATCH v4 2/3] vhost-user: Refactor the chr_closed_bh
  2022-11-17 16:51 [PATCH v4 0/3] Fix the virtio features negotiation flaw huangy81
  2022-11-17 16:51 ` [PATCH v4 1/3] vhost-user: Refactor vhost acked features saving huangy81
@ 2022-11-17 16:51 ` huangy81
  2022-11-17 16:51 ` [PATCH v4 3/3] vhost-user: Fix the virtio features negotiation flaw huangy81
  2 siblings, 0 replies; 6+ messages in thread
From: huangy81 @ 2022-11-17 16:51 UTC (permalink / raw)
  To: qemu-devel
  Cc: Michael S . Tsirkin, Jason Wang, Eric Blake, Markus Armbruster,
	Dr. David Alan Gilbert, Thomas Huth, Laurent Vivier,
	Paolo Bonzini, Stefano Garzarella, Raphael Norwitz,
	Hyman Huang(黄勇),
	Guoyi Tu

From: Hyman Huang(黄勇) <huangy81@chinatelecom.cn>

Use vhost_user_save_acked_features to implemente acked features
saving.

Signed-off-by: Hyman Huang(黄勇) <huangy81@chinatelecom.cn>
Signed-off-by: Guoyi Tu <tugy@chinatelecom.cn>
---
 net/vhost-user.c | 6 +-----
 1 file changed, 1 insertion(+), 5 deletions(-)

diff --git a/net/vhost-user.c b/net/vhost-user.c
index f5cb095..5993e4a 100644
--- a/net/vhost-user.c
+++ b/net/vhost-user.c
@@ -260,11 +260,7 @@ static void chr_closed_bh(void *opaque)
     s = DO_UPCAST(NetVhostUserState, nc, ncs[0]);
 
     for (i = queues -1; i >= 0; i--) {
-        s = DO_UPCAST(NetVhostUserState, nc, ncs[i]);
-
-        if (s->vhost_net) {
-            s->acked_features = vhost_net_get_acked_features(s->vhost_net);
-        }
+        vhost_user_save_acked_features(ncs[i]);
     }
 
     qmp_set_link(name, false, &err);
-- 
1.8.3.1



^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [PATCH v4 3/3] vhost-user: Fix the virtio features negotiation flaw
  2022-11-17 16:51 [PATCH v4 0/3] Fix the virtio features negotiation flaw huangy81
  2022-11-17 16:51 ` [PATCH v4 1/3] vhost-user: Refactor vhost acked features saving huangy81
  2022-11-17 16:51 ` [PATCH v4 2/3] vhost-user: Refactor the chr_closed_bh huangy81
@ 2022-11-17 16:51 ` huangy81
  2022-12-14  8:15   ` Liuxiangdong via
  2 siblings, 1 reply; 6+ messages in thread
From: huangy81 @ 2022-11-17 16:51 UTC (permalink / raw)
  To: qemu-devel
  Cc: Michael S . Tsirkin, Jason Wang, Eric Blake, Markus Armbruster,
	Dr. David Alan Gilbert, Thomas Huth, Laurent Vivier,
	Paolo Bonzini, Stefano Garzarella, Raphael Norwitz,
	Hyman Huang(黄勇),
	Guoyi Tu

From: Hyman Huang(黄勇) <huangy81@chinatelecom.cn>

This patch aims to fix unexpected negotiation features for
vhost-user netdev interface.

When openvswitch reconnect Qemu after an unexpected disconnection
and Qemu therefore start the vhost_dev, acked_features field in
vhost_dev is initialized with value fetched from acked_features
field in NetVhostUserState, which should be up-to-date at that
moment but Qemu could not make it actually during the time window
of virtio features negotiation.

So we save the acked_features right after being configured by
guest virtio driver so it can be used to restore acked_features
field in vhost_dev correctly.

Signed-off-by: Hyman Huang(黄勇) <huangy81@chinatelecom.cn>
Signed-off-by: Guoyi Tu <tugy@chinatelecom.cn>
---
 hw/net/vhost_net-stub.c | 5 +++++
 hw/net/vhost_net.c      | 6 ++++++
 hw/net/virtio-net.c     | 6 ++++++
 include/net/vhost_net.h | 2 ++
 4 files changed, 19 insertions(+)

diff --git a/hw/net/vhost_net-stub.c b/hw/net/vhost_net-stub.c
index 9f7daae..66ed5f0 100644
--- a/hw/net/vhost_net-stub.c
+++ b/hw/net/vhost_net-stub.c
@@ -113,3 +113,8 @@ int vhost_net_virtqueue_restart(VirtIODevice *vdev, NetClientState *nc,
 {
     return 0;
 }
+
+void vhost_net_save_acked_features(NetClientState *nc)
+{
+
+}
diff --git a/hw/net/vhost_net.c b/hw/net/vhost_net.c
index feda448..ceb962c 100644
--- a/hw/net/vhost_net.c
+++ b/hw/net/vhost_net.c
@@ -143,6 +143,12 @@ uint64_t vhost_net_get_acked_features(VHostNetState *net)
     return net->dev.acked_features;
 }
 
+void vhost_net_save_acked_features(NetClientState *nc)
+{
+    assert(nc->info->type == NET_CLIENT_DRIVER_VHOST_USER);
+    vhost_user_save_acked_features(nc);
+}
+
 static int vhost_net_get_fd(NetClientState *backend)
 {
     switch (backend->info->type) {
diff --git a/hw/net/virtio-net.c b/hw/net/virtio-net.c
index aba1275..91cbd0c 100644
--- a/hw/net/virtio-net.c
+++ b/hw/net/virtio-net.c
@@ -981,6 +981,12 @@ static void virtio_net_set_features(VirtIODevice *vdev, uint64_t features)
             continue;
         }
         vhost_net_ack_features(get_vhost_net(nc->peer), features);
+
+        /*
+         * keep acked_features in NetVhostUserState up-to-date so it
+         * can't miss any features configured by guest virtio driver.
+         */
+        vhost_net_save_acked_features(nc->peer);
     }
 
     if (virtio_has_feature(features, VIRTIO_NET_F_CTRL_VLAN)) {
diff --git a/include/net/vhost_net.h b/include/net/vhost_net.h
index 40b9a40..dfb1375 100644
--- a/include/net/vhost_net.h
+++ b/include/net/vhost_net.h
@@ -52,4 +52,6 @@ void vhost_net_virtqueue_reset(VirtIODevice *vdev, NetClientState *nc,
                                int vq_index);
 int vhost_net_virtqueue_restart(VirtIODevice *vdev, NetClientState *nc,
                                 int vq_index);
+
+void vhost_net_save_acked_features(NetClientState *nc);
 #endif
-- 
1.8.3.1



^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH v4 3/3] vhost-user: Fix the virtio features negotiation flaw
  2022-11-17 16:51 ` [PATCH v4 3/3] vhost-user: Fix the virtio features negotiation flaw huangy81
@ 2022-12-14  8:15   ` Liuxiangdong via
  2022-12-14  8:23     ` Hyman Huang
  0 siblings, 1 reply; 6+ messages in thread
From: Liuxiangdong via @ 2022-12-14  8:15 UTC (permalink / raw)
  To: huangy81
  Cc: armbru, dgilbert, eblake, jasowang, lvivier, mst, pbonzini,
	qemu-devel, raphael.norwitz, sgarzare, thuth, tugy, Fangyi (Eric),
	yezengruan, liuxiangdong5

QEMU will coredump when vm starts.

Using command line:

./build/qemu-system-x86_64 \
     -nodefaults \
     -m 4G \
     -machine pc-i440fx-4.1 \
     -accel kvm \
     -cpu host \
     -smp 4 \
     -device qemu-xhci -device usb-kbd -device usb-tablet \
     -drive if=none,id=linux,file=test.img,format=raw \
     -device virtio-blk-pci,drive=linux,disable-legacy=on \
     -vnc :0 \
     -d all \
     -D %dlog \
     -netdev tap,id=hostnet0,ifname=tap0,vhost=on,script=no,downscript=no \
     -device virtio-net-pci,netdev=hostnet0,id=net0,mac=52:54:00:6b:0d:a1 \
     -device cirrus-vga \
     -msg timestamp=on


And then:
qemu-system-x86_64: ../hw/net/vhost_net.c:149: 
vhost_net_save_acked_features: Assertion `nc->info->type == 
NET_CLIENT_DRIVER_VHOST_USER' failed.
Aborted (core dumped)

Because it may be a tap or vdpa besides vhost user when function 
"get_vhost_net(nc->peer)" returns ture.





From: liuxiangdong <liuxiangdong5@huawei.com>
Date: Mon, 5 Dec 2022 07:11:28 +0800
Subject: [PATCH] vhost_net: keep acked_feature only for
  NET_CLIENT_DRIVER_VHOST_USER

Keep acked_features in NetVhostUserState up-to-date by function 
vhost_net_save_acked_features
in function virtio_net_set_features. But nc->peer->info->type maybe 
NET_CLIENT_DRIVER_TAP or
NET_CLIENT_DRIVER_VHOST_VDPA besides NET_CLIENT_DRIVER_VHOST_USER.

Don't keep acked_features in other type now except 
NET_CLIENT_DRIVER_VHOST_USER

Fix:  vhost-user: Fix the virtio features negotiation flaw

Signed-off-by: liuxiangdong <liuxiangdong5@huawei.com>
---
  hw/net/vhost_net.c | 5 +++--
  1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/hw/net/vhost_net.c b/hw/net/vhost_net.c
index a98575ffbc..bea053a742 100644
--- a/hw/net/vhost_net.c
+++ b/hw/net/vhost_net.c
@@ -143,8 +143,9 @@ uint64_t vhost_net_get_acked_features(VHostNetState 
*net)

  void vhost_net_save_acked_features(NetClientState *nc)
  {
-    assert(nc->info->type == NET_CLIENT_DRIVER_VHOST_USER);
-    vhost_user_save_acked_features(nc);
+    if (nc->info->type == NET_CLIENT_DRIVER_VHOST_USER) {
+        vhost_user_save_acked_features(nc);
+    }
  }

  static int vhost_net_get_fd(NetClientState *backend)
-- 
Gitee




^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH v4 3/3] vhost-user: Fix the virtio features negotiation flaw
  2022-12-14  8:15   ` Liuxiangdong via
@ 2022-12-14  8:23     ` Hyman Huang
  0 siblings, 0 replies; 6+ messages in thread
From: Hyman Huang @ 2022-12-14  8:23 UTC (permalink / raw)
  To: Liuxiangdong
  Cc: armbru, dgilbert, eblake, jasowang, lvivier, mst, pbonzini,
	qemu-devel, raphael.norwitz, sgarzare, thuth, tugy, Fangyi (Eric),
	yezengruan

Thanks xiangdong for the testing and reporting, indeed, vhost-user 
negotiaion features saving only apply on dpdk interface, vhost-net and 
vdpa interface can be ingored. I'll apply it next version.

Yong

在 2022/12/14 16:15, Liuxiangdong 写道:
> QEMU will coredump when vm starts.
> 
> Using command line:
> 
> ./build/qemu-system-x86_64 \
>      -nodefaults \
>      -m 4G \
>      -machine pc-i440fx-4.1 \
>      -accel kvm \
>      -cpu host \
>      -smp 4 \
>      -device qemu-xhci -device usb-kbd -device usb-tablet \
>      -drive if=none,id=linux,file=test.img,format=raw \
>      -device virtio-blk-pci,drive=linux,disable-legacy=on \
>      -vnc :0 \
>      -d all \
>      -D %dlog \
>      -netdev tap,id=hostnet0,ifname=tap0,vhost=on,script=no,downscript=no \
>      -device virtio-net-pci,netdev=hostnet0,id=net0,mac=52:54:00:6b:0d:a1 \
>      -device cirrus-vga \
>      -msg timestamp=on
> 
> 
> And then:
> qemu-system-x86_64: ../hw/net/vhost_net.c:149: 
> vhost_net_save_acked_features: Assertion `nc->info->type == 
> NET_CLIENT_DRIVER_VHOST_USER' failed.
> Aborted (core dumped)
> 
> Because it may be a tap or vdpa besides vhost user when function 
> "get_vhost_net(nc->peer)" returns ture.
> 
> 
> 
> 
> 
> From: liuxiangdong <liuxiangdong5@huawei.com>
> Date: Mon, 5 Dec 2022 07:11:28 +0800
> Subject: [PATCH] vhost_net: keep acked_feature only for
>   NET_CLIENT_DRIVER_VHOST_USER
> 
> Keep acked_features in NetVhostUserState up-to-date by function 
> vhost_net_save_acked_features
> in function virtio_net_set_features. But nc->peer->info->type maybe 
> NET_CLIENT_DRIVER_TAP or
> NET_CLIENT_DRIVER_VHOST_VDPA besides NET_CLIENT_DRIVER_VHOST_USER.
> 
> Don't keep acked_features in other type now except 
> NET_CLIENT_DRIVER_VHOST_USER
> 
> Fix:  vhost-user: Fix the virtio features negotiation flaw
> 
> Signed-off-by: liuxiangdong <liuxiangdong5@huawei.com>
> ---
>   hw/net/vhost_net.c | 5 +++--
>   1 file changed, 3 insertions(+), 2 deletions(-)
> 
> diff --git a/hw/net/vhost_net.c b/hw/net/vhost_net.c
> index a98575ffbc..bea053a742 100644
> --- a/hw/net/vhost_net.c
> +++ b/hw/net/vhost_net.c
> @@ -143,8 +143,9 @@ uint64_t vhost_net_get_acked_features(VHostNetState 
> *net)
> 
>   void vhost_net_save_acked_features(NetClientState *nc)
>   {
> -    assert(nc->info->type == NET_CLIENT_DRIVER_VHOST_USER);
> -    vhost_user_save_acked_features(nc);
> +    if (nc->info->type == NET_CLIENT_DRIVER_VHOST_USER) {
> +        vhost_user_save_acked_features(nc);
> +    }
>   }
> 
>   static int vhost_net_get_fd(NetClientState *backend)

-- 
Best regard

Hyman Huang(黄勇)


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2022-12-14  8:41 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-11-17 16:51 [PATCH v4 0/3] Fix the virtio features negotiation flaw huangy81
2022-11-17 16:51 ` [PATCH v4 1/3] vhost-user: Refactor vhost acked features saving huangy81
2022-11-17 16:51 ` [PATCH v4 2/3] vhost-user: Refactor the chr_closed_bh huangy81
2022-11-17 16:51 ` [PATCH v4 3/3] vhost-user: Fix the virtio features negotiation flaw huangy81
2022-12-14  8:15   ` Liuxiangdong via
2022-12-14  8:23     ` Hyman Huang

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.