qemu-devel
[Top][All Lists]
Advanced

[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: Pavel Butsykin
Subject: Re: [Qemu-devel] [PATCH 02/10] qcow2: add qcow2_co_write_compressed
Date: Wed, 1 Jun 2016 12:53:37 +0300
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.3.0

On 01.06.2016 00:13, Eric Blake wrote:
On 05/31/2016 03:00 PM, Denis V. Lunev wrote:
On 05/31/2016 09:42 PM, Eric Blake wrote:
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.

AFAIK the file will be sparse in that unused areas

IIRC, on the NTFS file system, the minimum hole size is 64k. If you also
have 64k clusters, then you don't have a sparse file - every tail of
zero sectors will be explicit in the filesystem, if you are using 1:1
clusters for compression.  Other file systems may have finer granularity
for holes, but it's still rather awkward to be relying on sparseness
when a better solution is to pack compressed sectors consecutively.


Maybe you're right, I agree that the above mentioned issues are taking
place and it would be good to solve them, but it looks like the next
step. The solution that you proposed has a direct relation to the
improvement of the format driver that goes beyond the goals of this
patch-set, where the main goal is to provide opportunities compression
from the format drivers for the backup function.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]