Re: [Qemu-devel] [PATCH v4 5/5] qcow2: Avoid memory over-allocation on compressed images

2018-02-28 Thread Alberto Garcia
On Tue 27 Feb 2018 05:29:44 PM CET, Eric Blake wrote: > So, it's time to cut back on the waste. A compressed cluster > written by qemu will NEVER occupy more than an uncompressed > cluster, but based on mid-sector alignment, we may still need > to read 1 cluster + 1 sector in order to recover

[Qemu-devel] [PATCH v4 5/5] qcow2: Avoid memory over-allocation on compressed images

2018-02-27 Thread Eric Blake
When reading a compressed image, we were allocating s->cluster_data to 32*cluster_size + 512 (possibly over 64 megabytes, for an image with 2M clusters). Let's check out the history: Back when qcow2 was first written, we used s->cluster_data for everything, including copy_sectors() and