From d797bb62c3f77d5795d5eefec3b01ffb39af09ec Mon Sep 17 00:00:00 2001 From: Alexandre Derumier Date: Tue, 10 Oct 2023 17:37:17 +0200 Subject: [PATCH] cpu hotplug: cannot change feature online The vCPUs are passed as devices with specific id only when CPU hot-plug is enable at cold start. So, we can't enable/disable allow-hotplug online as then vCPU hotplug API will thrown errors not finding core id. Not enforcing this could also lead to migration failure, as the QEMU command line for the target VM could be made different than the one it was actually running with, causing a crash of the target as Fiona observed [0]. [0]: https://lists.proxmox.com/pipermail/pve-devel/2023-October/059434.html Signed-off-by: Alexandre Derumier [ TL: Reflowed & expanded commit message ] Signed-off-by: Thomas Lamprecht --- PVE/QemuServer.pm | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/PVE/QemuServer.pm b/PVE/QemuServer.pm index 2cd89485..1386a3ca 100644 --- a/PVE/QemuServer.pm +++ b/PVE/QemuServer.pm @@ -4961,7 +4961,7 @@ sub vmconfig_hotplug_pending { my $force = $pending_delete_hash->{$opt}->{force}; eval { if ($opt eq 'hotplug') { - die "skip\n" if ($conf->{hotplug} =~ /memory/); + die "skip\n" if ($conf->{hotplug} =~ /(cpu|memory)/); } elsif ($opt eq 'tablet') { die "skip\n" if !$hotplug_features->{usb}; if ($defaults->{tablet}) { @@ -5022,6 +5022,7 @@ sub vmconfig_hotplug_pending { eval { if ($opt eq 'hotplug') { die "skip\n" if ($value =~ /memory/) || ($value !~ /memory/ && $conf->{hotplug} =~ /memory/); + die "skip\n" if ($value =~ /cpu/) || ($value !~ /cpu/ && $conf->{hotplug} =~ /cpu/); } elsif ($opt eq 'tablet') { die "skip\n" if !$hotplug_features->{usb}; if ($value == 1) {