From: Wolfgang Bumiller Date: Tue, 12 Apr 2016 14:02:52 +0000 (+0200) Subject: Fix #908: cleanup OVS ports in tap_unplug X-Git-Url: https://git.proxmox.com/?p=pve-common.git;a=commitdiff_plain;h=dd44486ecbecc04b4e1865e6ebd667e9e9358bda Fix #908: cleanup OVS ports in tap_unplug tap_unplug() is only called in hotplugging functions which perform a tap_plug() afterwards, and and in qemu-server's bridge-down script. The OVS port cleanup for non-firewall ports was done only in tap_plug(), which means that in the case when qemu exits and the tap device disappears, the OVS port for it stays. With this patch the cleanup happens in both tap_unplug() and tap_plug() to avoid problems with upgrades on systems where there have already been ports leaked. --- diff --git a/src/PVE/Network.pm b/src/PVE/Network.pm index 78529e1..bda2067 100644 --- a/src/PVE/Network.pm +++ b/src/PVE/Network.pm @@ -371,6 +371,8 @@ sub tap_unplug { } &$cleanup_firewall_bridge($iface); + #cleanup old port config from any openvswitch bridge + eval {run_command("/usr/bin/ovs-vsctl del-port $iface", outfunc => sub {}, errfunc => sub {}) }; } sub copy_bridge_config {