[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH 02/10] qcow2: add qcow2_co_write_compressed
From: |
Eric Blake |
Subject: |
Re: [Qemu-devel] [PATCH 02/10] qcow2: add qcow2_co_write_compressed |
Date: |
Tue, 31 May 2016 12:42:54 -0600 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.3.0 |
On 05/30/2016 06:58 AM, Pavel Butsykin wrote:
>
> Sorry, but it seems this will never happen, because the second write
> will not pass this check:
>
> uint64_t qcow2_alloc_compressed_cluster_offset(BlockDriverState *bs,
> uint64_t offset,
> int compressed_size)
> {
> ...
> /* Compression can't overwrite anything. Fail if the cluster was
> already
> * allocated. */
> cluster_offset = be64_to_cpu(l2_table[l2_index]);
> if (cluster_offset & L2E_OFFSET_MASK) {
> qcow2_cache_put(bs, s->l2_table_cache, (void**) &l2_table);
> return 0;
> }
> ...
>
> As you can see we can't do the compressed write in the already allocated
> cluster.
Umm, doesn't that defeat the point of compression, if every compressed
cluster becomes the head of a new cluster? The whole goal of
compression is to be able to fit multiple clusters within one.
--
Eric Blake eblake redhat com +1-919-301-3266
Libvirt virtualization library http://libvirt.org
signature.asc
Description: OpenPGP digital signature
[Qemu-devel] [PATCH 01/10] block/io: add bdrv_co_write_compressed, Denis V. Lunev, 2016/05/14
[Qemu-devel] [PATCH 05/10] block: remove BlockDriver.bdrv_write_compressed, Denis V. Lunev, 2016/05/14