[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH 1/4] block: Improve empty format-specific info dump
From: |
Eric Blake |
Subject: |
Re: [PATCH 1/4] block: Improve empty format-specific info dump |
Date: |
Tue, 3 May 2022 13:44:55 -0500 |
User-agent: |
NeoMutt/20220415-26-c08bba |
On Tue, May 03, 2022 at 04:55:26PM +0200, Hanna Reitz wrote:
> When a block driver supports obtaining format-specific information, but
> that object only contains optional fields, it is possible that none of
> them are present, so that dump_qobject() (called by
> bdrv_image_info_specific_dump()) will not print anything.
>
> The callers of bdrv_image_info_specific_dump() put a header above this
> information ("Format specific information:\n"), which will look strange
> when there is nothing below. Modify bdrv_image_info_specific_dump() to
> print this header instead of its callers, and only if there is indeed
> something to be printed.
>
> Signed-off-by: Hanna Reitz <hreitz@redhat.com>
> ---
> include/block/qapi.h | 3 ++-
> block/qapi.c | 41 +++++++++++++++++++++++++++++++++++++----
> qemu-io-cmds.c | 4 ++--
> 3 files changed, 41 insertions(+), 7 deletions(-)
>
Reviewed-by: Eric Blake <eblake@redhat.com>
--
Eric Blake, Principal Software Engineer
Red Hat, Inc. +1-919-301-3266
Virtualization: qemu.org | libvirt.org