[PATCH] net/vhost-user: Save ack_features to net_clients during vhost_user_start

Yi Wang posted 1 patch 2 years ago
Test checkpatch passed
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/qemu tags/patchew/20220413081756.52983-1-wang.yi59@zte.com.cn
Maintainers: "Michael S. Tsirkin" <mst@redhat.com>, Jason Wang <jasowang@redhat.com>
net/vhost-user.c | 4 ++++
1 file changed, 4 insertions(+)
[PATCH] net/vhost-user: Save ack_features to net_clients during vhost_user_start
Posted by Yi Wang 2 years ago
From: Liu Xiangyu <liu.xiangyu2@zte.com.cn>

During vhost_user_start, if openvswitch.service restart, cause the final features
not expected. Because qemu not save the ack_features promptly.

Signed-off-by: Liu Xiangyu <liu.xiangyu2@zte.com.cn>
Signed-off-by: Yi Wang <wang.yi59@zte.com.cn>
---
 net/vhost-user.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/net/vhost-user.c b/net/vhost-user.c
index b1a0247..ce9dcb6 100644
--- a/net/vhost-user.c
+++ b/net/vhost-user.c
@@ -92,6 +92,10 @@ static int vhost_user_start(int queues, NetClientState *ncs[],
             goto err;
         }
 
+        if (s->vhost_net) {
+            s->acked_features = vhost_net_get_acked_features(net);
+        }
+
         if (i == 0) {
             max_queues = vhost_net_get_max_queues(net);
             if (queues > max_queues) {
-- 
1.8.3.1