From patchwork Wed Feb 6 10:58:36 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Hajnoczi X-Patchwork-Id: 218550 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 940EC2C02E8 for ; Wed, 6 Feb 2013 22:00:00 +1100 (EST) Received: from localhost ([::1]:57858 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1U32jO-0007Es-Nr for incoming@patchwork.ozlabs.org; Wed, 06 Feb 2013 05:59:58 -0500 Received: from eggs.gnu.org ([208.118.235.92]:55711) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1U32iS-0005HL-Fe for qemu-devel@nongnu.org; Wed, 06 Feb 2013 05:59:52 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1U32iI-0002h0-9d for qemu-devel@nongnu.org; Wed, 06 Feb 2013 05:59:00 -0500 Received: from mx1.redhat.com ([209.132.183.28]:13068) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1U32iI-0002gE-0c for qemu-devel@nongnu.org; Wed, 06 Feb 2013 05:58:50 -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 r16AwnRk011503 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Wed, 6 Feb 2013 05:58:49 -0500 Received: from localhost (ovpn-112-20.ams2.redhat.com [10.36.112.20]) by int-mx11.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id r16Awmw2007276; Wed, 6 Feb 2013 05:58:48 -0500 From: Stefan Hajnoczi To: Date: Wed, 6 Feb 2013 11:58:36 +0100 Message-Id: <1360148318-26988-4-git-send-email-stefanha@redhat.com> In-Reply-To: <1360148318-26988-1-git-send-email-stefanha@redhat.com> References: <1360148318-26988-1-git-send-email-stefanha@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.24 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 209.132.183.28 Cc: Kevin Wolf , fsimonce@redhat.com, Stefan Hajnoczi , crobinso@redhat.com Subject: [Qemu-devel] [PATCH v2 3/5] qemu-img: avoid excessive BlockFragInfo line length 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 The qemu-img check printf() statement that shows BlockFragInfo results is poorly formatted. Introduce a local variable to shorten the lines and restore proper indentation. The next patch adds a field to BlockFragInfo so it is beneficial to straighten out this code before modifying it. Signed-off-by: Stefan Hajnoczi --- qemu-img.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/qemu-img.c b/qemu-img.c index 85d3740..167d65f 100644 --- a/qemu-img.c +++ b/qemu-img.c @@ -389,6 +389,7 @@ static int img_check(int argc, char **argv) const char *filename, *fmt; BlockDriverState *bs; BdrvCheckResult result; + BlockFragInfo *bfi = &result.bfi; int fix = 0; int flags = BDRV_O_FLAGS | BDRV_O_CHECK; @@ -468,11 +469,12 @@ static int img_check(int argc, char **argv) } } - if (result.bfi.total_clusters != 0 && result.bfi.allocated_clusters != 0) { - printf("%" PRId64 "/%" PRId64 "= %0.2f%% allocated, %0.2f%% fragmented\n", - result.bfi.allocated_clusters, result.bfi.total_clusters, - result.bfi.allocated_clusters * 100.0 / result.bfi.total_clusters, - result.bfi.fragmented_clusters * 100.0 / result.bfi.allocated_clusters); + if (bfi->total_clusters != 0 && bfi->allocated_clusters != 0) { + printf("%" PRId64 "/%" PRId64 "= %0.2f%% allocated, " + "%0.2f%% fragmented\n", + bfi->allocated_clusters, bfi->total_clusters, + bfi->allocated_clusters * 100.0 / bfi->total_clusters, + bfi->fragmented_clusters * 100.0 / bfi->allocated_clusters); } bdrv_delete(bs);