On 22.03.2016 20:36, Kevin Wolf wrote:
> In order to get rid of bs->blk for bdrv_get_device_name() and
> bdrv_get_device_or_node_name(), ask all parents for their name and
> simply pick the first one.
> 
> Signed-off-by: Kevin Wolf <kw...@redhat.com>
> ---
>  block.c                   | 22 ++++++++++++++++++++--
>  block/block-backend.c     |  6 ++++++
>  include/block/block_int.h |  1 +
>  3 files changed, 27 insertions(+), 2 deletions(-)

[...]

> diff --git a/include/block/block_int.h b/include/block/block_int.h
> index f60cb7c..195abe8 100644
> --- a/include/block/block_int.h
> +++ b/include/block/block_int.h
> @@ -358,6 +358,7 @@ struct BdrvChildRole {
>  
>      void (*change_media)(BdrvChild *child, bool load);
>      void (*resize)(BdrvChild *child);
> +    const char* (*get_name)(BdrvChild *child);
>  
>      bool (*drain_queue)(BdrvChild *child);
>  };

I wouldn't mind an explanation there what this is supposed to be used
for. From the name alone I'd expect a parent BDS to return its node name.

Reviewed-by: Max Reitz <mre...@redhat.com>

Attachment: signature.asc
Description: OpenPGP digital signature

Reply via email to