]> git.proxmox.com Git - pve-storage.git/commitdiff
file size info: return early if we cannot parse json stable-6
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:41:06 +0000 (08:41 +0200)
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
(cherry picked from commit 339a4eb3c0ffa634e74d2c8081528d0a45a09e3d)
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
PVE/Storage/Plugin.pm

index 4a97654f7f5117f76217112549e1462870469649..26c74304aef46da195a5db1a1d266ccec7c3fb8c 100644 (file)
@@ -821,7 +821,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)};