From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:55046) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1R0xiC-0001o8-MQ for qemu-devel@nongnu.org; Tue, 06 Sep 2011 11:37:27 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1R0xi6-0003nj-Cb for qemu-devel@nongnu.org; Tue, 06 Sep 2011 11:37:15 -0400 Received: from mx1.redhat.com ([209.132.183.28]:11478) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1R0xi6-0003na-0P for qemu-devel@nongnu.org; Tue, 06 Sep 2011 11:37:14 -0400 From: Kevin Wolf Date: Tue, 6 Sep 2011 17:39:34 +0200 Message-Id: <1315323586-23840-20-git-send-email-kwolf@redhat.com> In-Reply-To: <1315323586-23840-1-git-send-email-kwolf@redhat.com> References: <1315323586-23840-1-git-send-email-kwolf@redhat.com> Subject: [Qemu-devel] [PATCH 19/31] VMDK: enable twoGbMaxExtentFlat List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: anthony@codemonkey.ws Cc: kwolf@redhat.com, qemu-devel@nongnu.org From: Fam Zheng Enable the createType 'twoGbMaxExtentFlat'. The supporting code is already in. Signed-off-by: Fam Zheng Reviewed-by: Stefan Hajnoczi Signed-off-by: Kevin Wolf --- block/vmdk.c | 4 +++- 1 files changed, 3 insertions(+), 1 deletions(-) diff --git a/block/vmdk.c b/block/vmdk.c index 5f673e9..1e9e8d0 100644 --- a/block/vmdk.c +++ b/block/vmdk.c @@ -551,7 +551,8 @@ static int vmdk_open_desc_file(BlockDriverState *bs, int flags) if (vmdk_parse_description(buf, "createType", ct, sizeof(ct))) { return -EINVAL; } - if (strcmp(ct, "monolithicFlat")) { + if (strcmp(ct, "monolithicFlat") && + strcmp(ct, "twoGbMaxExtentFlat")) { fprintf(stderr, "VMDK: Not supported image type \"%s\""".\n", ct); return -ENOTSUP; @@ -672,6 +673,7 @@ static int get_cluster_offset(BlockDriverState *bs, return 0; } + offset -= (extent->end_sector - extent->sectors) * SECTOR_SIZE; l1_index = (offset >> 9) / extent->l1_entry_sectors; if (l1_index >= extent->l1_size) { return -1; -- 1.7.6