summary refs log tree commit diff stats
path: root/scripts/qapi.py
diff options
context:
space:
mode:
authorEric Blake <eblake@redhat.com>2017-09-25 09:55:13 -0500
committerKevin Wolf <kwolf@redhat.com>2017-10-06 16:28:58 +0200
commit993e6525bfcc67ba48fe55bd64ec043a4b721e1d (patch)
tree2dacae7b36acdb3be677a0643555ebcce2f262f6 /scripts/qapi.py
parentebfcd2e75f719c5d74ba72bbca84fa9854b6698f (diff)
downloadfocaccia-qemu-993e6525bfcc67ba48fe55bd64ec043a4b721e1d.tar.gz
focaccia-qemu-993e6525bfcc67ba48fe55bd64ec043a4b721e1d.zip
dirty-bitmap: Track bitmap size by bytes
We are still using an internal hbitmap that tracks a size in sectors,
with the granularity scaled down accordingly, because it lets us
use a shortcut for our iterators which are currently sector-based.
But there's no reason we can't track the dirty bitmap size in bytes,
since it is (mostly) an internal-only variable (remember, the size
is how many bytes are covered by the bitmap, not how many bytes the
bitmap occupies).  A later cleanup will convert dirty bitmap
internals to be entirely byte-based, eliminating the intermediate
sector rounding added here; and technically, since bdrv_getlength()
already rounds up to sectors, our use of DIV_ROUND_UP is more for
theoretical completeness than for any actual rounding.

Use is_power_of_2() while at it, instead of open-coding that.

Signed-off-by: Eric Blake <eblake@redhat.com>
Reviewed-by: John Snow <jsnow@redhat.com>
Reviewed-by: Kevin Wolf <kwolf@redhat.com>
Reviewed-by: Fam Zheng <famz@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Diffstat (limited to 'scripts/qapi.py')
0 files changed, 0 insertions, 0 deletions