summaryrefslogtreecommitdiffstats
path: root/util/qemu-progress.c
diff options
context:
space:
mode:
authorMax Reitz <mreitz@redhat.com>2015-07-27 17:51:31 +0200
committerTimothy Pearson <tpearson@raptorengineering.com>2019-11-29 19:28:20 -0600
commitd91daa98a4d3fddc3abe5a932daaea0b76b9869d (patch)
tree1a0bf9b31c58305b46a7f847e0ce3faca759ee0b /util/qemu-progress.c
parent8f60dd2d677ca8f1bf404cec69ba26c187eff1a4 (diff)
downloadhqemu-d91daa98a4d3fddc3abe5a932daaea0b76b9869d.zip
hqemu-d91daa98a4d3fddc3abe5a932daaea0b76b9869d.tar.gz
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/qemu-progress.c')
-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 4ee5cd0..532333e 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();
}
OpenPOWER on IntegriCloud