mirror of
git://git.proxmox.com/git/pve-storage.git
synced 2025-03-11 16:58:28 +03:00
file_size_info: add warning when falling back to raw format
in case this gets called with an explicit format that is none of: - 'auto-detect' - 'subvol' - a member of the list of known "qemu" formats this should only affect third-party storage plugins that either call this directly with a format, or via inherited code that gets a format from parse_volname and passes it to file_size_info. Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com> Reviewed-by: Fiona Ebner <f.ebner@proxmox.com>
This commit is contained in:
parent
081ce2c9df
commit
a9e0f50d4a
@ -1012,8 +1012,10 @@ sub file_size_info {
|
|||||||
|
|
||||||
# TODO PVE 9 - consider upgrading to "die" if an unsupported format is passed in after
|
# TODO PVE 9 - consider upgrading to "die" if an unsupported format is passed in after
|
||||||
# evaluating breakage potential.
|
# evaluating breakage potential.
|
||||||
$file_format = 'raw' if $file_format && !grep { $_ eq $file_format } @checked_qemu_img_formats;
|
if ($file_format && !grep { $_ eq $file_format } @checked_qemu_img_formats) {
|
||||||
|
warn "file_size_info: '$filename': falling back to 'raw' from unknown format '$file_format'\n";
|
||||||
|
$file_format = 'raw';
|
||||||
|
}
|
||||||
my $cmd = ['/usr/bin/qemu-img', 'info', '--output=json', $filename];
|
my $cmd = ['/usr/bin/qemu-img', 'info', '--output=json', $filename];
|
||||||
push $cmd->@*, '-f', $file_format if $file_format;
|
push $cmd->@*, '-f', $file_format if $file_format;
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user