storage migrate: only output about cleaning-up snapshots if there are any

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
This commit is contained in:
Thomas Lamprecht
2024-04-17 12:21:08 +02:00
parent 9e222078a9
commit 3e5f91823a

View File

@ -915,8 +915,8 @@ sub storage_migrate {
if !defined($new_volid) && $target_apiver >= 5;
};
my $err = $@;
warn "send/receive failed, cleaning up snapshot(s)..\n" if $err;
if ($opts->{migration_snapshot}) {
warn "send/receive failed, cleaning up snapshot(s)..\n" if $err;
eval { volume_snapshot_delete($cfg, $volid, $opts->{snapshot}, 0) };
warn "could not remove source snapshot: $@\n" if $@;
}