From: Max Reitz <mreitz@redhat.com>
To: John Snow <jsnow@redhat.com>,
Pavel Butsykin <pbutsykin@virtuozzo.com>,
qemu-block@nongnu.org, qemu-devel@nongnu.org
Cc: kwolf@redhat.com, armbru@redhat.com, den@openvz.org
Subject: Re: [Qemu-devel] [PATCH v7 0/4] Add shrink image for qcow2
Date: Tue, 22 Aug 2017 19:17:13 +0200 [thread overview]
Message-ID: <603e29d3-5e65-cca6-65ea-933ec4290cef@redhat.com> (raw)
In-Reply-To: <9e6b08b2-6f01-3d35-2644-a86955770844@redhat.com>
[-- Attachment #1: Type: text/plain, Size: 2534 bytes --]
On 2017-08-22 01:31, John Snow wrote:
>
>
> On 08/17/2017 05:15 AM, Pavel Butsykin wrote:
>> This patch add shrinking of the image file for qcow2. As a result, this allows
>> us to reduce the virtual image size and free up space on the disk without
>> copying the image. Image can be fragmented and shrink is done by punching holes
>> in the image file.
>>
>> # ./qemu-img create -f qcow2 image.qcow2 4G
>> Formatting 'image.qcow2', fmt=qcow2 size=4294967296 encryption=off cluster_size=65536 lazy_refcounts=off refcount_bits=16
>>
>> # ./qemu-io -c "write -P 0x22 0 1G" image.qcow2
>> wrote 1073741824/1073741824 bytes at offset 0
>> 1 GiB, 1 ops; 0:00:04.59 (222.886 MiB/sec and 0.2177 ops/sec)
>>
>> # ./qemu-img resize image.qcow2 512M
>> 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.
>> error: qemu-img: Use the --shrink option to perform a shrink operation.
>>
>> # ./qemu-img resize --shrink image.qcow2 128M
>> Image resized.
>>
>> # ./qemu-img info image.qcow2
>> image: image.qcow2
>> file format: qcow2
>> virtual size: 128M (134217728 bytes)
>> disk size: 128M
>> cluster_size: 65536
>> Format specific information:
>> compat: 1.1
>> lazy refcounts: false
>> refcount bits: 16
>> corrupt: false
>>
>> # du -h image.qcow2
>> 129M image.qcow2
>>
>
> It looks sane to me, and already has a full set of R-Bs from Max. Are we
> waiting for Kevin?
We were waiting for Kevin to handle 2.10 patches so he could go into PTO
and for me to come back from PTO. ;-)
I'm still sifting through my inbox... When I'm done, I'll take a look,
but I have no idea how long that might last.
(Since 2.10 isn't out yet, there might be more pressing issues still...?
I don't quite now yet, to be honest...)
> It looks like in Vladimir's series we sidestepped the problem of what
> happens if we resize with persistent bitmaps: we deny the operation,
> regardless of if we are shrinking, growing, or have bitmaps that are
> read-only, frozen, or what-have-you.
>
> It shouldn't be too hard to add soon, but this is fine for now.
> (I think for adding it we just need to make sure the bitmaps aren't
> frozen and are not read-only, and the implementation bitmap structure
> can already handle truncation in either direction just fine.)
>
> Anyway;
>
> Reviewed-by: John Snow <jsnow@redhat.com>
Thanks, in any case. :-)
Max
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 512 bytes --]
next prev parent reply other threads:[~2017-08-22 17:17 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-08-17 9:15 [Qemu-devel] [PATCH v7 0/4] Add shrink image for qcow2 Pavel Butsykin
2017-08-17 9:15 ` [Qemu-devel] [PATCH v7 1/4] qemu-img: add --shrink flag for resize Pavel Butsykin
2017-09-16 15:49 ` Max Reitz
2017-08-17 9:15 ` [Qemu-devel] [PATCH v7 2/4] qcow2: add qcow2_cache_discard Pavel Butsykin
2017-09-16 14:59 ` Max Reitz
2017-08-17 9:15 ` [Qemu-devel] [PATCH v7 3/4] qcow2: add shrink image support Pavel Butsykin
2017-08-17 11:04 ` Eric Blake
2017-08-17 12:59 ` [Qemu-devel] [PATCH] follow-up path - " qcow2: add shrink image support" Pavel Butsykin
2017-08-17 13:05 ` no-reply
2017-09-16 15:29 ` [Qemu-devel] [PATCH v7 3/4] qcow2: add shrink image support Max Reitz
2017-08-17 9:15 ` [Qemu-devel] [PATCH v7 4/4] qemu-iotests: add shrinking image test Pavel Butsykin
2017-08-21 23:31 ` [Qemu-devel] [PATCH v7 0/4] Add shrink image for qcow2 John Snow
2017-08-22 17:17 ` Max Reitz [this message]
2017-09-16 14:56 ` Max Reitz
2017-09-18 9:45 ` Pavel Butsykin
2017-09-15 9:16 ` Pavel Butsykin
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=603e29d3-5e65-cca6-65ea-933ec4290cef@redhat.com \
--to=mreitz@redhat.com \
--cc=armbru@redhat.com \
--cc=den@openvz.org \
--cc=jsnow@redhat.com \
--cc=kwolf@redhat.com \
--cc=pbutsykin@virtuozzo.com \
--cc=qemu-block@nongnu.org \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).