Skip to content
This repository has been archived by the owner on May 12, 2021. It is now read-only.

Commit

Permalink
Merge pull request #715 from eguzman3/vfio-ids
Browse files Browse the repository at this point in the history
devices: add per-device VFIO ids
  • Loading branch information
Sebastien Boeuf authored Sep 12, 2018
2 parents 92037ab + e21cdf1 commit a5f05bf
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions virtcontainers/device/drivers/vfio.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import (
"fmt"
"io/ioutil"
"path/filepath"
"strconv"
"strings"

"github.com/sirupsen/logrus"
Expand Down Expand Up @@ -64,14 +65,14 @@ func (device *VFIODevice) Attach(devReceiver api.DeviceReceiver) error {
}

// Pass all devices in iommu group
for _, deviceFile := range deviceFiles {
for i, deviceFile := range deviceFiles {
//Get bdf of device eg 0000:00:1c.0
deviceBDF, err := getBDF(deviceFile.Name())
if err != nil {
return err
}
vfio := &config.VFIODev{
ID: utils.MakeNameID("vfio", device.DeviceInfo.ID, maxDevIDSize),
ID: utils.MakeNameID("vfio", device.DeviceInfo.ID+strconv.Itoa(i), maxDevIDSize),
BDF: deviceBDF,
}
device.vfioDevs = append(device.vfioDevs, vfio)
Expand Down

0 comments on commit a5f05bf

Please sign in to comment.