All of lore.kernel.org
 help / color / mirror / Atom feed
From: Kevin Wolf <kwolf@redhat.com>
To: qemu-block@nongnu.org
Cc: kwolf@redhat.com, peter.maydell@linaro.org, qemu-devel@nongnu.org
Subject: [PULL v2 10/10] block: Fix VM size column width in bdrv_snapshot_dump()
Date: Tue,  2 Feb 2021 17:28:34 +0100	[thread overview]
Message-ID: <20210202162834.269789-11-kwolf@redhat.com> (raw)
In-Reply-To: <20210202162834.269789-1-kwolf@redhat.com>

size_to_str() can return a size like "4.24 MiB", with a single digit
integer part and two fractional digits. This is eight characters, but
commit b39847a5 changed the format string to only reserve seven
characters for the column.

This can result in unaligned columns, which in turn changes the output of
iotests case 267 because exceeding the column size defeats the attempt
to filter the size out of the output (observed with the ppc64 emulator).
The resulting change is only a whitespace change, but since commit
f203080b this is enough for iotests to consider the test failed.

Taking a character away from the tag name column and adding it to the VM
size column doesn't change anything in the common case (the tag name is
left justified, the VM size is right justified), but fixes this case.

Fixes: b39847a50553b7679d6d7fefbe6a108a17aacf8d
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Message-Id: <20210202155911.179865-1-kwolf@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
---
 block/qapi.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/block/qapi.c b/block/qapi.c
index 0a96099e36..84a0aadc09 100644
--- a/block/qapi.c
+++ b/block/qapi.c
@@ -677,7 +677,7 @@ void bdrv_snapshot_dump(QEMUSnapshotInfo *sn)
     char *sizing = NULL;
 
     if (!sn) {
-        qemu_printf("%-10s%-18s%7s%20s%13s%11s",
+        qemu_printf("%-10s%-17s%8s%20s%13s%11s",
                     "ID", "TAG", "VM SIZE", "DATE", "VM CLOCK", "ICOUNT");
     } else {
         ti = sn->date_sec;
@@ -696,7 +696,7 @@ void bdrv_snapshot_dump(QEMUSnapshotInfo *sn)
             snprintf(icount_buf, sizeof(icount_buf),
                 "%"PRId64, sn->icount);
         }
-        qemu_printf("%-9s %-17s %7s%20s%13s%11s",
+        qemu_printf("%-9s %-16s %8s%20s%13s%11s",
                     sn->id_str, sn->name,
                     sizing,
                     date_buf,
-- 
2.29.2



  parent reply	other threads:[~2021-02-02 16:53 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-02-02 16:28 [PULL v2 00/10] Block layer patches Kevin Wolf
2021-02-02 16:28 ` [PULL v2 01/10] MAINTAINERS: Add Vladimir as co-maintainer for Block Jobs Kevin Wolf
2021-02-02 16:28 ` [PULL v2 02/10] block: Avoid processing BDS twice in bdrv_set_aio_context_ignore() Kevin Wolf
2021-02-02 16:28 ` [PULL v2 03/10] block: move blk_exp_close_all() to qemu_cleanup() Kevin Wolf
2021-02-02 16:28 ` [PULL v2 04/10] iotests/297: pylint: ignore too many statements Kevin Wolf
2021-02-02 16:28 ` [PULL v2 05/10] iotests: Revert emulator selection to old behaviour Kevin Wolf
2021-02-02 16:28 ` [PULL v2 06/10] iotests: check: return 1 on failure Kevin Wolf
2021-02-02 16:28 ` [PULL v2 07/10] iotests: Fix -makecheck output Kevin Wolf
2021-02-02 16:28 ` [PULL v2 08/10] block/nvme: Properly display doorbell stride length in trace event Kevin Wolf
2021-02-02 16:28 ` [PULL v2 09/10] block/nvme: Trace NVMe spec version supported by the controller Kevin Wolf
2021-02-02 16:28 ` Kevin Wolf [this message]
2021-02-02 17:57 ` [PULL v2 00/10] Block layer patches Peter Maydell

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210202162834.269789-11-kwolf@redhat.com \
    --to=kwolf@redhat.com \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-block@nongnu.org \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.