nodedev: Parse PCI capability_type for SR-IOV device
This will be used in the following patch to recognize SR-IOV capable device. Signed-off-by: Lin Ma <lma@suse.com>
This commit is contained in:
parent
899f53b993
commit
262376d16f
|
@ -279,6 +279,11 @@ class TestNodeDev(unittest.TestCase):
|
||||||
obj = self._nodeDevFromName(nodename)
|
obj = self._nodeDevFromName(nodename)
|
||||||
self.assertEqual(obj.iommu_group, 3)
|
self.assertEqual(obj.iommu_group, 3)
|
||||||
|
|
||||||
|
def testNodeDevSRIOV(self):
|
||||||
|
nodename = "pci_8086_10fb"
|
||||||
|
obj = self._nodeDevFromName(nodename)
|
||||||
|
self.assertEqual(obj.capability_type, "virt_functions")
|
||||||
|
|
||||||
def testNodeDevFail(self):
|
def testNodeDevFail(self):
|
||||||
nodename = "usb_device_1d6b_1_0000_00_1d_1_if0"
|
nodename = "usb_device_1d6b_1_0000_00_1d_1_if0"
|
||||||
devfile = ""
|
devfile = ""
|
||||||
|
|
|
@ -183,6 +183,8 @@ class PCIDevice(NodeDevice):
|
||||||
vendor_name = XMLProperty("./capability/vendor")
|
vendor_name = XMLProperty("./capability/vendor")
|
||||||
vendor_id = XMLProperty("./capability/vendor/@id")
|
vendor_id = XMLProperty("./capability/vendor/@id")
|
||||||
|
|
||||||
|
capability_type = XMLProperty("./capability/capability/@type")
|
||||||
|
|
||||||
iommu_group = XMLProperty("./capability/iommuGroup/@number", is_int=True)
|
iommu_group = XMLProperty("./capability/iommuGroup/@number", is_int=True)
|
||||||
|
|
||||||
def pretty_name(self):
|
def pretty_name(self):
|
||||||
|
|
Loading…
Reference in New Issue