diff options
author | Kevin Wolf <kwolf@redhat.com> | 2017-01-17 15:56:16 +0100 |
---|---|---|
committer | Kevin Wolf <kwolf@redhat.com> | 2017-02-28 20:40:37 +0100 |
commit | b5411555877121b74cbe0a12a867d16d861746b1 (patch) | |
tree | 22d43a5003523212305f875b6480e197b0afaa1e /include/block/block_int.h | |
parent | c6cc12bfa7bb9c61f4fa20491258b9bebc5b4771 (diff) |
block: Add BdrvChildRole.get_parent_desc()
For meaningful error messages in the permission system, we need to get
some human-readable description of the parent of a BdrvChild.
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Reviewed-by: Max Reitz <mreitz@redhat.com>
Acked-by: Fam Zheng <famz@redhat.com>
Diffstat (limited to 'include/block/block_int.h')
-rw-r--r-- | include/block/block_int.h | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/include/block/block_int.h b/include/block/block_int.h index e00d0f4c8c..3177b9f496 100644 --- a/include/block/block_int.h +++ b/include/block/block_int.h @@ -452,6 +452,12 @@ struct BdrvChildRole { * name), or NULL if the parent can't provide a better name. */ const char* (*get_name)(BdrvChild *child); + /* Returns a malloced string that describes the parent of the child for a + * human reader. This could be a node-name, BlockBackend name, qdev ID or + * QOM path of the device owning the BlockBackend, job type and ID etc. The + * caller is responsible for freeing the memory. */ + char* (*get_parent_desc)(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 |