From a5ed42d3472a7653d9edb59ec1ed1600b1140678 Mon Sep 17 00:00:00 2001 From: Dietmar Maurer Date: Fri, 25 Nov 2011 13:25:32 +0100 Subject: [PATCH] try to detect errors before starting the background task --- PVE/API2/Qemu.pm | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/PVE/API2/Qemu.pm b/PVE/API2/Qemu.pm index 376a9b24..8baa3062 100644 --- a/PVE/API2/Qemu.pm +++ b/PVE/API2/Qemu.pm @@ -1216,9 +1216,12 @@ __PACKAGE__->register_method({ if $param->{force} && $user ne 'root@pam'; # test if VM exists - PVE::QemuServer::load_config($vmid); + my $conf = PVE::QemuServer::load_config($vmid); # try to detect errors early + + PVE::QemuServer::check_lock($conf); + if (PVE::QemuServer::check_running($vmid)) { die "cant migrate running VM without --online\n" if !$param->{online};