summaryrefslogtreecommitdiff
path: root/block/qcow2.h
diff options
context:
space:
mode:
authorKevin Wolf <kwolf@redhat.com>2014-03-26 13:05:51 +0100
committerStefan Hajnoczi <stefanha@redhat.com>2014-04-01 15:22:34 +0200
commitbb572aefbdac290363bfa5ca0e810ccce0a14ed6 (patch)
tree8c7ce9ef37f114ce146c7c9dc39fc89ce3bc27bd /block/qcow2.h
parent2b5d5953eec0cc541857c3df812bdf8421596ab2 (diff)
downloadqemu-bb572aefbdac290363bfa5ca0e810ccce0a14ed6.tar.gz
qcow2: Fix types in qcow2_alloc_clusters and alloc_clusters_noref
In order to avoid integer overflows. Signed-off-by: Kevin Wolf <kwolf@redhat.com> Reviewed-by: Max Reitz <mreitz@redhat.com> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Diffstat (limited to 'block/qcow2.h')
-rw-r--r--block/qcow2.h6
1 files changed, 3 insertions, 3 deletions
diff --git a/block/qcow2.h b/block/qcow2.h
index 4015373bb0..364946545d 100644
--- a/block/qcow2.h
+++ b/block/qcow2.h
@@ -222,8 +222,8 @@ typedef struct BDRVQcowState {
uint64_t *refcount_table;
uint64_t refcount_table_offset;
uint32_t refcount_table_size;
- int64_t free_cluster_index;
- int64_t free_byte_offset;
+ uint64_t free_cluster_index;
+ uint64_t free_byte_offset;
CoMutex lock;
@@ -467,7 +467,7 @@ void qcow2_refcount_close(BlockDriverState *bs);
int qcow2_update_cluster_refcount(BlockDriverState *bs, int64_t cluster_index,
int addend, enum qcow2_discard_type type);
-int64_t qcow2_alloc_clusters(BlockDriverState *bs, int64_t size);
+int64_t qcow2_alloc_clusters(BlockDriverState *bs, uint64_t size);
int qcow2_alloc_clusters_at(BlockDriverState *bs, uint64_t offset,
int nb_clusters);
int64_t qcow2_alloc_bytes(BlockDriverState *bs, int size);