qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Kevin Wolf <kwolf@redhat.com>
To: Eric Blake <eblake@redhat.com>
Cc: Peter Lieven <pl@kamp.de>,
	qemu-block@nongnu.org, qemu-devel@nongnu.org, lersek@redhat.com,
	den@openvz.org, mreitz@redhat.com, berrange@redhat.com
Subject: Re: [Qemu-devel] [PATCH V5 10/10] block/qcow2: add compress info to image specific info
Date: Mon, 11 Sep 2017 16:08:58 +0200	[thread overview]
Message-ID: <20170911140858.GA6951@localhost.localdomain> (raw)
In-Reply-To: <546c49d1-57c3-7ba7-c0cf-558da609e7a7@redhat.com>

[-- Attachment #1: Type: text/plain, Size: 3366 bytes --]

Am 25.07.2017 um 23:55 hat Eric Blake geschrieben:
> On 07/25/2017 09:41 AM, Peter Lieven wrote:
> > Signed-off-by: Peter Lieven <pl@kamp.de>
> > ---
> >  block/qcow2.c        | 7 +++++++
> >  qapi/block-core.json | 6 +++++-
> >  2 files changed, 12 insertions(+), 1 deletion(-)
> > 
> > +++ b/qapi/block-core.json
> > @@ -68,6 +68,9 @@
> >  # @encrypt: details about encryption parameters; only set if image
> >  #           is encrypted (since 2.10)
> >  #
> > +# @compress: details about parameters for compressed clusters; only set if
> > +#            the compress format header extension is present (since 2.11)
> 
> Thinking aloud:
> 
> I still think this is better as "only set if the image uses compressed
> headers" (similar to encrypt).  That is, I would like this output to be
> present even when opening legacy deflate/0/12 images.
> 
> But thinking more, what I am REALLY asking for is "if any cluster is
> compressed, then this information is present; if nothing is compressed,
> the choice of compression header doesn't matter".  But we don't have a
> quick-and-dirty way to tell if an image has any compressed clusters,
> short of examining every L2 map (including maps inside internal snapshots).
> 
> Hmm - we already have 'Dirty bit' and 'Corrupt bit' as
> incompatible_features that can quickly identify certain image
> properties; do we want another bit set to 1 for images known to use
> compressed clusters?  Or even make it an auto-clear bit (or even a pair
> of auto-clear bits: one to designate that this image was written by a
> new-enough qemu that promises to mark the image if any compressed
> clusters exist, and the other is set only if such clusters do exist;
> that way, if both bits are clear, we know we have to walk L2 tables to
> look for compressed clusters, but if the first bit is set, then the
> second bit is reliable)?
> 
> So maybe this means we are still debating spec ideas.  Kevin, do you
> want to chime in?

I'm not sure if this would be an useful extension. Adding feature bits
is a relatively big change and I don't see what it actually buys us
here.

First of all, what use is the information that an image contains
compressed clusters? For any practical use that I could imagine, there
is a big difference between an image that contains one compressed
cluster and an image that has 100% compressed clusters - much bigger
than between the image with one compressed cluster and an image that is
fully uncompressed.

But if we assume for a moment that the information is useful: For old
images, we would still be in the same situation as today and couldn't
tell whether an image contains compressed clusters or not. For new
images that are meant for new qemu versions, we can have the compression
header, which is probably as close as we can get (at least I don't think
you suggested something that would unset the compressed bit as soon as
the last compressed cluster gets uncompressed through copy-on-write).

That leaves us with images created by new qemu versions that are meant
to be consumed by old versions so that we can't set the incompatible
feature bit. If we are concerned about these, couldn't we simply specify
that a compression header that contains the current defaults MAY exist
even without the incompatible feature bit?

Kevin

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 801 bytes --]

      parent reply	other threads:[~2017-09-11 14:09 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-07-25 14:41 [Qemu-devel] [PATCH V5 00/10] add Qcow2 compress format extension Peter Lieven
2017-07-25 14:41 ` [Qemu-devel] [PATCH V5 01/10] specs/qcow2: add " Peter Lieven
2017-07-25 15:03   ` Eric Blake
2017-07-25 20:29     ` Peter Lieven
2017-07-25 21:01       ` Eric Blake
2017-09-11 14:22   ` Kevin Wolf
2017-09-18 10:09     ` Peter Lieven
2017-09-18 10:50       ` Kevin Wolf
2017-12-13 16:43         ` Peter Lieven
2017-07-25 14:41 ` [Qemu-devel] [PATCH V5 02/10] qapi/block-core: add Qcow2Compress parameters Peter Lieven
2017-07-25 21:21   ` Eric Blake
2017-07-25 14:41 ` [Qemu-devel] [PATCH V5 03/10] block/qcow2: parse compress create options Peter Lieven
2017-07-25 21:26   ` Eric Blake
2017-07-25 14:41 ` [Qemu-devel] [PATCH V5 04/10] qemu-img: add documentation for compress settings Peter Lieven
2017-07-25 21:34   ` Eric Blake
2017-07-25 14:41 ` [Qemu-devel] [PATCH V5 05/10] block/qcow2: read and write the compress format extension Peter Lieven
2017-07-25 14:41 ` [Qemu-devel] [PATCH V5 06/10] block/qcow2: simplify ret usage in qcow2_create Peter Lieven
2017-07-25 14:41 ` [Qemu-devel] [PATCH V5 07/10] block/qcow2: optimize qcow2_co_pwritev_compressed Peter Lieven
2017-07-25 14:41 ` [Qemu-devel] [PATCH V5 08/10] block/qcow2: start using the compress format extension Peter Lieven
2017-07-25 14:41 ` [Qemu-devel] [PATCH V5 09/10] block/qcow2: add lzo compress format Peter Lieven
2017-07-25 21:41   ` Eric Blake
2017-07-25 14:41 ` [Qemu-devel] [PATCH V5 10/10] block/qcow2: add compress info to image specific info Peter Lieven
2017-07-25 21:55   ` Eric Blake
2017-07-26  9:05     ` Peter Lieven
2017-08-03 18:59     ` Peter Lieven
2017-09-11 14:08     ` Kevin Wolf [this message]

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=20170911140858.GA6951@localhost.localdomain \
    --to=kwolf@redhat.com \
    --cc=berrange@redhat.com \
    --cc=den@openvz.org \
    --cc=eblake@redhat.com \
    --cc=lersek@redhat.com \
    --cc=mreitz@redhat.com \
    --cc=pl@kamp.de \
    --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).