]> git.proxmox.com Git - mirror_qemu.git/commitdiff
docs/qcow2: Correct refcount_block_entries
authorMax Reitz <mreitz@redhat.com>
Tue, 2 Sep 2014 22:25:08 +0000 (00:25 +0200)
committerKevin Wolf <kwolf@redhat.com>
Thu, 23 Oct 2014 13:34:02 +0000 (15:34 +0200)
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>
docs/specs/qcow2.txt

index cfbc8b070c9246dba589b1a8962eb4defe82dbf0..0a878aa95de247eb4a5e46ea8658695139349604 100644 (file)
@@ -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