aboutsummaryrefslogtreecommitdiff
path: root/net/queue.c
diff options
context:
space:
mode:
authorEric Blake <eblake@redhat.com>2017-10-11 22:47:09 -0500
committerKevin Wolf <kwolf@redhat.com>2017-10-26 14:45:57 +0200
commit7daddc615e694ede5dd75366e8a0407f2404ccd8 (patch)
treea99cc2aad7b7356b450da9e50daf6393308c594f /net/queue.c
parent3182664220571d11d4fe03ecdc10fcc1e842ed32 (diff)
qemu-img: Simplify logic in img_compare()
As long as we are querying the status for a chunk smaller than the known image size, we are guaranteed that a successful return will have set pnum to a non-zero size (pnum is zero only for queries beyond the end of the file). Use that to slightly simplify the calculation of the current chunk size being compared. Likewise, we don't have to shrink the amount of data operated on until we know we have to read the file, and therefore have to fit in the bounds of our buffer. Also, note that 'total_sectors_over' is equivalent to 'progress_base'. With these changes in place, sectors_to_process() is now dead code, and can be removed. Signed-off-by: Eric Blake <eblake@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Diffstat (limited to 'net/queue.c')
0 files changed, 0 insertions, 0 deletions