From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:59162) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VCbEh-00039k-Kw for qemu-devel@nongnu.org; Thu, 22 Aug 2013 16:12:08 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VCbEc-0004FU-L3 for qemu-devel@nongnu.org; Thu, 22 Aug 2013 16:12:03 -0400 Received: from mx1.redhat.com ([209.132.183.28]:15747) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VCbEc-0004FL-Cv for qemu-devel@nongnu.org; Thu, 22 Aug 2013 16:11:58 -0400 From: Stefan Hajnoczi Date: Thu, 22 Aug 2013 22:11:02 +0200 Message-Id: <1377202298-22896-7-git-send-email-stefanha@redhat.com> In-Reply-To: <1377202298-22896-1-git-send-email-stefanha@redhat.com> References: <1377202298-22896-1-git-send-email-stefanha@redhat.com> Subject: [Qemu-devel] [PULL 06/42] vmdk: fix L1 and L2 table size in vmdk3 open List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Fam Zheng , Stefan Hajnoczi , Anthony Liguori From: Fam Zheng VMDK3 header has the field l1dir_size, but vmdk_open_vmdk3 hardcoded the value. This patch honors the header field. And the L2 table size is 4096 according to VMDK spec[1], instead of 1 << 9 (512). [1]: http://www.vmware.com/support/developer/vddk/vmdk_50_technote.pdf?src=vmdk Signed-off-by: Fam Zheng Signed-off-by: Stefan Hajnoczi --- block/vmdk.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/block/vmdk.c b/block/vmdk.c index f8c0a4e..4d282a6 100644 --- a/block/vmdk.c +++ b/block/vmdk.c @@ -494,14 +494,14 @@ static int vmdk_open_vmdk3(BlockDriverState *bs, if (ret < 0) { return ret; } - - ret = vmdk_add_extent(bs, - bs->file, false, - le32_to_cpu(header.disk_sectors), - le32_to_cpu(header.l1dir_offset) << 9, - 0, 1 << 6, 1 << 9, - le32_to_cpu(header.granularity), - &extent); + ret = vmdk_add_extent(bs, file, false, + le32_to_cpu(header.disk_sectors), + le32_to_cpu(header.l1dir_offset) << 9, + 0, + le32_to_cpu(header.l1dir_size), + 4096, + le32_to_cpu(header.granularity), + &extent); if (ret < 0) { return ret; } -- 1.8.3.1