qemu-img: Change img_compare() to be byte-based
commit033d9fc203a90f567b16119906cd06f7e65a397c
authorEric Blake <eblake@redhat.com>
Thu, 12 Oct 2017 03:47:16 +0000 (11 22:47 -0500)
committerKevin Wolf <kwolf@redhat.com>
Thu, 26 Oct 2017 12:45:57 +0000 (26 14:45 +0200)
tree1f55142eef370d67363a19fea96537df20fb1925
parent415362873fd3bfba4605ec44b6ae2da91bbb28d3
qemu-img: Change img_compare() to be byte-based

In the continuing quest to make more things byte-based, change
the internal iteration of img_compare().  We can finally drop the
TODO assertions added earlier, now that the entire algorithm is
byte-based and no longer has to shift from bytes to sectors.

Most of the change is mechanical ('total_sectors' becomes
'total_size', 'sector_num' becomes 'offset', 'nb_sectors' becomes
'chunk', 'progress_base' goes from sectors to bytes); some of it
is also a cleanup (sectors_to_bytes() is now unused, loss of
variable 'count' added earlier in commit 51b0a488).

Signed-off-by: Eric Blake <eblake@redhat.com>
Reviewed-by: John Snow <jsnow@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
qemu-img.c