From 14d7eb1355911b60350bb690654d90a7b64d5bb3 Mon Sep 17 00:00:00 2001 From: Vladimir Sementsov-Ogievskiy Date: Wed, 18 Mar 2026 14:31:41 +0300 Subject: [PATCH] net/tap: net_init_tap(): merge fd=, fds= and helper= cases into one Now fd= and helper= cases are just a duplication of fds= case with queues=1. Let's merge them all. Signed-off-by: Vladimir Sementsov-Ogievskiy Reviewed-by: Ben Chaney Signed-off-by: Jason Wang --- net/tap.c | 26 +------------------------- 1 file changed, 1 insertion(+), 25 deletions(-) diff --git a/net/tap.c b/net/tap.c index d5a719150b..c6bf8a7042 100644 --- a/net/tap.c +++ b/net/tap.c @@ -903,19 +903,7 @@ int net_init_tap(const Netdev *netdev, const char *name, goto fail; } - if (tap->fd) { - vnet_hdr = tap_probe_vnet_hdr(fds[0], errp); - if (vnet_hdr < 0) { - goto fail; - } - - if (!net_init_tap_one(tap, peer, name, NULL, - NULL, NULL, - vhost_fds ? vhost_fds[0] : -1, - vnet_hdr, fds[0], errp)) { - goto fail; - } - } else if (tap->fds) { + if (fds) { for (i = 0; i < queues; i++) { if (i == 0) { vnet_hdr = tap_probe_vnet_hdr(fds[i], errp); @@ -935,18 +923,6 @@ int net_init_tap(const Netdev *netdev, const char *name, goto fail; } } - } else if (tap->helper) { - vnet_hdr = tap_probe_vnet_hdr(fds[0], errp); - if (vnet_hdr < 0) { - goto fail; - } - - if (!net_init_tap_one(tap, peer, name, ifname, - NULL, NULL, - vhost_fds ? vhost_fds[0] : -1, - vnet_hdr, fds[0], errp)) { - goto fail; - } } else { g_autofree char *script = tap_parse_script(tap->script, DEFAULT_NETWORK_SCRIPT);