vmdk: fix VMFS extent parsing
authorFam Zheng <famz@redhat.com>
Fri, 18 Oct 2013 07:07:33 +0000 (15:07 +0800)
committerStefan Hajnoczi <stefanha@redhat.com>
Fri, 18 Oct 2013 11:41:36 +0000 (13:41 +0200)
The VMFS extent line in description file doesn't have start offset as
FLAT lines does, and it should be defaulted to 0. The flat_offset
variable is initialized to -1, so we need to set it in this case.

Signed-off-by: Fam Zheng <famz@redhat.com>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
block/vmdk.c

index b8901e272a9ff6dd74286bb5cd65dfc5172d67c5..32ec8b7766e0f043e209ba9c4ba1712e1b49c8c5 100644 (file)
@@ -726,6 +726,8 @@ static int vmdk_parse_extents(const char *desc, BlockDriverState *bs,
                 error_setg(errp, "Invalid extent lines: \n%s", p);
                 return -EINVAL;
             }
+        } else if (!strcmp(type, "VMFS")) {
+            flat_offset = 0;
         } else if (ret != 4) {
             error_setg(errp, "Invalid extent lines: \n%s", p);
             return -EINVAL;