]> xenbits.xensource.com Git - qemu-upstream-4.6-testing.git/commitdiff
vhost_net: init acked_features to backend_features
authorJason Wang <jasowang@redhat.com>
Wed, 3 Sep 2014 06:25:30 +0000 (14:25 +0800)
committerMichael S. Tsirkin <mst@redhat.com>
Wed, 3 Sep 2014 13:41:05 +0000 (16:41 +0300)
commit 2e6d46d77ed328d34a94688da8371bcbe243479b (vhost: add
vhost_get_features and vhost_ack_features) removes the step that
initializes the acked_features to backend_features.

As this field is now uninitialized, vhost initialization will sometimes
fail.

To fix, initialize acked_features on each ack.

Tested-by: Andrey Korolyov <andrey@xdel.ru>
Cc: Nikolay Nikolaev <n.nikolaev@virtualopensystems.com>
Cc: qemu-stable@nongnu.org
Signed-off-by: Jason Wang <jasowang@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
hw/net/vhost_net.c

index 3819044b02c582b1865bfe169222623e0e780897..b21e7a434f90b788f408cf9de9e1bd81f3c821e8 100644 (file)
@@ -115,6 +115,7 @@ unsigned vhost_net_get_features(struct vhost_net *net, unsigned features)
 
 void vhost_net_ack_features(struct vhost_net *net, unsigned features)
 {
+    net->dev.acked_features = net->dev.backend_features;
     vhost_ack_features(&net->dev, vhost_net_get_feature_bits(net), features);
 }