aboutsummaryrefslogtreecommitdiffstats
path: root/src/vlib/linux/vfio.c
diff options
context:
space:
mode:
authorDamjan Marion <damarion@cisco.com>2023-08-07 01:07:09 +0200
committerFlorin Coras <florin.coras@gmail.com>2023-08-07 18:00:10 +0000
commit40f481037ef98442b061e310a04ee5e110120f72 (patch)
tree20ecc6d1c7bcc701417b5bbbfd51cd2d1eadfa24 /src/vlib/linux/vfio.c
parent993735913c6764d7a66c8fae4196a61206611186 (diff)
vppinfra: add clib_file_get_resolved_basename
more generic version of clib_sysfs_link_to_name with support for format strings... Type: improvement Change-Id: I0cb263748970378c661415196eb7e08450370677 Signed-off-by: Damjan Marion <damarion@cisco.com>
Diffstat (limited to 'src/vlib/linux/vfio.c')
-rw-r--r--src/vlib/linux/vfio.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/src/vlib/linux/vfio.c b/src/vlib/linux/vfio.c
index dc68c52db02..ee04081d767 100644
--- a/src/vlib/linux/vfio.c
+++ b/src/vlib/linux/vfio.c
@@ -185,10 +185,8 @@ linux_vfio_group_get_device_fd (vlib_pci_addr_t * addr, int *fdp,
int fd;
*is_noiommu = 0;
- s =
- format (s, "/sys/bus/pci/devices/%U/iommu_group%c", format_vlib_pci_addr,
- addr, 0);
- tmpstr = clib_sysfs_link_to_name ((char *) s);
+ tmpstr = clib_file_get_resolved_basename (
+ "/sys/bus/pci/devices/%U/iommu_group", format_vlib_pci_addr, addr);
if (tmpstr)
{
iommu_group = atoi ((char *) tmpstr);