From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:39684) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UQkDI-0007Sk-Mc for qemu-devel@nongnu.org; Fri, 12 Apr 2013 16:04:50 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UQkDH-0000iG-GR for qemu-devel@nongnu.org; Fri, 12 Apr 2013 16:04:48 -0400 Received: from mx1.redhat.com ([209.132.183.28]:12748) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UQkDH-0000i9-4T for qemu-devel@nongnu.org; Fri, 12 Apr 2013 16:04:47 -0400 Message-ID: <516868D9.4060406@redhat.com> Date: Fri, 12 Apr 2013 14:04:41 -0600 From: Eric Blake MIME-Version: 1.0 References: <1365788268-24787-1-git-send-email-stefanha@redhat.com> <20130412195513.GA4510@irqsave.net> In-Reply-To: <20130412195513.GA4510@irqsave.net> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="----enig2NVOUNGIEUOJHLOKDFSMH" Subject: Re: [Qemu-devel] [PATCH] qemu-img: refuse to compress files with invalid size List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: =?UTF-8?B?QmVub8OudCBDYW5ldA==?= Cc: Kevin Wolf , qemu-devel@nongnu.org, Stefan Hajnoczi This is an OpenPGP/MIME signed message (RFC 4880 and 3156) ------enig2NVOUNGIEUOJHLOKDFSMH Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On 04/12/2013 01:55 PM, Beno=C3=AEt Canet wrote: > Le Friday 12 Apr 2013 =C3=A0 19:37:48 (+0200), Stefan Hajnoczi a =C3=A9= crit : >> Image file compression works at cluster granularity. It is not possib= le >> 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? --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org ------enig2NVOUNGIEUOJHLOKDFSMH Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.13 (GNU/Linux) Comment: Public key at http://people.redhat.com/eblake/eblake.gpg Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iQEcBAEBCAAGBQJRaGjZAAoJEKeha0olJ0NquqIH/i8DbLJ7flHjPSq/xcXGBCoi plrxSgi6uK228xursNp+Kzz/r7IDx0ccRHcNadPLeZch2YPTUpfKorX0ynjU+ZHf atEUFml2gPZwmPCxjV9yGL4uH9zNOLbBwmhilIvirsGEttTSZ6B0Y1YZjgJNXObJ 2I7YVymQsef9OGzsNzUiv2mMkNi0OuAgef4mQuSLJnYilrbkuCXVyoZPHeK+gu9I l5+ZI6nreptOyGzLymseNj4OLaKpTr8U2qjGMVSIBKz+8QLrW2RKsbqF/hEa1JbE iqgx90RRUlicrJW619vXD7aodgUjggOgDV3CULZh5HKIxbpjDL1rssAsYRV9MJU= =Rroc -----END PGP SIGNATURE----- ------enig2NVOUNGIEUOJHLOKDFSMH--