job: Move completion and cancellation to Job

This moves the top-level job completion and cancellation functions from
BlockJob to Job.

Signed-off-by: Kevin Wolf <kwolf@redhat.com>
This commit is contained in:
Kevin Wolf 2018-04-24 16:13:52 +02:00
parent 7eaa8fb57d
commit 3d70ff53b6
18 changed files with 171 additions and 209 deletions

View file

@ -145,7 +145,7 @@ static void replication_close(BlockDriverState *bs)
replication_stop(s->rs, false, NULL);
}
if (s->stage == BLOCK_REPLICATION_FAILOVER) {
block_job_cancel_sync(s->active_disk->bs->job);
job_cancel_sync(&s->active_disk->bs->job->job);
}
if (s->mode == REPLICATION_MODE_SECONDARY) {
@ -681,7 +681,7 @@ static void replication_stop(ReplicationState *rs, bool failover, Error **errp)
* disk, secondary disk in backup_job_completed().
*/
if (s->secondary_disk->bs->job) {
block_job_cancel_sync(s->secondary_disk->bs->job);
job_cancel_sync(&s->secondary_disk->bs->job->job);
}
if (!failover) {