X-Git-Url: https://git.proxmox.com/?a=blobdiff_plain;f=pve-bridge;h=64490b0a9b70278fc22e4a22c4c8007758457663;hb=1d682951721ae83399399ff54888964e631e6297;hp=b4550f1cf324e3ba1448ff4764c300ea7795ed4e;hpb=a279a03df3d34c07ae3f26cc9aa27b80c8732f60;p=qemu-server.git diff --git a/pve-bridge b/pve-bridge index b4550f1..64490b0 100755 --- a/pve-bridge +++ b/pve-bridge @@ -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,9 +22,9 @@ 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); +my $conf = PVE::QemuConfig->load_config($vmid, $migratedfrom); my $netconf = $conf->{$netid}; @@ -32,10 +38,6 @@ die "unable to parse network config '$netid'\n" if !$net; PVE::Network::tap_create($iface, $net->{bridge}); -# 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_rate_limit($iface, $net->{rate}) if $net->{rate}; +PVE::Network::tap_plug($iface, $net->{bridge}, $net->{tag}, $net->{firewall}, $net->{trunks}, $net->{rate}); exit 0;