[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH v2 3/5] qemu-img: avoid excessive BlockFragInfo
From: |
Kevin Wolf |
Subject: |
Re: [Qemu-devel] [PATCH v2 3/5] qemu-img: avoid excessive BlockFragInfo line length |
Date: |
Wed, 06 Feb 2013 12:30:49 +0100 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:13.0) Gecko/20120605 Thunderbird/13.0 |
Am 06.02.2013 11:58, schrieb Stefan Hajnoczi:
> 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 <address@hidden>
> ---
> 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, "
Can you add a space before the '=' while touching this?
Kevin
[Qemu-devel] [PATCH v2 4/5] qemu-img: add compressed clusters to BlockFragInfo, Stefan Hajnoczi, 2013/02/06
[Qemu-devel] [PATCH v2 5/5] qcow2: support compressed clusters in BlockFragInfo, Stefan Hajnoczi, 2013/02/06
Re: [Qemu-devel] [PATCH v2 0/5] qcow2: add fragmentation and compression info support, Eric Blake, 2013/02/06