|
|
9ae3a8 |
From a21710237f6c2cce366515fc2dacd4211bc31b7a Mon Sep 17 00:00:00 2001
|
|
|
9ae3a8 |
From: Fam Zheng <famz@redhat.com>
|
|
|
9ae3a8 |
Date: Mon, 14 Jul 2014 02:05:27 -0500
|
|
|
9ae3a8 |
Subject: [CHANGE 22/29] vmdk: Fix format specific information (create type)
|
|
|
9ae3a8 |
for streamOptimized
|
|
|
9ae3a8 |
To: rhvirt-patches@redhat.com,
|
|
|
9ae3a8 |
jen@redhat.com
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
RH-Author: Fam Zheng <famz@redhat.com>
|
|
|
9ae3a8 |
Message-id: <1405303527-10117-1-git-send-email-famz@redhat.com>
|
|
|
9ae3a8 |
Patchwork-id: 59872
|
|
|
9ae3a8 |
O-Subject: [RHEL-7 qemu-kvm PATCH] vmdk: Fix format specific information (create type) for streamOptimized
|
|
|
9ae3a8 |
Bugzilla: 1029271
|
|
|
9ae3a8 |
RH-Acked-by: Markus Armbruster <armbru@redhat.com>
|
|
|
9ae3a8 |
RH-Acked-by: Kevin Wolf <kwolf@redhat.com>
|
|
|
9ae3a8 |
RH-Acked-by: Stefan Hajnoczi <stefanha@redhat.com>
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=1029271
|
|
|
9ae3a8 |
Brew: http://brewweb.devel.redhat.com/brew/taskinfo?taskID=7695829
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
Previously the field is wrong:
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
$ ./qemu-img create -f vmdk -o subformat=streamOptimized /tmp/a.vmdk 1G
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
$ ./qemu-img info /tmp/a.vmdk
|
|
|
9ae3a8 |
image: /tmp/a.vmdk
|
|
|
9ae3a8 |
file format: vmdk
|
|
|
9ae3a8 |
virtual size: 1.0G (1073741824 bytes)
|
|
|
9ae3a8 |
disk size: 12K
|
|
|
9ae3a8 |
Format specific information:
|
|
|
9ae3a8 |
cid: 1390460459
|
|
|
9ae3a8 |
parent cid: 4294967295
|
|
|
9ae3a8 |
>>> create type: monolithicSparse
|
|
|
9ae3a8 |
<snip>
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
Signed-off-by: Fam Zheng <famz@redhat.com>
|
|
|
9ae3a8 |
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
|
|
|
9ae3a8 |
(cherry picked from commit d8a7b061ae01e5692cc994f05ad6480d8c170125)
|
|
|
9ae3a8 |
Signed-off-by: Fam Zheng <famz@redhat.com>
|
|
|
9ae3a8 |
---
|
|
|
9ae3a8 |
block/vmdk.c | 4 ++++
|
|
|
9ae3a8 |
1 file changed, 4 insertions(+)
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
Signed-off-by: jen <jen@redhat.com>
|
|
|
9ae3a8 |
---
|
|
|
9ae3a8 |
block/vmdk.c | 4 ++++
|
|
|
9ae3a8 |
1 file changed, 4 insertions(+)
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
diff --git a/block/vmdk.c b/block/vmdk.c
|
|
|
9ae3a8 |
index a966715..9e4b3b9 100644
|
|
|
9ae3a8 |
--- a/block/vmdk.c
|
|
|
9ae3a8 |
+++ b/block/vmdk.c
|
|
|
9ae3a8 |
@@ -650,6 +650,10 @@ static int vmdk_open_vmdk4(BlockDriverState *bs,
|
|
|
9ae3a8 |
}
|
|
|
9ae3a8 |
extent->compressed =
|
|
|
9ae3a8 |
le16_to_cpu(header.compressAlgorithm) == VMDK4_COMPRESSION_DEFLATE;
|
|
|
9ae3a8 |
+ if (extent->compressed) {
|
|
|
9ae3a8 |
+ g_free(s->create_type);
|
|
|
9ae3a8 |
+ s->create_type = g_strdup("streamOptimized");
|
|
|
9ae3a8 |
+ }
|
|
|
9ae3a8 |
extent->has_marker = le32_to_cpu(header.flags) & VMDK4_FLAG_MARKER;
|
|
|
9ae3a8 |
extent->version = le32_to_cpu(header.version);
|
|
|
9ae3a8 |
extent->has_zero_grain = le32_to_cpu(header.flags) & VMDK4_FLAG_ZERO_GRAIN;
|
|
|
9ae3a8 |
--
|
|
|
9ae3a8 |
1.9.3
|
|
|
9ae3a8 |
|