[pve-devel] [PATCH 2/4] cpu hotplug : add coldplugged cpu to qemu command line
Alexandre Derumier
aderumier at odiso.com
Tue Sep 6 12:41:54 CEST 2016
Signed-off-by: Alexandre Derumier <aderumier at odiso.com>
---
PVE/QemuServer.pm | 12 +++++++++++-
1 file changed, 11 insertions(+), 1 deletion(-)
diff --git a/PVE/QemuServer.pm b/PVE/QemuServer.pm
index 59ccb91..d3092ba 100644
--- a/PVE/QemuServer.pm
+++ b/PVE/QemuServer.pm
@@ -2902,8 +2902,18 @@ sub config_to_command {
die "MAX $allowed_vcpus vcpus allowed per VM on this node\n"
if ($allowed_vcpus < $maxcpus);
- push @$cmd, '-smp', "$vcpus,sockets=$sockets,cores=$cores,maxcpus=$maxcpus";
+ if($hotplug_features->{cpu} && qemu_machine_feature_enabled ($machine_type, $kvmver, 2, 7)) {
+ push @$cmd, '-smp', "1,sockets=$sockets,cores=$cores,maxcpus=$maxcpus";
+ for (my $i = 2; $i <= $vcpus; $i++) {
+ my $cpustr = print_cpu_device($conf,$i);
+ push @$cmd, '-device', $cpustr;
+ }
+
+ } else {
+
+ push @$cmd, '-smp', "$vcpus,sockets=$sockets,cores=$cores,maxcpus=$maxcpus";
+ }
push @$cmd, '-nodefaults';
my $bootorder = $conf->{boot} || $confdesc->{boot}->{default};
--
2.1.4
More information about the pve-devel
mailing list