@samitouri / QOSamiQemu / commits / b8ae1e56d4

net/tap: net_init_tap(): drop extra vhostfdname variable

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 b8ae1e56d4805e4b0dc37b477e8280e410b72c4a
1 file changed +3 -5
net/tap.c
+3 -5
@@ -822,14 +822,12 @@ int net_init_tap(const Netdev *netdev, const char *name,
822 const NetdevTapOptions *tap;
823 int fd, vnet_hdr = 0, i = 0, queues;
824 /* for the no-fd, no-helper case */
825 - const char *vhostfdname;
825 char ifname[128];
826 int ret = 0;
827
828 assert(netdev->type == NET_CLIENT_DRIVER_TAP);
829 tap = &netdev->u.tap;
830 queues = tap->has_queues ? tap->queues : 1;
832 - vhostfdname = tap->vhostfd;
831
832 /* QEMU hubs do not support multiqueue tap, in this case peer is set.
833 * For -netdev, peer is always NULL. */
@@ -871,7 +869,7 @@ int net_init_tap(const Netdev *netdev, const char *name,
869
870 if (!net_init_tap_one(tap, peer, "tap", name, NULL,
871 NULL, NULL,
874 - vhostfdname, vnet_hdr, fd, errp)) {
872 + tap->vhostfd, vnet_hdr, fd, errp)) {
873 close(fd);
874 return -1;
875 }
@@ -972,7 +970,7 @@ free_fail:
970 }
971
972 if (!net_init_tap_one(tap, peer, "bridge", name, ifname,
975 - NULL, NULL, vhostfdname,
973 + NULL, NULL, tap->vhostfd,
974 vnet_hdr, fd, errp)) {
975 close(fd);
976 return -1;
@@ -1012,7 +1010,7 @@ free_fail:
1010 if (!net_init_tap_one(tap, peer, "tap", name, ifname,
1011 i >= 1 ? NULL : script,
1012 i >= 1 ? NULL : downscript,
1015 - vhostfdname, vnet_hdr, fd, errp)) {
1013 + tap->vhostfd, vnet_hdr, fd, errp)) {
1014 close(fd);
1015 return -1;
1016 }