From 0f4b02b73e71cb761bfedcef180c5f10812f2953 Mon Sep 17 00:00:00 2001 From: Vladimir Sementsov-Ogievskiy Date: Tue, 1 Oct 2019 16:14:07 +0300 Subject: block/block-copy: split block_copy_set_callbacks function Split block_copy_set_callbacks out of block_copy_state_new. It's needed for further commit: block-copy will use BdrvChildren of backup-top filter, so it will be created from backup-top filter creation function. But callbacks will still belong to backup job and will be set in separate. Signed-off-by: Vladimir Sementsov-Ogievskiy Message-id: 20191001131409.14202-4-vsementsov@virtuozzo.com Reviewed-by: Max Reitz Signed-off-by: Max Reitz --- block/backup.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'block/backup.c') diff --git a/block/backup.c b/block/backup.c index b5b7939356..1057ed0a4e 100644 --- a/block/backup.c +++ b/block/backup.c @@ -478,8 +478,7 @@ BlockJob *backup_job_create(const char *job_id, BlockDriverState *bs, job->bitmap_mode = bitmap_mode; job->bcs = block_copy_state_new(bs, target, cluster_size, write_flags, - backup_progress_bytes_callback, - backup_progress_reset_callback, job, errp); + errp); if (!job->bcs) { goto error; } @@ -487,6 +486,9 @@ BlockJob *backup_job_create(const char *job_id, BlockDriverState *bs, job->cluster_size = cluster_size; job->len = len; + block_copy_set_callbacks(job->bcs, backup_progress_bytes_callback, + backup_progress_reset_callback, job); + /* Required permissions are already taken by block-copy-state target */ block_job_add_bdrv(&job->common, "target", target, 0, BLK_PERM_ALL, &error_abort); -- cgit v1.2.3