[pve-devel] [PATCH 2/4] pve-bridge : move tap creation code in PVE::Network::tap_create

Alexandre Derumier aderumier at odiso.com
Tue Mar 5 10:22:16 CET 2013


Signed-off-by: Alexandre Derumier <aderumier at odiso.com>
---
 pve-bridge |    9 +--------
 1 file changed, 1 insertion(+), 8 deletions(-)

diff --git a/pve-bridge b/pve-bridge
index b8ef158..0b0cdc5 100755
--- a/pve-bridge
+++ b/pve-bridge
@@ -25,14 +25,7 @@ die "unable to get network config '$netid'\n"
 my $net = PVE::QemuServer::parse_net($conf->{$netid});
 die "unable to parse network config '$netid'\n" if !$net;
 
-my $bridge = $net->{bridge};
-die "unable to get bridge setting\n" if !$bridge;
-
-my $bridgemtu = PVE::Tools::file_read_firstline("/sys/class/net/$bridge/mtu");
-die "bridge '$bridge' does not exist\n" if !$bridgemtu;
-
-system ("/sbin/ifconfig $iface 0.0.0.0 promisc up mtu $bridgemtu") == 0 ||
-    die "interface activation failed\n";
+PVE::Network::tap_create($iface, $net->{bridge});
 
 PVE::Network::tap_rate_limit($iface, $net->{rate}) if $net->{rate};
 
-- 
1.7.10.4




More information about the pve-devel mailing list