Change in vdsm[master]: numa: refactor to single pass caps parse
mpolednik at redhat.com
mpolednik at redhat.com
Wed Mar 2 10:08:23 UTC 2016
Martin Polednik has posted comments on this change.
Change subject: numa: refactor to single pass caps parse
......................................................................
Patch Set 9:
(3 comments)
https://gerrit.ovirt.org/#/c/53288/9/lib/vdsm/numa.py
File lib/vdsm/numa.py:
Line 46: siblings = set()
Line 47: online_cpus = []
Line 48:
Line 49: caps = ET.fromstring(capabilities)
Line 50: cells = caps.find('host').find('.//cells').findall('cell')
> I'm a bit torn because I don't like the chained calls, it is a (light) code
Done
Line 51:
Line 52: for cell in cells:
Line 53: cell_id = cell.get('id')
Line 54: meminfo = memory_by_cell(int(cell_id))
Line 52: for cell in cells:
Line 53: cell_id = cell.get('id')
Line 54: meminfo = memory_by_cell(int(cell_id))
Line 55: topology[cell_id]['totalMemory'] = meminfo['total']
Line 56: topology[cell_id]['cpus'] = []
> (very) minor:
Tried and I have to say that I dislike using that approach in this particular case.
Line 57: distances[cell_id] = []
Line 58:
Line 59: for cpu in cell.find('cpus').findall('cpu'):
Line 60: topology[cell_id]['cpus'].append(int(cpu.get('id')))
Line 55: topology[cell_id]['totalMemory'] = meminfo['total']
Line 56: topology[cell_id]['cpus'] = []
Line 57: distances[cell_id] = []
Line 58:
Line 59: for cpu in cell.find('cpus').findall('cpu'):
> same comment as per line 50, albeit less important.
Done
Line 60: topology[cell_id]['cpus'].append(int(cpu.get('id')))
Line 61: if cpu.get('siblings') and cpu.get('socket_id'):
Line 62: online_cpus.append(cpu.get('id'))
Line 63: sockets.add(cpu.get('socket_id'))
--
To view, visit https://gerrit.ovirt.org/53288
To unsubscribe, visit https://gerrit.ovirt.org/settings
Gerrit-MessageType: comment
Gerrit-Change-Id: Ie81b5b76523070ec9fd7a6ffe902ffa25da9e3a6
Gerrit-PatchSet: 9
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: 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