Martin Polednik has uploaded a new change for review.

Change subject: hostdev: remove physfn attribute in physfn
......................................................................

hostdev: remove physfn attribute in physfn

Previously, detecting physfn was done via finding capabilities
inside capabilities element, where address element pointed to physfn.
This caused capabilities element in physfn with type 'virt_functions'
to wrongly reference physfn in physfn. This patch fixes the bug,
adding check for type attribute inside capabilities element, therefore
removing the wrongful referencing.

Change-Id: I9d2cbdb1c53eda9929b35596b6192b2ae6b1b344
Signed-off-by: Martin Polednik <[email protected]>
---
M tests/hostdevTests.py
M vdsm/hostdev.py
2 files changed, 2 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/95/37395/1

diff --git a/tests/hostdevTests.py b/tests/hostdevTests.py
index 69b1121..6abd017 100644
--- a/tests/hostdevTests.py
+++ b/tests/hostdevTests.py
@@ -390,7 +390,6 @@
 _SRIOV_PF_PARSED = {'capability': 'pci',
                     'iommu_group': '15',
                     'parent': 'pci_0000_00_09_0',
-                    'physfn': 'pci_0000_05_10_1',
                     'product': '82576 Gigabit Network Connection',
                     'product_id': '0x10c9',
                     'totalvfs': 7,
diff --git a/vdsm/hostdev.py b/vdsm/hostdev.py
index d6b8cfa..f4c4615 100644
--- a/vdsm/hostdev.py
+++ b/vdsm/hostdev.py
@@ -72,7 +72,8 @@
                 params[element] = elementXML.text
 
     physfn = caps.find('capability')
-    if physfn is not None and params['capability'] == 'pci':
+    if physfn is not None and physfn.attrib['type'] == 'phys_function' \
+            and params['capability'] == 'pci':
         address = physfn.find('address')
         params['physfn'] = _pci_address_to_name(**address.attrib)
 


-- 
To view, visit http://gerrit.ovirt.org/37395
To unsubscribe, visit http://gerrit.ovirt.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I9d2cbdb1c53eda9929b35596b6192b2ae6b1b344
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Martin Polednik <[email protected]>
_______________________________________________
vdsm-patches mailing list
[email protected]
https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches

Reply via email to