summary refs log tree commit diff stats
path: root/include/net/vhost_net.h
diff options
context:
space:
mode:
authorHyman Huang(黄勇) <huangy81@chinatelecom.cn>2022-12-21 21:06:40 +0800
committerMichael S. Tsirkin <mst@redhat.com>2023-01-08 01:54:22 -0500
commitc9bdc449f97422e62dc802fd2cbe11b840195595 (patch)
tree3f1d039706c2e29ed7e7a5adbd65d61f22ec39c7 /include/net/vhost_net.h
parentbebcac052a019a9818c1870622294ee2675b48ef (diff)
downloadfocaccia-qemu-c9bdc449f97422e62dc802fd2cbe11b840195595.tar.gz
focaccia-qemu-c9bdc449f97422e62dc802fd2cbe11b840195595.zip
vhost-user: Fix the virtio features negotiation flaw
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>
Signed-off-by: Liuxiangdong <liuxiangdong5@huawei.com>
Message-Id: <b9f8cf5561a79ea65ea38960e5a5e6d3707eef0a.1671627406.git.huangy81@chinatelecom.cn>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Diffstat (limited to 'include/net/vhost_net.h')
-rw-r--r--include/net/vhost_net.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/include/net/vhost_net.h b/include/net/vhost_net.h
index 40b9a40074..dfb13756cd 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