From dbbcaa8d4358fdf3c42bf01e9e2d687300e84770 Mon Sep 17 00:00:00 2001 From: Fam Zheng Date: Fri, 18 Oct 2013 15:07:33 +0800 Subject: vmdk: fix VMFS extent parsing 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 Signed-off-by: Stefan Hajnoczi --- block/vmdk.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'block/vmdk.c') diff --git a/block/vmdk.c b/block/vmdk.c index b8901e272a..32ec8b7766 100644 --- a/block/vmdk.c +++ b/block/vmdk.c @@ -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; -- cgit v1.2.3