Re: [PATCH] vfio/pci: print vfio-device name to fdinfo

From: Keith Busch
Date: Mon Jun 23 2025 - 17:50:30 EST


On Mon, Jun 23, 2025 at 02:02:38PM -0700, Alex Mastro wrote:
> Print the PCI device name to a vfio device's fdinfo. This enables tools
> to query which device is associated with a given vfio device fd. It's
> inspired by eventfd's printing of "eventfd-id" (fs/eventfd.c), which
> lsof uses to format the NAME column (e.g. "[eventfd:7278]").
>
> This results in output like below:
>
> $ cat /proc/"$process_using_vfio"/fdinfo/"$vfio_device_fd" | grep vfio
> vfio-device-name: 0000:c6:00.0

procfs' fdinfo sounds like the right interface to append this attribute,
so looks looks good to me!

Reviewed-by: Keith Busch <kbusch@xxxxxxxxxx>