mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-04 08:13:54 -06:00
block-copy: move progress_set_remaining in block_copy_task_end
Moving this function in task_end ensures to update the progress anyways, even if there is an error. It also helps in next patch, allowing task_end to have only one critical section. Reviewed-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com> Signed-off-by: Emanuele Giuseppe Esposito <eesposit@redhat.com> Message-Id: <20210624072043.180494-4-eesposit@redhat.com> Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
This commit is contained in:
parent
05d5e12b24
commit
e3dd339fee
1 changed files with 3 additions and 3 deletions
|
@ -248,6 +248,9 @@ static void coroutine_fn block_copy_task_end(BlockCopyTask *task, int ret)
|
||||||
bdrv_set_dirty_bitmap(task->s->copy_bitmap, task->offset, task->bytes);
|
bdrv_set_dirty_bitmap(task->s->copy_bitmap, task->offset, task->bytes);
|
||||||
}
|
}
|
||||||
QLIST_REMOVE(task, list);
|
QLIST_REMOVE(task, list);
|
||||||
|
progress_set_remaining(task->s->progress,
|
||||||
|
bdrv_get_dirty_count(task->s->copy_bitmap) +
|
||||||
|
task->s->in_flight_bytes);
|
||||||
qemu_co_queue_restart_all(&task->wait_queue);
|
qemu_co_queue_restart_all(&task->wait_queue);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -638,9 +641,6 @@ block_copy_dirty_clusters(BlockCopyCallState *call_state)
|
||||||
}
|
}
|
||||||
if (s->skip_unallocated && !(ret & BDRV_BLOCK_ALLOCATED)) {
|
if (s->skip_unallocated && !(ret & BDRV_BLOCK_ALLOCATED)) {
|
||||||
block_copy_task_end(task, 0);
|
block_copy_task_end(task, 0);
|
||||||
progress_set_remaining(s->progress,
|
|
||||||
bdrv_get_dirty_count(s->copy_bitmap) +
|
|
||||||
s->in_flight_bytes);
|
|
||||||
trace_block_copy_skip_range(s, task->offset, task->bytes);
|
trace_block_copy_skip_range(s, task->offset, task->bytes);
|
||||||
offset = task_end(task);
|
offset = task_end(task);
|
||||||
bytes = end - offset;
|
bytes = end - offset;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue