]> git.proxmox.com Git - mirror_qemu.git/commit
qcow2: Return useful error code in refcount_init()
authorMax Reitz <mreitz@redhat.com>
Wed, 28 May 2014 22:19:54 +0000 (00:19 +0200)
committerKevin Wolf <kwolf@redhat.com>
Fri, 15 Aug 2014 13:07:16 +0000 (15:07 +0200)
commit8fcffa9853473ab148d36858f15c5531161a1824
treeb844c551834c0cf1bc1960ce0f751d1cc6a348e0
parent7504edf477d2bac9cbf53225811ec595abf045e4
qcow2: Return useful error code in refcount_init()

If bdrv_pread() returns an error, it is very unlikely that it was
ENOMEM. In this case, the return value should be passed along; as
bdrv_pread() will always either return the number of bytes read or a
negative value (the error code), the condition for checking whether
bdrv_pread() failed can be simplified (and clarified) as well.

Signed-off-by: Max Reitz <mreitz@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Reviewed-by: Benoit Canet <benoit@irqsave.net>
block/qcow2-refcount.c