qemu-e2k/block
Max Reitz 7324c10f96 qcow2: Only return status from qcow2_get_refcount
Refcounts can theoretically be of type uint64_t; in order to be able to
represent the full range, qcow2_get_refcount() cannot use a single
variable to represent both all refcount values and also keep some values
reserved for errors.

One solution would be to add an Error pointer parameter to
qcow2_get_refcount(); however, no caller could (currently) pass that
error message, so it would have to be emitted immediately and be
passed to the next caller by returning -EIO or something similar.
Therefore, an Error parameter does not offer any advantages here.

The solution applied by this patch is simpler to use. Because no caller
would be able to pass the error message, they would have to print it and
free it, whereas with this patch the caller only needs to pass the
returned integer (which is often a no-op from the code perspective,
because that integer will be stored in a variable "ret" which will be
returned by the fail path of many callers).

Signed-off-by: Max Reitz <mreitz@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2015-03-10 14:02:21 +01:00
..
accounting.c block: add accounting for merged requests 2015-02-06 17:24:21 +01:00
archipelago.c
backup.c qmp: Add command 'blockdev-backup' 2015-01-13 11:47:56 +00:00
blkdebug.c
blkverify.c
block-backend.c hmp: Normalize HMP command handler names 2015-02-25 13:14:37 +00:00
bochs.c
cloop.c
commit.c
curl.c
dmg.c block/dmg: improve zeroes handling 2015-02-06 17:24:21 +01:00
gluster.c
iscsi.c iscsi: Handle write protected case in reopen 2015-02-27 18:26:31 +01:00
linux-aio.c linux-aio: simplify removal of completed iocbs from the list 2014-12-12 16:57:55 +00:00
Makefile.objs block/dmg: support bzip2 block entry types 2015-02-06 17:24:21 +01:00
mirror.c block: mirror - change string allocation to 2-bytes 2015-01-23 18:17:06 +01:00
nbd-client.c nbd: fix the co_queue multi-adding bug 2015-02-16 15:07:17 +00:00
nbd-client.h nbd: Drop BDS backpointer 2015-02-16 14:36:03 +00:00
nbd.c QemuOpts: Convert qemu_opt_set_number() to Error, fix its use 2015-02-26 14:47:32 +01:00
nfs.c block/nfs: Add create_opts 2014-12-10 10:31:19 +01:00
null.c
parallels.c
qapi.c block: add event when disk usage exceeds threshold 2015-02-06 17:24:21 +01:00
qcow2-cache.c block: Give always priority to unused entries in the qcow2 L2 cache 2015-02-06 17:24:22 +01:00
qcow2-cluster.c qcow2: Only return status from qcow2_get_refcount 2015-03-10 14:02:21 +01:00
qcow2-refcount.c qcow2: Only return status from qcow2_get_refcount 2015-03-10 14:02:21 +01:00
qcow2-snapshot.c
qcow2.c qcow2: Add refcount_bits to format-specific info 2015-03-10 14:02:20 +01:00
qcow2.h qcow2: Only return status from qcow2_get_refcount 2015-03-10 14:02:21 +01:00
qcow.c block: fix off-by-one error in qcow and qcow2 2015-02-06 17:24:21 +01:00
qed-check.c
qed-cluster.c
qed-gencb.c
qed-l2-cache.c
qed-table.c
qed.c qed: check for header size overflow 2015-02-06 17:24:21 +01:00
qed.h qed: Really remove unused field QEDAIOCB.finished 2015-02-06 17:24:21 +01:00
quorum.c
raw_bsd.c block: Make essential BlockDriver objects public 2014-12-10 10:31:19 +01:00
raw-aio.h linux-aio: drop return code from laio_io_unplug and ioq_submit 2014-12-12 16:57:55 +00:00
raw-posix.c block/raw-posix: fix compilation warning on OSX 2015-03-09 11:11:59 +01:00
raw-win32.c block: Remove "growable" from BDS 2015-02-16 15:07:19 +00:00
rbd.c block/rbd: fix memory leak 2014-12-12 13:16:56 +00:00
sheepdog.c sheepdog: selectable object size support 2015-03-09 11:11:59 +01:00
snapshot.c
ssh.c
stream.c
vdi.c block: remove BLOCK_OPT_NOCOW from vdi_create_opts 2014-12-10 10:31:20 +01:00
vhdx-endian.c
vhdx-log.c
vhdx.c block: vhdx - force FileOffsetMB field to '0' for certain block states 2015-01-23 12:41:32 -05:00
vhdx.h block: vhdx - update PAYLOAD_BLOCK_UNMAPPED value to match 1.00 spec 2014-12-12 15:42:22 +00:00
vmdk.c block: vmdk - fixed sizeof() error 2015-02-16 15:07:17 +00:00
vpc.c vpc: Implement bdrv_co_get_block_status() 2015-03-09 11:11:59 +01:00
vvfat.c QemuOpts: Drop qemu_opt_set(), rename qemu_opt_set_err(), fix use 2015-02-26 14:49:31 +01:00
win32-aio.c
write-threshold.c block: add event when disk usage exceeds threshold 2015-02-06 17:24:21 +01:00