[pve-devel] [PATCH 15/19] phase3_cleanup : clear migration lock on source vm

Alexandre Derumier aderumier at odiso.com
Wed Feb 22 14:33:39 CET 2017


Signed-off-by: Alexandre Derumier <aderumier at odiso.com>
---
 PVE/QemuMigrate.pm | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/PVE/QemuMigrate.pm b/PVE/QemuMigrate.pm
index 35b752e..6c238b7 100644
--- a/PVE/QemuMigrate.pm
+++ b/PVE/QemuMigrate.pm
@@ -1043,6 +1043,12 @@ sub phase3_cleanup {
     }
 
     # clear migrate lock
+    if ($self->{opts}->{externalcluster}) {
+	my $src_conf = PVE::QemuConfig->load_config($vmid);
+	delete $src_conf->{lock};
+	eval { PVE::QemuConfig->write_config($vmid, $src_conf) };
+    }
+
     my $cmd = [ @{$self->{rem_ssh}}, 'qm', 'unlock', $targetvmid ];
     $self->cmd_logerr($cmd, errmsg => "failed to clear migrate lock");
 }
-- 
2.1.4




More information about the pve-devel mailing list