mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-10 14:57:42 +00:00
qemu: add macvlan delete to qemuDomainAttachNetDevice cleanup
If an error occurs during qemuDomainAttachNetDevice after the macvtap was created in qemuPhysIfaceConnect, the macvtap device gets left behind. This patch adds code to the cleanup routine to delete the macvtap. Signed-off-by: Matthew Rosato <mjrosato@linux.vnet.ibm.com> Reviewed-by: Viktor Mihajlovski <mihajlov@linux.vnet.ibm.com>
This commit is contained in:
parent
9e37f57f43
commit
97f97a4907
@ -947,6 +947,16 @@ cleanup:
|
||||
if (iface_connected) {
|
||||
virDomainConfNWFilterTeardown(net);
|
||||
|
||||
if (virDomainNetGetActualType(net) == VIR_DOMAIN_NET_TYPE_DIRECT) {
|
||||
ignore_value(virNetDevMacVLanDeleteWithVPortProfile(
|
||||
net->ifname, &net->mac,
|
||||
virDomainNetGetActualDirectDev(net),
|
||||
virDomainNetGetActualDirectMode(net),
|
||||
virDomainNetGetActualVirtPortProfile(net),
|
||||
cfg->stateDir));
|
||||
VIR_FREE(net->ifname);
|
||||
}
|
||||
|
||||
vport = virDomainNetGetActualVirtPortProfile(net);
|
||||
if (vport && vport->virtPortType == VIR_NETDEV_VPORT_PROFILE_OPENVSWITCH)
|
||||
ignore_value(virNetDevOpenvswitchRemovePort(
|
||||
|
Loading…
Reference in New Issue
Block a user