|
|
a83cc2 |
From de25a5f05b76ca99299e09dabe04e7d59b9bed79 Mon Sep 17 00:00:00 2001
|
|
|
a83cc2 |
From: Kevin Wolf <kwolf@redhat.com>
|
|
|
a83cc2 |
Date: Mon, 12 Jul 2021 10:22:32 -0400
|
|
|
a83cc2 |
Subject: [PATCH 12/43] vhost-user: Fix backends without multiqueue support
|
|
|
a83cc2 |
|
|
|
a83cc2 |
RH-Author: Miroslav Rezanina <mrezanin@redhat.com>
|
|
|
a83cc2 |
RH-Bugzilla: 1957194
|
|
|
a83cc2 |
|
|
|
a83cc2 |
dev->max_queues was never initialised for backends that don't support
|
|
|
a83cc2 |
VHOST_USER_PROTOCOL_F_MQ, so it would use 0 as the maximum number of
|
|
|
a83cc2 |
queues to check against and consequently fail for any such backend.
|
|
|
a83cc2 |
|
|
|
a83cc2 |
Set it to 1 if the backend doesn't have multiqueue support.
|
|
|
a83cc2 |
|
|
|
a83cc2 |
Fixes: c90bd505a3e8210c23d69fecab9ee6f56ec4a161
|
|
|
a83cc2 |
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
|
|
|
a83cc2 |
Message-Id: <20210705171429.29286-1-kwolf@redhat.com>
|
|
|
a83cc2 |
Reviewed-by: Cornelia Huck <cohuck@redhat.com>
|
|
|
a83cc2 |
Reviewed-by: Raphael Norwitz <raphael.norwitz@nutanix.com>
|
|
|
a83cc2 |
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
|
|
|
a83cc2 |
(cherry picked from commit 84affad1fd4c5251d7cccf4df43b29e9157983a9)
|
|
|
a83cc2 |
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
|
|
|
a83cc2 |
Signed-off-by: Danilo C. L. de Paula <ddepaula@redhat.com>
|
|
|
a83cc2 |
Signed-off-by: Miroslav Rezanina <mrezanin@redhat.com>
|
|
|
a83cc2 |
---
|
|
|
a83cc2 |
hw/virtio/vhost-user.c | 3 +++
|
|
|
a83cc2 |
1 file changed, 3 insertions(+)
|
|
|
a83cc2 |
|
|
|
a83cc2 |
diff --git a/hw/virtio/vhost-user.c b/hw/virtio/vhost-user.c
|
|
|
a83cc2 |
index ee57abe045..53f50adcba 100644
|
|
|
a83cc2 |
--- a/hw/virtio/vhost-user.c
|
|
|
a83cc2 |
+++ b/hw/virtio/vhost-user.c
|
|
|
a83cc2 |
@@ -1908,7 +1908,10 @@ static int vhost_user_backend_init(struct vhost_dev *dev, void *opaque)
|
|
|
a83cc2 |
if (err < 0) {
|
|
|
a83cc2 |
return err;
|
|
|
a83cc2 |
}
|
|
|
a83cc2 |
+ } else {
|
|
|
a83cc2 |
+ dev->max_queues = 1;
|
|
|
a83cc2 |
}
|
|
|
a83cc2 |
+
|
|
|
a83cc2 |
if (dev->num_queues && dev->max_queues < dev->num_queues) {
|
|
|
a83cc2 |
error_report("The maximum number of queues supported by the "
|
|
|
a83cc2 |
"backend is %" PRIu64, dev->max_queues);
|
|
|
a83cc2 |
--
|
|
|
a83cc2 |
2.27.0
|
|
|
a83cc2 |
|