qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH v3] qemu-img: Fix Column Width and Improve Formatting in snap


From: atp exp
Subject: Re: [PATCH v3] qemu-img: Fix Column Width and Improve Formatting in snapshot list
Date: Mon, 22 Jan 2024 18:56:26 +0530

Alright, right now there are 10 digits for ID, don't think a billion snapshots are feasible anyway.

> Maybe what we should also do is decreasing the width of each field by
> one and instead writing a space character into the format string.

I'm assuming  you are talking about adding spaces between DATE, VM_CLOCK
and ICOUNT, because spaces already exist for ID and TAGS.

Will send a patch soon.

Abhiram

On Fri, 19 Jan 2024 at 01:13, Kevin Wolf <kwolf@redhat.com> wrote:
Am 11.01.2024 um 18:25 hat Abhiram Tilak geschrieben:
> When running the command `qemu-img snapshot -l SNAPSHOT` the output of
> VM_CLOCK (measures the offset between host and VM clock) cannot to
> accommodate values in the order of thousands (4-digit).
>
> This line [1] hints on the problem. Additionally, the column width for
> the VM_CLOCK field was reduced from 15 to 13 spaces in commit b39847a5
> in line [2], resulting in a shortage of space.
>
> [1]: https://gitlab.com/qemu-project/qemu/-/blob/master/block/qapi.c?ref_type=heads#L753
> [2]: https://gitlab.com/qemu-project/qemu/-/blob/master/block/qapi.c?ref_type=heads#L763
>
> This patch restores the column width to 15 spaces and makes adjustments
> to the affected iotests accordingly. Furthermore, addresses a potential source
> of confusion by removing whitespace in column headers. Example, VM CLOCK
> is modified to VM_CLOCK. Additionally a '--' symbol is introduced when
> ICOUNT returns no output for clarity.
>
> Resolves: https://gitlab.com/qemu-project/qemu/-/issues/2062
> Fixes: b39847a50553 (migration: introduce icount field for snapshots )
> Signed-off-by: Abhiram Tilak <atp.exp@gmail.com>

We can tweak the format a bit, but then we need to save those two
characters somewhere else so that the output still fits in 80
characters. We can probably reduce the size of the ID column.

Maybe what we should also do is decreasing the width of each field by
one and instead writing a space character into the format string. So if
we ever use up the space for one of the fields again, we would lose the
nice column alignment, but you could still recognise the individual
fields.

Kevin


reply via email to

[Prev in Thread] Current Thread [Next in Thread]