try to detect errors before starting the background task

This commit is contained in:
Dietmar Maurer 2011-11-25 13:25:32 +01:00
parent 15f231e1c7
commit a5ed42d347

View File

@ -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};