diff --git a/pkg/utils/utils.go b/pkg/utils/utils.go index c0c4769c9..f3f0551e0 100644 --- a/pkg/utils/utils.go +++ b/pkg/utils/utils.go @@ -295,8 +295,8 @@ func GetVFIODeviceFile(dev string) (devFile string, err error) { namePath := filepath.Join(linkName, "name") // Read the iommu group name // The name file will not exist on baremetal - vfioName, err := ioutil.ReadFile(namePath) - if err == nil { + vfioName, errName := ioutil.ReadFile(namePath) + if errName == nil { vName := strings.TrimSpace(string(vfioName)) // if the iommu group name == vfio-noiommu then we are in a VM, adjust path to vfio device