From 84617bf2f8d3e83a078414b92bc1d8a94c79269b Mon Sep 17 00:00:00 2001 From: Laine Stump Date: Sun, 20 Dec 2020 20:35:02 -0500 Subject: [PATCH] lxc: remove unnecessary call to virNetDevReserveName() In all cases *except* when parsing status XML as libvirt is being restarted, the XML parser will delete any manually specified interface name (aka "" aka net->ifname) that could have been generated by virNetDevGenerateName(). This means that during the setup when a domain is being started (e.g. during virLXCProcessSetupInterfaceTap()) it is pointless to call virNetDevReserveName() with any setting of net->ifname that has come from the XML parser - it is guaranteed to not fit the pattern of any auto-generated name, and so the call is just a NOP anyway. Signed-off-by: Laine Stump Reviewed-by: Michal Privoznik --- src/lxc/lxc_process.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/lxc/lxc_process.c b/src/lxc/lxc_process.c index a842ac91c5..f6932c248b 100644 --- a/src/lxc/lxc_process.c +++ b/src/lxc/lxc_process.c @@ -308,8 +308,6 @@ virLXCProcessSetupInterfaceTap(virDomainDefPtr vm, VIR_DEBUG("calling vethCreate()"); parentVeth = net->ifname; - if (parentVeth) - virNetDevReserveName(parentVeth); if (virNetDevVethCreate(&parentVeth, &containerVeth) < 0) return NULL;