file size info: return early if we cannot parse json
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
This commit is contained in:
@ -833,7 +833,10 @@ sub file_size_info {
|
|||||||
warn $@ if $@;
|
warn $@ if $@;
|
||||||
|
|
||||||
my $info = eval { decode_json($json) };
|
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)};
|
my ($size, $format, $used, $parent) = $info->@{qw(virtual-size format actual-size backing-filename)};
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user