]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
bhyve: remove redundant code that adds "template" netdev name
authorLaine Stump <laine@redhat.com>
Tue, 15 Dec 2020 19:32:23 +0000 (14:32 -0500)
committerLaine Stump <laine@redhat.com>
Thu, 17 Dec 2020 02:31:51 +0000 (21:31 -0500)
The FreeBSD version of virNetDevTapCreate() now calls
virNetDevGenerateName(), and virNetDevGenerateName() understands that
a blank ifname should be replaced with a generated name based on a
device-type-specific template - so there is no longer any need for the
higher level functions to stuff a template name ("vnet%d") into
ifname.

Signed-off-by: Laine Stump <laine@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
src/bhyve/bhyve_command.c

index 4cf98c0eb1c987e962328053e89103512cd21eb7..daf313c9c17d785e875a987758814f3d8a5b690d 100644 (file)
@@ -79,13 +79,6 @@ bhyveBuildNetArgStr(const virDomainDef *def,
         goto cleanup;
     }
 
-    if (!net->ifname ||
-        STRPREFIX(net->ifname, VIR_NET_GENERATED_VNET_PREFIX) ||
-        strchr(net->ifname, '%')) {
-        VIR_FREE(net->ifname);
-        net->ifname = g_strdup(VIR_NET_GENERATED_VNET_PREFIX "%d");
-    }
-
     if (!dryRun) {
         if (virNetDevTapCreateInBridgePort(brname, &net->ifname, &net->mac,
                                            def->uuid, NULL, NULL, 0,