From: Max Reitz <mreitz@redhat.com>
To: Fam Zheng <famz@redhat.com>
Cc: Kevin Wolf <kwolf@redhat.com>, Benoit Canet <benoit@irqsave.net>,
Markus Armbruster <armbru@redhat.com>,
qemu-devel@nongnu.org, Luiz Capitulino <lcapitulino@redhat.com>,
Stefan Hajnoczi <stefanha@redhat.com>
Subject: Re: [Qemu-devel] [PATCH 4/4] qmp: Add optional switch "query-nodes" in query-blockstats
Date: Tue, 04 Nov 2014 09:49:17 +0100 [thread overview]
Message-ID: <5458930D.9070108@redhat.com> (raw)
In-Reply-To: <20141031032015.GC22382@fam-t430.nay.redhat.com>
On 2014-10-31 at 04:20, Fam Zheng wrote:
> On Wed, 10/29 10:11, Max Reitz wrote:
>> On 2014-10-29 at 06:04, Fam Zheng wrote:
>>> This bool option will allow query all the node names. It iterates all
>>> the BDSes that are assigned a name, also in this case don't query up the
>>> backing chain.
>>>
>>> Signed-off-by: Fam Zheng <famz@redhat.com>
>>> ---
>>> block/qapi.c | 20 +++++++++++++-------
>>> hmp.c | 2 +-
>>> qapi/block-core.json | 4 +++-
>>> qmp-commands.hx | 2 +-
>>> 4 files changed, 18 insertions(+), 10 deletions(-)
>>>
>>> diff --git a/block/qapi.c b/block/qapi.c
>>> index a4d1a20..e26033e 100644
>>> --- a/block/qapi.c
>>> +++ b/block/qapi.c
>>> @@ -322,7 +322,8 @@ static void bdrv_query_info(BlockBackend *blk, BlockInfo **p_info,
>>> qapi_free_BlockInfo(info);
>>> }
>>> -static BlockStats *bdrv_query_stats(const BlockDriverState *bs)
>>> +static BlockStats *bdrv_query_stats(const BlockDriverState *bs,
>>> + bool query_backing)
>>> {
>>> BlockStats *s;
>>> @@ -352,12 +353,12 @@ static BlockStats *bdrv_query_stats(const BlockDriverState *bs)
>>> if (bs->file) {
>>> s->has_parent = true;
>>> - s->parent = bdrv_query_stats(bs->file);
>>> + s->parent = bdrv_query_stats(bs->file, query_backing);
>>> }
>>> - if (bs->backing_hd) {
>>> + if (query_backing && bs->backing_hd) {
>>> s->has_backing = true;
>>> - s->backing = bdrv_query_stats(bs->backing_hd);
>>> + s->backing = bdrv_query_stats(bs->backing_hd, query_backing);
>>> }
>> Is there a specific reason why you're not querying the backing chain but
>> still recurse to bs->file?
> Unlike its backing, there can be some information in ->file which is
> interesting to the node itself, because it is ->file carries out the actual
> read/write on the image. Makes sense?
Ah, I forgot to answer. Well, ->backing carries out reads, too. I
thought you omitted it because you could give it a node-name as well and
therefore you'd have some BDS appear twice; but the same applies to
->file, that's why I asked.
Max
next prev parent reply other threads:[~2014-11-04 8:49 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-10-29 5:04 [Qemu-devel] [PATCH 0/4] block: Allow query stats for drive-mirror target Fam Zheng
2014-10-29 5:04 ` [Qemu-devel] [PATCH 1/4] block: Add bdrv_next_node Fam Zheng
2014-10-29 8:49 ` Max Reitz
2014-10-30 21:32 ` Eric Blake
2014-10-29 5:04 ` [Qemu-devel] [PATCH 2/4] block: Add bdrv_get_node_name Fam Zheng
2014-10-29 8:51 ` Max Reitz
2014-10-30 21:33 ` Eric Blake
2014-10-29 5:04 ` [Qemu-devel] [PATCH 3/4] block: Include "node-name" if present in query-blockstats Fam Zheng
2014-10-29 8:57 ` Max Reitz
2014-10-30 21:36 ` Eric Blake
2014-10-29 5:04 ` [Qemu-devel] [PATCH 4/4] qmp: Add optional switch "query-nodes" " Fam Zheng
2014-10-29 9:11 ` Max Reitz
2014-10-31 3:20 ` Fam Zheng
2014-11-04 8:49 ` Max Reitz [this message]
2014-10-30 21:47 ` Eric Blake
2014-10-31 3:14 ` Fam Zheng
2014-10-30 21:48 ` [Qemu-devel] [PATCH 0/4] block: Allow query stats for drive-mirror target 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=5458930D.9070108@redhat.com \
--to=mreitz@redhat.com \
--cc=armbru@redhat.com \
--cc=benoit@irqsave.net \
--cc=famz@redhat.com \
--cc=kwolf@redhat.com \
--cc=lcapitulino@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=stefanha@redhat.com \
/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).