Commit 96c51eb5 authored by Fam Zheng's avatar Fam Zheng Committed by Stefan Hajnoczi
Browse files

vmdk: refuse to open higher version than supported

Refuse to open higher version for safety.

Although we try to be compatible with published VMDK spec, VMware has
newer version from ESXi 5.1 exported OVF/OVA, which we have no knowledge
what's changed in it. And it is very likely to have more new versions in
the future, so it's not safe to open them blindly.
Signed-off-by: default avatarFam Zheng <>
Signed-off-by: default avatarStefan Hajnoczi <>
parent 50b05b6f
......@@ -561,6 +561,15 @@ static int vmdk_open_vmdk4(BlockDriverState *bs,
header = footer.header;
if (le32_to_cpu(header.version) >= 3) {
char buf[64];
snprintf(buf, sizeof(buf), "VMDK version %d",
bs->device_name, "vmdk", buf);
return -ENOTSUP;
l1_entry_sectors = le32_to_cpu(header.num_gtes_per_gte)
* le64_to_cpu(header.granularity);
if (l1_entry_sectors == 0) {
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment