diff options
author | Kevin Wolf <kwolf@redhat.com> | 2016-02-26 10:22:16 +0100 |
---|---|---|
committer | Kevin Wolf <kwolf@redhat.com> | 2016-05-19 16:45:31 +0200 |
commit | 4c265bf9f434d4b47f42e3c079adc205b7625ad6 (patch) | |
tree | fd9b775bf928f0d79cdd10cc74223b7673a0fdb7 /include/block | |
parent | 5c8cab48087d3544cb788309ac729bca08244020 (diff) | |
download | qemu-4c265bf9f434d4b47f42e3c079adc205b7625ad6.zip qemu-4c265bf9f434d4b47f42e3c079adc205b7625ad6.tar.gz qemu-4c265bf9f434d4b47f42e3c079adc205b7625ad6.tar.bz2 |
block: User BdrvChild callback for device name
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 <kwolf@redhat.com>
Reviewed-by: Max Reitz <mreitz@redhat.com>
Diffstat (limited to 'include/block')
-rw-r--r-- | include/block/block_int.h | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/include/block/block_int.h b/include/block/block_int.h index 9555429..80e2da5 100644 --- a/include/block/block_int.h +++ b/include/block/block_int.h @@ -368,6 +368,11 @@ struct BdrvChildRole { void (*change_media)(BdrvChild *child, bool load); void (*resize)(BdrvChild *child); + /* Returns a name that is supposedly more useful for human users than the + * node name for identifying the node in question (in particular, a BB + * name), or NULL if the parent can't provide a better name. */ + const char* (*get_name)(BdrvChild *child); + /* * If this pair of functions is implemented, the parent doesn't issue new * requests after returning from .drained_begin() until .drained_end() is |