[pve-devel] [PATCH 2/2] dynamic rate limit change on network update

Alexandre DERUMIER aderumier at odiso.com
Mon Mar 4 16:52:22 CET 2013


I don't have remove the unplug code yet.

(I'll work on dynamic vlan change first)


----- Mail original ----- 

De: "Dietmar Maurer" <dietmar at proxmox.com> 
À: "Alexandre Derumier" <aderumier at odiso.com>, pve-devel at pve.proxmox.com 
Envoyé: Lundi 4 Mars 2013 16:34:16 
Objet: RE: [pve-devel] [PATCH 2/2] dynamic rate limit change on network update 

> 
> @@ -750,10 +751,19 @@ my $vmconfig_update_net = sub { 
> my ($rpcenv, $authuser, $conf, $storecfg, $vmid, $opt, $value) = @_; 
> 
> if ($conf->{$opt}) { 
> + my $oldnet = PVE::QemuServer::parse_net($conf->{$opt}); 
> + my $newnet = PVE::QemuServer::parse_net($value); 
> + 
> + if(($newnet->{rate} && $newnet->{rate} ne $oldnet->{rate}) || ($oldnet- 
> >{rate} && !$newnet->{rate})){ 
> + if($opt =~ m/net(\d+)/){ 
> + my $iface = "tap".$vmid."i".$1; 
> + PVE::Network::tap_rate_limit($iface, $newnet->{rate}); 
> + } 
> + } 
> + 
> #if online update, then unplug first 
> die "error hot-unplug $opt for update" if 
> !PVE::QemuServer::vm_deviceunplug($vmid, $conf, $opt); 

We unplug after setting the rate? 



More information about the pve-devel mailing list