[pve-devel] [PATCH qemu-server v2] qemu-server: pending config: fix hotplug check

Hannes Duerr h.duerr at proxmox.com
Tue Oct 14 16:58:58 CEST 2025


When checking whether cpu and mem hotplug have already been set, it was
not checked whether there is already a hotplug section in the VM config,
which results in an uninitialized value error.
At the same time, remove unnecessary regex.

Signed-off-by: Hannes Duerr <h.duerr at proxmox.com>
---

changes since v1:
removed unnecessary Data::Dumper dependency
 src/PVE/QemuServer.pm | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/PVE/QemuServer.pm b/src/PVE/QemuServer.pm
index 45daa06c..f8ad9bbb 100644
--- a/src/PVE/QemuServer.pm
+++ b/src/PVE/QemuServer.pm
@@ -4714,9 +4714,9 @@ sub vmconfig_hotplug_pending {
         eval {
             if ($opt eq 'hotplug') {
                 die "skip\n"
-                    if ($value =~ /memory/) || ($value !~ /memory/ && $conf->{hotplug} =~ /memory/);
+                    if ($value =~ /cpu/) || ($conf->{hotplug} && $conf->{hotplug} =~ /cpu/);
                 die "skip\n"
-                    if ($value =~ /cpu/) || ($value !~ /cpu/ && $conf->{hotplug} =~ /cpu/);
+                    if ($value =~ /memory/) || ($conf->{hotplug} && $conf->{hotplug} =~ /memory/);
             } elsif ($opt eq 'tablet') {
                 die "skip\n" if !$hotplug_features->{usb};
                 if ($value == 1) {
-- 
2.47.3





More information about the pve-devel mailing list