[pve-devel] [PATCH container 2/2] migrate: cleanup final_cleanup

Fabian Grünbichler f.gruenbichler at proxmox.com
Thu Oct 12 10:08:08 CEST 2017


use remove_lock instead of manually removing

Signed-off-by: Fabian Grünbichler <f.gruenbichler at proxmox.com>
---
 src/PVE/LXC/Migrate.pm | 7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)

diff --git a/src/PVE/LXC/Migrate.pm b/src/PVE/LXC/Migrate.pm
index cab2aed..3864a19 100644
--- a/src/PVE/LXC/Migrate.pm
+++ b/src/PVE/LXC/Migrate.pm
@@ -363,16 +363,13 @@ sub final_cleanup {
     $self->log('info', "start final cleanup");
 
     if (!$self->{conf_migrated}) {
-	my $conf = $self->{vmconf};
-	delete $conf->{lock};
-
-	eval { PVE::LXC::Config->write_config($vmid, $conf); };
+	eval { PVE::LXC::Config->remove_lock($vmid, 'migrate'); };
 	if (my $err = $@) {
 	    $self->log('err', $err);
 	}
     } else {
 	my $cmd = [ @{$self->{rem_ssh}}, 'pct', 'unlock', $vmid ];
-	$self->cmd_logerr($cmd, errmsg => "failed to clear migrate lock");	
+	$self->cmd_logerr($cmd, errmsg => "failed to clear migrate lock");
     }
 }
 
-- 
2.14.1





More information about the pve-devel mailing list