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

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