qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] [PATCH 1/2] vmdk: Allow read only open of VMDK version 3


From: Fam Zheng
Subject: [Qemu-devel] [PATCH 1/2] vmdk: Allow read only open of VMDK version 3
Date: Wed, 27 Nov 2013 10:06:30 +0800

Signed-off-by: Fam Zheng <address@hidden>
---
 block/vmdk.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/block/vmdk.c b/block/vmdk.c
index a7ebd0f..7c64bed 100644
--- a/block/vmdk.c
+++ b/block/vmdk.c
@@ -605,13 +605,16 @@ 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) {
+        error_setg(errp, "VMDK version 3 must be read only");
+        return -EINVAL;
     }
 
     if (le32_to_cpu(header.num_gtes_per_gt) > 512) {
-- 
1.8.4.2




reply via email to

[Prev in Thread] Current Thread [Next in Thread]