From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:56864) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XjOye-0000qz-GY for qemu-devel@nongnu.org; Wed, 29 Oct 2014 04:51:42 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XjOyX-0000PZ-Sh for qemu-devel@nongnu.org; Wed, 29 Oct 2014 04:51:36 -0400 Received: from mx1.redhat.com ([209.132.183.28]:36663) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XjOyX-0000PD-L1 for qemu-devel@nongnu.org; Wed, 29 Oct 2014 04:51:29 -0400 Message-ID: <5450AA8B.8010903@redhat.com> Date: Wed, 29 Oct 2014 09:51:23 +0100 From: Max Reitz MIME-Version: 1.0 References: <1414559044-14501-1-git-send-email-famz@redhat.com> <1414559044-14501-3-git-send-email-famz@redhat.com> In-Reply-To: <1414559044-14501-3-git-send-email-famz@redhat.com> Content-Type: text/plain; charset=iso-8859-15; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH 2/4] block: Add bdrv_get_node_name List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Fam Zheng , qemu-devel@nongnu.org Cc: Kevin Wolf , Benoit Canet , Markus Armbruster , Luiz Capitulino , Stefan Hajnoczi 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 > --- > 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,