From patchwork Tue Sep 6 15:39:34 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kevin Wolf X-Patchwork-Id: 113588 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [140.186.70.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 3817BB6F68 for ; Wed, 7 Sep 2011 01:39:22 +1000 (EST) Received: from localhost ([::1]:45822 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1R0xjv-0005kf-Qh for incoming@patchwork.ozlabs.org; Tue, 06 Sep 2011 11:39:07 -0400 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 Received: from int-mx12.intmail.prod.int.phx2.redhat.com (int-mx12.intmail.prod.int.phx2.redhat.com [10.5.11.25]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id p86FbCj5017346 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Tue, 6 Sep 2011 11:37:12 -0400 Received: from dhcp-5-188.str.redhat.com (dhcp-5-175.str.redhat.com [10.32.5.175]) by int-mx12.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id p86FamTV015671; Tue, 6 Sep 2011 11:37:11 -0400 From: Kevin Wolf To: anthony@codemonkey.ws 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> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.25 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 209.132.183.28 Cc: kwolf@redhat.com, qemu-devel@nongnu.org Subject: [Qemu-devel] [PATCH 19/31] VMDK: enable twoGbMaxExtentFlat X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@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;