Re: [Qemu-devel] [PATCH v3 06/22] qcow2: Helper for refcount array reallocation

2014-12-02 Thread Max Reitz
On 2014-11-28 at 11:46, Stefan Hajnoczi wrote: On Thu, Nov 27, 2014 at 04:11:12PM +0100, Max Reitz wrote: On 2014-11-27 at 16:09, Stefan Hajnoczi wrote: On Thu, Nov 20, 2014 at 06:06:22PM +0100, Max Reitz wrote: +/** + * Reallocates *array so that it can hold new_size entries. *size must

Re: [Qemu-devel] [PATCH v3 06/22] qcow2: Helper for refcount array reallocation

2014-11-28 Thread Stefan Hajnoczi
On Thu, Nov 27, 2014 at 04:11:12PM +0100, Max Reitz wrote: On 2014-11-27 at 16:09, Stefan Hajnoczi wrote: On Thu, Nov 20, 2014 at 06:06:22PM +0100, Max Reitz wrote: +/** + * Reallocates *array so that it can hold new_size entries. *size must contain + * the current number of entries in

Re: [Qemu-devel] [PATCH v3 06/22] qcow2: Helper for refcount array reallocation

2014-11-27 Thread Stefan Hajnoczi
On Thu, Nov 20, 2014 at 06:06:22PM +0100, Max Reitz wrote: +/** + * Reallocates *array so that it can hold new_size entries. *size must contain + * the current number of entries in *array. If the reallocation fails, *array + * and *size will not be modified and -errno will be returned. If

Re: [Qemu-devel] [PATCH v3 06/22] qcow2: Helper for refcount array reallocation

2014-11-27 Thread Max Reitz
On 2014-11-27 at 16:09, Stefan Hajnoczi wrote: On Thu, Nov 20, 2014 at 06:06:22PM +0100, Max Reitz wrote: +/** + * Reallocates *array so that it can hold new_size entries. *size must contain + * the current number of entries in *array. If the reallocation fails, *array + * and *size will not be

Re: [Qemu-devel] [PATCH v3 06/22] qcow2: Helper for refcount array reallocation

2014-11-21 Thread Max Reitz
On 2014-11-20 at 22:43, Eric Blake wrote: On 11/20/2014 10:06 AM, Max Reitz wrote: Add a helper function for reallocating a refcount array, independent of the refcount order. The newly allocated space is zeroed and the function handles failed reallocations gracefully. The helper function will

[Qemu-devel] [PATCH v3 06/22] qcow2: Helper for refcount array reallocation

2014-11-20 Thread Max Reitz
Add a helper function for reallocating a refcount array, independent of the refcount order. The newly allocated space is zeroed and the function handles failed reallocations gracefully. The helper function will always align the buffer size to a cluster boundary; if storing the refcounts in such

Re: [Qemu-devel] [PATCH v3 06/22] qcow2: Helper for refcount array reallocation

2014-11-20 Thread Eric Blake
On 11/20/2014 10:06 AM, Max Reitz wrote: Add a helper function for reallocating a refcount array, independent of the refcount order. The newly allocated space is zeroed and the function handles failed reallocations gracefully. The helper function will always align the buffer size to a