mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-02 07:13:54 -06:00
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>
This commit is contained in:
parent
5c8cab4808
commit
4c265bf9f4
3 changed files with 31 additions and 2 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue