diff options
author | John Snow <jsnow@redhat.com> | 2016-10-27 12:06:57 -0400 |
---|---|---|
committer | Jeff Cody <jcody@redhat.com> | 2016-11-01 07:55:57 -0400 |
commit | 47970dfb0a611f6468a0ba44781b4610525d1af1 (patch) | |
tree | 392c59e1601b8ab977243240941e8d4fc25a5896 /block/mirror.c | |
parent | f81e0b453275f7b59a4018093eb93d2173790665 (diff) | |
download | qemu-47970dfb0a611f6468a0ba44781b4610525d1af1.zip qemu-47970dfb0a611f6468a0ba44781b4610525d1af1.tar.gz qemu-47970dfb0a611f6468a0ba44781b4610525d1af1.tar.bz2 |
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>
Diffstat (limited to 'block/mirror.c')
-rw-r--r-- | block/mirror.c | 21 |
1 files changed, 10 insertions, 11 deletions
diff --git a/block/mirror.c b/block/mirror.c index e9fba9b..fa41849 100644 --- a/block/mirror.c +++ b/block/mirror.c @@ -937,9 +937,9 @@ static const BlockJobDriver commit_active_job_driver = { }; static void mirror_start_job(const char *job_id, BlockDriverState *bs, - BlockDriverState *target, const char *replaces, - int64_t speed, uint32_t granularity, - int64_t buf_size, + int creation_flags, BlockDriverState *target, + const char *replaces, int64_t speed, + uint32_t granularity, int64_t buf_size, BlockMirrorBackingMode backing_mode, BlockdevOnError on_source_error, BlockdevOnError on_target_error, @@ -967,8 +967,8 @@ static void mirror_start_job(const char *job_id, BlockDriverState *bs, buf_size = DEFAULT_MIRROR_BUF_SIZE; } - s = block_job_create(job_id, driver, bs, speed, - BLOCK_JOB_DEFAULT, cb, opaque, errp); + s = block_job_create(job_id, driver, bs, speed, creation_flags, + cb, opaque, errp); if (!s) { return; } @@ -1031,17 +1031,16 @@ void mirror_start(const char *job_id, BlockDriverState *bs, } is_none_mode = mode == MIRROR_SYNC_MODE_NONE; base = mode == MIRROR_SYNC_MODE_TOP ? backing_bs(bs) : NULL; - mirror_start_job(job_id, bs, target, replaces, + mirror_start_job(job_id, bs, BLOCK_JOB_DEFAULT, target, replaces, speed, granularity, buf_size, backing_mode, on_source_error, on_target_error, unmap, cb, opaque, errp, &mirror_job_driver, is_none_mode, base, false); } void commit_active_start(const char *job_id, BlockDriverState *bs, - BlockDriverState *base, int64_t speed, - BlockdevOnError on_error, - BlockCompletionFunc *cb, - void *opaque, Error **errp, + BlockDriverState *base, int creation_flags, + int64_t speed, BlockdevOnError on_error, + BlockCompletionFunc *cb, void *opaque, Error **errp, bool auto_complete) { int64_t length, base_length; @@ -1080,7 +1079,7 @@ void commit_active_start(const char *job_id, BlockDriverState *bs, } } - mirror_start_job(job_id, bs, base, NULL, speed, 0, 0, + mirror_start_job(job_id, bs, creation_flags, base, NULL, speed, 0, 0, MIRROR_LEAVE_BACKING_CHAIN, on_error, on_error, true, cb, opaque, &local_err, &commit_active_job_driver, false, base, auto_complete); |