From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:55656) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WD41a-0005IG-Mw for qemu-devel@nongnu.org; Mon, 10 Feb 2014 22:28:48 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WD41U-0001vE-No for qemu-devel@nongnu.org; Mon, 10 Feb 2014 22:28:42 -0500 Received: from mx1.redhat.com ([209.132.183.28]:34037) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WD41U-0001v3-GL for qemu-devel@nongnu.org; Mon, 10 Feb 2014 22:28:36 -0500 From: Fam Zheng Date: Tue, 11 Feb 2014 11:28:34 +0800 Message-Id: <1392089319-25307-1-git-send-email-famz@redhat.com> Subject: [Qemu-devel] [PATCH v2 0/5] Fix conversion from ISO to VMDK streamOptimized List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: kwolf@redhat.com, jcody@redhat.com, gentoo.integer@gmail.com, stefanha@redhat.com Previouly, conversion from ISO to VMDK with subformat=streamOptimized fails: $ ./qemu-img convert -O vmdk -o subformat=streamOptimized foo.iso bar.vmdk VMDK: can't write to allocated cluster for streamOptimized qemu-img: error while writing sector 64: Input/output error Current code in qemu-img.c picks the normal convert loop for this case, rather than the "compress == true" loop, which writes in target cluster size. In VMDK streamOptimized, writes must be in cluster unit, because write to an allocated cluster is not supported. This series adds an is_compressed field in BlockDriverInfo, and use compressed convertion loop if the block driver set this field to true. Implement .bdrv_get_info and .bdrv_write_compressed in VMDK driver to fit into this procedure. v2: Rebase to current master. Fam Zheng (5): qemu-img: Convert by cluster size if target is compressed vmdk: Implement .bdrv_write_compressed block: Change BlockDriverInfo.cluster_size to 64 bits vmdk: Implement .bdrv_get_info() mirror: Check for bdrv_get_info result block/mirror.c | 4 ++-- block/vmdk.c | 33 +++++++++++++++++++++++++++++++++ include/block/block.h | 3 ++- qemu-img.c | 3 +++ tests/qemu-iotests/059.out | 4 ++++ 5 files changed, 44 insertions(+), 3 deletions(-) -- 1.8.5.4