[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH] vmdk: refuse to open higher version than suppor
From: |
Kevin Wolf |
Subject: |
Re: [Qemu-devel] [PATCH] vmdk: refuse to open higher version than supported |
Date: |
Mon, 10 Jun 2013 11:09:15 +0200 |
User-agent: |
Mutt/1.5.21 (2010-09-15) |
Am 09.06.2013 um 03:44 hat Fam Zheng geschrieben:
> 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: Fam Zheng <address@hidden>
Yes, it's definitely a good idea to add a check.
> @@ -558,6 +558,10 @@ static int vmdk_open_vmdk4(BlockDriverState *bs,
> header = footer.header;
> }
>
> + if (le32_to_cpu(header.version) >= 3) {
> + return -EINVAL;
> + }
> +
Other block drivers return -ENOTSUP for this case, and also call
qerror_report(QERR_UNKNOWN_BLOCK_FORMAT_FEATURE, ...) so that you get a
meaningful error message. Can you model the VMDK code after them?
Kevin