From patchwork Fri May 6 09:39:10 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jes Sorensen X-Patchwork-Id: 94351 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [140.186.70.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 81533B6F57 for ; Fri, 6 May 2011 19:40:32 +1000 (EST) Received: from localhost ([::1]:42018 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QIHWP-0000tO-HM for incoming@patchwork.ozlabs.org; Fri, 06 May 2011 05:40:29 -0400 Received: from eggs.gnu.org ([140.186.70.92]:34708) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QIHW9-0000rB-Fu for qemu-devel@nongnu.org; Fri, 06 May 2011 05:40:14 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QIHW8-0007Ow-GM for qemu-devel@nongnu.org; Fri, 06 May 2011 05:40:13 -0400 Received: from mx1.redhat.com ([209.132.183.28]:15092) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QIHW8-0007Oq-1t for qemu-devel@nongnu.org; Fri, 06 May 2011 05:40:12 -0400 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id p469eB7G008899 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Fri, 6 May 2011 05:40:11 -0400 Received: from red-feather.gva.redhat.com (dhcp-144-167.gva.redhat.com [10.33.144.167]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id p469e7HK024253; Fri, 6 May 2011 05:40:10 -0400 From: Jes.Sorensen@redhat.com To: kwolf@redhat.com Date: Fri, 6 May 2011 11:39:10 +0200 Message-Id: <1304674751-19111-2-git-send-email-Jes.Sorensen@redhat.com> In-Reply-To: <1304674751-19111-1-git-send-email-Jes.Sorensen@redhat.com> References: <1304674751-19111-1-git-send-email-Jes.Sorensen@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.22 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 209.132.183.28 Cc: qemu-devel@nongnu.org, armbru@redhat.com Subject: [Qemu-devel] [PATCH 1/2] Add documentation for qemu_progres_print() X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org From: Jes Sorensen Signed-off-by: Jes Sorensen --- qemu-progress.c | 8 ++++++++ 1 files changed, 8 insertions(+), 0 deletions(-) diff --git a/qemu-progress.c b/qemu-progress.c index a4894c0..70928d6 100644 --- a/qemu-progress.c +++ b/qemu-progress.c @@ -111,6 +111,14 @@ void qemu_progress_end(void) state.end(); } +/* + * Add delta to current state, and print the output if the current + * state has progressed more than min_skip since the last value was + * printed. 'max' specifies the relative percentage, ie. a function + * can count for 30% of the total work, and still count from 0-100, by + * setting max to 30. If max is set to zero, the percent argument + * becomes an absolute value for current state. + */ void qemu_progress_print(float percent, int max) { float current;