|
|
218e99 |
From abce415a153d6bdf7068e812e3847ba559d33081 Mon Sep 17 00:00:00 2001
|
|
|
218e99 |
From: Fam Zheng <famz@redhat.com>
|
|
|
218e99 |
Date: Mon, 19 Aug 2013 18:54:26 +0800
|
|
|
218e99 |
Subject: [PATCH 11/13] vmdk: fix L1 and L2 table size in vmdk3 open
|
|
|
218e99 |
|
|
|
218e99 |
Message-id: <1377573001-27070-12-git-send-email-famz@redhat.com>
|
|
|
218e99 |
Patchwork-id: 53791
|
|
|
218e99 |
O-Subject: [RHEL-7 qemu-kvm PATCH 11/13] vmdk: fix L1 and L2 table size in vmdk3
|
|
|
218e99 |
open
|
|
|
218e99 |
Bugzilla: 995866
|
|
|
218e99 |
RH-Acked-by: Paolo Bonzini <pbonzini@redhat.com>
|
|
|
218e99 |
RH-Acked-by: Stefan Hajnoczi <stefanha@redhat.com>
|
|
|
218e99 |
RH-Acked-by: Kevin Wolf <kwolf@redhat.com>
|
|
|
218e99 |
|
|
|
218e99 |
VMDK3 header has the field l1dir_size, but vmdk_open_vmdk3 hardcoded the
|
|
|
218e99 |
value. This patch honors the header field.
|
|
|
218e99 |
|
|
|
218e99 |
And the L2 table size is 4096 according to VMDK spec[1], instead of
|
|
|
218e99 |
1 << 9 (512).
|
|
|
218e99 |
|
|
|
218e99 |
[1]:
|
|
|
218e99 |
http://www.vmware.com/support/developer/vddk/vmdk_50_technote.pdf?src=vmdk
|
|
|
218e99 |
|
|
|
218e99 |
Signed-off-by: Fam Zheng <famz@redhat.com>
|
|
|
218e99 |
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
|
|
|
218e99 |
(cherry picked from commit f6b61e54bdd5b9ef46837c15547e1819b3bb4f37)
|
|
|
218e99 |
Signed-off-by: Fam Zheng <famz@redhat.com>
|
|
|
218e99 |
---
|
|
|
218e99 |
block/vmdk.c | 16 ++++++++--------
|
|
|
218e99 |
1 files changed, 8 insertions(+), 8 deletions(-)
|
|
|
218e99 |
|
|
|
218e99 |
diff --git a/block/vmdk.c b/block/vmdk.c
|
|
|
218e99 |
index 4388038..4997da4 100644
|
|
|
218e99 |
--- a/block/vmdk.c
|
|
|
218e99 |
+++ b/block/vmdk.c
|
|
|
218e99 |
@@ -494,14 +494,14 @@ static int vmdk_open_vmdk3(BlockDriverState *bs,
|
|
|
218e99 |
if (ret < 0) {
|
|
|
218e99 |
return ret;
|
|
|
218e99 |
}
|
|
|
218e99 |
-
|
|
|
218e99 |
- ret = vmdk_add_extent(bs,
|
|
|
218e99 |
- bs->file, false,
|
|
|
218e99 |
- le32_to_cpu(header.disk_sectors),
|
|
|
218e99 |
- le32_to_cpu(header.l1dir_offset) << 9,
|
|
|
218e99 |
- 0, 1 << 6, 1 << 9,
|
|
|
218e99 |
- le32_to_cpu(header.granularity),
|
|
|
218e99 |
- &extent);
|
|
|
218e99 |
+ ret = vmdk_add_extent(bs, file, false,
|
|
|
218e99 |
+ le32_to_cpu(header.disk_sectors),
|
|
|
218e99 |
+ le32_to_cpu(header.l1dir_offset) << 9,
|
|
|
218e99 |
+ 0,
|
|
|
218e99 |
+ le32_to_cpu(header.l1dir_size),
|
|
|
218e99 |
+ 4096,
|
|
|
218e99 |
+ le32_to_cpu(header.granularity),
|
|
|
218e99 |
+ &extent);
|
|
|
218e99 |
if (ret < 0) {
|
|
|
218e99 |
return ret;
|
|
|
218e99 |
}
|
|
|
218e99 |
--
|
|
|
218e99 |
1.7.1
|
|
|
218e99 |
|