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