aboutsummaryrefslogtreecommitdiff
path: root/block/vmdk.c
diff options
context:
space:
mode:
authorFam Zheng <famz@redhat.com>2014-01-23 15:10:52 +0800
committerKevin Wolf <kwolf@redhat.com>2014-01-24 14:33:00 +0100
commitd8a7b061ae01e5692cc994f05ad6480d8c170125 (patch)
tree3ce16e4d5e29fbb16a66df5930c00cf8e636c223 /block/vmdk.c
parent6df3bf8eb3ed428015c85cfbd554ac9b32164f40 (diff)
vmdk: Fix format specific information (create type) for streamOptimized
Previously the field is wrong: $ ./qemu-img create -f vmdk -o subformat=streamOptimized /tmp/a.vmdk 1G $ ./qemu-img info /tmp/a.vmdk image: /tmp/a.vmdk file format: vmdk virtual size: 1.0G (1073741824 bytes) disk size: 12K Format specific information: cid: 1390460459 parent cid: 4294967295 >>> create type: monolithicSparse <snip> Signed-off-by: Fam Zheng <famz@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Diffstat (limited to 'block/vmdk.c')
-rw-r--r--block/vmdk.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/block/vmdk.c b/block/vmdk.c
index 74c44bd5fb..67b5f96a19 100644
--- a/block/vmdk.c
+++ b/block/vmdk.c
@@ -661,6 +661,10 @@ static int vmdk_open_vmdk4(BlockDriverState *bs,
}
extent->compressed =
le16_to_cpu(header.compressAlgorithm) == VMDK4_COMPRESSION_DEFLATE;
+ if (extent->compressed) {
+ g_free(s->create_type);
+ s->create_type = g_strdup("streamOptimized");
+ }
extent->has_marker = le32_to_cpu(header.flags) & VMDK4_FLAG_MARKER;
extent->version = le32_to_cpu(header.version);
extent->has_zero_grain = le32_to_cpu(header.flags) & VMDK4_FLAG_ZERO_GRAIN;