]> git.proxmox.com Git - mirror_ubuntu-zesty-kernel.git/blobdiff - drivers/vhost/test.c
vhost: move acked_features to VQs
[mirror_ubuntu-zesty-kernel.git] / drivers / vhost / test.c
index c2a54fbf7f996e9065702a5aab1d284447c9785b..6fa3bf8bdec78613aa69ed96491216ac5b23fa10 100644 (file)
@@ -241,15 +241,18 @@ done:
 
 static int vhost_test_set_features(struct vhost_test *n, u64 features)
 {
+       struct vhost_virtqueue *vq;
+
        mutex_lock(&n->dev.mutex);
        if ((features & (1 << VHOST_F_LOG_ALL)) &&
            !vhost_log_access_ok(&n->dev)) {
                mutex_unlock(&n->dev.mutex);
                return -EFAULT;
        }
-       n->dev.acked_features = features;
-       smp_wmb();
-       vhost_test_flush(n);
+       vq = &n->vqs[VHOST_TEST_VQ];
+       mutex_lock(&vq->mutex);
+       vq->acked_features = features;
+       mutex_unlock(&vq->mutex);
        mutex_unlock(&n->dev.mutex);
        return 0;
 }