Dan Kenigsberg has posted comments on this change.

Change subject: caps: Repair collect numa information
......................................................................


Patch Set 1: Code-Review-1

(3 comments)

http://gerrit.ovirt.org/#/c/27090/1/tests/capsTests.py
File tests/capsTests.py:

Line 39: 
Line 40:     def __get__(self, obj, objtype):
Line 41:         return None
Line 42: 
Line 43: utils.memoized = FakeMemoized
This is going to affect all tests that are going to be run after this one. 

Making the test aware of the memoized-ness of caps._getNumaTopology (by testing 
caps._getNumaTopology.func instead) is a small price to make to avoid this side 
effect.
Line 44: reload(caps)
Line 45: 
Line 46: 
Line 47: def _getTestData(testFileName):


http://gerrit.ovirt.org/#/c/27090/1/vdsm/caps.py
File vdsm/caps.py:

Line 199:         cellsInfo[cellIndex] = cellInfo
Line 200:     return cellsInfo
Line 201: 
Line 202: 
Line 203: def _getMemoryStatsByNumaCell(cell):
this function now does two completely things, one of them has -- by definition 
-- nothing to do with the name of the function.

Please define a new function, say "_getUmaMemoryStats", and call it from 
_getNumaTopology.
Line 204:     """
Line 205:     Get the memory stats of a specified numa node.
Line 206: 
Line 207:     :param cell: the index of numa node. If the cell is 
_NON_NUMA_SUPPORT,


Line 210:     :return: dict like {'total': 50321208L, 'free': 47906488L}
Line 211:     """
Line 212:     memDict = {}
Line 213:     if cell == _NON_NUMA_SUPPORT:
Line 214:         memDict['total'] = long(utils.readMemInfo()['MemTotal'])
afair utils.readMemInfo()['MemTotal'] is already an integer. Is the explicit 
conversion to long() really needed?
Line 215:         memDict['free'] = long(utils.readMemInfo()['MemFree'])
Line 216:     else:
Line 217:         memDict = libvirtconnection.get().getMemoryStats(cell, 0)
Line 218:     return memDict


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

Gerrit-MessageType: comment
Gerrit-Change-Id: Ifb70231c81e75d29107f4ea89367aa33d8e85bad
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Xiaolei Shi <[email protected]>
Gerrit-Reviewer: Adam Litke <[email protected]>
Gerrit-Reviewer: Antoni Segura Puimedon <[email protected]>
Gerrit-Reviewer: Dan Kenigsberg <[email protected]>
Gerrit-Reviewer: Gilad Chaplik <[email protected]>
Gerrit-Reviewer: Martin Sivák <[email protected]>
Gerrit-Reviewer: Xiaolei Shi <[email protected]>
Gerrit-Reviewer: [email protected]
Gerrit-Reviewer: oVirt Jenkins CI Server
Gerrit-HasComments: Yes
_______________________________________________
vdsm-patches mailing list
[email protected]
https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches

Reply via email to