qcow2: Return 0/-errno in qcow2_alloc_compressed_cluster_offset()
commit77e023ff79222191e8cc3d377504da8f19926837
authorKevin Wolf <kwolf@redhat.com>
Wed, 27 Feb 2019 09:26:24 +0000 (27 10:26 +0100)
committerKevin Wolf <kwolf@redhat.com>
Fri, 8 Mar 2019 11:26:45 +0000 (8 12:26 +0100)
treecb20fe92b89dd4dd24f840ddaa41c8026de3685d
parentc6d619cc12813acb2b1198f28cf2256ea9a30107
qcow2: Return 0/-errno in qcow2_alloc_compressed_cluster_offset()

qcow2_alloc_compressed_cluster_offset() used to return the cluster
offset for success and 0 for error. This doesn't only conflict with 0 as
a valid host offset, but also loses the error code.

Similar to the change made to qcow2_alloc_cluster_offset() for
uncompressed clusters in commit 148da7ea9d6, make the function return
0/-errno and return the allocated cluster offset in a by-reference
parameter.

Signed-off-by: Kevin Wolf <kwolf@redhat.com>
block/qcow2-cluster.c
block/qcow2.c
block/qcow2.h
tests/qemu-iotests/220.out