[pve-devel] [PATCH qemu-server] Use has_lock to check for specific lock

Fabian Grünbichler f.gruenbichler at proxmox.com
Fri Mar 11 12:11:57 CET 2016


---
 PVE/QemuServer.pm | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/PVE/QemuServer.pm b/PVE/QemuServer.pm
index c0907bc..fb6d07d 100644
--- a/PVE/QemuServer.pm
+++ b/PVE/QemuServer.pm
@@ -4733,7 +4733,8 @@ sub vm_suspend {
 
 	my $conf = PVE::QemuConfig->load_config($vmid);
 
-	PVE::QemuConfig->check_lock($conf) if !($skiplock || ($conf->{lock} && $conf->{lock} eq 'backup'));
+	PVE::QemuConfig->check_lock($conf)
+	    if !($skiplock || PVE::QemuConfig->has_lock($conf, 'backup'));
 
 	vm_mon_cmd($vmid, "stop");
     });
@@ -4748,7 +4749,8 @@ sub vm_resume {
 
 	    my $conf = PVE::QemuConfig->load_config($vmid);
 
-	    PVE::QemuConfig->check_lock($conf) if !($skiplock || ($conf->{lock} && $conf->{lock} eq 'backup'));
+	    PVE::QemuConfig->check_lock($conf)
+		if !($skiplock || PVE::QemuConfig->has_lock($conf, 'backup'));
 
 	    vm_mon_cmd($vmid, "cont");
 
-- 
2.1.4





More information about the pve-devel mailing list