]> git.proxmox.com Git - qemu-server.git/commitdiff
cpu hotplug: cannot change feature online
authorAlexandre Derumier <aderumier@odiso.com>
Tue, 10 Oct 2023 15:37:17 +0000 (17:37 +0200)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Tue, 24 Oct 2023 09:46:52 +0000 (11:46 +0200)
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 <aderumier@odiso.com>
 [ TL: Reflowed & expanded commit message ]
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
PVE/QemuServer.pm

index 2cd894859b5b7568ca4d4d3b026eea9bfdec7255..1386a3cacd5c357911d67eb75cc40134cd52157b 100644 (file)
@@ -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) {