qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH] qemu-img: refuse to compress files with invalid


From: Stefan Hajnoczi
Subject: Re: [Qemu-devel] [PATCH] qemu-img: refuse to compress files with invalid size
Date: Mon, 15 Apr 2013 08:53:29 +0200
User-agent: Mutt/1.5.21 (2010-09-15)

On Fri, Apr 12, 2013 at 02:04:41PM -0600, Eric Blake wrote:
> 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?

I will send a new patch that does this.  kwolf also suggested it on
Friday and it sounds like a good idea.

Stefan



reply via email to

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