@samitouri / QOSamiQemu / commits / 8faa6cd071

net/tap: net_init_tap(): relax QEMU hubs check

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> Reviewed-by: Ben Chaney <bchaney@akamai.com> Signed-off-by: Jason Wang <jasowang@redhat.com>

Vladimir Sementsov-Ogievskiy committed Mar 18, 2026 at 14:31 UTC 8faa6cd071e2ad930308be10c5a11a178e6b42d9
1 file changed +9 -7
net/tap.c
+9 -7
@@ -869,13 +869,6 @@ int net_init_tap(const Netdev *netdev, const char *name,
869 assert(netdev->type == NET_CLIENT_DRIVER_TAP);
870 tap = &netdev->u.tap;
871
872 - /* QEMU hubs do not support multiqueue tap, in this case peer is set.
873 - * For -netdev, peer is always NULL. */
874 - if (peer && (tap->has_queues || tap->fds || tap->vhostfds)) {
875 - error_setg(errp, "Multiqueue tap cannot be used with hubs");
876 - return -1;
877 - }
878 -
872 if (tap->has_vhost && !tap->vhost && (tap->vhostfds || tap->vhostfd)) {
873 error_setg(errp, "vhostfd(s)= is not valid without vhost");
874 return -1;
@@ -899,6 +892,15 @@ int net_init_tap(const Netdev *netdev, const char *name,
892 return -1;
893 }
894
895 + /*
896 + * QEMU hubs do not support multiqueue tap, in this case peer is set.
897 + * For -netdev, peer is always NULL.
898 + */
899 + if (peer && queues > 1) {
900 + error_setg(errp, "Multiqueue tap cannot be used with hubs");
901 + goto fail;
902 + }
903 +
904 if (!tap_parse_vhost_fds(tap, &vhost_fds, queues, errp)) {
905 goto fail;
906 }