mirror of
https://git.proxmox.com/git/qemu-server
synced 2025-12-10 01:01:55 +00:00
add maxcpus config
Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
This commit is contained in:
parent
8b8345f3ac
commit
3bd18e48cf
@ -300,6 +300,13 @@ EODESC
|
|||||||
minimum => 1,
|
minimum => 1,
|
||||||
default => 1,
|
default => 1,
|
||||||
},
|
},
|
||||||
|
maxcpus => {
|
||||||
|
optional => 1,
|
||||||
|
type => 'integer',
|
||||||
|
description => "Maximum cpus for hotplug.",
|
||||||
|
minimum => 1,
|
||||||
|
default => 1,
|
||||||
|
},
|
||||||
acpi => {
|
acpi => {
|
||||||
optional => 1,
|
optional => 1,
|
||||||
type => 'boolean',
|
type => 'boolean',
|
||||||
@ -1741,6 +1748,9 @@ sub write_vm_config {
|
|||||||
delete $conf->{smp};
|
delete $conf->{smp};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ($conf->{maxcpus} && $conf->{sockets}){
|
||||||
|
delete $conf->{sockets};
|
||||||
|
}
|
||||||
my $used_volids = {};
|
my $used_volids = {};
|
||||||
|
|
||||||
my $cleanup_config = sub {
|
my $cleanup_config = sub {
|
||||||
@ -2403,7 +2413,13 @@ sub config_to_command {
|
|||||||
$sockets = $conf->{sockets} if $conf->{sockets};
|
$sockets = $conf->{sockets} if $conf->{sockets};
|
||||||
|
|
||||||
my $cores = $conf->{cores} || 1;
|
my $cores = $conf->{cores} || 1;
|
||||||
|
my $maxcpus = $conf->{maxcpus} if $conf->{maxcpus};
|
||||||
|
|
||||||
|
if($maxcpus){
|
||||||
|
push @$cmd, '-smp', "cpus=$cores,maxcpus=$maxcpus";
|
||||||
|
}else{
|
||||||
push @$cmd, '-smp', "sockets=$sockets,cores=$cores";
|
push @$cmd, '-smp', "sockets=$sockets,cores=$cores";
|
||||||
|
}
|
||||||
|
|
||||||
push @$cmd, '-nodefaults';
|
push @$cmd, '-nodefaults';
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user