mirror of
https://git.proxmox.com/git/qemu-server
synced 2025-11-03 06:56:53 +00:00
delete ram state files when restoring a backup
currently we leave orphaned vmstate files when we restore a backup over a vm, which has snapshots with saved ram state. this patch deletes those files on a restore. Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
This commit is contained in:
parent
7efedbf397
commit
381b8fae81
@ -5562,6 +5562,18 @@ sub restore_vma_archive {
|
||||
PVE::Storage::vdisk_free($cfg, $volid);
|
||||
}
|
||||
});
|
||||
|
||||
# delete vmstate files
|
||||
# since after the restore we have no snapshots anymore
|
||||
foreach my $snapname (keys %{$oldconf->{snapshots}}) {
|
||||
my $snap = $oldconf->{snapshots}->{$snapname};
|
||||
if ($snap->{vmstate}) {
|
||||
eval { PVE::Storage::vdisk_free($cfg, $snap->{vmstate}); };
|
||||
if (my $err = $@) {
|
||||
warn $err;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
my $map = {};
|
||||
|
||||
Loading…
Reference in New Issue
Block a user