mirror of
				https://git.proxmox.com/git/qemu-server
				synced 2025-10-31 08:50:46 +00:00 
			
		
		
		
	 a279a03df3
			
		
	
	
		a279a03df3
		
	
	
	
	
		
			
			the ovs-vsctl del-port flush the tc settings. So we have to change the arrangement of setting up the network. Signed-off-by: Wolfgang Link <w.link@proxmox.com>
		
			
				
	
	
		
			42 lines
		
	
	
		
			1.0 KiB
		
	
	
	
		
			Perl
		
	
	
		
			Executable File
		
	
	
	
	
			
		
		
	
	
			42 lines
		
	
	
		
			1.0 KiB
		
	
	
	
		
			Perl
		
	
	
		
			Executable File
		
	
	
	
	
| #!/usr/bin/perl
 | |
| 
 | |
| use strict;
 | |
| use warnings;
 | |
| use PVE::QemuServer;
 | |
| use PVE::Tools qw(run_command);
 | |
| use PVE::Network;
 | |
| 
 | |
| my $iface = shift;
 | |
| 
 | |
| die "no interface specified\n" if !$iface;
 | |
| 
 | |
| die "got strange interface name '$iface'\n" 
 | |
|     if $iface !~ m/^tap(\d+)i(\d+)$/;
 | |
| 
 | |
| my $vmid = $1;
 | |
| my $netid = "net$2";
 | |
| 
 | |
| 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 !defined($netconf);
 | |
| 
 | |
| my $net = PVE::QemuServer::parse_net($netconf);
 | |
| 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};
 | |
| 
 | |
| exit 0;
 |