yeahuh / rpms / qemu-kvm

Forked from rpms/qemu-kvm 2 years ago
Clone
26ba25
From fa82fe1be0413e2dbc453aa5a2a930218e915907 Mon Sep 17 00:00:00 2001
26ba25
From: John Snow <jsnow@redhat.com>
26ba25
Date: Tue, 24 Jul 2018 13:01:08 +0200
26ba25
Subject: [PATCH 238/268] block: split flags in copy_range
26ba25
26ba25
RH-Author: John Snow <jsnow@redhat.com>
26ba25
Message-id: <20180718225511.14878-21-jsnow@redhat.com>
26ba25
Patchwork-id: 81415
26ba25
O-Subject: [RHEL-7.6 qemu-kvm-rhev PATCH 20/35] block: split flags in copy_range
26ba25
Bugzilla: 1207657
26ba25
RH-Acked-by: Eric Blake <eblake@redhat.com>
26ba25
RH-Acked-by: Stefan Hajnoczi <stefanha@redhat.com>
26ba25
RH-Acked-by: Fam Zheng <famz@redhat.com>
26ba25
26ba25
From: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
26ba25
26ba25
Pass read flags and write flags separately. This is needed to handle
26ba25
coming BDRV_REQ_NO_SERIALISING clearly in following patches.
26ba25
26ba25
Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
26ba25
Reviewed-by: Fam Zheng <famz@redhat.com>
26ba25
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
26ba25
(cherry picked from commit 67b51fb998c697afb5d744066fcbde53e04fe941)
26ba25
Signed-off-by: John Snow <jsnow@redhat.com>
26ba25
---
26ba25
 block/backup.c                 |  2 +-
26ba25
 block/block-backend.c          |  5 +++--
26ba25
 block/file-posix.c             | 21 +++++++++++--------
26ba25
 block/io.c                     | 46 +++++++++++++++++++++++-------------------
26ba25
 block/iscsi.c                  |  9 ++++++---
26ba25
 block/qcow2.c                  | 20 +++++++++---------
26ba25
 block/raw-format.c             | 24 ++++++++++++++--------
26ba25
 include/block/block.h          |  3 ++-
26ba25
 include/block/block_int.h      | 14 +++++++++----
26ba25
 include/sysemu/block-backend.h |  3 ++-
26ba25
 qemu-img.c                     |  2 +-
26ba25
 11 files changed, 90 insertions(+), 59 deletions(-)
26ba25
26ba25
diff --git a/block/backup.c b/block/backup.c
26ba25
index adb3cbd..369155a 100644
26ba25
--- a/block/backup.c
26ba25
+++ b/block/backup.c
26ba25
@@ -163,7 +163,7 @@ static int coroutine_fn backup_cow_with_offload(BackupBlockJob *job,
26ba25
     hbitmap_reset(job->copy_bitmap, start / job->cluster_size,
26ba25
                   nr_clusters);
26ba25
     ret = blk_co_copy_range(blk, start, job->target, start, nbytes,
26ba25
-                            is_write_notifier ? BDRV_REQ_NO_SERIALISING : 0);
26ba25
+                            is_write_notifier ? BDRV_REQ_NO_SERIALISING : 0, 0);
26ba25
     if (ret < 0) {
26ba25
         trace_backup_do_cow_copy_range_fail(job, start, ret);
26ba25
         hbitmap_set(job->copy_bitmap, start / job->cluster_size,
26ba25
diff --git a/block/block-backend.c b/block/block-backend.c
26ba25
index f34e4c3..3554b7e 100644
26ba25
--- a/block/block-backend.c
26ba25
+++ b/block/block-backend.c
26ba25
@@ -2225,7 +2225,8 @@ void blk_unregister_buf(BlockBackend *blk, void *host)
26ba25
 
26ba25
 int coroutine_fn blk_co_copy_range(BlockBackend *blk_in, int64_t off_in,
26ba25
                                    BlockBackend *blk_out, int64_t off_out,
26ba25
-                                   int bytes, BdrvRequestFlags flags)
26ba25
+                                   int bytes, BdrvRequestFlags read_flags,
26ba25
+                                   BdrvRequestFlags write_flags)
26ba25
 {
26ba25
     int r;
26ba25
     r = blk_check_byte_request(blk_in, off_in, bytes);
26ba25
@@ -2238,5 +2239,5 @@ int coroutine_fn blk_co_copy_range(BlockBackend *blk_in, int64_t off_in,
26ba25
     }
26ba25
     return bdrv_co_copy_range(blk_in->root, off_in,
26ba25
                               blk_out->root, off_out,
26ba25
-                              bytes, flags);
26ba25
+                              bytes, read_flags, write_flags);
26ba25
 }
26ba25
diff --git a/block/file-posix.c b/block/file-posix.c
26ba25
index 06ec67d..c12cdb7 100644
26ba25
--- a/block/file-posix.c
26ba25
+++ b/block/file-posix.c
26ba25
@@ -2476,18 +2476,23 @@ static void raw_abort_perm_update(BlockDriverState *bs)
26ba25
     raw_handle_perm_lock(bs, RAW_PL_ABORT, 0, 0, NULL);
26ba25
 }
26ba25
 
26ba25
-static int coroutine_fn raw_co_copy_range_from(BlockDriverState *bs,
26ba25
-                                               BdrvChild *src, uint64_t src_offset,
26ba25
-                                               BdrvChild *dst, uint64_t dst_offset,
26ba25
-                                               uint64_t bytes, BdrvRequestFlags flags)
26ba25
+static int coroutine_fn raw_co_copy_range_from(
26ba25
+        BlockDriverState *bs, BdrvChild *src, uint64_t src_offset,
26ba25
+        BdrvChild *dst, uint64_t dst_offset, uint64_t bytes,
26ba25
+        BdrvRequestFlags read_flags, BdrvRequestFlags write_flags)
26ba25
 {
26ba25
-    return bdrv_co_copy_range_to(src, src_offset, dst, dst_offset, bytes, flags);
26ba25
+    return bdrv_co_copy_range_to(src, src_offset, dst, dst_offset, bytes,
26ba25
+                                 read_flags, write_flags);
26ba25
 }
26ba25
 
26ba25
 static int coroutine_fn raw_co_copy_range_to(BlockDriverState *bs,
26ba25
-                                             BdrvChild *src, uint64_t src_offset,
26ba25
-                                             BdrvChild *dst, uint64_t dst_offset,
26ba25
-                                             uint64_t bytes, BdrvRequestFlags flags)
26ba25
+                                             BdrvChild *src,
26ba25
+                                             uint64_t src_offset,
26ba25
+                                             BdrvChild *dst,
26ba25
+                                             uint64_t dst_offset,
26ba25
+                                             uint64_t bytes,
26ba25
+                                             BdrvRequestFlags read_flags,
26ba25
+                                             BdrvRequestFlags write_flags)
26ba25
 {
26ba25
     BDRVRawState *s = bs->opaque;
26ba25
     BDRVRawState *src_s;
26ba25
diff --git a/block/io.c b/block/io.c
26ba25
index f8de42f..2d04289 100644
26ba25
--- a/block/io.c
26ba25
+++ b/block/io.c
26ba25
@@ -2841,13 +2841,11 @@ void bdrv_unregister_buf(BlockDriverState *bs, void *host)
26ba25
     }
26ba25
 }
26ba25
 
26ba25
-static int coroutine_fn bdrv_co_copy_range_internal(BdrvChild *src,
26ba25
-                                                    uint64_t src_offset,
26ba25
-                                                    BdrvChild *dst,
26ba25
-                                                    uint64_t dst_offset,
26ba25
-                                                    uint64_t bytes,
26ba25
-                                                    BdrvRequestFlags flags,
26ba25
-                                                    bool recurse_src)
26ba25
+static int coroutine_fn bdrv_co_copy_range_internal(
26ba25
+        BdrvChild *src, uint64_t src_offset, BdrvChild *dst,
26ba25
+        uint64_t dst_offset, uint64_t bytes,
26ba25
+        BdrvRequestFlags read_flags, BdrvRequestFlags write_flags,
26ba25
+        bool recurse_src)
26ba25
 {
26ba25
     BdrvTrackedRequest req;
26ba25
     int ret;
26ba25
@@ -2860,8 +2858,8 @@ static int coroutine_fn bdrv_co_copy_range_internal(BdrvChild *src,
26ba25
     if (ret) {
26ba25
         return ret;
26ba25
     }
26ba25
-    if (flags & BDRV_REQ_ZERO_WRITE) {
26ba25
-        return bdrv_co_pwrite_zeroes(dst, dst_offset, bytes, flags);
26ba25
+    if (write_flags & BDRV_REQ_ZERO_WRITE) {
26ba25
+        return bdrv_co_pwrite_zeroes(dst, dst_offset, bytes, write_flags);
26ba25
     }
26ba25
 
26ba25
     if (!src || !src->bs) {
26ba25
@@ -2883,14 +2881,15 @@ static int coroutine_fn bdrv_co_copy_range_internal(BdrvChild *src,
26ba25
         tracked_request_begin(&req, src->bs, src_offset, bytes,
26ba25
                               BDRV_TRACKED_READ);
26ba25
 
26ba25
-        if (!(flags & BDRV_REQ_NO_SERIALISING)) {
26ba25
+        if (!(read_flags & BDRV_REQ_NO_SERIALISING)) {
26ba25
             wait_serialising_requests(&req;;
26ba25
         }
26ba25
 
26ba25
         ret = src->bs->drv->bdrv_co_copy_range_from(src->bs,
26ba25
                                                     src, src_offset,
26ba25
                                                     dst, dst_offset,
26ba25
-                                                    bytes, flags);
26ba25
+                                                    bytes,
26ba25
+                                                    read_flags, write_flags);
26ba25
 
26ba25
         tracked_request_end(&req;;
26ba25
         bdrv_dec_in_flight(src->bs);
26ba25
@@ -2899,15 +2898,15 @@ static int coroutine_fn bdrv_co_copy_range_internal(BdrvChild *src,
26ba25
         tracked_request_begin(&req, dst->bs, dst_offset, bytes,
26ba25
                               BDRV_TRACKED_WRITE);
26ba25
 
26ba25
-        /* BDRV_REQ_NO_SERIALISING is only for read operation,
26ba25
-         * so we ignore it in flags.
26ba25
-         */
26ba25
+        /* BDRV_REQ_NO_SERIALISING is only for read operation */
26ba25
+        assert(!(write_flags & BDRV_REQ_NO_SERIALISING));
26ba25
         wait_serialising_requests(&req;;
26ba25
 
26ba25
         ret = dst->bs->drv->bdrv_co_copy_range_to(dst->bs,
26ba25
                                                   src, src_offset,
26ba25
                                                   dst, dst_offset,
26ba25
-                                                  bytes, flags);
26ba25
+                                                  bytes,
26ba25
+                                                  read_flags, write_flags);
26ba25
 
26ba25
         tracked_request_end(&req;;
26ba25
         bdrv_dec_in_flight(dst->bs);
26ba25
@@ -2922,10 +2921,12 @@ static int coroutine_fn bdrv_co_copy_range_internal(BdrvChild *src,
26ba25
  * semantics. */
26ba25
 int coroutine_fn bdrv_co_copy_range_from(BdrvChild *src, uint64_t src_offset,
26ba25
                                          BdrvChild *dst, uint64_t dst_offset,
26ba25
-                                         uint64_t bytes, BdrvRequestFlags flags)
26ba25
+                                         uint64_t bytes,
26ba25
+                                         BdrvRequestFlags read_flags,
26ba25
+                                         BdrvRequestFlags write_flags)
26ba25
 {
26ba25
     return bdrv_co_copy_range_internal(src, src_offset, dst, dst_offset,
26ba25
-                                       bytes, flags, true);
26ba25
+                                       bytes, read_flags, write_flags, true);
26ba25
 }
26ba25
 
26ba25
 /* Copy range from @src to @dst.
26ba25
@@ -2934,19 +2935,22 @@ int coroutine_fn bdrv_co_copy_range_from(BdrvChild *src, uint64_t src_offset,
26ba25
  * semantics. */
26ba25
 int coroutine_fn bdrv_co_copy_range_to(BdrvChild *src, uint64_t src_offset,
26ba25
                                        BdrvChild *dst, uint64_t dst_offset,
26ba25
-                                       uint64_t bytes, BdrvRequestFlags flags)
26ba25
+                                       uint64_t bytes,
26ba25
+                                       BdrvRequestFlags read_flags,
26ba25
+                                       BdrvRequestFlags write_flags)
26ba25
 {
26ba25
     return bdrv_co_copy_range_internal(src, src_offset, dst, dst_offset,
26ba25
-                                       bytes, flags, false);
26ba25
+                                       bytes, read_flags, write_flags, false);
26ba25
 }
26ba25
 
26ba25
 int coroutine_fn bdrv_co_copy_range(BdrvChild *src, uint64_t src_offset,
26ba25
                                     BdrvChild *dst, uint64_t dst_offset,
26ba25
-                                    uint64_t bytes, BdrvRequestFlags flags)
26ba25
+                                    uint64_t bytes, BdrvRequestFlags read_flags,
26ba25
+                                    BdrvRequestFlags write_flags)
26ba25
 {
26ba25
     return bdrv_co_copy_range_from(src, src_offset,
26ba25
                                    dst, dst_offset,
26ba25
-                                   bytes, flags);
26ba25
+                                   bytes, read_flags, write_flags);
26ba25
 }
26ba25
 
26ba25
 static void bdrv_parent_cb_resize(BlockDriverState *bs)
26ba25
diff --git a/block/iscsi.c b/block/iscsi.c
26ba25
index 5047e83..2b45458 100644
26ba25
--- a/block/iscsi.c
26ba25
+++ b/block/iscsi.c
26ba25
@@ -2193,9 +2193,11 @@ static int coroutine_fn iscsi_co_copy_range_from(BlockDriverState *bs,
26ba25
                                                  BdrvChild *dst,
26ba25
                                                  uint64_t dst_offset,
26ba25
                                                  uint64_t bytes,
26ba25
-                                                 BdrvRequestFlags flags)
26ba25
+                                                 BdrvRequestFlags read_flags,
26ba25
+                                                 BdrvRequestFlags write_flags)
26ba25
 {
26ba25
-    return bdrv_co_copy_range_to(src, src_offset, dst, dst_offset, bytes, flags);
26ba25
+    return bdrv_co_copy_range_to(src, src_offset, dst, dst_offset, bytes,
26ba25
+                                 read_flags, write_flags);
26ba25
 }
26ba25
 
26ba25
 static struct scsi_task *iscsi_xcopy_task(int param_len)
26ba25
@@ -2332,7 +2334,8 @@ static int coroutine_fn iscsi_co_copy_range_to(BlockDriverState *bs,
26ba25
                                                BdrvChild *dst,
26ba25
                                                uint64_t dst_offset,
26ba25
                                                uint64_t bytes,
26ba25
-                                               BdrvRequestFlags flags)
26ba25
+                                               BdrvRequestFlags read_flags,
26ba25
+                                               BdrvRequestFlags write_flags)
26ba25
 {
26ba25
     IscsiLun *dst_lun = dst->bs->opaque;
26ba25
     IscsiLun *src_lun;
26ba25
diff --git a/block/qcow2.c b/block/qcow2.c
26ba25
index e171a99..1ea7203 100644
26ba25
--- a/block/qcow2.c
26ba25
+++ b/block/qcow2.c
26ba25
@@ -3248,13 +3248,14 @@ static int coroutine_fn
26ba25
 qcow2_co_copy_range_from(BlockDriverState *bs,
26ba25
                          BdrvChild *src, uint64_t src_offset,
26ba25
                          BdrvChild *dst, uint64_t dst_offset,
26ba25
-                         uint64_t bytes, BdrvRequestFlags flags)
26ba25
+                         uint64_t bytes, BdrvRequestFlags read_flags,
26ba25
+                         BdrvRequestFlags write_flags)
26ba25
 {
26ba25
     BDRVQcow2State *s = bs->opaque;
26ba25
     int ret;
26ba25
     unsigned int cur_bytes; /* number of bytes in current iteration */
26ba25
     BdrvChild *child = NULL;
26ba25
-    BdrvRequestFlags cur_flags;
26ba25
+    BdrvRequestFlags cur_write_flags;
26ba25
 
26ba25
     assert(!bs->encrypted);
26ba25
     qemu_co_mutex_lock(&s->lock);
26ba25
@@ -3263,7 +3264,7 @@ qcow2_co_copy_range_from(BlockDriverState *bs,
26ba25
         uint64_t copy_offset = 0;
26ba25
         /* prepare next request */
26ba25
         cur_bytes = MIN(bytes, INT_MAX);
26ba25
-        cur_flags = flags;
26ba25
+        cur_write_flags = write_flags;
26ba25
 
26ba25
         ret = qcow2_get_cluster_offset(bs, src_offset, &cur_bytes, &copy_offset);
26ba25
         if (ret < 0) {
26ba25
@@ -3275,20 +3276,20 @@ qcow2_co_copy_range_from(BlockDriverState *bs,
26ba25
             if (bs->backing && bs->backing->bs) {
26ba25
                 int64_t backing_length = bdrv_getlength(bs->backing->bs);
26ba25
                 if (src_offset >= backing_length) {
26ba25
-                    cur_flags |= BDRV_REQ_ZERO_WRITE;
26ba25
+                    cur_write_flags |= BDRV_REQ_ZERO_WRITE;
26ba25
                 } else {
26ba25
                     child = bs->backing;
26ba25
                     cur_bytes = MIN(cur_bytes, backing_length - src_offset);
26ba25
                     copy_offset = src_offset;
26ba25
                 }
26ba25
             } else {
26ba25
-                cur_flags |= BDRV_REQ_ZERO_WRITE;
26ba25
+                cur_write_flags |= BDRV_REQ_ZERO_WRITE;
26ba25
             }
26ba25
             break;
26ba25
 
26ba25
         case QCOW2_CLUSTER_ZERO_PLAIN:
26ba25
         case QCOW2_CLUSTER_ZERO_ALLOC:
26ba25
-            cur_flags |= BDRV_REQ_ZERO_WRITE;
26ba25
+            cur_write_flags |= BDRV_REQ_ZERO_WRITE;
26ba25
             break;
26ba25
 
26ba25
         case QCOW2_CLUSTER_COMPRESSED:
26ba25
@@ -3312,7 +3313,7 @@ qcow2_co_copy_range_from(BlockDriverState *bs,
26ba25
         ret = bdrv_co_copy_range_from(child,
26ba25
                                       copy_offset,
26ba25
                                       dst, dst_offset,
26ba25
-                                      cur_bytes, cur_flags);
26ba25
+                                      cur_bytes, read_flags, cur_write_flags);
26ba25
         qemu_co_mutex_lock(&s->lock);
26ba25
         if (ret < 0) {
26ba25
             goto out;
26ba25
@@ -3333,7 +3334,8 @@ static int coroutine_fn
26ba25
 qcow2_co_copy_range_to(BlockDriverState *bs,
26ba25
                        BdrvChild *src, uint64_t src_offset,
26ba25
                        BdrvChild *dst, uint64_t dst_offset,
26ba25
-                       uint64_t bytes, BdrvRequestFlags flags)
26ba25
+                       uint64_t bytes, BdrvRequestFlags read_flags,
26ba25
+                       BdrvRequestFlags write_flags)
26ba25
 {
26ba25
     BDRVQcow2State *s = bs->opaque;
26ba25
     int offset_in_cluster;
26ba25
@@ -3377,7 +3379,7 @@ qcow2_co_copy_range_to(BlockDriverState *bs,
26ba25
         ret = bdrv_co_copy_range_to(src, src_offset,
26ba25
                                     bs->file,
26ba25
                                     cluster_offset + offset_in_cluster,
26ba25
-                                    cur_bytes, flags);
26ba25
+                                    cur_bytes, read_flags, write_flags);
26ba25
         qemu_co_mutex_lock(&s->lock);
26ba25
         if (ret < 0) {
26ba25
             goto fail;
26ba25
diff --git a/block/raw-format.c b/block/raw-format.c
26ba25
index b78da56..a359198 100644
26ba25
--- a/block/raw-format.c
26ba25
+++ b/block/raw-format.c
26ba25
@@ -498,9 +498,13 @@ static int raw_probe_geometry(BlockDriverState *bs, HDGeometry *geo)
26ba25
 }
26ba25
 
26ba25
 static int coroutine_fn raw_co_copy_range_from(BlockDriverState *bs,
26ba25
-                                               BdrvChild *src, uint64_t src_offset,
26ba25
-                                               BdrvChild *dst, uint64_t dst_offset,
26ba25
-                                               uint64_t bytes, BdrvRequestFlags flags)
26ba25
+                                               BdrvChild *src,
26ba25
+                                               uint64_t src_offset,
26ba25
+                                               BdrvChild *dst,
26ba25
+                                               uint64_t dst_offset,
26ba25
+                                               uint64_t bytes,
26ba25
+                                               BdrvRequestFlags read_flags,
26ba25
+                                               BdrvRequestFlags write_flags)
26ba25
 {
26ba25
     int ret;
26ba25
 
26ba25
@@ -509,13 +513,17 @@ static int coroutine_fn raw_co_copy_range_from(BlockDriverState *bs,
26ba25
         return ret;
26ba25
     }
26ba25
     return bdrv_co_copy_range_from(bs->file, src_offset, dst, dst_offset,
26ba25
-                                   bytes, flags);
26ba25
+                                   bytes, read_flags, write_flags);
26ba25
 }
26ba25
 
26ba25
 static int coroutine_fn raw_co_copy_range_to(BlockDriverState *bs,
26ba25
-                                             BdrvChild *src, uint64_t src_offset,
26ba25
-                                             BdrvChild *dst, uint64_t dst_offset,
26ba25
-                                             uint64_t bytes, BdrvRequestFlags flags)
26ba25
+                                             BdrvChild *src,
26ba25
+                                             uint64_t src_offset,
26ba25
+                                             BdrvChild *dst,
26ba25
+                                             uint64_t dst_offset,
26ba25
+                                             uint64_t bytes,
26ba25
+                                             BdrvRequestFlags read_flags,
26ba25
+                                             BdrvRequestFlags write_flags)
26ba25
 {
26ba25
     int ret;
26ba25
 
26ba25
@@ -524,7 +532,7 @@ static int coroutine_fn raw_co_copy_range_to(BlockDriverState *bs,
26ba25
         return ret;
26ba25
     }
26ba25
     return bdrv_co_copy_range_to(src, src_offset, bs->file, dst_offset, bytes,
26ba25
-                                 flags);
26ba25
+                                 read_flags, write_flags);
26ba25
 }
26ba25
 
26ba25
 BlockDriver bdrv_raw = {
26ba25
diff --git a/include/block/block.h b/include/block/block.h
26ba25
index 716fb5b..409db21 100644
26ba25
--- a/include/block/block.h
26ba25
+++ b/include/block/block.h
26ba25
@@ -661,5 +661,6 @@ void bdrv_unregister_buf(BlockDriverState *bs, void *host);
26ba25
  **/
26ba25
 int coroutine_fn bdrv_co_copy_range(BdrvChild *src, uint64_t src_offset,
26ba25
                                     BdrvChild *dst, uint64_t dst_offset,
26ba25
-                                    uint64_t bytes, BdrvRequestFlags flags);
26ba25
+                                    uint64_t bytes, BdrvRequestFlags read_flags,
26ba25
+                                    BdrvRequestFlags write_flags);
26ba25
 #endif
26ba25
diff --git a/include/block/block_int.h b/include/block/block_int.h
26ba25
index 27e168f..b05cf11 100644
26ba25
--- a/include/block/block_int.h
26ba25
+++ b/include/block/block_int.h
26ba25
@@ -220,7 +220,8 @@ struct BlockDriver {
26ba25
                                                 BdrvChild *dst,
26ba25
                                                 uint64_t dst_offset,
26ba25
                                                 uint64_t bytes,
26ba25
-                                                BdrvRequestFlags flags);
26ba25
+                                                BdrvRequestFlags read_flags,
26ba25
+                                                BdrvRequestFlags write_flags);
26ba25
 
26ba25
     /* Map [offset, offset + nbytes) range onto a child of bs to copy data to,
26ba25
      * and invoke bdrv_co_copy_range_to(child, src, ...), or perform the copy
26ba25
@@ -236,7 +237,8 @@ struct BlockDriver {
26ba25
                                               BdrvChild *dst,
26ba25
                                               uint64_t dst_offset,
26ba25
                                               uint64_t bytes,
26ba25
-                                              BdrvRequestFlags flags);
26ba25
+                                              BdrvRequestFlags read_flags,
26ba25
+                                              BdrvRequestFlags write_flags);
26ba25
 
26ba25
     /*
26ba25
      * Building block for bdrv_block_status[_above] and
26ba25
@@ -1125,10 +1127,14 @@ void blockdev_close_all_bdrv_states(void);
26ba25
 
26ba25
 int coroutine_fn bdrv_co_copy_range_from(BdrvChild *src, uint64_t src_offset,
26ba25
                                          BdrvChild *dst, uint64_t dst_offset,
26ba25
-                                         uint64_t bytes, BdrvRequestFlags flags);
26ba25
+                                         uint64_t bytes,
26ba25
+                                         BdrvRequestFlags read_flags,
26ba25
+                                         BdrvRequestFlags write_flags);
26ba25
 int coroutine_fn bdrv_co_copy_range_to(BdrvChild *src, uint64_t src_offset,
26ba25
                                        BdrvChild *dst, uint64_t dst_offset,
26ba25
-                                       uint64_t bytes, BdrvRequestFlags flags);
26ba25
+                                       uint64_t bytes,
26ba25
+                                       BdrvRequestFlags read_flags,
26ba25
+                                       BdrvRequestFlags write_flags);
26ba25
 
26ba25
 int refresh_total_sectors(BlockDriverState *bs, int64_t hint);
26ba25
 
26ba25
diff --git a/include/sysemu/block-backend.h b/include/sysemu/block-backend.h
26ba25
index 8d03d49..830d873 100644
26ba25
--- a/include/sysemu/block-backend.h
26ba25
+++ b/include/sysemu/block-backend.h
26ba25
@@ -234,6 +234,7 @@ void blk_unregister_buf(BlockBackend *blk, void *host);
26ba25
 
26ba25
 int coroutine_fn blk_co_copy_range(BlockBackend *blk_in, int64_t off_in,
26ba25
                                    BlockBackend *blk_out, int64_t off_out,
26ba25
-                                   int bytes, BdrvRequestFlags flags);
26ba25
+                                   int bytes, BdrvRequestFlags read_flags,
26ba25
+                                   BdrvRequestFlags write_flags);
26ba25
 
26ba25
 #endif
26ba25
diff --git a/qemu-img.c b/qemu-img.c
26ba25
index b2ef54e..eaee6d6 100644
26ba25
--- a/qemu-img.c
26ba25
+++ b/qemu-img.c
26ba25
@@ -1786,7 +1786,7 @@ static int coroutine_fn convert_co_copy_range(ImgConvertState *s, int64_t sector
26ba25
 
26ba25
         ret = blk_co_copy_range(blk, offset, s->target,
26ba25
                                 sector_num << BDRV_SECTOR_BITS,
26ba25
-                                n << BDRV_SECTOR_BITS, 0);
26ba25
+                                n << BDRV_SECTOR_BITS, 0, 0);
26ba25
         if (ret < 0) {
26ba25
             return ret;
26ba25
         }
26ba25
-- 
26ba25
1.8.3.1
26ba25