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

In the continuing quest to make more things byte-based, change
the internal iteration of img_rebase().  We can finally drop the
TODO assertion 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 ('num_sectors' becomes 'size',
'sector' becomes 'offset', 'n' goes from sectors to bytes); some
of it is also a cleanup (use of MIN() instead of open-coding,
loss of variable 'count' added earlier in commit d6a644bb).

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