]> git.proxmox.com Git - pve-storage.git/commitdiff
file size info: return early if we cannot parse json
authorThomas Lamprecht <t.lamprecht@proxmox.com>
Wed, 23 Jun 2021 06:25:20 +0000 (08:25 +0200)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Wed, 23 Jun 2021 06:28:48 +0000 (08:28 +0200)
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
PVE/Storage/Plugin.pm

index 44697eceb53efdbbf6f6a5ea446d17411616b20e..31d9e286dc8bf1fe967437df0f7f808ef6cb8aeb 100644 (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)};