[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-block] [PATCH v2] qcow2: do not allocate extra memory

From: Max Reitz
Subject: Re: [Qemu-block] [PATCH v2] qcow2: do not allocate extra memory
Date: Fri, 15 Jul 2016 14:49:04 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.2.0

On 14.07.2016 18:59, Vladimir Sementsov-Ogievskiy wrote:
> There are no needs to allocate more than one cluster, as we set
> avail_out for deflate to one cluster.
> Zlib docs (http://www.zlib.net/manual.html) says:
> "deflate compresses as much data as possible, and stops when the input
> buffer becomes empty or the output buffer becomes full."
> So, deflate will not write more than avail_out to output buffer. If
> there is no enough space in output buffer for compressed data (it may be
> larger than input data) deflate just returns Z_OK. (if all data is
> compressed and written to output buffer deflate returns Z_STREAM_END).
> Signed-off-by: Vladimir Sementsov-Ogievskiy <address@hidden>
> ---
> v2: improve commit message
>  block/qcow.c  | 2 +-
>  block/qcow2.c | 2 +-
>  2 files changed, 2 insertions(+), 2 deletions(-)

Thanks Vladimir, applied to my block branch (with s/no/not/ as proposed
by Eric):



Attachment: signature.asc
Description: OpenPGP digital signature

reply via email to

[Prev in Thread] Current Thread [Next in Thread]