mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-04 08:13:54 -06:00
Replication/Blockjobs: Create replication jobs as internal
Bubble up the internal interface to commit and backup jobs, then switch replication tasks over to using this methodology. Signed-off-by: John Snow <jsnow@redhat.com> Reviewed-by: Kevin Wolf <kwolf@redhat.com> Reviewed-by: Jeff Cody <jcody@redhat.com> Message-id: 1477584421-1399-4-git-send-email-jsnow@redhat.com Signed-off-by: Jeff Cody <jcody@redhat.com>
This commit is contained in:
parent
f81e0b4532
commit
47970dfb0a
6 changed files with 36 additions and 27 deletions
|
@ -508,10 +508,11 @@ static void replication_start(ReplicationState *rs, ReplicationMode mode,
|
|||
bdrv_op_block_all(top_bs, s->blocker);
|
||||
bdrv_op_unblock(top_bs, BLOCK_OP_TYPE_DATAPLANE, s->blocker);
|
||||
|
||||
backup_start("replication-backup", s->secondary_disk->bs,
|
||||
s->hidden_disk->bs, 0, MIRROR_SYNC_MODE_NONE, NULL, false,
|
||||
backup_start(NULL, s->secondary_disk->bs, s->hidden_disk->bs, 0,
|
||||
MIRROR_SYNC_MODE_NONE, NULL, false,
|
||||
BLOCKDEV_ON_ERROR_REPORT, BLOCKDEV_ON_ERROR_REPORT,
|
||||
backup_job_completed, bs, NULL, &local_err);
|
||||
BLOCK_JOB_INTERNAL, backup_job_completed, bs,
|
||||
NULL, &local_err);
|
||||
if (local_err) {
|
||||
error_propagate(errp, local_err);
|
||||
backup_job_cleanup(bs);
|
||||
|
@ -633,10 +634,9 @@ static void replication_stop(ReplicationState *rs, bool failover, Error **errp)
|
|||
}
|
||||
|
||||
s->replication_state = BLOCK_REPLICATION_FAILOVER;
|
||||
commit_active_start("replication-commit", s->active_disk->bs,
|
||||
s->secondary_disk->bs, 0, BLOCKDEV_ON_ERROR_REPORT,
|
||||
replication_done,
|
||||
bs, errp, true);
|
||||
commit_active_start(NULL, s->active_disk->bs, s->secondary_disk->bs,
|
||||
BLOCK_JOB_INTERNAL, 0, BLOCKDEV_ON_ERROR_REPORT,
|
||||
replication_done, bs, errp, true);
|
||||
break;
|
||||
default:
|
||||
aio_context_release(aio_context);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue