Change in vdsm[master]: ppc64le: fix cpuinfo caps parsing

danken at redhat.com danken at redhat.com
Tue Mar 24 09:22:12 UTC 2015


Dan Kenigsberg has posted comments on this change.

Change subject: ppc64le: fix cpuinfo caps parsing
......................................................................


Patch Set 1:

(2 comments)

https://gerrit.ovirt.org/#/c/39059/1/vdsm/caps.py
File vdsm/caps.py:

Line 143: class Architecture:
Line 144:     X86_64 = 'x86_64'
Line 145:     PPC64 = 'ppc64'
Line 146:     PPC64LE = 'ppc64le'
Line 147:     POWER = (PPC64, PPC64LE)
Defining "enumerables" of two different types does not feel right. It requires every user of Architecture class to remember that using Architecture.POWER is inherently different than others.

How about defining

@staticmethod
def is_power(arch):
   return arch in (PPC64, PPC64LE)

?
Line 148: 
Line 149: 
Line 150: class CpuInfo(object):
Line 151:     def __init__(self, cpuinfo='/proc/cpuinfo'):


Line 193: 
Line 194: class CpuTopology(object):
Line 195:     def __init__(self, capabilities=None):
Line 196: 
Line 197:         if platform.machine() == Architecture.PPC64:
> This needs to be removed - in future patch.
can you explain why a future patch? It seems logically related to this patch.
Line 198:             from ppc64HardwareInfo import \
Line 199:                 getCpuTopology as getPPC64CpuTopology
Line 200:             self._topology = getPPC64CpuTopology(capabilities)
Line 201:         else:


-- 
To view, visit https://gerrit.ovirt.org/39059
To unsubscribe, visit https://gerrit.ovirt.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: I042e817e4f97866be3a762efb3cf7afdd3ecee7f
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: Madhu Pavan <kmp at linux.vnet.ibm.com>
Gerrit-Reviewer: Martin Polednik <mpolednik at redhat.com>
Gerrit-Reviewer: Michal Skrivanek <michal.skrivanek at redhat.com>
Gerrit-Reviewer: automation at ovirt.org
Gerrit-Reviewer: oVirt Jenkins CI Server
Gerrit-HasComments: Yes


More information about the vdsm-patches mailing list