mirror of
https://github.com/virt-manager/virt-manager.git
synced 2025-01-11 05:17:59 +03:00
nodedev: Parse PCI iommuGroup
This commit is contained in:
parent
2301f19e4b
commit
6673123185
@ -217,6 +217,11 @@ class TestNodeDev(unittest.TestCase):
|
||||
devfile = "pcidev.xml"
|
||||
self._testNode2DeviceCompare(nodename, devfile)
|
||||
|
||||
def testPCIParse(self):
|
||||
nodename = "pci_1180_476"
|
||||
obj = self._nodeDevFromName(nodename)
|
||||
self.assertEqual(obj.iommu_group, 3)
|
||||
|
||||
def testNodeDevFail(self):
|
||||
nodename = "usb_device_1d6b_1_0000_00_1d_1_if0"
|
||||
devfile = ""
|
||||
|
@ -1678,6 +1678,9 @@ ba</description>
|
||||
<function>50</function>
|
||||
<product id='0x0476'>RL5c476 II</product>
|
||||
<vendor id='0x1180'>Ricoh Co Ltd</vendor>
|
||||
<iommuGroup number='3'>
|
||||
<address domain='0x0000' bus='0x15' slot='0x00' function='0x4'/>
|
||||
</iommuGroup>
|
||||
</capability>
|
||||
</device>
|
||||
|
||||
@ -1692,6 +1695,9 @@ ba</description>
|
||||
<function>4</function>
|
||||
<product id='0x0592'>R5C592 Memory Stick Bus Host Adapter</product>
|
||||
<vendor id='0x1180'>Ricoh Co Ltd</vendor>
|
||||
<iommuGroup number='3'>
|
||||
<address domain='0x0001' bus='0x15' slot='0x0A' function='0x4'/>
|
||||
</iommuGroup>
|
||||
</capability>
|
||||
</device>
|
||||
|
||||
|
@ -171,6 +171,8 @@ class PCIDevice(NodeDevice):
|
||||
vendor_name = XMLProperty("./capability/vendor")
|
||||
vendor_id = XMLProperty("./capability/vendor/@id")
|
||||
|
||||
iommu_group = XMLProperty("./capability/iommuGroup/@number", is_int=True)
|
||||
|
||||
def pretty_name(self, child_dev=None):
|
||||
devstr = "%.2X:%.2X:%X" % (int(self.bus),
|
||||
int(self.slot),
|
||||
|
Loading…
Reference in New Issue
Block a user