]> git.proxmox.com Git - qemu-server.git/blobdiff - pve-bridge
vzdump : abord backup if disk have iothread enabled.
[qemu-server.git] / pve-bridge
index f4ea56e8bc9e386bb615775e9642c7d62c0a6aba..b4550f1cf324e3ba1448ff4764c300ea7795ed4e 100755 (executable)
@@ -1,6 +1,7 @@
-#!/usr/bin/perl -w
+#!/usr/bin/perl
 
 use strict;
+use warnings;
 use PVE::QemuServer;
 use PVE::Tools qw(run_command);
 use PVE::Network;
@@ -19,16 +20,22 @@ my $migratedfrom = $ENV{PVE_MIGRATED_FROM};
 
 my $conf = PVE::QemuServer::load_config($vmid, $migratedfrom);
 
+my $netconf = $conf->{$netid};
+
+$netconf = $conf->{pending}->{$netid} if !$migratedfrom && defined($conf->{pending}->{$netid}); 
 die "unable to get network config '$netid'\n"
-    if !$conf->{$netid};
+    if !defined($netconf);
 
-my $net = PVE::QemuServer::parse_net($conf->{$netid});
+my $net = PVE::QemuServer::parse_net($netconf);
 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});
 
-PVE::Network::tap_plug($iface, $net->{bridge}, $net->{tag});
+PVE::Network::tap_rate_limit($iface, $net->{rate}) if $net->{rate};
 
 exit 0;