[pve-devel] [PATCH container 2/3] Use new move_config_to_node method
Fabian Ebner
f.ebner at proxmox.com
Wed Jul 1 13:39:06 CEST 2020
Signed-off-by: Fabian Ebner <f.ebner at proxmox.com>
---
I felt like this makes sense as a single block now (without each
line being separated by a blank), but I can send a v2 without that style
change if you want. Same for the next patch.
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 d0be6d4..3525e9a 100644
--- a/src/PVE/LXC/Migrate.pm
+++ b/src/PVE/LXC/Migrate.pm
@@ -295,9 +295,6 @@ sub phase1 {
PVE::Storage::storage_migrate($self->{storecfg}, $volid, $self->{ssh_info}, $sid, $storage_migrate_opts);
}
- my $conffile = PVE::LXC::Config->config_file($vmid);
- my $newconffile = PVE::LXC::Config->config_file($vmid, $self->{node});
-
if ($self->{running}) {
die "implement me";
}
@@ -312,15 +309,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