Re: [PATCH] tools/virtio: fix virtio_test execution

From: Jason Wang
Date: Tue Jan 18 2022 - 21:45:19 EST


On Tue, Jan 18, 2022 at 11:06 PM Stefano Garzarella <sgarzare@xxxxxxxxxx> wrote:
>
> 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@xxxxxxxxxx>

Acked-by: Jason Wang <jasowang@xxxxxxxxxx>

> ---
> tools/virtio/virtio_test.c | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/tools/virtio/virtio_test.c b/tools/virtio/virtio_test.c
> index cb3f29c09aff..23f142af544a 100644
> --- a/tools/virtio/virtio_test.c
> +++ b/tools/virtio/virtio_test.c
> @@ -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);
> --
> 2.31.1
>