thebeanogamer / rpms / qemu-kvm

Forked from rpms/qemu-kvm 5 months ago
Clone
9ae3a8
From 7777177c3c7291ff5c4b24040b075a1bd1c1db77 Mon Sep 17 00:00:00 2001
9ae3a8
From: Fam Zheng <famz@redhat.com>
9ae3a8
Date: Mon, 15 Feb 2016 09:28:29 +0100
9ae3a8
Subject: [PATCH 16/18] vmdk: Create streamOptimized as version 3
9ae3a8
9ae3a8
RH-Author: Fam Zheng <famz@redhat.com>
9ae3a8
Message-id: <1455528511-9357-17-git-send-email-famz@redhat.com>
9ae3a8
Patchwork-id: 69182
9ae3a8
O-Subject: [RHEL-7.3 qemu-kvm PATCH 16/18] vmdk: Create streamOptimized as version 3
9ae3a8
Bugzilla: 1299116
9ae3a8
RH-Acked-by: Kevin Wolf <kwolf@redhat.com>
9ae3a8
RH-Acked-by: Max Reitz <mreitz@redhat.com>
9ae3a8
RH-Acked-by: Markus Armbruster <armbru@redhat.com>
9ae3a8
9ae3a8
BZ: https://bugzilla.redhat.com/show_bug.cgi?id=1299116
9ae3a8
9ae3a8
VMware products accept only version 3 for streamOptimized, let's bump
9ae3a8
the version.
9ae3a8
9ae3a8
Reported-by: Radoslav Gerganov <rgerganov@vmware.com>
9ae3a8
Signed-off-by: Fam Zheng <famz@redhat.com>
9ae3a8
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
9ae3a8
(cherry picked from commit d62d9dc4b814950dcc8bd261a3e2e9300d9065e6)
9ae3a8
Signed-off-by: Fam Zheng <famz@redhat.com>
9ae3a8
Signed-off-by: Miroslav Rezanina <mrezanin@redhat.com>
9ae3a8
---
9ae3a8
 block/vmdk.c | 8 +++++++-
9ae3a8
 1 file changed, 7 insertions(+), 1 deletion(-)
9ae3a8
9ae3a8
diff --git a/block/vmdk.c b/block/vmdk.c
9ae3a8
index 7009660..7b3e397 100644
9ae3a8
--- a/block/vmdk.c
9ae3a8
+++ b/block/vmdk.c
9ae3a8
@@ -1658,7 +1658,13 @@ static int vmdk_create_extent(const char *filename, int64_t filesize,
9ae3a8
     }
9ae3a8
     magic = cpu_to_be32(VMDK4_MAGIC);
9ae3a8
     memset(&header, 0, sizeof(header));
9ae3a8
-    header.version = zeroed_grain ? 2 : 1;
9ae3a8
+    if (compress) {
9ae3a8
+        header.version = 3;
9ae3a8
+    } else if (zeroed_grain) {
9ae3a8
+        header.version = 2;
9ae3a8
+    } else {
9ae3a8
+        header.version = 1;
9ae3a8
+    }
9ae3a8
     header.flags = VMDK4_FLAG_RGD | VMDK4_FLAG_NL_DETECT
9ae3a8
                    | (compress ? VMDK4_FLAG_COMPRESS | VMDK4_FLAG_MARKER : 0)
9ae3a8
                    | (zeroed_grain ? VMDK4_FLAG_ZERO_GRAIN : 0);
9ae3a8
-- 
9ae3a8
1.8.3.1
9ae3a8