[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 30/53] block/block-copy: add list of all call-states
From: |
Max Reitz |
Subject: |
[PULL 30/53] block/block-copy: add list of all call-states |
Date: |
Tue, 26 Jan 2021 15:19:53 +0100 |
From: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
It simplifies debugging.
Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
Reviewed-by: Max Reitz <mreitz@redhat.com>
Message-Id: <20210116214705.822267-6-vsementsov@virtuozzo.com>
Signed-off-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
- [PULL 15/53] iotests.py: Assume a couple of variables as given, (continued)
- [PULL 15/53] iotests.py: Assume a couple of variables as given, Max Reitz, 2021/01/26
- [PULL 18/53] iotests/129: Remove test images in tearDown(), Max Reitz, 2021/01/26
- [PULL 19/53] iotests/129: Do not check @busy, Max Reitz, 2021/01/26
- [PULL 25/53] coroutine-sigaltstack: Add SIGUSR2 mutex, Max Reitz, 2021/01/26
- [PULL 27/53] block/block-copy: More explicit call_state, Max Reitz, 2021/01/26
- [PULL 23/53] iotests/129: Clean up pylint and mypy complaints, Max Reitz, 2021/01/26
- [PULL 26/53] qapi: backup: add perf.use-copy-range parameter, Max Reitz, 2021/01/26
- [PULL 21/53] iotests/129: Actually test a commit job, Max Reitz, 2021/01/26
- [PULL 24/53] iotests/300: Clean up pylint and mypy complaints, Max Reitz, 2021/01/26
- [PULL 28/53] block/block-copy: implement block_copy_async, Max Reitz, 2021/01/26
- [PULL 30/53] block/block-copy: add list of all call-states,
Max Reitz <=
- [PULL 29/53] block/block-copy: add max_chunk and max_workers parameters, Max Reitz, 2021/01/26
- [PULL 31/53] block/block-copy: add ratelimit to block-copy, Max Reitz, 2021/01/26
- [PULL 33/53] blockjob: add set_speed to BlockJobDriver, Max Reitz, 2021/01/26
- [PULL 34/53] job: call job_enter from job_pause, Max Reitz, 2021/01/26
- [PULL 35/53] qapi: backup: add max-chunk and max-workers to x-perf struct, Max Reitz, 2021/01/26
- [PULL 32/53] block/block-copy: add block_copy_cancel, Max Reitz, 2021/01/26
- [PULL 36/53] iotests: 56: prepare for backup over block-copy, Max Reitz, 2021/01/26
- [PULL 37/53] iotests/129: Limit backup's max-chunk/max-workers, Max Reitz, 2021/01/26
- [PULL 38/53] iotests: 185: prepare for backup over block-copy, Max Reitz, 2021/01/26
- [PULL 39/53] iotests: 219: prepare for backup over block-copy, Max Reitz, 2021/01/26