minimum => 1,
default => 1,
},
+ maxcpus => {
+ optional => 1,
+ type => 'integer',
+ description => "Maximum cpus for hotplug.",
+ minimum => 1,
+ default => 1,
+ },
acpi => {
optional => 1,
type => 'boolean',
delete $conf->{smp};
}
+ if ($conf->{maxcpus} && $conf->{sockets}){
+ delete $conf->{sockets};
+ }
my $used_volids = {};
my $cleanup_config = sub {
$sockets = $conf->{sockets} if $conf->{sockets};
my $cores = $conf->{cores} || 1;
- push @$cmd, '-smp', "sockets=$sockets,cores=$cores";
+ 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, '-nodefaults';