]> www.infradead.org Git - users/dwmw2/qemu.git/commit
block/qcow2-threads: fix qcow2_decompress
authorVladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
Mon, 2 Mar 2020 15:09:30 +0000 (18:09 +0300)
committerMichael Roth <mdroth@linux.vnet.ibm.com>
Thu, 4 Jun 2020 00:52:15 +0000 (19:52 -0500)
commite0ccde388779ae22a1070c180c8e4df09888f77e
tree59c2d76d1e2a3ca084ec7a5162b7fa8ffad80023
parent4a1c5955e7b02a5f6782a7f2219a193e70844fdf
block/qcow2-threads: fix qcow2_decompress

On success path we return what inflate() returns instead of 0. And it
most probably works for Z_STREAM_END as it is positive, but is
definitely broken for Z_BUF_ERROR.

While being here, switch to errno return code, to be closer to
qcow2_compress API (and usual expectations).

Revert condition in if to be more positive. Drop dead initialization of
ret.

Cc: qemu-stable@nongnu.org # v4.0
Fixes: 341926ab83e2b
Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
Message-Id: <20200302150930.16218-1-vsementsov@virtuozzo.com>
Reviewed-by: Alberto Garcia <berto@igalia.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
Signed-off-by: Max Reitz <mreitz@redhat.com>
(cherry picked from commit e7266570f2cf7b3ca2a156c677ee0a59d563458b)
Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
block/qcow2-threads.c