Re: [PATCH] vfio/pci: print vfio-device name to fdinfo
From: Jason Gunthorpe
Date: Tue Jun 24 2025 - 14:16:30 EST
On Tue, Jun 24, 2025 at 09:35:58AM -0700, Alex Mastro wrote:
> > The userspace can deduce more information, like the actual PCI BDF, by
> > mapping the name through sysfs.
>
> In the vfio cdev case, <pci sysfs path>/vfio-dev/X tells you the
> /dev/vfio/devices/X mapping, but is there a straightforward way to map in the
> opposite direction?
There will be a symlink under /sys/class/vfio-xx/XX pointing to the
<pci sysfs path>/vfio-dev/X directory
And another symlink under /sys/dev/char/XX:XX doing the same.
Jason