[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 40/41] vmdk: Allow read only open of VMDK version 3
From: |
Kevin Wolf |
Subject: |
[Qemu-devel] [PULL 40/41] vmdk: Allow read only open of VMDK version 3 |
Date: |
Fri, 29 Nov 2013 17:45:54 +0100 |
From: Fam Zheng <address@hidden>
Signed-off-by: Fam Zheng <address@hidden>
Signed-off-by: Kevin Wolf <address@hidden>
---
block/vmdk.c | 9 ++++++++-
1 file changed, 8 insertions(+), 1 deletion(-)
diff --git a/block/vmdk.c b/block/vmdk.c
index 5fb6c81..88d09e3 100644
--- a/block/vmdk.c
+++ b/block/vmdk.c
@@ -605,13 +605,20 @@ static int vmdk_open_vmdk4(BlockDriverState *bs,
header = footer.header;
}
- if (le32_to_cpu(header.version) >= 3) {
+ if (le32_to_cpu(header.version) > 3) {
char buf[64];
snprintf(buf, sizeof(buf), "VMDK version %d",
le32_to_cpu(header.version));
qerror_report(QERR_UNKNOWN_BLOCK_FORMAT_FEATURE,
bs->device_name, "vmdk", buf);
return -ENOTSUP;
+ } else if (le32_to_cpu(header.version) == 3 && (flags & BDRV_O_RDWR)) {
+ /* VMware KB 2064959 explains that version 3 added support for
+ * persistent changed block tracking (CBT), and backup software can
+ * read it as version=1 if it doesn't care about the changed area
+ * information. So we are safe to enable read only. */
+ error_setg(errp, "VMDK version 3 must be read only");
+ return -EINVAL;
}
if (le32_to_cpu(header.num_gtes_per_gt) > 512) {
--
1.8.1.4
- [Qemu-devel] [PULL 29/41] sheepdog: refactor do_sd_create(), (continued)
- [Qemu-devel] [PULL 29/41] sheepdog: refactor do_sd_create(), Kevin Wolf, 2013/11/29
- [Qemu-devel] [PULL 31/41] qemu-iotests: Drop local version of cancel_and_wait from 040, Kevin Wolf, 2013/11/29
- [Qemu-devel] [PULL 30/41] sheepdog: support user-defined redundancy option, Kevin Wolf, 2013/11/29
- [Qemu-devel] [PULL 32/41] blkdebug: add "remove_break" command, Kevin Wolf, 2013/11/29
- [Qemu-devel] [PULL 33/41] qemu-iotest: Add pause_drive and resume_drive methods, Kevin Wolf, 2013/11/29
- [Qemu-devel] [PULL 34/41] qemu-iotests: Make test case 030, 040 and 055 deterministic, Kevin Wolf, 2013/11/29
- [Qemu-devel] [PULL 35/41] block: Enable BDRV_O_SNAPSHOT with driver-specific options, Kevin Wolf, 2013/11/29
- [Qemu-devel] [PULL 37/41] block: Use BDRV_O_NO_BACKING where appropriate, Kevin Wolf, 2013/11/29
- [Qemu-devel] [PULL 36/41] qemu-iotests: Test snapshot mode, Kevin Wolf, 2013/11/29
- [Qemu-devel] [PULL 38/41] qemu-iotests: Filter qemu-io output in 025, Kevin Wolf, 2013/11/29
- [Qemu-devel] [PULL 40/41] vmdk: Allow read only open of VMDK version 3,
Kevin Wolf <=
- [Qemu-devel] [PULL 41/41] qemu-iotests: Add sample image and test for VMDK version 3, Kevin Wolf, 2013/11/29