[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH] qcow2: Support BDRV_REQ_MAY_UNMAP
From: |
Paolo Bonzini |
Subject: |
Re: [Qemu-devel] [PATCH] qcow2: Support BDRV_REQ_MAY_UNMAP |
Date: |
Thu, 29 Sep 2016 14:14:09 +0200 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.3.0 |
On 29/09/2016 12:39, Kevin Wolf wrote:
>> >
>> > Because there is another check of pass-discard-request value in
>> > update_refcount:
>> >
>> > if (refcount == 0 && s->discard_passthrough[type]) {
>> > update_refcount_discard(bs, cluster_offset, s->cluster_size);
>> > }
> What I mean is that in the second case, you're still uselessly
> deallocating the cluster on the qcow2 level while you can't reclaim it
> on the filesystem level. So it would be better to leave it allocated in
> qcow2, too, so that you don't get an expensive reallocation the next
> time you write to it.
But if you do a qemu-img convert, the deallocated cluster wouldn't be in
the destination.
Paolo