From 339a4eb3c0ffa634e74d2c8081528d0a45a09e3d Mon Sep 17 00:00:00 2001 From: Thomas Lamprecht Date: Wed, 23 Jun 2021 08:25:20 +0200 Subject: [PATCH] file size info: return early if we cannot parse json Signed-off-by: Thomas Lamprecht --- PVE/Storage/Plugin.pm | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/PVE/Storage/Plugin.pm b/PVE/Storage/Plugin.pm index 44697ec..31d9e28 100644 --- a/PVE/Storage/Plugin.pm +++ b/PVE/Storage/Plugin.pm @@ -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)};