queues may be set to 1, as well as fds may contain only one fd.
No reason to block such cases. Let's check exactly number of queues.
Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@yandex-team.ru>
---
net/tap.c | 16 +++++++++-------
1 file changed, 9 insertions(+), 7 deletions(-)
diff --git a/net/tap.c b/net/tap.c
index c6bea0dcab..288cfedd81 100644
--- a/net/tap.c
+++ b/net/tap.c
@@ -870,13 +870,6 @@ int net_init_tap(const Netdev *netdev, const char *name,
assert(netdev->type == NET_CLIENT_DRIVER_TAP);
tap = &netdev->u.tap;
- /* QEMU hubs do not support multiqueue tap, in this case peer is set.
- * For -netdev, peer is always NULL. */
- if (peer && (tap->has_queues || tap->fds || tap->vhostfds)) {
- error_setg(errp, "Multiqueue tap cannot be used with hubs");
- return -1;
- }
-
if (tap->has_vhost && !tap->vhost && (tap->vhostfds || tap->vhostfd)) {
error_setg(errp, "vhostfd(s)= is not valid without vhost");
return -1;
@@ -900,6 +893,15 @@ int net_init_tap(const Netdev *netdev, const char *name,
return -1;
}
+ /*
+ * QEMU hubs do not support multiqueue tap, in this case peer is set.
+ * For -netdev, peer is always NULL.
+ */
+ if (peer && queues > 1) {
+ error_setg(errp, "Multiqueue tap cannot be used with hubs");
+ goto fail;
+ }
+
if (!tap_parse_vhost_fds(tap, &vhost_fds, queues, errp)) {
goto fail;
}
--
2.52.0