All of lore.kernel.org
 help / color / mirror / Atom feed
From: Eric Blake <eblake@redhat.com>
To: Peter Krempa <pkrempa@redhat.com>
Cc: qemu-devel@nongnu.org, qemu-block@nongnu.org,
	 Kevin Wolf <kwolf@redhat.com>, Hanna Reitz <hreitz@redhat.com>,
	 Markus Armbruster <armbru@redhat.com>
Subject: Re: [PATCH v2 1/2] block: Wire up 'flat' mode also for 'query-block'
Date: Mon, 26 Jan 2026 13:27:33 -0600	[thread overview]
Message-ID: <aXe-G3OaSiHz890m@redhat.com> (raw)
In-Reply-To: <a28928bee84afcc1755695db58ca6c358da43a76.1768920111.git.pkrempa@redhat.com>

On Tue, Jan 20, 2026 at 03:45:56PM +0100, Peter Krempa wrote:
> From: Peter Krempa <pkrempa@redhat.com>
> 
> Some time ago (commit facda5443f5a8) I've added 'flat' mode (which
> omits 'backing-image' key in reply) to 'query-named-block-nodes' to
> minimize the size of the returned JSON for deeper backing chains.
> 
> While 'query-block' behaved slightly better it turns out that in libvirt
> we do call 'query-block' to figure out some information about the
> block device (e.g. throttling info) but we don't look at the backing
> chain itself.
> 
> Wire up 'flat' for 'query-block' so that libvirt can ask for an
> abbreviated output. The implementation is much simpler as the internals
> are shared with 'query-named-block-nodes'.
> 
> Signed-off-by: Peter Krempa <pkrempa@redhat.com>
> Acked-by: Markus Armbruster <armbru@redhat.com>
> ---
>  block/monitor/block-hmp-cmds.c | 4 ++--
>  block/qapi.c                   | 9 +++++----
>  qapi/block-core.json           | 7 +++++++
>  ui/cocoa.m                     | 2 +-
>  4 files changed, 15 insertions(+), 7 deletions(-)
> +++ b/qapi/block-core.json
> @@ -855,6 +855,12 @@
>  #
>  # Get a list of `BlockInfo` for all virtual block devices.
>  #
> +# @flat: Omit the nested data about backing image (Omitted are
> +#        contents of 'backing-image' key of the 'ImageInfo' struct
> +#        which is returned as 'image' key of 'BlockDeviceInfo' struct
> +#        returned as 'inserted' key in  'BlockInfo' struct returned

Extra space.

> +#        by this command).  Default is false (Since 11.0)

Still hard to parse.  Maybe:

@flat: Omit nested data about the backing image (ie. the contents at
       'inserted.image.backing-image' are trimmed to avoid duplicate
       data about that backing image).  Default is false (Since 11.0)

The idea makes sense to me, but I will defer to Markus on whether the
wording still needs a tweak.


-- 
Eric Blake, Principal Software Engineer
Red Hat, Inc.
Virtualization:  qemu.org | libguestfs.org



  reply	other threads:[~2026-01-26 19:28 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-01-20 14:45 [PATCH v2 0/2] block: Wire up 'flat' mode also for 'query-block' Peter Krempa
2026-01-20 14:45 ` [PATCH v2 1/2] " Peter Krempa
2026-01-26 19:27   ` Eric Blake [this message]
2026-01-29  8:54     ` Peter Krempa
2026-01-20 14:45 ` [PATCH v2 2/2] hmp_nbd_server_start: Don't ask for backing image data Peter Krempa
2026-01-26 19:29   ` Eric Blake

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=aXe-G3OaSiHz890m@redhat.com \
    --to=eblake@redhat.com \
    --cc=armbru@redhat.com \
    --cc=hreitz@redhat.com \
    --cc=kwolf@redhat.com \
    --cc=pkrempa@redhat.com \
    --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.