summaryrefslogtreecommitdiff
path: root/block/qcow2-refcount.c
diff options
context:
space:
mode:
authorMax Reitz <mreitz@redhat.com>2017-06-13 22:21:05 +0200
committerMax Reitz <mreitz@redhat.com>2017-07-11 17:45:02 +0200
commit772d1f973f87269f6a4a4ea4b880680f3779bbdf (patch)
treea9344e1c6ee3050763ec568c4e0a23c5f677606a /block/qcow2-refcount.c
parent60c48a29b75f3e1276bb046186476674bbc74de9 (diff)
downloadqemu-772d1f973f87269f6a4a4ea4b880680f3779bbdf.tar.gz
block/qcow2: falloc/full preallocating growth
Implement the preallocation modes falloc and full for growing qcow2 images. Signed-off-by: Max Reitz <mreitz@redhat.com> Message-id: 20170613202107.10125-15-mreitz@redhat.com Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com> Signed-off-by: Max Reitz <mreitz@redhat.com>
Diffstat (limited to 'block/qcow2-refcount.c')
-rw-r--r--block/qcow2-refcount.c12
1 files changed, 4 insertions, 8 deletions
diff --git a/block/qcow2-refcount.c b/block/qcow2-refcount.c
index 1aca6455f7..c9b0dcb4f3 100644
--- a/block/qcow2-refcount.c
+++ b/block/qcow2-refcount.c
@@ -34,10 +34,6 @@ static int64_t alloc_clusters_noref(BlockDriverState *bs, uint64_t size);
static int QEMU_WARN_UNUSED_RESULT update_refcount(BlockDriverState *bs,
int64_t offset, int64_t length, uint64_t addend,
bool decrease, enum qcow2_discard_type type);
-static int64_t qcow2_refcount_area(BlockDriverState *bs, uint64_t offset,
- uint64_t additional_clusters,
- bool exact_size, int new_refblock_index,
- uint64_t new_refblock_offset);
static uint64_t get_refcount_ro0(const void *refcount_array, uint64_t index);
static uint64_t get_refcount_ro1(const void *refcount_array, uint64_t index);
@@ -517,10 +513,10 @@ fail:
* Returns: The offset after the new refcount structures (i.e. where the
* @additional_clusters may be placed) on success, -errno on error.
*/
-static int64_t qcow2_refcount_area(BlockDriverState *bs, uint64_t start_offset,
- uint64_t additional_clusters,
- bool exact_size, int new_refblock_index,
- uint64_t new_refblock_offset)
+int64_t qcow2_refcount_area(BlockDriverState *bs, uint64_t start_offset,
+ uint64_t additional_clusters, bool exact_size,
+ int new_refblock_index,
+ uint64_t new_refblock_offset)
{
BDRVQcow2State *s = bs->opaque;
uint64_t total_refblock_count_u64, additional_refblock_count;