From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:59106) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a9we5-0000bW-Tp for qemu-devel@nongnu.org; Fri, 18 Dec 2015 10:08:38 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1a9we5-0004Sx-5A for qemu-devel@nongnu.org; Fri, 18 Dec 2015 10:08:37 -0500 From: Kevin Wolf Date: Fri, 18 Dec 2015 16:07:31 +0100 Message-Id: <1450451274-7472-26-git-send-email-kwolf@redhat.com> In-Reply-To: <1450451274-7472-1-git-send-email-kwolf@redhat.com> References: <1450451274-7472-1-git-send-email-kwolf@redhat.com> Subject: [Qemu-devel] [PULL 25/48] progress: Allow regressing progress List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-block@nongnu.org Cc: kwolf@redhat.com, qemu-devel@nongnu.org From: Max Reitz 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 --- util/qemu-progress.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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(); } -- 1.8.3.1