5
0
mirror of git://git.proxmox.com/git/pve-storage.git synced 2025-01-20 14:03:52 +03:00

file size info: return early if we cannot parse json

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
This commit is contained in:
Thomas Lamprecht 2021-06-23 08:25:20 +02:00
parent d4e00f2bd5
commit 339a4eb3c0

View File

@ -833,7 +833,10 @@ sub file_size_info {
warn $@ if $@;
my $info = eval { decode_json($json) };
warn "could not parse qemu-img info command output for '$filename'\n" if $@;
if (my $err = $@) {
warn "could not parse qemu-img info command output for '$filename' - $err\n";
return wantarray ? (undef, undef, undef, undef, $st->ctime) : undef;
}
my ($size, $format, $used, $parent) = $info->@{qw(virtual-size format actual-size backing-filename)};