Skip to content

Commit

Permalink
tools/virtio: fix virtio_test execution
Browse files Browse the repository at this point in the history
virtio_test hangs on __vring_new_virtqueue() because `vqs_list_lock`
is not initialized.

Let's initialize it in vdev_info_init().

Signed-off-by: Stefano Garzarella <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Michael S. Tsirkin <[email protected]>
Acked-by: Jason Wang <[email protected]>
  • Loading branch information
stefano-garzarella authored and mstsirkin committed Mar 6, 2022
1 parent 4c80936 commit 32f1b53
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions tools/virtio/virtio_test.c
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,7 @@ static void vdev_info_init(struct vdev_info* dev, unsigned long long features)
memset(dev, 0, sizeof *dev);
dev->vdev.features = features;
INIT_LIST_HEAD(&dev->vdev.vqs);
spin_lock_init(&dev->vdev.vqs_list_lock);
dev->buf_size = 1024;
dev->buf = malloc(dev->buf_size);
assert(dev->buf);
Expand Down

0 comments on commit 32f1b53

Please sign in to comment.