Skip to content

Commit

Permalink
vmdk: fix VMFS extent parsing
Browse files Browse the repository at this point in the history
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 <[email protected]>
Signed-off-by: Stefan Hajnoczi <[email protected]>
  • Loading branch information
Fam Zheng authored and stefanhaRH committed Oct 18, 2013
1 parent c338b6a commit dbbcaa8
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions block/vmdk.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit dbbcaa8

Please sign in to comment.