qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Max Reitz <mreitz@redhat.com>
To: Peter Krempa <pkrempa@redhat.com>, qemu-devel@nongnu.org
Cc: Kevin Wolf <kwolf@redhat.com>,
	Markus Armbruster <armbru@redhat.com>,
	qemu-block@nongnu.org
Subject: Re: [PATCH v2] qapi: Allow getting flat output from 'query-named-block-nodes'
Date: Fri, 7 Feb 2020 11:08:14 +0100	[thread overview]
Message-ID: <79ada57a-f73e-fb7f-0c3d-11541fc5d6d5@redhat.com> (raw)
In-Reply-To: <4470f8c779abc404dcf65e375db195cd91a80651.1579509782.git.pkrempa@redhat.com>


[-- Attachment #1.1: Type: text/plain, Size: 2759 bytes --]

On 20.01.20 09:50, Peter Krempa wrote:
> When a management application manages node names there's no reason to
> recurse into backing images in the output of query-named-block-nodes.
> 
> Add a parameter to the command which will return just the top level
> structs.
> 
> Signed-off-by: Peter Krempa <pkrempa@redhat.com>
> ---
> 
> Diff to v1:
>  - rewrote setting of 'return_flat' in qmp_query_named_block_nodes
>  - tried to clarify the QMP schema docs for the new field
> 
> This patch does not aim to fix the rather suboptimal original
> documentation of the command as that is going to end up in a bunch of
> bikeshedding.
> 
> While I know that there are plans for a new command that should fix
> this, the plans were already there for quite some time without much
> happening. This is a quick fix to a real problem, because if you have
> (maybe unpractically) deep backing chains, the returned JSON is getting
> huge. (140 nesting levels exceeds 10MiB of JSON)

The main reason nothing is happening is because nobody is pressing for
it, I think.  We talk about it from time to time but then our result is
“As long as nobody seriously complains and tells us what we need, we’re
going to assume what we have is good enough.”

For example:
https://lists.nongnu.org/archive/html/qemu-block/2020-01/msg00049.html
(Under “Query function situation”)

>  block.c               |  5 +++--
>  block/qapi.c          | 10 ++++++++--
>  blockdev.c            |  8 ++++++--
>  include/block/block.h |  2 +-
>  include/block/qapi.h  |  4 +++-
>  monitor/hmp-cmds.c    |  2 +-
>  qapi/block-core.json  |  7 ++++++-
>  7 files changed, 28 insertions(+), 10 deletions(-)

[...]

> diff --git a/block/qapi.c b/block/qapi.c
> index 9a5d0c9b27..84048e1a57 100644
> --- a/block/qapi.c
> +++ b/block/qapi.c
> @@ -42,7 +42,9 @@
>  #include "qemu/cutils.h"
> 
>  BlockDeviceInfo *bdrv_block_device_info(BlockBackend *blk,
> -                                        BlockDriverState *bs, Error **errp)
> +                                        BlockDriverState *bs,
> +                                        bool flat,
> +                                        Error **errp)
>  {
>      ImageInfo **p_image_info;
>      BlockDriverState *bs0;
> @@ -156,6 +158,10 @@ BlockDeviceInfo *bdrv_block_device_info(BlockBackend *blk,
>              return NULL;
>          }
> 
> +        /* stop gathering data for flat output */
> +        if (flat)
> +            break;

This should be enclosed in curly brackets (qemu coding style).

Shall I fix that up?

Max

> +
>          if (bs0->drv && bs0->backing) {
>              info->backing_file_depth++;
>              bs0 = bs0->backing->bs;


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

      parent reply	other threads:[~2020-02-07 10:09 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-01-20  8:50 [PATCH v2] qapi: Allow getting flat output from 'query-named-block-nodes' Peter Krempa
2020-01-20 19:16 ` Eric Blake
2020-02-07 10:08 ` Max Reitz [this message]

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=79ada57a-f73e-fb7f-0c3d-11541fc5d6d5@redhat.com \
    --to=mreitz@redhat.com \
    --cc=armbru@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).