diff options
author | Max Reitz <mreitz@redhat.com> | 2017-06-13 22:21:03 +0200 |
---|---|---|
committer | Max Reitz <mreitz@redhat.com> | 2017-07-11 17:45:02 +0200 |
commit | 12cc30a8cbdbb4c9c90cbffb970dfa679a1e3212 (patch) | |
tree | c11d287f068c09839334b15e1a0ab1934d35f3a6 /block/qcow2.h | |
parent | 95b98f343b054e100a905181cd140c653c80cbad (diff) |
block/qcow2: Add qcow2_refcount_area()
This function creates a collection of self-describing refcount
structures (including a new refcount table) at the end of a qcow2 image
file. Optionally, these structures can also describe a number of
additional clusters beyond themselves; this will be important for
preallocated truncation, which will place the data clusters and L2
tables there.
For now, we can use this function to replace the part of
alloc_refcount_block() that grows the refcount table (from which it is
actually derived).
Signed-off-by: Max Reitz <mreitz@redhat.com>
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
Message-id: 20170613202107.10125-13-mreitz@redhat.com
Signed-off-by: Max Reitz <mreitz@redhat.com>
Diffstat (limited to 'block/qcow2.h')
-rw-r--r-- | block/qcow2.h | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/block/qcow2.h b/block/qcow2.h index 2df05ac8dd..3854080725 100644 --- a/block/qcow2.h +++ b/block/qcow2.h @@ -525,6 +525,10 @@ static inline uint64_t refcount_diff(uint64_t r1, uint64_t r2) int qcow2_backing_read1(BlockDriverState *bs, QEMUIOVector *qiov, int64_t sector_num, int nb_sectors); +int64_t qcow2_refcount_metadata_size(int64_t clusters, size_t cluster_size, + int refcount_order, bool generous_increase, + uint64_t *refblock_count); + int qcow2_mark_dirty(BlockDriverState *bs); int qcow2_mark_corrupt(BlockDriverState *bs); int qcow2_mark_consistent(BlockDriverState *bs); |