All of lore.kernel.org
 help / color / mirror / Atom feed
From: Eric Blake <eblake@redhat.com>
To: "Benoît Canet" <benoit.canet@irqsave.net>
Cc: Kevin Wolf <kwolf@redhat.com>,
	qemu-devel@nongnu.org, Stefan Hajnoczi <stefanha@redhat.com>
Subject: Re: [Qemu-devel] [PATCH] qemu-img: refuse to compress files with invalid size
Date: Fri, 12 Apr 2013 14:04:41 -0600	[thread overview]
Message-ID: <516868D9.4060406@redhat.com> (raw)
In-Reply-To: <20130412195513.GA4510@irqsave.net>

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

On 04/12/2013 01:55 PM, Benoît Canet wrote:
> Le Friday 12 Apr 2013 à 19:37:48 (+0200), Stefan Hajnoczi a écrit :
>> Image file compression works at cluster granularity.  It is not possible
>> to compress less than a cluster of data at a time.

Shouldn't it be possible to treat a file that is not rounded to a
cluster boundary as though the rest of the final cluster is all NUL
bytes, and compress that?  As long as you know the original size, this
operation is reversible, instead of having to error out just because the
original wasn't a complete multiple.

>> I considered automatically adjusting the output file size but think it's
>> better to be explicit.  This avoids confusion when users notice that
>> image file size changed after conversion.

I agree that changing the final image size on a round trip through
compression is not appropriate, but does that mean we have to reject the
file completely if it wasn't sized to a multiple to begin with?

-- 
Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 621 bytes --]

  reply	other threads:[~2013-04-12 20:04 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-04-12 17:37 [Qemu-devel] [PATCH] qemu-img: refuse to compress files with invalid size Stefan Hajnoczi
2013-04-12 19:55 ` Benoît Canet
2013-04-12 20:04   ` Eric Blake [this message]
2013-04-15  6:53     ` 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=516868D9.4060406@redhat.com \
    --to=eblake@redhat.com \
    --cc=benoit.canet@irqsave.net \
    --cc=kwolf@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.