mirror of
https://git.proxmox.com/git/qemu-server
synced 2025-08-06 11:36:23 +00:00
Add check if host has enough real CPUs for starting VM
To prevent a Qemu CPU emualtion! Signed-off-by: Wolfgang Link <wolfgang@linksystems.org>
This commit is contained in:
parent
883839209f
commit
7626772856
@ -2588,6 +2588,12 @@ sub config_to_command {
|
||||
my $cores = $conf->{cores} || 1;
|
||||
my $maxcpus = $conf->{maxcpus} if $conf->{maxcpus};
|
||||
|
||||
my $total_cores = $sockets * $cores;
|
||||
my $allowed_cores = $cpuinfo->{cpus};
|
||||
|
||||
die "MAX $allowed_cores Cores allowed per VM on this Node"
|
||||
if ($allowed_cores < $total_cores);
|
||||
|
||||
if ($maxcpus) {
|
||||
push @$cmd, '-smp', "cpus=$cores,maxcpus=$maxcpus";
|
||||
} else {
|
||||
|
Loading…
Reference in New Issue
Block a user