[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v4 05/23] block/block-copy: add list of all call-states
From: |
Vladimir Sementsov-Ogievskiy |
Subject: |
[PATCH v4 05/23] block/block-copy: add list of all call-states |
Date: |
Sun, 17 Jan 2021 00:46:47 +0300 |
It simplifies debugging.
Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
Reviewed-by: Max Reitz <mreitz@redhat.com>
---
block/block-copy.c | 11 ++++++++++-
1 file changed, 10 insertions(+), 1 deletion(-)
diff --git a/block/block-copy.c b/block/block-copy.c
index 35213bd832..6bf1735b93 100644
--- a/block/block-copy.c
+++ b/block/block-copy.c
@@ -42,6 +42,9 @@ typedef struct BlockCopyCallState {
/* Coroutine where async block-copy is running */
Coroutine *co;
+ /* To reference all call states from BlockCopyState */
+ QLIST_ENTRY(BlockCopyCallState) list;
+
/* State */
int ret;
bool finished;
@@ -81,7 +84,8 @@ typedef struct BlockCopyState {
bool use_copy_range;
int64_t copy_size;
uint64_t len;
- QLIST_HEAD(, BlockCopyTask) tasks;
+ QLIST_HEAD(, BlockCopyTask) tasks; /* All tasks from all block-copy calls
*/
+ QLIST_HEAD(, BlockCopyCallState) calls;
BdrvRequestFlags write_flags;
@@ -282,6 +286,7 @@ BlockCopyState *block_copy_state_new(BdrvChild *source,
BdrvChild *target,
}
QLIST_INIT(&s->tasks);
+ QLIST_INIT(&s->calls);
return s;
}
@@ -669,6 +674,8 @@ static int coroutine_fn
block_copy_common(BlockCopyCallState *call_state)
{
int ret;
+ QLIST_INSERT_HEAD(&call_state->s->calls, call_state, list);
+
do {
ret = block_copy_dirty_clusters(call_state);
@@ -694,6 +701,8 @@ static int coroutine_fn
block_copy_common(BlockCopyCallState *call_state)
call_state->cb(call_state->cb_opaque);
}
+ QLIST_REMOVE(call_state, list);
+
return ret;
}
--
2.29.2
- [PATCH v4 00/23] backup performance: block_status + async, Vladimir Sementsov-Ogievskiy, 2021/01/16
- [PATCH v4 01/23] qapi: backup: add perf.use-copy-range parameter, Vladimir Sementsov-Ogievskiy, 2021/01/16
- [PATCH v4 02/23] block/block-copy: More explicit call_state, Vladimir Sementsov-Ogievskiy, 2021/01/16
- [PATCH v4 03/23] block/block-copy: implement block_copy_async, Vladimir Sementsov-Ogievskiy, 2021/01/16
- [PATCH v4 06/23] block/block-copy: add ratelimit to block-copy, Vladimir Sementsov-Ogievskiy, 2021/01/16
- [PATCH v4 05/23] block/block-copy: add list of all call-states,
Vladimir Sementsov-Ogievskiy <=
- [PATCH v4 09/23] job: call job_enter from job_pause, Vladimir Sementsov-Ogievskiy, 2021/01/16
- [PATCH v4 10/23] qapi: backup: add max-chunk and max-workers to x-perf struct, Vladimir Sementsov-Ogievskiy, 2021/01/16
- [PATCH v4 04/23] block/block-copy: add max_chunk and max_workers parameters, Vladimir Sementsov-Ogievskiy, 2021/01/16
- [PATCH v4 07/23] block/block-copy: add block_copy_cancel, Vladimir Sementsov-Ogievskiy, 2021/01/16
- [PATCH v4 11/23] iotests: 56: prepare for backup over block-copy, Vladimir Sementsov-Ogievskiy, 2021/01/16
- [PATCH v4 08/23] blockjob: add set_speed to BlockJobDriver, Vladimir Sementsov-Ogievskiy, 2021/01/16
- [PATCH v4 19/23] block/block-copy: drop unused block_copy_set_progress_callback(), Vladimir Sementsov-Ogievskiy, 2021/01/16
- [PATCH v4 12/23] iotests: 185: prepare for backup over block-copy, Vladimir Sementsov-Ogievskiy, 2021/01/16