Add a getter function for the if_name array, so that also outside functions can access it.
Signed-off-by: Emanuele Giuseppe Esposito <eespo...@redhat.com> --- blockdev.c | 5 +++++ include/sysemu/blockdev.h | 1 + 2 files changed, 6 insertions(+) diff --git a/blockdev.c b/blockdev.c index b35072644e..1581f0d2f5 100644 --- a/blockdev.c +++ b/blockdev.c @@ -83,6 +83,11 @@ static const char *const if_name[IF_COUNT] = { [IF_XEN] = "xen", }; +const char *block_if_name(BlockInterfaceType iface) +{ + return if_name[iface]; +} + static int if_max_devs[IF_COUNT] = { /* * Do not change these numbers! They govern how drive option diff --git a/include/sysemu/blockdev.h b/include/sysemu/blockdev.h index 32c2d6023c..b321286dee 100644 --- a/include/sysemu/blockdev.h +++ b/include/sysemu/blockdev.h @@ -42,6 +42,7 @@ DriveInfo *blk_legacy_dinfo(BlockBackend *blk); DriveInfo *blk_set_legacy_dinfo(BlockBackend *blk, DriveInfo *dinfo); BlockBackend *blk_by_legacy_dinfo(DriveInfo *dinfo); +const char *block_if_name(BlockInterfaceType iface); void override_max_devs(BlockInterfaceType type, int max_devs); DriveInfo *drive_get(BlockInterfaceType type, int bus, int unit); -- 2.31.1