From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:45435) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b7od0-0005Wz-KE for qemu-devel@nongnu.org; Tue, 31 May 2016 14:43:01 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1b7ocy-0002BT-H9 for qemu-devel@nongnu.org; Tue, 31 May 2016 14:42:57 -0400 Received: from mx1.redhat.com ([209.132.183.28]:53990) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b7ocy-0002BL-B9 for qemu-devel@nongnu.org; Tue, 31 May 2016 14:42:56 -0400 References: <1463229957-14253-1-git-send-email-den@openvz.org> <1463229957-14253-3-git-send-email-den@openvz.org> <20160527173335.GF27946@stefanha-x1.localdomain> <574C0404.9040507@virtuozzo.com> <574C38D9.8020709@virtuozzo.com> From: Eric Blake Message-ID: <574DDB2E.9070801@redhat.com> Date: Tue, 31 May 2016 12:42:54 -0600 MIME-Version: 1.0 In-Reply-To: <574C38D9.8020709@virtuozzo.com> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="me9ke3l20qRqOaCVn0vhOOA2MPhtWfKKE" Subject: Re: [Qemu-devel] [PATCH 02/10] qcow2: add qcow2_co_write_compressed List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Pavel Butsykin , Stefan Hajnoczi , "Denis V. Lunev" Cc: Kevin Wolf , Jeff Cody , qemu-devel@nongnu.org, Markus Armbruster , Stefan Hajnoczi , John Snow This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --me9ke3l20qRqOaCVn0vhOOA2MPhtWfKKE Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 05/30/2016 06:58 AM, Pavel Butsykin wrote: >=20 > Sorry, but it seems this will never happen, because the second write > will not pass this check: >=20 > 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 =3D 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; > } > ... >=20 > As you can see we can't do the compressed write in the already allocate= d > 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. --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --me9ke3l20qRqOaCVn0vhOOA2MPhtWfKKE Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 Comment: Public key at http://people.redhat.com/eblake/eblake.gpg Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iQEcBAEBCAAGBQJXTdsuAAoJEKeha0olJ0NqP2oH/1rNZsd+DJLnkZrim9y7m6Tm T6J7qAD8cu9tGZKBtSQ2y9JNnZWX/l204l0aO5rQKIrLDx7dRchzeDdMq+vC3I8A BC5gARNKV1ptiXD1vzP1NI6RAMuDpEdhIAggYsE46coc9ytTeiT7DLusMk/aB0tk 4qCZ+L0KcnTxKyFL0bMpWz3vM1EK/eX75TwB9F4wfrkQbhrDrNAr88Z+C+pB8bbu KvACQbo/BgquJuIXbnV72OLJK6ofIXhLWLKwRfpI9/aKb5fVP6hemc0Xn3B1GwRF kSQLKIs//0VpISksqyUADHdxCE2XlV6cPILfCTX+XoT2sl+IELFrhtfOftDLhTg= =c3Lf -----END PGP SIGNATURE----- --me9ke3l20qRqOaCVn0vhOOA2MPhtWfKKE--