Complete vhost-user negotiation by syncing the features
supported by the backend.
Signed-off-by: Marcel Apfelbaum <address@hidden>
---
To be used on top of:
[PATCH 0/4] vhost-user: protocol updates
https://lists.gnu.org/archive/html/qemu-devel/2015-07/msg03842.html
Currently the vhost-user supported features are not evaluated.
The way I see it, and please correct me, the best way to do
this is to:
1. get the backend features on vhost init
2. Instead of simply copying them during features ack,
check that that all backend features are supported by current QEMU
3. All other code should remain the same.
Thanks,
Marcel
hw/net/vhost_net.c | 3 ++-
hw/virtio/vhost-user.c | 4 ++--
2 files changed, 4 insertions(+), 3 deletions(-)
diff --git a/hw/net/vhost_net.c b/hw/net/vhost_net.c
index c864237..1ea5866 100644
--- a/hw/net/vhost_net.c
+++ b/hw/net/vhost_net.c
@@ -118,7 +118,8 @@ uint64_t vhost_net_get_features(struct vhost_net *net,
uint64_t features)
void vhost_net_ack_features(struct vhost_net *net, uint64_t features)
{
- net->dev.acked_features = net->dev.backend_features;
+ vhost_ack_features(&net->dev, vhost_net_get_feature_bits(net),
+ net->dev.backend_features);
vhost_ack_features(&net->dev, vhost_net_get_feature_bits(net), features);