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>
This commit is contained in:
Max Reitz 2015-07-27 17:51:31 +02:00 committed by Kevin Wolf
parent 0a8111e0fb
commit bd5072d756

View File

@ -152,7 +152,8 @@ void qemu_progress_print(float delta, int max)
state.current = current; state.current = current;
if (current > (state.last_print + state.min_skip) || 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.last_print = state.current;
state.print(); state.print();
} }