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

383d26
From 360e16997de84bddd37f5262f33d98b96b8aae2f Mon Sep 17 00:00:00 2001
383d26
From: John Snow <jsnow@redhat.com>
383d26
Date: Mon, 10 Sep 2018 18:17:50 +0200
383d26
Subject: [PATCH 12/25] block/stream: add block job creation flags
383d26
383d26
RH-Author: John Snow <jsnow@redhat.com>
383d26
Message-id: <20180910181803.11781-13-jsnow@redhat.com>
383d26
Patchwork-id: 82089
383d26
O-Subject: [RHEL-7.6 qemu-kvm-rhev PATCH 12/25] block/stream: add block job creation flags
383d26
Bugzilla: 1626061
383d26
RH-Acked-by: Max Reitz <mreitz@redhat.com>
383d26
RH-Acked-by: Jeffrey Cody <jcody@redhat.com>
383d26
RH-Acked-by: Kevin Wolf <kwolf@redhat.com>
383d26
383d26
Add support for taking and passing forward job creation flags.
383d26
383d26
Signed-off-by: John Snow <jsnow@redhat.com>
383d26
Reviewed-by: Max Reitz <mreitz@redhat.com>
383d26
Reviewed-by: Jeff Cody <jcody@redhat.com>
383d26
Message-id: 20180906130225.5118-4-jsnow@redhat.com
383d26
Signed-off-by: Max Reitz <mreitz@redhat.com>
383d26
(cherry picked from commit 764cffd288722a4799e7cae0eb679d80fd636fdc)
383d26
Signed-off-by: John Snow <jsnow@redhat.com>
383d26
Signed-off-by: Miroslav Rezanina <mrezanin@redhat.com>
383d26
---
383d26
 block/stream.c            | 5 +++--
383d26
 blockdev.c                | 3 ++-
383d26
 include/block/block_int.h | 5 ++++-
383d26
 3 files changed, 9 insertions(+), 4 deletions(-)
383d26
383d26
diff --git a/block/stream.c b/block/stream.c
383d26
index 67e1e72..700eb23 100644
383d26
--- a/block/stream.c
383d26
+++ b/block/stream.c
383d26
@@ -214,7 +214,8 @@ static const BlockJobDriver stream_job_driver = {
383d26
 
383d26
 void stream_start(const char *job_id, BlockDriverState *bs,
383d26
                   BlockDriverState *base, const char *backing_file_str,
383d26
-                  int64_t speed, BlockdevOnError on_error, Error **errp)
383d26
+                  int creation_flags, int64_t speed,
383d26
+                  BlockdevOnError on_error, Error **errp)
383d26
 {
383d26
     StreamBlockJob *s;
383d26
     BlockDriverState *iter;
383d26
@@ -236,7 +237,7 @@ void stream_start(const char *job_id, BlockDriverState *bs,
383d26
                          BLK_PERM_GRAPH_MOD,
383d26
                          BLK_PERM_CONSISTENT_READ | BLK_PERM_WRITE_UNCHANGED |
383d26
                          BLK_PERM_WRITE,
383d26
-                         speed, JOB_DEFAULT, NULL, NULL, errp);
383d26
+                         speed, creation_flags, NULL, NULL, errp);
383d26
     if (!s) {
383d26
         goto fail;
383d26
     }
383d26
diff --git a/blockdev.c b/blockdev.c
383d26
index 5d38e17..c4a1801 100644
383d26
--- a/blockdev.c
383d26
+++ b/blockdev.c
383d26
@@ -3280,6 +3280,7 @@ void qmp_block_stream(bool has_job_id, const char *job_id, const char *device,
383d26
     AioContext *aio_context;
383d26
     Error *local_err = NULL;
383d26
     const char *base_name = NULL;
383d26
+    int job_flags = JOB_DEFAULT;
383d26
 
383d26
     if (!has_on_error) {
383d26
         on_error = BLOCKDEV_ON_ERROR_REPORT;
383d26
@@ -3342,7 +3343,7 @@ void qmp_block_stream(bool has_job_id, const char *job_id, const char *device,
383d26
     base_name = has_backing_file ? backing_file : base_name;
383d26
 
383d26
     stream_start(has_job_id ? job_id : NULL, bs, base_bs, base_name,
383d26
-                 has_speed ? speed : 0, on_error, &local_err);
383d26
+                 job_flags, has_speed ? speed : 0, on_error, &local_err);
383d26
     if (local_err) {
383d26
         error_propagate(errp, local_err);
383d26
         goto out;
383d26
diff --git a/include/block/block_int.h b/include/block/block_int.h
383d26
index 07517cf..341cbe8 100644
383d26
--- a/include/block/block_int.h
383d26
+++ b/include/block/block_int.h
383d26
@@ -929,6 +929,8 @@ int is_windows_drive(const char *filename);
383d26
  * flatten the whole backing file chain onto @bs.
383d26
  * @backing_file_str: The file name that will be written to @bs as the
383d26
  * the new backing file if the job completes. Ignored if @base is %NULL.
383d26
+ * @creation_flags: Flags that control the behavior of the Job lifetime.
383d26
+ *                  See @BlockJobCreateFlags
383d26
  * @speed: The maximum speed, in bytes per second, or 0 for unlimited.
383d26
  * @on_error: The action to take upon error.
383d26
  * @errp: Error object.
383d26
@@ -942,7 +944,8 @@ int is_windows_drive(const char *filename);
383d26
  */
383d26
 void stream_start(const char *job_id, BlockDriverState *bs,
383d26
                   BlockDriverState *base, const char *backing_file_str,
383d26
-                  int64_t speed, BlockdevOnError on_error, Error **errp);
383d26
+                  int creation_flags, int64_t speed,
383d26
+                  BlockdevOnError on_error, Error **errp);
383d26
 
383d26
 /**
383d26
  * commit_start:
383d26
-- 
383d26
1.8.3.1
383d26