From bd5072d75622c3a702741064df87ea8911bae1a4 Mon Sep 17 00:00:00 2001 From: Max Reitz Date: Mon, 27 Jul 2015 17:51:31 +0200 Subject: [PATCH] progress: Allow regressing progress Progress may regress; this should be displayed correctly by qemu_progress_print(). While touching that area of code, drop the redundant parentheses in the same condition. Signed-off-by: Max Reitz Reviewed-by: Eric Blake Reviewed-by: Stefan Hajnoczi Signed-off-by: Kevin Wolf --- util/qemu-progress.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/util/qemu-progress.c b/util/qemu-progress.c index 4ee5cd07f2..532333e757 100644 --- a/util/qemu-progress.c +++ b/util/qemu-progress.c @@ -152,7 +152,8 @@ void qemu_progress_print(float delta, int max) state.current = current; if (current > (state.last_print + state.min_skip) || - (current == 100) || (current == 0)) { + current < (state.last_print - state.min_skip) || + current == 100 || current == 0) { state.last_print = state.current; state.print(); } -- 2.11.0