Make blk_get_attached_dev_path() public so we can use it in the I/O
operation delay QMP event to identify the affected guest block device.

Signed-off-by: Hanna Czenczek <[email protected]>
---
 include/system/block-backend-io.h | 9 +++++++++
 block/block-backend.c             | 6 +-----
 2 files changed, 10 insertions(+), 5 deletions(-)

diff --git a/include/system/block-backend-io.h 
b/include/system/block-backend-io.h
index fd84723d9d0..63b2dd2e24f 100644
--- a/include/system/block-backend-io.h
+++ b/include/system/block-backend-io.h
@@ -41,6 +41,15 @@ bool blk_iostatus_is_enabled(const BlockBackend *blk);
  */
 char *blk_get_attached_dev_id(BlockBackend *blk);
 
+/*
+ * Return the QOM path of the block device attached to the
+ * BlockBackend.
+ *
+ * The caller is responsible for releasing the value returned
+ * with g_free() after use.
+ */
+char *blk_get_attached_dev_path(BlockBackend *blk);
+
 BlockAIOCB *blk_aio_pwrite_zeroes(BlockBackend *blk, int64_t offset,
                                   int64_t bytes, BdrvRequestFlags flags,
                                   BlockCompletionFunc *cb, void *opaque);
diff --git a/block/block-backend.c b/block/block-backend.c
index 37ba7e9fc40..164bda846f4 100644
--- a/block/block-backend.c
+++ b/block/block-backend.c
@@ -1053,11 +1053,7 @@ char *blk_get_attached_dev_id(BlockBackend *blk)
     return blk_get_attached_dev_id_or_path(blk, true);
 }
 
-/*
- * The caller is responsible for releasing the value returned
- * with g_free() after use.
- */
-static char *blk_get_attached_dev_path(BlockBackend *blk)
+char *blk_get_attached_dev_path(BlockBackend *blk)
 {
     return blk_get_attached_dev_id_or_path(blk, false);
 }
-- 
2.55.0


Reply via email to