]> Git Repo - qemu.git/commit
specs/qcow2: Fix documentation of the compressed cluster descriptor
authorAlberto Garcia <[email protected]>
Wed, 21 Feb 2018 14:08:49 +0000 (16:08 +0200)
committerKevin Wolf <[email protected]>
Fri, 2 Mar 2018 17:39:07 +0000 (18:39 +0100)
commit156b46ded3853dfc6b34c5afae019ff61798491b
tree649b3bc5fd4e13207399d510974b53d2735f372b
parentafe35cde6c2f3bdcee6e1f878836a64174fccb17
specs/qcow2: Fix documentation of the compressed cluster descriptor

This patch fixes several mistakes in the documentation of the
compressed cluster descriptor:

1) the documentation claims that the cluster descriptor contains the
   number of sectors used to store the compressed data, but what it
   actually contains is the number of sectors *minus one* or, in other
   words, the number of additional sectors after the first one.

2) the width of the fields is incorrectly specified. The number of bits
   used by each field is

      x = 62 - (cluster_bits - 8)   for the offset field
      y = (cluster_bits - 8)        for the size field

   So the offset field's location is [0, x-1], not [0, x] as stated.

3) the size field does not contain the size of the compressed data,
   but rather the number of sectors where that data is stored. The
   compressed data starts at the exact point specified in the offset
   field and ends when there's enough data to produce a cluster of
   decompressed data. Both points can be in the middle of a sector,
   allowing several compressed clusters to be stored next to one
   another, sharing sectors if necessary.

Cc: [email protected]
Signed-off-by: Alberto Garcia <[email protected]>
Reviewed-by: Eric Blake <[email protected]>
Signed-off-by: Kevin Wolf <[email protected]>
docs/interop/qcow2.txt
This page took 0.026001 seconds and 4 git commands to generate.