From 30fdf99cffaff191b5e2cfd17c07469a3db84718 Mon Sep 17 00:00:00 2001 From: Stefan Hanreich Date: Thu, 5 Jan 2023 15:51:56 +0100 Subject: [PATCH] fix #4358: destroy_vm: Ignore 'suspended' lock when destroying VM Since we can now differentiate between 'suspended' and 'suspending', it is possible to ignore the 'suspended' lock when destroying a VM. It shouldn't matter whether the VM is locked because of hibernation when you want to remove it. Therefore we can safely ignore the lock. --- PVE/QemuServer.pm | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/PVE/QemuServer.pm b/PVE/QemuServer.pm index 4292da74..d94fe5ab 100644 --- a/PVE/QemuServer.pm +++ b/PVE/QemuServer.pm @@ -2341,7 +2341,9 @@ sub destroy_vm { my $conf = PVE::QemuConfig->load_config($vmid); - PVE::QemuConfig->check_lock($conf) if !$skiplock; + if (!$skiplock && !PVE::QemuConfig->has_lock($conf, 'suspended')) { + PVE::QemuConfig->check_lock($conf); + } if ($conf->{template}) { # check if any base image is still used by a linked clone