Skip to content

Commit

Permalink
Implementation of getting the iommu pci devices address
Browse files Browse the repository at this point in the history
Add the function of getting the pci devices addresses
sharing the same iommuGroup.

Signed-off-by: Lily Zhu <[email protected]>
  • Loading branch information
iccaszhulili committed Sep 11, 2017
1 parent bf5087b commit 02c3291
Showing 1 changed file with 24 additions and 1 deletion.
25 changes: 24 additions & 1 deletion virttest/libvirt_xml/nodedev_xml.py
Original file line number Diff line number Diff line change
Expand Up @@ -140,8 +140,27 @@ class for capability whose type is pci.
# <numa node='0'/>
#</capability>

# or the Example of iommu:
#<capability type="pci">
#<domain>0</domain>
#<bus>4</bus>
#<slot>0</slot>
#<function>1</function>
#<product id="0x1639">NetXtreme II BCM5709 Gigabit Ethernet</product>
#<vendor id="0x14e4">Broadcom Limited</vendor>
#<iommuGroup number="15">
# <address bus="0x04" domain="0x0000" function="0x0" slot="0x00" />
# <address bus="0x04" domain="0x0000" function="0x1" slot="0x00" />
#</iommuGroup>
#<numa node="0" />
#<pci-express>
# <link port="0" speed="5" validity="cap" width="4" />
# <link speed="5" validity="sta" width="4" />
#</pci-express>
#</capability>

__slots__ = ('domain', 'bus', 'slot', 'function', 'product_id',
'vendor_id', 'virt_functions', 'numa_node')
'vendor_id', 'virt_functions', 'iommuGroup_number', 'numa_node')

def __init__(self, virsh_instance=base.virsh):
accessors.XMLElementInt('domain', self, parent_xpath='/',
Expand All @@ -162,6 +181,10 @@ def __init__(self, virsh_instance=base.virsh):
parent_xpath='/capability',
marshal_from=self.marshal_from_address,
marshal_to=self.marshal_to_address)
accessors.XMLElementList('iommuGroup_number', self,
parent_xpath='/iommuGroup',
marshal_from=self.marshal_from_address,
marshal_to=self.marshal_to_address)
super(PCIXML, self).__init__(virsh_instance=virsh_instance)
self.xml = (' <capability type=\'pci\'></capability>')

Expand Down

0 comments on commit 02c3291

Please sign in to comment.