Reported-by: Markus Armbruster <arm...@redhat.com> Signed-off-by: Fam Zheng <f...@redhat.com> --- block/vmdk.c | 3 +++ 1 file changed, 3 insertions(+)
diff --git a/block/vmdk.c b/block/vmdk.c index 22f85c4..dd97e25 100644 --- a/block/vmdk.c +++ b/block/vmdk.c @@ -642,6 +642,7 @@ static int vmdk_open_vmdk4(BlockDriverState *bs, bs->file->total_sectors * 512 - 1536, &footer, sizeof(footer)); if (ret < 0) { + error_setg_errno(errp, -ret, "Failed to read footer"); return ret; } @@ -653,6 +654,7 @@ static int vmdk_open_vmdk4(BlockDriverState *bs, le32_to_cpu(footer.eos_marker.size) != 0 || le32_to_cpu(footer.eos_marker.type) != MARKER_END_OF_STREAM) { + error_setg(errp, "Invalid footer"); return -EINVAL; } @@ -683,6 +685,7 @@ static int vmdk_open_vmdk4(BlockDriverState *bs, l1_entry_sectors = le32_to_cpu(header.num_gtes_per_gt) * le64_to_cpu(header.granularity); if (l1_entry_sectors == 0) { + error_setg(errp, "L1 entry size is invalid"); return -EINVAL; } l1_size = (le64_to_cpu(header.capacity) + l1_entry_sectors - 1) -- 1.9.3