Blame SOURCES/kvm-block-mirror-add-block-job-creation-flags.patch

357786
From 504f6ad36108eb4d710cd1e29694bb4a2bcdb8bd Mon Sep 17 00:00:00 2001
357786
From: John Snow <jsnow@redhat.com>
357786
Date: Mon, 10 Sep 2018 18:17:49 +0200
357786
Subject: [PATCH 11/25] block/mirror: add block job creation flags
357786
357786
RH-Author: John Snow <jsnow@redhat.com>
357786
Message-id: <20180910181803.11781-12-jsnow@redhat.com>
357786
Patchwork-id: 82088
357786
O-Subject: [RHEL-7.6 qemu-kvm-rhev PATCH 11/25] block/mirror: add block job creation flags
357786
Bugzilla: 1626061
357786
RH-Acked-by: Max Reitz <mreitz@redhat.com>
357786
RH-Acked-by: Jeffrey Cody <jcody@redhat.com>
357786
RH-Acked-by: Kevin Wolf <kwolf@redhat.com>
357786
357786
Add support for taking and passing forward job creation flags.
357786
357786
Signed-off-by: John Snow <jsnow@redhat.com>
357786
Reviewed-by: Max Reitz <mreitz@redhat.com>
357786
Reviewed-by: Jeff Cody <jcody@redhat.com>
357786
Message-id: 20180906130225.5118-3-jsnow@redhat.com
357786
Signed-off-by: Max Reitz <mreitz@redhat.com>
357786
(cherry picked from commit bbb6798d0caa79cd4e899b33777c577d0bd04399)
357786
Signed-off-by: John Snow <jsnow@redhat.com>
357786
Signed-off-by: Miroslav Rezanina <mrezanin@redhat.com>
357786
---
357786
 block/mirror.c            | 5 +++--
357786
 blockdev.c                | 3 ++-
357786
 include/block/block_int.h | 5 ++++-
357786
 3 files changed, 9 insertions(+), 4 deletions(-)
357786
357786
diff --git a/block/mirror.c b/block/mirror.c
357786
index 0ab0822..a80c359 100644
357786
--- a/block/mirror.c
357786
+++ b/block/mirror.c
357786
@@ -1270,7 +1270,8 @@ fail:
357786
 
357786
 void mirror_start(const char *job_id, BlockDriverState *bs,
357786
                   BlockDriverState *target, const char *replaces,
357786
-                  int64_t speed, uint32_t granularity, int64_t buf_size,
357786
+                  int creation_flags, int64_t speed,
357786
+                  uint32_t granularity, int64_t buf_size,
357786
                   MirrorSyncMode mode, BlockMirrorBackingMode backing_mode,
357786
                   BlockdevOnError on_source_error,
357786
                   BlockdevOnError on_target_error,
357786
@@ -1285,7 +1286,7 @@ void mirror_start(const char *job_id, BlockDriverState *bs,
357786
     }
357786
     is_none_mode = mode == MIRROR_SYNC_MODE_NONE;
357786
     base = mode == MIRROR_SYNC_MODE_TOP ? backing_bs(bs) : NULL;
357786
-    mirror_start_job(job_id, bs, JOB_DEFAULT, target, replaces,
357786
+    mirror_start_job(job_id, bs, creation_flags, target, replaces,
357786
                      speed, granularity, buf_size, backing_mode,
357786
                      on_source_error, on_target_error, unmap, NULL, NULL,
357786
                      &mirror_job_driver, is_none_mode, base, false,
357786
diff --git a/blockdev.c b/blockdev.c
357786
index 20dbcf5..5d38e17 100644
357786
--- a/blockdev.c
357786
+++ b/blockdev.c
357786
@@ -3746,6 +3746,7 @@ static void blockdev_mirror_common(const char *job_id, BlockDriverState *bs,
357786
                                    const char *filter_node_name,
357786
                                    Error **errp)
357786
 {
357786
+    int job_flags = JOB_DEFAULT;
357786
 
357786
     if (!has_speed) {
357786
         speed = 0;
357786
@@ -3795,7 +3796,7 @@ static void blockdev_mirror_common(const char *job_id, BlockDriverState *bs,
357786
      * and will allow to check whether the node still exist at mirror completion
357786
      */
357786
     mirror_start(job_id, bs, target,
357786
-                 has_replaces ? replaces : NULL,
357786
+                 has_replaces ? replaces : NULL, job_flags,
357786
                  speed, granularity, buf_size, sync, backing_mode,
357786
                  on_source_error, on_target_error, unmap, filter_node_name,
357786
                  errp);
357786
diff --git a/include/block/block_int.h b/include/block/block_int.h
357786
index 25ad363..07517cf 100644
357786
--- a/include/block/block_int.h
357786
+++ b/include/block/block_int.h
357786
@@ -1000,6 +1000,8 @@ void commit_active_start(const char *job_id, BlockDriverState *bs,
357786
  * @target: Block device to write to.
357786
  * @replaces: Block graph node name to replace once the mirror is done. Can
357786
  *            only be used when full mirroring is selected.
357786
+ * @creation_flags: Flags that control the behavior of the Job lifetime.
357786
+ *                  See @BlockJobCreateFlags
357786
  * @speed: The maximum speed, in bytes per second, or 0 for unlimited.
357786
  * @granularity: The chosen granularity for the dirty bitmap.
357786
  * @buf_size: The amount of data that can be in flight at one time.
357786
@@ -1020,7 +1022,8 @@ void commit_active_start(const char *job_id, BlockDriverState *bs,
357786
  */
357786
 void mirror_start(const char *job_id, BlockDriverState *bs,
357786
                   BlockDriverState *target, const char *replaces,
357786
-                  int64_t speed, uint32_t granularity, int64_t buf_size,
357786
+                  int creation_flags, int64_t speed,
357786
+                  uint32_t granularity, int64_t buf_size,
357786
                   MirrorSyncMode mode, BlockMirrorBackingMode backing_mode,
357786
                   BlockdevOnError on_source_error,
357786
                   BlockdevOnError on_target_error,
357786
-- 
357786
1.8.3.1
357786