Add iommugrp argument to getPci function
authorReto Buerki <reet@codelabs.ch>
Fri, 8 Sep 2017 13:43:05 +0000 (15:43 +0200)
committerReto Buerki <reet@codelabs.ch>
Fri, 8 Sep 2017 15:44:03 +0000 (17:44 +0200)
src/creator.py
test/test_creator.py

index 9849a21..60c07a1 100644 (file)
@@ -490,7 +490,7 @@ class PciDevicesCreator():
                                 ". Please update pci.ids (-u) and try again"))
         return classname
 
-    def getPci(self, devicepath, devicecapmgr, devicespec):
+    def getPci(self, devicepath, devicecapmgr, devicespec, iommugrpdir):
         pcistr = os.path.basename(devicepath)
         return schemadata.schema.pciType(
             bus=util.wrap16(self.getDeviceBus(pcistr)),
@@ -615,7 +615,8 @@ class PciDevicesCreator():
         if devicespec.descr:
             device.description = devicespec.descr
 
-        device.pci = self.getPci(devicepath, devicecapmgr, devicespec)
+        device.pci = self.getPci(devicepath, devicecapmgr, devicespec,
+                                 iommugrp)
 
         # irq
         for irq in self.getIrqs(devicepath):
index 5fdb126..8b32b68 100644 (file)
@@ -439,7 +439,8 @@ class TestPciDevicesCreator:
             revisionId="16#a1#",
             descr="Some device")
 
-        dev_pci = self.pcicreator.getPci(dev, devicecapmgr, devicespec)
+        dev_pci = self.pcicreator.getPci(dev, devicecapmgr, devicespec,
+                                         testpaths.PATH_IOMMUGRP)
         assert dev_pci.bus == "16#01#"
         assert dev_pci.function == 3
         assert dev_pci.device == "16#02#"