]> git.proxmox.com Git - mirror_qemu.git/commit - block/qcow2.c
qcow2: Allow qcow2_get_cluster_offset to return errors
authorKevin Wolf <kwolf@redhat.com>
Fri, 21 May 2010 15:59:36 +0000 (17:59 +0200)
committerKevin Wolf <kwolf@redhat.com>
Fri, 28 May 2010 11:29:11 +0000 (13:29 +0200)
commit1c46efaa0a175e468772405385ca26a1e35dd94c
treee4238b6824fd4e1b712f76b44f41601b527b5de0
parentc63782cbe8bdc2c401ea710cef427de0214c5900
qcow2: Allow qcow2_get_cluster_offset to return errors

qcow2_get_cluster_offset() looks up a given virtual disk offset and returns the
offset of the corresponding cluster in the image file. Errors (e.g. L2 table
can't be read) are currenctly indicated by a return value of 0, which is
unfortuately the same as for any unallocated cluster. So in effect we can't
check for errors.

This makes the old return value a by-reference parameter and returns the usual
0/-errno error code.

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