Change in vdsm[master]: hostdev: fix detection for ppc64le
fromani at redhat.com
fromani at redhat.com
Tue Dec 15 14:52:14 UTC 2015
Francesco Romani has posted comments on this change.
Change subject: hostdev: fix detection for ppc64le
......................................................................
Patch Set 1:
(1 comment)
works, let's try some improvements
https://gerrit.ovirt.org/#/c/50525/1/vdsm/caps.py
File vdsm/caps.py:
Line 580: if platform.machine() in Architecture.POWER:
Line 581: return (bool(len(os.listdir('/sys/kernel/iommu_groups'))))
Line 582: else:
Line 583: return (bool(len(os.listdir('/sys/class/iommu'))) and
Line 584: bool(len(os.listdir('/sys/kernel/iommu_groups'))))
what about something like:
try:
supported_groups = bool(len(os.listdir('/sys/kernel/iommu_groups')))
if platform.machine() in Architecture.POWER:
# one-line comment explaing why this is enough
return supported_groups
return (bool(len(os.listdir('/sys/class/iommu'))) and supported_groups
except OSError:
return False
feel free to fix the naming as you like most.
Line 585: except OSError:
Line 586: return False
Line 587:
Line 588:
--
To view, visit https://gerrit.ovirt.org/50525
To unsubscribe, visit https://gerrit.ovirt.org/settings
Gerrit-MessageType: comment
Gerrit-Change-Id: I314c8bda6a6831bf334e08085e8bf2fc4874aced
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Martin Polednik <mpolednik at redhat.com>
Gerrit-Reviewer: Dan Kenigsberg <danken at redhat.com>
Gerrit-Reviewer: Francesco Romani <fromani at redhat.com>
Gerrit-Reviewer: Ido Barkan <ibarkan at redhat.com>
Gerrit-Reviewer: Jenkins CI
Gerrit-Reviewer: Martin Polednik <mpolednik at redhat.com>
Gerrit-Reviewer: gerrit-hooks <automation at ovirt.org>
Gerrit-HasComments: Yes
More information about the vdsm-patches
mailing list