When loading the VM state during resume from hibernation, it is
essential that the QEMU commandline of the new instance matches the
one from the instance the VM state was created with. Thus, pending
changes cannot be applied.

Checking for hibernation was missing in the logic checking whether
pending changes should be applied. In particular, the $statefile
parameter is not used when resuming after hibernation. There, the
$resume parameter is set and the state file/volume is found in the
'vmstate' configuraiton option.

Signed-off-by: Fiona Ebner <[email protected]>
---
 src/PVE/QemuServer.pm | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/PVE/QemuServer.pm b/src/PVE/QemuServer.pm
index cf195ccc..c54a49ee 100644
--- a/src/PVE/QemuServer.pm
+++ b/src/PVE/QemuServer.pm
@@ -5454,7 +5454,7 @@ sub vm_start_nolock {
     eval { clear_reboot_request($vmid); };
     warn $@ if $@;
 
-    if (!$statefile && scalar(keys %{ $conf->{pending} })) {
+    if (!$statefile && !$resume && scalar(keys %{ $conf->{pending} })) {
         vmconfig_apply_pending($vmid, $conf, $storecfg);
         $conf = PVE::QemuConfig->load_config($vmid); # update/reload
     }
-- 
2.47.3



_______________________________________________
pve-devel mailing list
[email protected]
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel

Reply via email to