diff mbox

vmdk: fix VMFS extent parsing

Message ID 1382080053-19080-1-git-send-email-famz@redhat.com
State New
Headers show

Commit Message

Fam Zheng Oct. 18, 2013, 7:07 a.m. UTC
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>
---
 block/vmdk.c | 2 ++
 1 file changed, 2 insertions(+)

Comments

Stefan Hajnoczi Oct. 18, 2013, 11:41 a.m. UTC | #1
On Fri, Oct 18, 2013 at 03:07:33PM +0800, Fam Zheng wrote:
> 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>
> ---
>  block/vmdk.c | 2 ++
>  1 file changed, 2 insertions(+)

Thanks, applied to my block tree:
https://github.com/stefanha/qemu/commits/block

Stefan
diff mbox

Patch

diff --git a/block/vmdk.c b/block/vmdk.c
index 5a9f278..5ef46f5 100644
--- a/block/vmdk.c
+++ b/block/vmdk.c
@@ -728,6 +728,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;