]> git.proxmox.com Git - qemu-server.git/commitdiff
pve-bridge : move tap creation code in PVE::Network::tap_create
authorAlexandre Derumier <aderumier@odiso.com>
Tue, 5 Mar 2013 09:22:16 +0000 (10:22 +0100)
committerDietmar Maurer <dietmar@proxmox.com>
Tue, 5 Mar 2013 11:07:29 +0000 (12:07 +0100)
Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
pve-bridge

index b8ef158f7e39468465992cdf3fe8649581610a3e..0b0cdc5a03050c4c0a668c26e86647531587a212 100755 (executable)
@@ -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};