diff options
author | Jason Wang <jasowang@redhat.com> | 2011-06-21 06:04:27 -0400 |
---|---|---|
committer | Michael S. Tsirkin <mst@redhat.com> | 2011-07-19 06:28:34 -0400 |
commit | f59281dafb832b161133743fcf3dc29051e6fdb8 (patch) | |
tree | 3eacc9fd60396174a94c8bd02326e930ff94351d /drivers/vhost/test.c | |
parent | 81fc70d86527a1450560709500ca5f52e661da1f (diff) |
vhost: init used ring after backend was set
Move the used ring initialization after backend was set. This
makes it possible to disable the backend and tweak the used ring,
then restart. This will also make it possible to log the used ring
write correctly.
Signed-off-by: Jason Wang <jasowang@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Diffstat (limited to 'drivers/vhost/test.c')
-rw-r--r-- | drivers/vhost/test.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/drivers/vhost/test.c b/drivers/vhost/test.c index 734e1d74ad80..fc9a1d75281f 100644 --- a/drivers/vhost/test.c +++ b/drivers/vhost/test.c | |||
@@ -195,8 +195,13 @@ static long vhost_test_run(struct vhost_test *n, int test) | |||
195 | lockdep_is_held(&vq->mutex)); | 195 | lockdep_is_held(&vq->mutex)); |
196 | rcu_assign_pointer(vq->private_data, priv); | 196 | rcu_assign_pointer(vq->private_data, priv); |
197 | 197 | ||
198 | r = vhost_init_used(&n->vqs[index]); | ||
199 | |||
198 | mutex_unlock(&vq->mutex); | 200 | mutex_unlock(&vq->mutex); |
199 | 201 | ||
202 | if (r) | ||
203 | goto err; | ||
204 | |||
200 | if (oldpriv) { | 205 | if (oldpriv) { |
201 | vhost_test_flush_vq(n, index); | 206 | vhost_test_flush_vq(n, index); |
202 | } | 207 | } |