list volumes: also return backup type for backups

Otherwise, there is no storage-agnostic way to filter by backup group.

Call it subtype, to not confuse it with content type, and to be able
to re-use it for other content types than backup, if the need ever
arises.

Signed-off-by: Fabian Ebner <f.ebner@proxmox.com>
This commit is contained in:
Fabian Ebner
2021-12-16 13:12:23 +01:00
committed by Thomas Lamprecht
parent 5ef50a8262
commit c66e0b8a0a
3 changed files with 12 additions and 0 deletions

View File

@ -688,6 +688,7 @@ sub list_volumes {
content => 'backup',
vmid => int($bid),
ctime => $epoch,
subtype => $btype eq 'vm' ? 'qemu' : 'lxc', # convert to PVE backup type
};
$info->{verification} = $item->{verification} if defined($item->{verification});

View File

@ -1164,6 +1164,7 @@ my $get_subdir_files = sub {
my $archive_info = eval { PVE::Storage::archive_info($fn) } // {};
$info->{ctime} = $archive_info->{ctime} if defined($archive_info->{ctime});
$info->{subtype} = $archive_info->{type} // 'unknown';
if (defined($vmid) || $fn =~ m!\-([1-9][0-9]{2,8})\-[^/]+\.${format}$!) {
$info->{vmid} = $vmid // $1;