diff options
author | Max Reitz <mreitz@redhat.com> | 2014-09-03 00:25:08 +0200 |
---|---|---|
committer | Kevin Wolf <kwolf@redhat.com> | 2014-10-23 15:34:02 +0200 |
commit | 4b318d6ca66545e59eafbf595f66e31bf1625d9a (patch) | |
tree | 4076192f27a4cc6a4b7b163b9d6456f7d6a2f951 | |
parent | 17bd5f472754acd2458b53dc02a30d5651e6dd79 (diff) | |
download | qemu-4b318d6ca66545e59eafbf595f66e31bf1625d9a.zip qemu-4b318d6ca66545e59eafbf595f66e31bf1625d9a.tar.gz qemu-4b318d6ca66545e59eafbf595f66e31bf1625d9a.tar.bz2 |
docs/qcow2: Correct refcount_block_entries
A refblock entry may have a different size than 16 bits, it may even be
smaller than a byte. Correct the refcount_block_entries calculation
accordingly.
Signed-off-by: Max Reitz <mreitz@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
-rw-r--r-- | docs/specs/qcow2.txt | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/docs/specs/qcow2.txt b/docs/specs/qcow2.txt index cfbc8b0..0a878aa 100644 --- a/docs/specs/qcow2.txt +++ b/docs/specs/qcow2.txt @@ -183,7 +183,7 @@ blocks and are exactly one cluster in size. Given a offset into the image file, the refcount of its cluster can be obtained as follows: - refcount_block_entries = (cluster_size / sizeof(uint16_t)) + refcount_block_entries = (cluster_size * 8 / refcount_bits) refcount_block_index = (offset / cluster_size) % refcount_block_entries refcount_table_index = (offset / cluster_size) / refcount_block_entries |