[pve-devel] [PATCH 6/6] network : add tap_unplug

Alexandre Derumier aderumier at odiso.com
Tue Mar 5 10:23:47 CET 2013


Signed-off-by: Alexandre Derumier <aderumier at odiso.com>
---
 data/PVE/Network.pm |    9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/data/PVE/Network.pm b/data/PVE/Network.pm
index a7e55d7..8f82686 100644
--- a/data/PVE/Network.pm
+++ b/data/PVE/Network.pm
@@ -74,6 +74,15 @@ sub tap_plug {
 	die "can't add interface to bridge\n";
 }
 
+sub tap_unplug {
+    my ($iface, $bridge, $tag) = @_;
+
+    $bridge .= "v$tag" if $tag;
+
+    system ("/usr/sbin/brctl delif $bridge $iface") == 0 ||
+	die "can't del interface from bridge\n";
+}
+
 sub copy_bridge_config {
     my ($br0, $br1) = @_;
 
-- 
1.7.10.4




More information about the pve-devel mailing list