[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH v2 7/9] block: Use common req handling in copy offlo
From: |
Fam Zheng |
Subject: |
[Qemu-devel] [PATCH v2 7/9] block: Use common req handling in copy offloading |
Date: |
Thu, 5 Jul 2018 15:36:59 +0800 |
This brings the request handling logic inline with write and discard,
fixing write_gen, resize_cb, dirty bitmaps and image size refreshing.
The last of these issues broke iotest case 222, which is now fixed.
Signed-off-by: Fam Zheng <address@hidden>
---
block/io.c | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/block/io.c b/block/io.c
index 912fcb962a..d07849fa96 100644
--- a/block/io.c
+++ b/block/io.c
@@ -2962,7 +2962,11 @@ static int coroutine_fn
bdrv_co_copy_range_internal(BdrvChild *src,
if (!(flags & BDRV_REQ_NO_SERIALISING)) {
wait_serialising_requests(&src_req);
- wait_serialising_requests(&dst_req);
+ }
+
+ ret = bdrv_co_write_req_prepare(dst, &dst_req, flags);
+ if (ret) {
+ goto out;
}
if (recurse_src) {
ret = src->bs->drv->bdrv_co_copy_range_from(src->bs,
@@ -2975,6 +2979,8 @@ static int coroutine_fn
bdrv_co_copy_range_internal(BdrvChild *src,
dst, dst_offset,
bytes, flags);
}
+out:
+ bdrv_co_write_req_finish(dst, &dst_req, ret);
tracked_request_end(&src_req);
tracked_request_end(&dst_req);
bdrv_dec_in_flight(src->bs);
--
2.17.1