2 Subject: [Qemu-devel] [PATCH v2 1/2] vmdk: Allow read only open of VMDK version 3
3 Date: Thu, 28 Nov 2013 09:48:03 +0800
4 URL: https://lists.gnu.org/archive/html/qemu-devel/2013-11/msg03652.html
6 Signed-off-by: Fam Zheng <address@hidden>
8 block/vmdk.c | 9 ++++++++-
9 1 file changed, 8 insertions(+), 1 deletion(-)
11 diff --git a/block/vmdk.c b/block/vmdk.c
12 index a7ebd0f..6fd20dc 100644
15 @@ -605,13 +605,20 @@ static int vmdk_open_vmdk4(BlockDriverState *bs,
16 header = footer.header;
19 - if (le32_to_cpu(header.version) >= 3) {
20 + if (le32_to_cpu(header.version) > 3) {
22 snprintf(buf, sizeof(buf), "VMDK version %d",
23 le32_to_cpu(header.version));
24 qerror_report(QERR_UNKNOWN_BLOCK_FORMAT_FEATURE,
25 bs->device_name, "vmdk", buf);
27 + } else if (le32_to_cpu(header.version) == 3 && (flags & BDRV_O_RDWR)) {
28 + /* VMware KB 2064959 explains that version 3 added support for
29 + * persistent changed block tracking (CBT), and backup software can
30 + * read it as version=1 if it doesn't care about the changed area
31 + * information. So we are safe to enable read only. */
32 + error_setg(errp, "VMDK version 3 must be read only");
36 if (le32_to_cpu(header.num_gtes_per_gt) > 512) { --