Re: [Qemu-devel] [PATCH v4 2/7] qcow2: Discard/zero clusters by byte count

2017-02-09 Thread Eric Blake
On 01/31/2017 07:54 PM, Max Reitz wrote: >>> Another thing: I'm not quite positive whether qcow2_cluster_zeroize() >>> can actually handle a byte count greater than INT_MAX. If you could pass >>> such a number to it, the multiplication "ret * s->cluster_size" might >>> overflow. It's only caller q

Re: [Qemu-devel] [PATCH v4 2/7] qcow2: Discard/zero clusters by byte count

2017-01-31 Thread Max Reitz
On 30.01.2017 17:52, Eric Blake wrote: > On 01/28/2017 02:21 PM, Max Reitz wrote: >> On 20.12.2016 20:15, Eric Blake wrote: >>> Passing a byte offset, but sector count, when we ultimately >>> want to operate on cluster granularity, is madness. Clean up >>> the interfaces to take both offset and co

Re: [Qemu-devel] [PATCH v4 2/7] qcow2: Discard/zero clusters by byte count

2017-01-30 Thread Eric Blake
On 01/28/2017 02:21 PM, Max Reitz wrote: > On 20.12.2016 20:15, Eric Blake wrote: >> Passing a byte offset, but sector count, when we ultimately >> want to operate on cluster granularity, is madness. Clean up >> the interfaces to take both offset and count as bytes, while >> still keeping the asse

Re: [Qemu-devel] [PATCH v4 2/7] qcow2: Discard/zero clusters by byte count

2017-01-28 Thread Max Reitz
On 20.12.2016 20:15, Eric Blake wrote: > Passing a byte offset, but sector count, when we ultimately > want to operate on cluster granularity, is madness. Clean up > the interfaces to take both offset and count as bytes, while > still keeping the assertion added previously that the caller > must a

[Qemu-devel] [PATCH v4 2/7] qcow2: Discard/zero clusters by byte count

2016-12-20 Thread Eric Blake
Passing a byte offset, but sector count, when we ultimately want to operate on cluster granularity, is madness. Clean up the interfaces to take both offset and count as bytes, while still keeping the assertion added previously that the caller must align the values to a cluster. Then rename things