From: Kevin Wolf <kwolf@redhat.com>
To: Eric Blake <eblake@redhat.com>
Cc: Pavel Butsykin <pbutsykin@virtuozzo.com>,
Stefan Hajnoczi <stefanha@gmail.com>,
"Denis V. Lunev" <den@openvz.org>, Jeff Cody <jcody@redhat.com>,
qemu-devel@nongnu.org, Markus Armbruster <armbru@redhat.com>,
Stefan Hajnoczi <stefanha@redhat.com>,
John Snow <jsnow@redhat.com>
Subject: Re: [Qemu-devel] [PATCH 02/10] qcow2: add qcow2_co_write_compressed
Date: Wed, 1 Jun 2016 11:31:43 +0200 [thread overview]
Message-ID: <20160601093143.GC5356@noname.str.redhat.com> (raw)
In-Reply-To: <574DDB2E.9070801@redhat.com>
[-- Attachment #1: Type: text/plain, Size: 1728 bytes --]
Am 31.05.2016 um 20:42 hat Eric Blake geschrieben:
> 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.
With compression, be careful what kind of clusters you're looking at.
The clusters in the code above are guest clusters and you can't
overwrite a guest cluster that has already been written (I'm not sure
why, though - didn't matter so far because the only writer is qemu-img
convert, which writes the whole image sequentially and doesn't split
clusters across requests, but if we want to allow compressed writes in a
running VM, we may want to change this).
However, the compressed data of multiple guest clusters may end up in
the same host cluster, and that's indeed the whole point of compression.
Kevin
[-- Attachment #2: Type: application/pgp-signature, Size: 836 bytes --]
next prev parent reply other threads:[~2016-06-01 9:31 UTC|newest]
Thread overview: 34+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-05-14 12:45 [Qemu-devel] [PATCH v3 00/10] backup compression Denis V. Lunev
2016-05-14 12:45 ` [Qemu-devel] [PATCH 01/10] block/io: add bdrv_co_write_compressed Denis V. Lunev
2016-05-16 16:52 ` Eric Blake
2016-05-17 15:01 ` Pavel Butsykin
2016-05-19 21:25 ` Stefan Hajnoczi
2016-05-19 21:39 ` Denis V. Lunev
2016-05-14 12:45 ` [Qemu-devel] [PATCH 02/10] qcow2: add qcow2_co_write_compressed Denis V. Lunev
2016-05-27 17:33 ` Stefan Hajnoczi
2016-05-30 9:12 ` Pavel Butsykin
2016-05-30 12:58 ` Pavel Butsykin
2016-05-31 18:42 ` Eric Blake
2016-05-31 21:00 ` Denis V. Lunev
2016-05-31 21:13 ` Eric Blake
2016-06-01 9:53 ` Pavel Butsykin
2016-06-01 9:31 ` Kevin Wolf [this message]
2016-06-01 9:25 ` Kevin Wolf
2016-06-01 20:06 ` Stefan Hajnoczi
2016-05-14 12:45 ` [Qemu-devel] [PATCH 03/10] vmdk: add vmdk_co_write_compressed Denis V. Lunev
2016-05-27 17:38 ` Stefan Hajnoczi
2016-05-14 12:45 ` [Qemu-devel] [PATCH 04/10] qcow: add qcow_co_write_compressed Denis V. Lunev
2016-05-27 17:45 ` Stefan Hajnoczi
2016-05-30 14:27 ` Pavel Butsykin
2016-05-14 12:45 ` [Qemu-devel] [PATCH 05/10] block: remove BlockDriver.bdrv_write_compressed Denis V. Lunev
2016-05-16 16:57 ` Eric Blake
2016-05-17 12:22 ` Pavel Butsykin
2016-05-14 12:45 ` [Qemu-devel] [PATCH 06/10] drive-backup: added support for data compression Denis V. Lunev
2016-05-16 16:59 ` Eric Blake
2016-05-27 17:56 ` Stefan Hajnoczi
2016-05-14 12:45 ` [Qemu-devel] [PATCH 07/10] blockdev-backup: " Denis V. Lunev
2016-05-16 17:00 ` Eric Blake
2016-05-27 17:57 ` Stefan Hajnoczi
2016-05-14 12:45 ` [Qemu-devel] [PATCH 08/10] qemu-iotests: test backup compression in 055 Denis V. Lunev
2016-05-14 12:45 ` [Qemu-devel] [PATCH 09/10] block: fix backup in vmdk format image Denis V. Lunev
2016-05-27 18:01 ` Stefan Hajnoczi
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=20160601093143.GC5356@noname.str.redhat.com \
--to=kwolf@redhat.com \
--cc=armbru@redhat.com \
--cc=den@openvz.org \
--cc=eblake@redhat.com \
--cc=jcody@redhat.com \
--cc=jsnow@redhat.com \
--cc=pbutsykin@virtuozzo.com \
--cc=qemu-devel@nongnu.org \
--cc=stefanha@gmail.com \
--cc=stefanha@redhat.com \
/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).