gpu: IOMMUFD provide proper ID

We need a proper ID otherwise QEMU sometimes fails with invalid ID.
Use the same pattern as with the old VFIO implementation.

Signed-off-by: Zvonko Kaiser <zkaiser@nvidia.com>
This commit is contained in:
Zvonko Kaiser 2025-02-24 18:26:46 +00:00
parent e09ae2cc0b
commit 804e5cd332

View File

@ -224,10 +224,11 @@ func GetDeviceFromVFIODev(device config.DeviceInfo) ([]*config.VFIODev, error) {
deviceID := getPCIDeviceProperty(deviceBDF, PCISysFsDevicesDevice) deviceID := getPCIDeviceProperty(deviceBDF, PCISysFsDevicesDevice)
pciClass := getPCIDeviceProperty(deviceBDF, PCISysFsDevicesClass) pciClass := getPCIDeviceProperty(deviceBDF, PCISysFsDevicesClass)
id, err := extractIndex(device.HostPath) i, err := extractIndex(device.HostPath)
if err != nil { if err != nil {
return nil, err return nil, err
} }
id := utils.MakeNameID("vfio", device.ID+i, maxDevIDSize)
vfio := config.VFIODev{ vfio := config.VFIODev{
ID: id, ID: id,