]> git.proxmox.com Git - qemu-server.git/blobdiff - pve-bridge
bump version to 4.0-55
[qemu-server.git] / pve-bridge
index 1b9801d00e843205549eca9d41eb63aacaa24685..4426c65c552f017c473aa1449f3d59a0e8034eb3 100755 (executable)
@@ -8,6 +8,12 @@ use PVE::Network;
 
 my $iface = shift;
 
+my $hotplug = 0;
+if ($iface eq '--hotplug') {
+    $hotplug = 1;
+    $iface = shift;
+}
+
 die "no interface specified\n" if !$iface;
 
 die "got strange interface name '$iface'\n" 
@@ -16,7 +22,7 @@ die "got strange interface name '$iface'\n"
 my $vmid = $1;
 my $netid = "net$2";
 
-my $migratedfrom = $ENV{PVE_MIGRATED_FROM};
+my $migratedfrom = $hotplug ? undef : $ENV{PVE_MIGRATED_FROM};
 
 my $conf = PVE::QemuServer::load_config($vmid, $migratedfrom);
 
@@ -32,8 +38,10 @@ die "unable to parse network config '$netid'\n" if !$net;
 
 PVE::Network::tap_create($iface, $net->{bridge});
 
-PVE::Network::tap_rate_limit($iface, $net->{rate}) if $net->{rate};
+# if ovs is under this bridge all traffic control settings will be flushed.
+# so we need to call tap_rate_limit after tap_plug
+PVE::Network::tap_plug($iface, $net->{bridge}, $net->{tag}, $net->{firewall}, $net->{trunks});
 
-PVE::Network::tap_plug($iface, $net->{bridge}, $net->{tag}, $net->{firewall});
+PVE::Network::tap_rate_limit($iface, $net->{rate}) if $net->{rate};
 
 exit 0;