5
0
mirror of git://git.proxmox.com/git/qemu-server.git synced 2025-02-15 05:57:39 +03:00

migrate: cleanup replica volume skip condition

This commit is contained in:
Wolfgang Bumiller 2017-04-28 10:34:46 +02:00
parent 1849c59288
commit 6e8044dcea

View File

@ -861,16 +861,16 @@ sub phase3 {
# destroy local copies
foreach my $volid (@$volids) {
# do not destroy if new target is local_host
if (!($self->{vmconf}->{replica} && defined($synced_volumes->{$volid})
&& $self->{vmconf}->{replica_target} eq $self->{opts}->{node}) ) {
eval { PVE::Storage::vdisk_free($self->{storecfg}, $volid); };
if (my $err = $@) {
$self->log('err', "removing local copy of '$volid' failed - $err");
$self->{errors} = 1;
last if $err =~ /^interrupted by signal$/;
}
next if $self->{vmconf}->{replica} &&
defined($synced_volumes->{$volid}) &&
$self->{vmconf}->{replica_target} eq $self->{opts}->{node};
eval { PVE::Storage::vdisk_free($self->{storecfg}, $volid); };
if (my $err = $@) {
$self->log('err', "removing local copy of '$volid' failed - $err");
$self->{errors} = 1;
last if $err =~ /^interrupted by signal$/;
}
}
}