From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:60687) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aaPyK-0003S9-8I for qemu-devel@nongnu.org; Mon, 29 Feb 2016 10:43:01 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aaPyJ-0007Gx-9y for qemu-devel@nongnu.org; Mon, 29 Feb 2016 10:42:56 -0500 References: <1456758714-12609-1-git-send-email-eblake@redhat.com> From: Max Reitz Message-ID: <56D466F1.8090104@redhat.com> Date: Mon, 29 Feb 2016 16:42:41 +0100 MIME-Version: 1.0 In-Reply-To: <1456758714-12609-1-git-send-email-eblake@redhat.com> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="J0gtgr0cE2j5dmRavXBsrLtqABx587UxA" 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: Eric Blake , qemu-devel@nongnu.org Cc: mgreger@cinci.rr.com, qemu-block@nongnu.org This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --J0gtgr0cE2j5dmRavXBsrLtqABx587UxA Content-Type: multipart/mixed; boundary="T7LstGH2UdAONUEV3tUi77nPlb2dNQwo1" From: Max Reitz To: Eric Blake , qemu-devel@nongnu.org Cc: mgreger@cinci.rr.com, qemu-block@nongnu.org Message-ID: <56D466F1.8090104@redhat.com> Subject: Re: [Qemu-block] [PATCH] qcow2: Clarify that compressed cluster offset requires shift References: <1456758714-12609-1-git-send-email-eblake@redhat.com> In-Reply-To: <1456758714-12609-1-git-send-email-eblake@redhat.com> --T7LstGH2UdAONUEV3tUi77nPlb2dNQwo1 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On 29.02.2016 16:11, Eric Blake wrote: > The specs for the host cluster offset of a compressed cluster > were not clear that the offset is in terms of sectors, and requires > a shift by 9 to be a byte offset. Add some more text to make the > interpretation obvious. >=20 > CC: mgreger@cinci.rr.com > Signed-off-by: Eric Blake > --- > docs/specs/qcow2.txt | 9 +++++++-- > 1 file changed, 7 insertions(+), 2 deletions(-) >=20 > diff --git a/docs/specs/qcow2.txt b/docs/specs/qcow2.txt > index 80cdfd0..7049415 100644 > --- a/docs/specs/qcow2.txt > +++ b/docs/specs/qcow2.txt > @@ -323,11 +323,16 @@ Standard Cluster Descriptor: >=20 > Compressed Clusters Descriptor (x =3D 62 - (cluster_bits - 8)): >=20 > - Bit 0 - x: Host cluster offset. This is usually _not_ aligned= 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. Max > + usually _not_ aligned to a cluster boundary! >=20 > x+1 - 61: Compressed size of the images in sectors of 512 by= tes >=20 > +The bits of the host cluster offset not specified in the cluster descr= iptor > +are 0 (bits 0-8 are obvious because a 512-byte sector is the smallest > +addressable unit, while bits 56-63 implies that a qcow2 file cannot ex= ceed > +2^56 bytes in size). > + > If a cluster is unallocated, read requests shall read the data from th= e backing > file (except if bit 0 in the Standard Cluster Descriptor is set). If t= here is > no backing file or the backing file is smaller than the image, they sh= all read >=20 --T7LstGH2UdAONUEV3tUi77nPlb2dNQwo1-- --J0gtgr0cE2j5dmRavXBsrLtqABx587UxA 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 iQEcBAEBCAAGBQJW1GbxAAoJEDuxQgLoOKyt5aQH/R89u80MlgnSZwltzZDdOIq6 fAqazQaL2nQyQyy66Bkw1e3H8IckMXzEEtPF1h2cqqqSW/n8tYz7Zp65IlIa4up8 LK17lmBD+AktXsJySBzhbKfD8LA5K7//y9ghOpfhvbyvWUh2dhvielyqF8HwzT14 z+W4Jb7dDrVVjaTKLgM1a0ci4/t+hmZiDOypFego6GNYg/o4XvSm6mydJ8ONM+od +1cONbYnIJGf3ALl0w3iMxhboFlcub2Uzk9lePylusCX1rBu74BRa2LZfSnKOGjM HLRLUIIvj/3kBl4o3v93qV18WeEh96kZ/CDZ3VUqtfx983gxCNZElGDJnrjRBYk= =OmeI -----END PGP SIGNATURE----- --J0gtgr0cE2j5dmRavXBsrLtqABx587UxA--