aboutsummaryrefslogtreecommitdiff
path: root/util
diff options
context:
space:
mode:
authorMax Reitz <mreitz@redhat.com>2015-07-27 17:51:31 +0200
committerKevin Wolf <kwolf@redhat.com>2015-12-18 14:34:43 +0100
commitbd5072d75622c3a702741064df87ea8911bae1a4 (patch)
treeb4ebcfde055893e3de4adbd8009d3d3839793861 /util
parent0a8111e0fbeccdf94ee011bc3b3013a45166a9a8 (diff)
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 <mreitz@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Diffstat (limited to 'util')
-rw-r--r--util/qemu-progress.c3
1 files changed, 2 insertions, 1 deletions
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();
}