[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-block] [PULL 02/42] block/mirror: add block job creation flags
From: |
Max Reitz |
Subject: |
[Qemu-block] [PULL 02/42] block/mirror: add block job creation flags |
Date: |
Tue, 25 Sep 2018 17:15:01 +0200 |
From: John Snow <address@hidden>
Add support for taking and passing forward job creation flags.
Signed-off-by: John Snow <address@hidden>
Reviewed-by: Max Reitz <address@hidden>
Reviewed-by: Jeff Cody <address@hidden>
Message-id: address@hidden
Signed-off-by: Max Reitz <address@hidden>
---
include/block/block_int.h | 5 ++++-
block/mirror.c | 5 +++--
blockdev.c | 3 ++-
3 files changed, 9 insertions(+), 4 deletions(-)
diff --git a/include/block/block_int.h b/include/block/block_int.h
index ffab0b4d3e..b40f0bfc9b 100644
--- a/include/block/block_int.h
+++ b/include/block/block_int.h
@@ -1029,6 +1029,8 @@ void commit_active_start(const char *job_id,
BlockDriverState *bs,
* @target: Block device to write to.
* @replaces: Block graph node name to replace once the mirror is done. Can
* only be used when full mirroring is selected.
+ * @creation_flags: Flags that control the behavior of the Job lifetime.
+ * See @BlockJobCreateFlags
* @speed: The maximum speed, in bytes per second, or 0 for unlimited.
* @granularity: The chosen granularity for the dirty bitmap.
* @buf_size: The amount of data that can be in flight at one time.
@@ -1050,7 +1052,8 @@ void commit_active_start(const char *job_id,
BlockDriverState *bs,
*/
void mirror_start(const char *job_id, BlockDriverState *bs,
BlockDriverState *target, const char *replaces,
- int64_t speed, uint32_t granularity, int64_t buf_size,
+ int creation_flags, int64_t speed,
+ uint32_t granularity, int64_t buf_size,
MirrorSyncMode mode, BlockMirrorBackingMode backing_mode,
BlockdevOnError on_source_error,
BlockdevOnError on_target_error,
diff --git a/block/mirror.c b/block/mirror.c
index b8941db6c1..cba555b4ef 100644
--- a/block/mirror.c
+++ b/block/mirror.c
@@ -1639,7 +1639,8 @@ fail:
void mirror_start(const char *job_id, BlockDriverState *bs,
BlockDriverState *target, const char *replaces,
- int64_t speed, uint32_t granularity, int64_t buf_size,
+ int creation_flags, int64_t speed,
+ uint32_t granularity, int64_t buf_size,
MirrorSyncMode mode, BlockMirrorBackingMode backing_mode,
BlockdevOnError on_source_error,
BlockdevOnError on_target_error,
@@ -1655,7 +1656,7 @@ 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, JOB_DEFAULT, target, replaces,
+ mirror_start_job(job_id, bs, creation_flags, target, replaces,
speed, granularity, buf_size, backing_mode,
on_source_error, on_target_error, unmap, NULL, NULL,
&mirror_job_driver, is_none_mode, base, false,
diff --git a/blockdev.c b/blockdev.c
index c15a1e624b..6574356708 100644
--- a/blockdev.c
+++ b/blockdev.c
@@ -3590,6 +3590,7 @@ static void blockdev_mirror_common(const char *job_id,
BlockDriverState *bs,
bool has_copy_mode, MirrorCopyMode
copy_mode,
Error **errp)
{
+ int job_flags = JOB_DEFAULT;
if (!has_speed) {
speed = 0;
@@ -3642,7 +3643,7 @@ static void blockdev_mirror_common(const char *job_id,
BlockDriverState *bs,
* and will allow to check whether the node still exist at mirror
completion
*/
mirror_start(job_id, bs, target,
- has_replaces ? replaces : NULL,
+ has_replaces ? replaces : NULL, job_flags,
speed, granularity, buf_size, sync, backing_mode,
on_source_error, on_target_error, unmap, filter_node_name,
copy_mode, errp);
--
2.17.1
- [Qemu-block] [PULL 00/42] Block patches, Max Reitz, 2018/09/25
- [Qemu-block] [PULL 03/42] block/stream: add block job creation flags, Max Reitz, 2018/09/25
- [Qemu-block] [PULL 01/42] block/commit: add block job creation flags, Max Reitz, 2018/09/25
- [Qemu-block] [PULL 05/42] block/mirror: don't install backing chain on abort, Max Reitz, 2018/09/25
- [Qemu-block] [PULL 04/42] block/commit: refactor commit to use job callbacks, Max Reitz, 2018/09/25
- [Qemu-block] [PULL 02/42] block/mirror: add block job creation flags,
Max Reitz <=
- [Qemu-block] [PULL 06/42] block/mirror: conservative mirror_exit refactor, Max Reitz, 2018/09/25
- [Qemu-block] [PULL 07/42] block/stream: refactor stream to use job callbacks, Max Reitz, 2018/09/25
- [Qemu-block] [PULL 08/42] tests/blockjob: replace Blockjob with Job, Max Reitz, 2018/09/25
- [Qemu-block] [PULL 10/42] tests/test-blockjob-txn: move .exit to .clean, Max Reitz, 2018/09/25
- [Qemu-block] [PULL 09/42] tests/test-blockjob: remove exit callback, Max Reitz, 2018/09/25
- [Qemu-block] [PULL 12/42] qapi/block-commit: expose new job properties, Max Reitz, 2018/09/25
- [Qemu-block] [PULL 11/42] jobs: remove .exit callback, Max Reitz, 2018/09/25
- [Qemu-block] [PULL 16/42] blockdev: document transactional shortcomings, Max Reitz, 2018/09/25
- [Qemu-block] [PULL 13/42] qapi/block-mirror: expose new job properties, Max Reitz, 2018/09/25
- [Qemu-block] [PULL 15/42] block/backup: qapi documentation fixup, Max Reitz, 2018/09/25