mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-04 16:23:55 -06:00
job: refactor progress to separate object
We need it in separate to pass to the block-copy object in the next commit. Cc: qemu-stable@nongnu.org Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com> Reviewed-by: Andrey Shinkevich <andrey.shinkevich@virtuozzo.com> Reviewed-by: Max Reitz <mreitz@redhat.com> Message-Id: <20200311103004.7649-2-vsementsov@virtuozzo.com> Signed-off-by: Max Reitz <mreitz@redhat.com>
This commit is contained in:
parent
e7266570f2
commit
01fe1ca945
6 changed files with 76 additions and 25 deletions
|
@ -884,9 +884,9 @@ static void run_block_job(BlockJob *job, Error **errp)
|
|||
do {
|
||||
float progress = 0.0f;
|
||||
aio_poll(aio_context, true);
|
||||
if (job->job.progress_total) {
|
||||
progress = (float)job->job.progress_current /
|
||||
job->job.progress_total * 100.f;
|
||||
if (job->job.progress.total) {
|
||||
progress = (float)job->job.progress.current /
|
||||
job->job.progress.total * 100.f;
|
||||
}
|
||||
qemu_progress_print(progress, 0);
|
||||
} while (!job_is_ready(&job->job) && !job_is_completed(&job->job));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue