]> git.proxmox.com Git - mirror_qemu.git/commitdiff
progress: Allow regressing progress
authorMax Reitz <mreitz@redhat.com>
Mon, 27 Jul 2015 15:51:31 +0000 (17:51 +0200)
committerKevin Wolf <kwolf@redhat.com>
Fri, 18 Dec 2015 13:34:43 +0000 (14:34 +0100)
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>
util/qemu-progress.c

index 4ee5cd07f2776c16c7ba590b25f7a5262d386b79..532333e7573d23dedae3d4b896ebbeab53473c43 100644 (file)
@@ -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();
     }