diff options
author | Kevin Wolf <kwolf@redhat.com> | 2010-05-21 17:59:36 +0200 |
---|---|---|
committer | Kevin Wolf <kwolf@redhat.com> | 2010-05-28 13:29:11 +0200 |
commit | 1c46efaa0a175e468772405385ca26a1e35dd94c (patch) | |
tree | e4238b6824fd4e1b712f76b44f41601b527b5de0 /block/qcow2.h | |
parent | c63782cbe8bdc2c401ea710cef427de0214c5900 (diff) | |
download | qemu-1c46efaa0a175e468772405385ca26a1e35dd94c.zip qemu-1c46efaa0a175e468772405385ca26a1e35dd94c.tar.gz qemu-1c46efaa0a175e468772405385ca26a1e35dd94c.tar.bz2 |
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>
Diffstat (limited to 'block/qcow2.h')
-rw-r--r-- | block/qcow2.h | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/block/qcow2.h b/block/qcow2.h index 01053b7..c59b827 100644 --- a/block/qcow2.h +++ b/block/qcow2.h @@ -196,8 +196,8 @@ void qcow2_encrypt_sectors(BDRVQcowState *s, int64_t sector_num, int nb_sectors, int enc, const AES_KEY *key); -uint64_t qcow2_get_cluster_offset(BlockDriverState *bs, uint64_t offset, - int *num); +int qcow2_get_cluster_offset(BlockDriverState *bs, uint64_t offset, + int *num, uint64_t *cluster_offset); int qcow2_alloc_cluster_offset(BlockDriverState *bs, uint64_t offset, int n_start, int n_end, int *num, QCowL2Meta *m); uint64_t qcow2_alloc_compressed_cluster_offset(BlockDriverState *bs, |