Re: [Qemu-devel] [PATCH 2/4] qcow2: Reuse preallocated zero clusters

2017-05-03 Thread Eric Blake
On 05/03/2017 06:11 PM, Max Reitz wrote: > Instead of just freeing preallocated zero clusters and completely > allocating them from scratch, reuse them. > > We cannot do this in handle_copied(), however, since this is a COW > operation. Therefore, we have to add the new logic to handle_alloc() and

[Qemu-devel] [PATCH 2/4] qcow2: Reuse preallocated zero clusters

2017-05-03 Thread Max Reitz
Instead of just freeing preallocated zero clusters and completely allocating them from scratch, reuse them. We cannot do this in handle_copied(), however, since this is a COW operation. Therefore, we have to add the new logic to handle_alloc() and simply return the existing offset if it exists. Th