From: Max Reitz <mreitz@redhat.com>
To: Fam Zheng <famz@redhat.com>, qemu-devel@nongnu.org
Cc: Kevin Wolf <kwolf@redhat.com>, Benoit Canet <benoit@irqsave.net>,
Markus Armbruster <armbru@redhat.com>,
Luiz Capitulino <lcapitulino@redhat.com>,
Stefan Hajnoczi <stefanha@redhat.com>
Subject: Re: [Qemu-devel] [PATCH 2/4] block: Add bdrv_get_node_name
Date: Wed, 29 Oct 2014 09:51:23 +0100 [thread overview]
Message-ID: <5450AA8B.8010903@redhat.com> (raw)
In-Reply-To: <1414559044-14501-3-git-send-email-famz@redhat.com>
On 2014-10-29 at 06:04, Fam Zheng wrote:
> This returns the node name of a BDS. Remove the TODO comment and expect
> the callers to be explicit.
>
> Signed-off-by: Fam Zheng <famz@redhat.com>
> ---
> block.c | 6 +++++-
> include/block/block.h | 1 +
> 2 files changed, 6 insertions(+), 1 deletion(-)
>
> diff --git a/block.c b/block.c
> index c92a913..1448e38 100644
> --- a/block.c
> +++ b/block.c
> @@ -3791,7 +3791,11 @@ BlockDriverState *bdrv_next(BlockDriverState *bs)
> return QTAILQ_NEXT(bs, device_list);
> }
>
> -/* TODO check what callers really want: bs->node_name or blk_name() */
Well, we still need to check this, don't we? cscope tells me there are
61 callers of bdrv_get_device_name() and not all of them look like they
always query a BDS with a BB.
Max
> +const char *bdrv_get_node_name(const BlockDriverState *bs)
> +{
> + return bs->node_name;
> +}
> +
> const char *bdrv_get_device_name(const BlockDriverState *bs)
> {
> return bs->blk ? blk_name(bs->blk) : "";
> diff --git a/include/block/block.h b/include/block/block.h
> index 25acd81..71fff2c 100644
> --- a/include/block/block.h
> +++ b/include/block/block.h
> @@ -373,6 +373,7 @@ int bdrv_set_key(BlockDriverState *bs, const char *key);
> int bdrv_query_missing_keys(void);
> void bdrv_iterate_format(void (*it)(void *opaque, const char *name),
> void *opaque);
> +const char *bdrv_get_node_name(const BlockDriverState *bs);
> const char *bdrv_get_device_name(const BlockDriverState *bs);
> int bdrv_get_flags(BlockDriverState *bs);
> int bdrv_write_compressed(BlockDriverState *bs, int64_t sector_num,
next prev parent reply other threads:[~2014-10-29 8:51 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 [this message]
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
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=5450AA8B.8010903@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).