From: Kevin Wolf Date: Mon, 5 Jul 2021 17:14:29 +0000 (+0200) Subject: vhost-user: Fix backends without multiqueue support X-Git-Tag: v6.1.0-rc0~32^2~10 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=84affad1fd4c5251d7cccf4df43b29e9157983a9;p=thirdparty%2Fqemu.git vhost-user: Fix backends without multiqueue support dev->max_queues was never initialised for backends that don't support VHOST_USER_PROTOCOL_F_MQ, so it would use 0 as the maximum number of queues to check against and consequently fail for any such backend. Set it to 1 if the backend doesn't have multiqueue support. Fixes: c90bd505a3e8210c23d69fecab9ee6f56ec4a161 Signed-off-by: Kevin Wolf Message-Id: <20210705171429.29286-1-kwolf@redhat.com> Reviewed-by: Cornelia Huck Reviewed-by: Raphael Norwitz Signed-off-by: Kevin Wolf --- diff --git a/hw/virtio/vhost-user.c b/hw/virtio/vhost-user.c index 1ac4a2ebec3..29ea2b4fceb 100644 --- a/hw/virtio/vhost-user.c +++ b/hw/virtio/vhost-user.c @@ -1913,7 +1913,10 @@ static int vhost_user_backend_init(struct vhost_dev *dev, void *opaque, if (err < 0) { return -EPROTO; } + } else { + dev->max_queues = 1; } + if (dev->num_queues && dev->max_queues < dev->num_queues) { error_setg(errp, "The maximum number of queues supported by the " "backend is %" PRIu64, dev->max_queues);