aboutsummaryrefslogtreecommitdiff
path: root/block/backup.c
diff options
context:
space:
mode:
authorVladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>2019-10-01 16:14:07 +0300
committerMax Reitz <mreitz@redhat.com>2019-10-10 10:56:18 +0200
commit0f4b02b73e71cb761bfedcef180c5f10812f2953 (patch)
treec89335a3fb9e016dbf09591c1c0bcdbf2bb37bce /block/backup.c
parent843670f30f35935cfd7781b6a49c258f22261b1d (diff)
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 <vsementsov@virtuozzo.com> Message-id: 20191001131409.14202-4-vsementsov@virtuozzo.com Reviewed-by: Max Reitz <mreitz@redhat.com> Signed-off-by: Max Reitz <mreitz@redhat.com>
Diffstat (limited to 'block/backup.c')
-rw-r--r--block/backup.c6
1 files changed, 4 insertions, 2 deletions
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);