[PATCH 2/5] bhyve: remove redundant code that adds "template" netdev name

Roman Bogorodskiy bogorodskiy at gmail.com
Thu Dec 17 15:52:09 UTC 2020


  Laine Stump wrote:

> 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 at redhat.com>

For this and 1/5:

Reviewed-by: Roman Bogorodskiy <bogorodskiy at gmail.com>

Thanks for this cleanup.

> ---
>  src/bhyve/bhyve_command.c | 7 -------
>  1 file changed, 7 deletions(-)
> 
> diff --git a/src/bhyve/bhyve_command.c b/src/bhyve/bhyve_command.c
> index 4cf98c0eb1..daf313c9c1 100644
> --- a/src/bhyve/bhyve_command.c
> +++ b/src/bhyve/bhyve_command.c
> @@ -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,
> -- 
> 2.28.0
> 

Roman Bogorodskiy
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 488 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20201217/250aa03e/attachment-0001.sig>


More information about the libvir-list mailing list