mirror of
				https://git.proxmox.com/git/qemu-server
				synced 2025-11-04 09:40:34 +00:00 
			
		
		
		
	systemd scope: add CPUWeight for cgroupv2
This commit is contained in:
		
							parent
							
								
									5b65b00d04
								
							
						
					
					
						commit
						6cbd3eb82c
					
				@ -5078,10 +5078,15 @@ sub vm_start_nolock {
 | 
			
		||||
 | 
			
		||||
    my %properties = (
 | 
			
		||||
	Slice => 'qemu.slice',
 | 
			
		||||
	KillMode => 'none',
 | 
			
		||||
	CPUShares => $cpuunits
 | 
			
		||||
	KillMode => 'none'
 | 
			
		||||
    );
 | 
			
		||||
 | 
			
		||||
    if (PVE::CGroup::cgroup_mode() == 2) {
 | 
			
		||||
	$properties{CPUWeight} = $cpuunits;
 | 
			
		||||
    } else {
 | 
			
		||||
	$properties{CPUShares} = $cpuunits;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    if (my $cpulimit = $conf->{cpulimit}) {
 | 
			
		||||
	$properties{CPUQuota} = int($cpulimit * 100);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
		Loading…
	
		Reference in New Issue
	
	Block a user