From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:60651) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YLHR1-0002kv-9c for qemu-devel@nongnu.org; Tue, 10 Feb 2015 15:29:30 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YLHQz-0006zB-Of for qemu-devel@nongnu.org; Tue, 10 Feb 2015 15:29:27 -0500 Received: from mx1.redhat.com ([209.132.183.28]:40995) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YLHQz-0006yw-Cq for qemu-devel@nongnu.org; Tue, 10 Feb 2015 15:29:25 -0500 Received: from int-mx11.intmail.prod.int.phx2.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id t1AKTOxo006589 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL) for ; Tue, 10 Feb 2015 15:29:24 -0500 From: Max Reitz Date: Tue, 10 Feb 2015 15:28:57 -0500 Message-Id: <1423600146-7642-16-git-send-email-mreitz@redhat.com> In-Reply-To: <1423600146-7642-1-git-send-email-mreitz@redhat.com> References: <1423600146-7642-1-git-send-email-mreitz@redhat.com> Subject: [Qemu-devel] [PATCH v6 15/24] progress: Allow regressing progress List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Kevin Wolf , Stefan Hajnoczi , 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 --- 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(); } -- 2.1.0