Received: from eggs.gnu.org ([2001:4830:134:3::10]:50707) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bO2YN-0008C9-Tt for qemu-devel@nongnu.org; Fri, 15 Jul 2016 08:49:19 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bO2YL-0008Pm-T2 for qemu-devel@nongnu.org; Fri, 15 Jul 2016 08:49:14 -0400 References: <1468515565-81313-1-git-send-email-vsementsov@virtuozzo.com> From: Max Reitz Message-ID: <5d6a418e-65f2-7f9e-4c16-1cd0bc82ac10@redhat.com> Date: Fri, 15 Jul 2016 14:49:04 +0200 MIME-Version: 1.0 In-Reply-To: <1468515565-81313-1-git-send-email-vsementsov@virtuozzo.com> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="Lbqt2P0Jw0FurTlqecqKdpo0vXdwTC96G" Subject: Re: [Qemu-devel] [PATCH v2] qcow2: do not allocate extra memory List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Vladimir Sementsov-Ogievskiy , qemu-devel@nongnu.org, qemu-block@nongnu.org Cc: kwolf@redhat.com, stefanha@redhat.com, eblake@redhat.com, den@openvz.org This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --Lbqt2P0Jw0FurTlqecqKdpo0vXdwTC96G From: Max Reitz To: Vladimir Sementsov-Ogievskiy , qemu-devel@nongnu.org, qemu-block@nongnu.org Cc: kwolf@redhat.com, stefanha@redhat.com, eblake@redhat.com, den@openvz.org Message-ID: <5d6a418e-65f2-7f9e-4c16-1cd0bc82ac10@redhat.com> Subject: Re: [PATCH v2] qcow2: do not allocate extra memory References: <1468515565-81313-1-git-send-email-vsementsov@virtuozzo.com> In-Reply-To: <1468515565-81313-1-git-send-email-vsementsov@virtuozzo.com> Content-Type: text/plain; charset=iso-8859-15 Content-Transfer-Encoding: quoted-printable On 14.07.2016 18:59, Vladimir Sementsov-Ogievskiy wrote: > There are no needs to allocate more than one cluster, as we set > avail_out for deflate to one cluster. >=20 > Zlib docs (http://www.zlib.net/manual.html) says: > "deflate compresses as much data as possible, and stops when the input > buffer becomes empty or the output buffer becomes full." >=20 > So, deflate will not write more than avail_out to output buffer. If > there is no enough space in output buffer for compressed data (it may b= e > larger than input data) deflate just returns Z_OK. (if all data is > compressed and written to output buffer deflate returns Z_STREAM_END). >=20 > Signed-off-by: Vladimir Sementsov-Ogievskiy > --- >=20 > v2: improve commit message >=20 > block/qcow.c | 2 +- > block/qcow2.c | 2 +- > 2 files changed, 2 insertions(+), 2 deletions(-) Thanks Vladimir, applied to my block branch (with s/no/not/ as proposed by Eric): https://github.com/XanClic/qemu/commits/block Max --Lbqt2P0Jw0FurTlqecqKdpo0vXdwTC96G 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 iQEvBAEBCAAZBQJXiNvBEhxtcmVpdHpAcmVkaGF0LmNvbQAKCRA7sUIC6DisrT74 CACghd0Al3keIGDI20WFkG63A3IYJE2yEDQocAUsyB0KCGrZGiVMMZfrhEAxO70q kUmQgJmXWVVKNyacU2NbRlnd9i6gmZLOSFwmNMJTyBc5sLnLJLLewm4y0mZTYt+5 3/UBW3TO7UA8glXwO32FZMlKMs+u57ZiHowjxHOQtBD1aX2YByT3HTN/KJ3zoMW3 nSvB94eHFePTVUgdb7vjehYaf4ybw5lvnyUhgAmXePti9XGNL0PzboEpW6ma8skQ fjZjd1a1DhPxFly18LmWYYtLY/S8UoJnoJ4MsjKupTTvtsYLWvflanig35ZkcqLN MejDDUJFheFinZFHY918d63L =bgr9 -----END PGP SIGNATURE----- --Lbqt2P0Jw0FurTlqecqKdpo0vXdwTC96G--