[{"id":1770393,"web_url":"http://patchwork.ozlabs.org/comment/1770393/","msgid":"<c53ecaa4-89c1-b163-f925-aaad7d497482@redhat.com>","list_archive_url":null,"date":"2017-09-18T18:22:03","subject":"Re: [Qemu-devel] [PATCH v8 0/4] Add shrink image for qcow2","submitter":{"id":36836,"url":"http://patchwork.ozlabs.org/api/people/36836/","name":"Max Reitz","email":"mreitz@redhat.com"},"content":"On 2017-09-18 14:42, Pavel Butsykin wrote:\n> This patch add shrinking of the image file for qcow2. As a result, this allows\n> us to reduce the virtual image size and free up space on the disk without\n> copying the image. Image can be fragmented and shrink is done by punching holes\n> in the image file.\n> \n> # ./qemu-img create -f qcow2 image.qcow2 4G\n> Formatting 'image.qcow2', fmt=qcow2 size=4294967296 encryption=off cluster_size=65536 lazy_refcounts=off refcount_bits=16\n> \n> # ./qemu-io -c \"write -P 0x22 0 1G\" image.qcow2\n> wrote 1073741824/1073741824 bytes at offset 0\n> 1 GiB, 1 ops; 0:00:04.59 (222.886 MiB/sec and 0.2177 ops/sec)\n> \n> # ./qemu-img resize image.qcow2 512M\n> warning: qemu-img: Shrinking an image will delete all data beyond the shrunken image's end. Before performing such an operation, make sure there is no important data there.\n> error: qemu-img: Use the --shrink option to perform a shrink operation.\n> \n> # ./qemu-img resize --shrink image.qcow2 128M\n> Image resized.\n> \n> # ./qemu-img info image.qcow2\n> image: image.qcow2\n> file format: qcow2\n> virtual size: 128M (134217728 bytes)\n> disk size: 128M\n> cluster_size: 65536\n> Format specific information:\n>     compat: 1.1\n>     lazy refcounts: false\n>     refcount bits: 16\n>     corrupt: false\n> \n> # du -h image.qcow2\n> 129M    image.qcow2\n\nThanks, I've added the missing space in patch 1 and applied the series\nto my block branch:\n\nhttps://github.com/XanClic/qemu/commits/block\n\nMax","headers":{"Return-Path":"<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>","X-Original-To":"incoming@patchwork.ozlabs.org","Delivered-To":"patchwork-incoming@bilbo.ozlabs.org","Authentication-Results":["ozlabs.org;\n\tspf=pass (mailfrom) smtp.mailfrom=nongnu.org\n\t(client-ip=2001:4830:134:3::11; helo=lists.gnu.org;\n\tenvelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org;\n\treceiver=<UNKNOWN>)","ext-mx07.extmail.prod.ext.phx2.redhat.com;\n\tdmarc=none (p=none dis=none) header.from=redhat.com","ext-mx07.extmail.prod.ext.phx2.redhat.com;\n\tspf=fail smtp.mailfrom=mreitz@redhat.com"],"Received":["from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11])\n\t(using TLSv1 with cipher AES256-SHA (256/256 bits))\n\t(No client certificate requested)\n\tby ozlabs.org (Postfix) with ESMTPS id 3xwvWD6Nrcz9s7B\n\tfor <incoming@patchwork.ozlabs.org>;\n\tTue, 19 Sep 2017 04:22:47 +1000 (AEST)","from localhost ([::1]:38243 helo=lists.gnu.org)\n\tby lists.gnu.org with esmtp (Exim 4.71) (envelope-from\n\t<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>)\n\tid 1du0gu-00081R-5M\n\tfor incoming@patchwork.ozlabs.org; Mon, 18 Sep 2017 14:22:44 -0400","from eggs.gnu.org ([2001:4830:134:3::10]:60036)\n\tby lists.gnu.org with esmtp (Exim 4.71)\n\t(envelope-from <mreitz@redhat.com>) id 1du0gX-00080E-R0\n\tfor qemu-devel@nongnu.org; Mon, 18 Sep 2017 14:22:23 -0400","from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)\n\t(envelope-from <mreitz@redhat.com>) id 1du0gW-0004Og-My\n\tfor qemu-devel@nongnu.org; Mon, 18 Sep 2017 14:22:21 -0400","from mx1.redhat.com ([209.132.183.28]:34170)\n\tby eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32)\n\t(Exim 4.71) (envelope-from <mreitz@redhat.com>)\n\tid 1du0gS-0004MR-6Z; Mon, 18 Sep 2017 14:22:16 -0400","from smtp.corp.redhat.com\n\t(int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11])\n\t(using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits))\n\t(No client certificate requested)\n\tby mx1.redhat.com (Postfix) with ESMTPS id 2AC15C014199;\n\tMon, 18 Sep 2017 18:22:15 +0000 (UTC)","from dresden.str.redhat.com (unknown [10.40.205.73])\n\tby smtp.corp.redhat.com (Postfix) with ESMTPS id 1EE6419802;\n\tMon, 18 Sep 2017 18:22:05 +0000 (UTC)"],"DMARC-Filter":"OpenDMARC Filter v1.3.2 mx1.redhat.com 2AC15C014199","To":"Pavel Butsykin <pbutsykin@virtuozzo.com>, qemu-block@nongnu.org,\n\tqemu-devel@nongnu.org","References":"<20170918124230.8152-1-pbutsykin@virtuozzo.com>","From":"Max Reitz <mreitz@redhat.com>","Message-ID":"<c53ecaa4-89c1-b163-f925-aaad7d497482@redhat.com>","Date":"Mon, 18 Sep 2017 20:22:03 +0200","User-Agent":"Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101\n\tThunderbird/52.3.0","MIME-Version":"1.0","In-Reply-To":"<20170918124230.8152-1-pbutsykin@virtuozzo.com>","Content-Type":"multipart/signed; micalg=pgp-sha256;\n\tprotocol=\"application/pgp-signature\";\n\tboundary=\"kuttc5vPMWAGr4qi2FKU6h80hv2UulKPf\"","X-Scanned-By":"MIMEDefang 2.79 on 10.5.11.11","X-Greylist":"Sender IP whitelisted, not delayed by milter-greylist-4.5.16\n\t(mx1.redhat.com [10.5.110.31]);\n\tMon, 18 Sep 2017 18:22:15 +0000 (UTC)","X-detected-operating-system":"by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]\n\t[fuzzy]","X-Received-From":"209.132.183.28","X-Content-Filtered-By":"Mailman/MimeDel 2.1.21","Subject":"Re: [Qemu-devel] [PATCH v8 0/4] Add shrink image for qcow2","X-BeenThere":"qemu-devel@nongnu.org","X-Mailman-Version":"2.1.21","Precedence":"list","List-Id":"<qemu-devel.nongnu.org>","List-Unsubscribe":"<https://lists.nongnu.org/mailman/options/qemu-devel>,\n\t<mailto:qemu-devel-request@nongnu.org?subject=unsubscribe>","List-Archive":"<http://lists.nongnu.org/archive/html/qemu-devel/>","List-Post":"<mailto:qemu-devel@nongnu.org>","List-Help":"<mailto:qemu-devel-request@nongnu.org?subject=help>","List-Subscribe":"<https://lists.nongnu.org/mailman/listinfo/qemu-devel>,\n\t<mailto:qemu-devel-request@nongnu.org?subject=subscribe>","Cc":"kwolf@redhat.com, jsnow@redhat.com, armbru@redhat.com, den@openvz.org","Errors-To":"qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org","Sender":"\"Qemu-devel\"\n\t<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>"}}]