mirror of
https://chromium.googlesource.com/crosvm/crosvm
synced 2024-11-25 05:03:05 +00:00
qcow: Fix refcount_bytes
This should be the number of bits (1 << order) divided by bits per byte. BUG=none TEST=cargo test Change-Id: I201dbaf21d13a82af6bcb493ba5f3b62c89286fa Signed-off-by: Dylan Reid <dgreid@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/954348 Reviewed-by: Stephen Barber <smbarber@chromium.org> Reviewed-by: Zach Reizner <zachr@chromium.org>
This commit is contained in:
parent
d1ab493672
commit
818afd6eb0
1 changed files with 1 additions and 1 deletions
|
@ -143,7 +143,7 @@ impl QcowHeader {
|
|||
// Pre-allocate enough clusters for the entire refcount table as it must be
|
||||
// continuous in the file. Allocate enough space to refcount all clusters, including
|
||||
// the refcount clusters.
|
||||
let refcount_bytes = 0x01u32 << DEFAULT_REFCOUNT_ORDER / 8;
|
||||
let refcount_bytes = (0x01u32 << DEFAULT_REFCOUNT_ORDER) / 8;
|
||||
let for_data = div_round_up_u32(num_clusters * refcount_bytes, cluster_size);
|
||||
let for_refcounts = div_round_up_u32(for_data * refcount_bytes, cluster_size);
|
||||
let max_refcount_clusters = for_data + for_refcounts;
|
||||
|
|
Loading…
Reference in a new issue