aboutsummaryrefslogtreecommitdiff
path: root/block/backup.c
diff options
context:
space:
mode:
authorVladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>2019-08-29 12:09:53 +0300
committerKevin Wolf <kwolf@redhat.com>2019-09-10 08:58:43 +0200
commitbb0c94099382b52734a4a4f3c060e90c9a2ac6cf (patch)
treeac02b2959676479a50414ee2144fc433681526b1 /block/backup.c
parentb70d08205b2e4044c529eefc21df2c8ab61b473b (diff)
job: drop job_drain
In job_finish_sync job_enter should be enough for a job to make some progress and draining is a wrong tool for it. So use job_enter directly here and drop job_drain with all related staff not used more. Suggested-by: Kevin Wolf <kwolf@redhat.com> Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com> Tested-by: John Snow <jsnow@redhat.com> Reviewed-by: John Snow <jsnow@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Diffstat (limited to 'block/backup.c')
-rw-r--r--block/backup.c19
1 files changed, 1 insertions, 18 deletions
diff --git a/block/backup.c b/block/backup.c
index 03637aeb11..763f0d7ff6 100644
--- a/block/backup.c
+++ b/block/backup.c
@@ -425,21 +425,6 @@ void backup_do_checkpoint(BlockJob *job, Error **errp)
bdrv_set_dirty_bitmap(backup_job->copy_bitmap, 0, backup_job->len);
}
-static void backup_drain(BlockJob *job)
-{
- BackupBlockJob *s = container_of(job, BackupBlockJob, common);
-
- /* Need to keep a reference in case blk_drain triggers execution
- * of backup_complete...
- */
- if (s->target) {
- BlockBackend *target = s->target;
- blk_ref(target);
- blk_drain(target);
- blk_unref(target);
- }
-}
-
static BlockErrorAction backup_error_action(BackupBlockJob *job,
bool read, int error)
{
@@ -588,13 +573,11 @@ static const BlockJobDriver backup_job_driver = {
.job_type = JOB_TYPE_BACKUP,
.free = block_job_free,
.user_resume = block_job_user_resume,
- .drain = block_job_drain,
.run = backup_run,
.commit = backup_commit,
.abort = backup_abort,
.clean = backup_clean,
- },
- .drain = backup_drain,
+ }
};
static int64_t backup_calculate_cluster_size(BlockDriverState *target,