file size info: prepare to make format parameter mandatory

In almost all cases, there already is an expected format. Allow
setting a special value 'auto-detect' to opt-in to automatic format
detection by 'qemu-img' for the exceptions.

Suggested-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
Signed-off-by: Fiona Ebner <f.ebner@proxmox.com>
This commit is contained in:
Fiona Ebner
2024-12-06 17:25:27 +01:00
committed by Fabian Grünbichler
parent 9612844ff3
commit 936fbe3f35
3 changed files with 10 additions and 3 deletions

View File

@ -354,7 +354,7 @@ ovf:Item[rasd:InstanceID='%s']/rasd:ResourceType", $controller_id);
}
if (!$isOva) {
my $size = PVE::Storage::file_size_info($backing_file_path);
my $size = PVE::Storage::file_size_info($backing_file_path, undef, 'auto-detect');
die "error parsing $backing_file_path, cannot determine file size\n"
if !$size;