mirror of
https://git.proxmox.com/git/qemu-server
synced 2025-04-29 09:02:26 +00:00
restore: refactor archive parsing
to avoid duplicate work, always set 'volid' to the backup volume's volid, if it was successfully parsed as such. Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
This commit is contained in:
parent
c961ab6d80
commit
c36214d2a6
@ -750,20 +750,20 @@ my $parse_restore_archive = sub {
|
|||||||
|
|
||||||
my ($archive_storeid, $archive_volname) = PVE::Storage::parse_volume_id($archive, 1);
|
my ($archive_storeid, $archive_volname) = PVE::Storage::parse_volume_id($archive, 1);
|
||||||
|
|
||||||
|
my $res = {};
|
||||||
|
|
||||||
if (defined($archive_storeid)) {
|
if (defined($archive_storeid)) {
|
||||||
my $scfg = PVE::Storage::storage_config($storecfg, $archive_storeid);
|
my $scfg = PVE::Storage::storage_config($storecfg, $archive_storeid);
|
||||||
|
$res->{volid} = $archive;
|
||||||
if ($scfg->{type} eq 'pbs') {
|
if ($scfg->{type} eq 'pbs') {
|
||||||
return {
|
$res->{type} = 'pbs';
|
||||||
type => 'pbs',
|
return $res;
|
||||||
volid => $archive,
|
|
||||||
};
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
my $path = PVE::Storage::abs_filesystem_path($storecfg, $archive);
|
my $path = PVE::Storage::abs_filesystem_path($storecfg, $archive);
|
||||||
return {
|
$res->{type} = 'file';
|
||||||
type => 'file',
|
$res->{path} = $path;
|
||||||
path => $path,
|
return $res;
|
||||||
};
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user