Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

tools/virtio: fix virtio_test execution

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 <sgarzare@redhat.com>
Link: https://lore.kernel.org/r/20220118150631.167015-1-sgarzare@redhat.com
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Acked-by: Jason Wang <jasowang@redhat.com>

authored by

Stefano Garzarella and committed by
Michael S. Tsirkin
32f1b53f 4c809363

+1
+1
tools/virtio/virtio_test.c
··· 130 130 memset(dev, 0, sizeof *dev); 131 131 dev->vdev.features = features; 132 132 INIT_LIST_HEAD(&dev->vdev.vqs); 133 + spin_lock_init(&dev->vdev.vqs_list_lock); 133 134 dev->buf_size = 1024; 134 135 dev->buf = malloc(dev->buf_size); 135 136 assert(dev->buf);