From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:43142) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aaQLR-0007ka-3K for qemu-devel@nongnu.org; Mon, 29 Feb 2016 11:06:50 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aaQLQ-0007KH-5b for qemu-devel@nongnu.org; Mon, 29 Feb 2016 11:06:49 -0500 References: <1456758714-12609-1-git-send-email-eblake@redhat.com> <56D466F1.8090104@redhat.com> <56D467C5.9030402@redhat.com> From: Eric Blake Message-ID: <56D46C91.6070207@redhat.com> Date: Mon, 29 Feb 2016 09:06:41 -0700 MIME-Version: 1.0 In-Reply-To: <56D467C5.9030402@redhat.com> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="iItErxvHtMLcLPDIGJvLo48bEMVBQ65kO" Subject: Re: [Qemu-devel] [Qemu-block] [PATCH] qcow2: Clarify that compressed cluster offset requires shift List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Max Reitz , qemu-devel@nongnu.org Cc: mgreger@cinci.rr.com, qemu-block@nongnu.org This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --iItErxvHtMLcLPDIGJvLo48bEMVBQ65kO Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 02/29/2016 08:46 AM, Max Reitz wrote: >>> Compressed Clusters Descriptor (x =3D 62 - (cluster_bits - 8)): >>> >>> - Bit 0 - x: Host cluster offset. This is usually _not_ align= ed to a >>> - cluster boundary! >>> + Bit 0 - x: Bits 9-(x+9) of host cluster offset. This is >> >> I'd rather use one of "9..(x+9)", "[9, x+9]", "9 - (x+9)", "9=E2=80=94= (x+9)" in >> order to clarify that this is not a minus but a range. >=20 > ...unless, of course, this is actually a byte offset, which it seems to= > be, judging from qcow2_get_cluster_offset() (and > qcow2_decompress_cluster(), as Kevin said on IRC). Hmm, then I may be totally wrong. (Serves me right for trying to write a spec patch without testing actual behavior). At the least, we may want to say that things are usually not aligned to even a _sector_ boundary (not just cluster boundary), and also clarify whether the sector length is truncated or rounded up (zlib doesn't care about trailing garbage during decompression, but you DO need to know how many sectors to read to ensure that you are supplying zlib with trailing garbage, rather than a truncated stream). --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --iItErxvHtMLcLPDIGJvLo48bEMVBQ65kO 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/ iQEcBAEBCAAGBQJW1GyRAAoJEKeha0olJ0NqEnYH/21NoqMJcNL/rYxN4S6jnRs1 ySb/EtPi1pO47ux5GFmQ2F6xh356JwbojE9g/sfyfmo+Mw8MUGOz+pw9ElG7ANLN SCXjiujPNzV8+UDJOcF0HInubHGtPaT1WvwcA09QiOOUdbRH5GjoP6Je2f0PZrvE xMfkbZ3EG5cOxiLmwvUPpV2yIzxSsTHAXutkcQ2nIF4AyG/pXGsRd5nfYbNmQ6tq 9VHw2QwfUIFe9BDEFUlw2nL5RbZgvwA2eY9LuJo+uEiHSfOCwRMdhcKjhzcWWc7M WHnC9ZdlcSg9afXj7XKoPDbg22kQ+SvnoZ+fVrc1xzAr7lYM0Nv017p1CqAzK5M= =R1SL -----END PGP SIGNATURE----- --iItErxvHtMLcLPDIGJvLo48bEMVBQ65kO--