5
0
mirror of git://git.proxmox.com/git/qemu-server.git synced 2025-01-22 22:03:55 +03:00

add possibility to restore backup on rbd in krbd mode

This commit is contained in:
Wolfgang Link 2015-09-08 16:05:21 +02:00 committed by Dietmar Maurer
parent 116da78402
commit 5f96f4df75

View File

@ -5363,6 +5363,8 @@ sub restore_vma_archive {
$d->{volid} = $volid;
my $path = PVE::Storage::path($cfg, $volid);
PVE::Storage::activate_volumes($cfg,[$volid]);
my $write_zeros = 1;
# fixme: what other storages types initialize volumes with zero?
if ($scfg->{type} eq 'dir' || $scfg->{type} eq 'nfs' || $scfg->{type} eq 'glusterfs' ||
@ -5428,13 +5430,21 @@ sub restore_vma_archive {
alarm($oldtimeout) if $oldtimeout;
my $vollist = [];
foreach my $devname (keys %$devinfo) {
my $volid = $devinfo->{$devname}->{volid};
push @$vollist, $volid if $volid;
}
my $cfg = cfs_read_file('storage.cfg');
PVE::Storage::deactivate_volumes($cfg, $vollist);
unlink $mapfifo;
if ($err) {
rmtree $tmpdir;
unlink $tmpfn;
my $cfg = cfs_read_file('storage.cfg');
foreach my $devname (keys %$devinfo) {
my $volid = $devinfo->{$devname}->{volid};
next if !$volid;