Received: from eggs.gnu.org ([2001:4830:134:3::10]:32772) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VX49x-0007iZ-N7 for qemu-devel@nongnu.org; Fri, 18 Oct 2013 03:07:51 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VX49q-0008EJ-Dt for qemu-devel@nongnu.org; Fri, 18 Oct 2013 03:07:45 -0400 Received: from mx1.redhat.com ([209.132.183.28]:27889) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VX49q-0008E8-57 for qemu-devel@nongnu.org; Fri, 18 Oct 2013 03:07:38 -0400 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id r9I77a0S027410 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Fri, 18 Oct 2013 03:07:36 -0400 From: Fam Zheng Date: Fri, 18 Oct 2013 15:07:33 +0800 Message-Id: <1382080053-19080-1-git-send-email-famz@redhat.com> Subject: [Qemu-devel] [PATCH] vmdk: fix VMFS extent parsing List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: kwolf@redhat.com, pbonzini@redhat.com, stefanha@redhat.com 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 --- block/vmdk.c | 2 ++ 1 file changed, 2 insertions(+) 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; -- 1.8.3.1