]> git.proxmox.com Git - pve-common.git/commitdiff
Fix #908: cleanup OVS ports in tap_unplug
authorWolfgang Bumiller <w.bumiller@proxmox.com>
Tue, 12 Apr 2016 14:03:50 +0000 (16:03 +0200)
committerDietmar Maurer <dietmar@proxmox.com>
Wed, 13 Apr 2016 04:40:21 +0000 (06:40 +0200)
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.

data/PVE/Network.pm

index eda370068fb4886d24d8e22bae91b9f9547415f6..f0d76f133575aa2ca17de0a12792f5a068876eda 100644 (file)
@@ -259,6 +259,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 {