]> git.proxmox.com Git - qemu-server.git/commitdiff
Die on misaligned memory for hotplugging
authorStefan Reiter <s.reiter@proxmox.com>
Wed, 18 Mar 2020 15:18:45 +0000 (16:18 +0100)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Thu, 19 Mar 2020 17:55:27 +0000 (18:55 +0100)
...instead of booting with an invalid config once and then silently
changing the memory size for consequent VM starts.

Signed-off-by: Stefan Reiter <s.reiter@proxmox.com>
Tested-by: Alwin Antreich <a.antreich@proxmox.com>
PVE/QemuServer/Memory.pm

index ae9598b34ffc2391f43dbe07d29ff4c3d07829a5..b7cf5d57e066013c5b4d87c53117f01ca585a9bc 100644 (file)
@@ -321,11 +321,8 @@ sub config {
            push @$cmd, "-object" , $mem_object;
            push @$cmd, "-device", "pc-dimm,id=$name,memdev=mem-$name,node=$numanode";
 
-           #if dimm_memory is not aligned to dimm map
-           if($current_size > $memory) {
-                $conf->{memory} = $current_size;
-                PVE::QemuConfig->write_config($vmid, $conf);
-           }
+           die "memory size ($memory) must be aligned to $dimm_size for hotplugging\n"
+               if $current_size > $memory;
        });
     }
 }