From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:33372) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1W6ERI-00088z-Sd for qemu-devel@nongnu.org; Thu, 23 Jan 2014 02:11:06 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1W6ERC-0002h9-UX for qemu-devel@nongnu.org; Thu, 23 Jan 2014 02:11:00 -0500 Received: from mx1.redhat.com ([209.132.183.28]:42329) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1W6ERC-0002h5-Ma for qemu-devel@nongnu.org; Thu, 23 Jan 2014 02:10:54 -0500 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id s0N7Armo007801 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Thu, 23 Jan 2014 02:10:53 -0500 From: Fam Zheng Date: Thu, 23 Jan 2014 15:10:52 +0800 Message-Id: <1390461052-6840-1-git-send-email-famz@redhat.com> Subject: [Qemu-devel] [PATCH] vmdk: Fix format specific information (create type) for streamOptimized List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: kwolf@redhat.com, stefanha@redhat.com 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 Signed-off-by: Fam Zheng --- block/vmdk.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/block/vmdk.c b/block/vmdk.c index c6b60b4..c78fecc 100644 --- a/block/vmdk.c +++ b/block/vmdk.c @@ -654,6 +654,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; -- 1.8.5.3