Re: [Qemu-devel] [PATCH v4 13/23] qemu-img: Simplify logic in img_compare()

2017-09-27 Thread Eric Blake
On 09/27/2017 02:05 PM, John Snow wrote: > > > On 09/13/2017 12:03 PM, Eric Blake wrote: >> 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

Re: [Qemu-devel] [PATCH v4 13/23] qemu-img: Simplify logic in img_compare()

2017-09-27 Thread John Snow
On 09/13/2017 12:03 PM, Eric Blake wrote: > 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

[Qemu-devel] [PATCH v4 13/23] qemu-img: Simplify logic in img_compare()

2017-09-13 Thread Eric Blake
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