]> git.proxmox.com Git - mirror_qemu.git/commit - block/mirror.c
dirty-bitmap: Change bdrv_get_dirty_locked() to take bytes
authorEric Blake <eblake@redhat.com>
Mon, 25 Sep 2017 14:55:19 +0000 (09:55 -0500)
committerKevin Wolf <kwolf@redhat.com>
Fri, 6 Oct 2017 14:28:58 +0000 (16:28 +0200)
commit3b5d4df0c6b52746c6194bd2ea65828822db8438
tree8acbcd8f5f56e08fd2d80c26cfb26fe8f948a721
parent9a46dba7b76f5198555819905d1d8235947ba98f
dirty-bitmap: Change bdrv_get_dirty_locked() to take bytes

Half the callers were already scaling bytes to sectors; the other
half can eventually be simplified to use byte iteration.  Both
callers were already using the result as a bool, so make that
explicit.  Making the change also makes it easier for a future
dirty-bitmap patch to offload scaling over to the internal hbitmap.

Remember, asking whether a byte is dirty is effectively asking
whether the entire granularity containing the byte is dirty, since
we only track dirtiness by granularity.

Signed-off-by: Eric Blake <eblake@redhat.com>
Reviewed-by: John Snow <jsnow@redhat.com>
Reviewed-by: Juan Quintela <quintela@redhat.com>
Reviewed-by: Kevin Wolf <kwolf@redhat.com>
Reviewed-by: Fam Zheng <famz@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
block/dirty-bitmap.c
block/mirror.c
include/block/dirty-bitmap.h
migration/block.c