Blame 0101-vmdk-Create-streamOptimized-as-version-3.patch
|
|
7d975d |
From: Fam Zheng <famz@redhat.com>
|
|
|
7d975d |
Date: Thu, 17 Sep 2015 13:04:10 +0800
|
|
|
7d975d |
Subject: [PATCH] vmdk: Create streamOptimized as version 3
|
|
|
7d975d |
|
|
|
7d975d |
VMware products accept only version 3 for streamOptimized, let's bump
|
|
|
7d975d |
the version.
|
|
|
7d975d |
|
|
|
7d975d |
Reported-by: Radoslav Gerganov <rgerganov@vmware.com>
|
|
|
7d975d |
Signed-off-by: Fam Zheng <famz@redhat.com>
|
|
|
7d975d |
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
|
|
|
7d975d |
(cherry picked from commit d62d9dc4b814950dcc8bd261a3e2e9300d9065e6)
|
|
|
7d975d |
---
|
|
|
7d975d |
block/vmdk.c | 8 +++++++-
|
|
|
7d975d |
1 file changed, 7 insertions(+), 1 deletion(-)
|
|
|
7d975d |
|
|
|
7d975d |
diff --git a/block/vmdk.c b/block/vmdk.c
|
|
|
7d975d |
index 6f819e4..26b76d9 100644
|
|
|
7d975d |
--- a/block/vmdk.c
|
|
|
7d975d |
+++ b/block/vmdk.c
|
|
|
7d975d |
@@ -1654,7 +1654,13 @@ static int vmdk_create_extent(const char *filename, int64_t filesize,
|
|
|
7d975d |
}
|
|
|
7d975d |
magic = cpu_to_be32(VMDK4_MAGIC);
|
|
|
7d975d |
memset(&header, 0, sizeof(header));
|
|
|
7d975d |
- header.version = zeroed_grain ? 2 : 1;
|
|
|
7d975d |
+ if (compress) {
|
|
|
7d975d |
+ header.version = 3;
|
|
|
7d975d |
+ } else if (zeroed_grain) {
|
|
|
7d975d |
+ header.version = 2;
|
|
|
7d975d |
+ } else {
|
|
|
7d975d |
+ header.version = 1;
|
|
|
7d975d |
+ }
|
|
|
7d975d |
header.flags = VMDK4_FLAG_RGD | VMDK4_FLAG_NL_DETECT
|
|
|
7d975d |
| (compress ? VMDK4_FLAG_COMPRESS | VMDK4_FLAG_MARKER : 0)
|
|
|
7d975d |
| (zeroed_grain ? VMDK4_FLAG_ZERO_GRAIN : 0);
|