From: Max Reitz Date: Mon, 27 Jul 2015 15:51:31 +0000 (+0200) Subject: progress: Allow regressing progress X-Git-Tag: v2.6.0-rc0~253^2~16 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=bd5072d75622c3a702741064df87ea8911bae1a4;p=thirdparty%2Fqemu.git 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 --- diff --git a/util/qemu-progress.c b/util/qemu-progress.c index 4ee5cd07f27..532333e7573 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(); }