Francesco Romani has posted comments on this change. Change subject: Implementation for CPU topology reporting ......................................................................
Patch Set 7: (3 comments) http://gerrit.ovirt.org/#/c/23268/7/ovirt-guest-agent/Makefile.am File ovirt-guest-agent/Makefile.am: Line 9: GuestAgentLinux2.py \ Line 10: OVirtAgentLogic.py \ Line 11: VirtIoChannel.py \ Line 12: ovirt-guest-agent.py \ Line 13: topology.py \ tabs vs spaces? No big deal howeverer. Line 14: $(NULL) Line 15: Line 16: noinst_PYTHON=\ Line 17: GuestAgentWin32.py \ http://gerrit.ovirt.org/#/c/23268/7/ovirt-guest-agent/topology.py File ovirt-guest-agent/topology.py: Line 34: def _read_file(*parts): Line 35: f = open(os.path.join('/sys/devices/system/cpu', *parts), 'r') Line 36: result = f.read().replace('\n', '') Line 37: f.close() Line 38: return result pet peeve of mine (so again no big deal): with open(os.path.join('/sys/devices/system/cpu', *parts)) as f: return f.read().replace('\n', '') Line 39: Line 40: Line 41: def _read_topology_file(id, file): Line 42: return _read_file('cpu%d' % id, 'topology', file) Line 52: socket = _read_topology_file(id, 'physical_package_id') Line 53: if not thread in cores: Line 54: cores.add(thread) Line 55: if not socket in sockets: Line 56: sockets.add(socket) I still dont' get why the if check is needed here... if `sockets` and `cores` are sets() just calling add() should do the right thing here. Or am I missing something? Line 57: details.append({ Line 58: 'id': id, Line 59: 'thread': thread, Line 60: 'socket': socket}) -- To view, visit http://gerrit.ovirt.org/23268 To unsubscribe, visit http://gerrit.ovirt.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: If937fd33d2efa11425c814188df2087a85af8357 Gerrit-PatchSet: 7 Gerrit-Project: ovirt-guest-agent Gerrit-Branch: master Gerrit-Owner: Vinzenz Feenstra <[email protected]> Gerrit-Reviewer: Francesco Romani <[email protected]> Gerrit-Reviewer: Michal Skrivanek <[email protected]> Gerrit-Reviewer: Roy Golan <[email protected]> Gerrit-Reviewer: Vinzenz Feenstra <[email protected]> Gerrit-Reviewer: oVirt Jenkins CI Server Gerrit-HasComments: Yes _______________________________________________ Engine-patches mailing list [email protected] http://lists.ovirt.org/mailman/listinfo/engine-patches
