[pve-devel] [PATCH v2 container 2/5] Use new move_config_to_node method

Fabian Ebner f.ebner at proxmox.com
Thu Aug 20 11:11:39 CEST 2020


Signed-off-by: Fabian Ebner <f.ebner at proxmox.com>
---
 src/PVE/LXC/Migrate.pm | 12 ++----------
 1 file changed, 2 insertions(+), 10 deletions(-)

diff --git a/src/PVE/LXC/Migrate.pm b/src/PVE/LXC/Migrate.pm
index 90d74b4..d2938f6 100644
--- a/src/PVE/LXC/Migrate.pm
+++ b/src/PVE/LXC/Migrate.pm
@@ -302,9 +302,6 @@ sub phase1 {
 	}
     }
 
-    my $conffile = PVE::LXC::Config->config_file($vmid);
-    my $newconffile = PVE::LXC::Config->config_file($vmid, $self->{node});
-
     if ($self->{running}) {
 	die "implement me";
     }
@@ -319,15 +316,10 @@ sub phase1 {
     my $vollist = PVE::LXC::Config->get_vm_volumes($conf);
     PVE::Storage::deactivate_volumes($self->{storecfg}, $vollist);
 
-   # transfer replication state before move config
+    # transfer replication state before moving config
     $self->transfer_replication_state() if $rep_volumes;
-
-    # move config
-    die "Failed to move config to node '$self->{node}' - rename failed: $!\n"
-	if !rename($conffile, $newconffile);
-
+    PVE::LXC::Config->move_config_to_node($vmid, $self->{node});
     $self->{conf_migrated} = 1;
-
     $self->switch_replication_job_target() if $rep_volumes;
 }
 
-- 
2.20.1






More information about the pve-devel mailing list