Change in vdsm[master]: numa: get distance information from libvirt

mpolednik at redhat.com mpolednik at redhat.com
Mon Feb 15 11:45:29 UTC 2016


Martin Polednik has posted comments on this change.

Change subject: numa: get distance information from libvirt
......................................................................


Patch Set 3:

(3 comments)

https://gerrit.ovirt.org/#/c/53285/3/vdsm/caps.py
File vdsm/caps.py:

Line 253:     if capabilities is None:
Line 254:         capabilities = _getCapsXMLStr()
Line 255:     caps = ET.fromstring(capabilities)
Line 256:     cells = caps.find('host').find('.//cells').findall('cell')
Line 257:     distances = {}
> minor: maybe defaultdict(list) ?
good point, I think it is added later on (as I'm not exactly happy about adding defaultdict to caps and removing it right after) but let's get it here.
Line 258:     for cell in cells:
Line 259:         cellIndex = cell.get('id')
Line 260:         distances[cellIndex] = []
Line 261:         for sibling in cell.find('distances').findall('sibling'):


Line 255:     caps = ET.fromstring(capabilities)
Line 256:     cells = caps.find('host').find('.//cells').findall('cell')
Line 257:     distances = {}
Line 258:     for cell in cells:
Line 259:         cellIndex = cell.get('id')
> same as below
Needs to remain a string to be compatible with previous API.
Line 260:         distances[cellIndex] = []
Line 261:         for sibling in cell.find('distances').findall('sibling'):
Line 262:             distances[cellIndex].append(sibling.get('value'))
Line 263: 


Line 258:     for cell in cells:
Line 259:         cellIndex = cell.get('id')
Line 260:         distances[cellIndex] = []
Line 261:         for sibling in cell.find('distances').findall('sibling'):
Line 262:             distances[cellIndex].append(sibling.get('value'))
> this will be a str, right? do we need to make it an int?
Right in this case.
Line 263: 
Line 264:     return distances
Line 265: 
Line 266: 


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

Gerrit-MessageType: comment
Gerrit-Change-Id: I80b423e27fa37bc49388cca72785b081e4365e69
Gerrit-PatchSet: 3
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Martin Polednik <mpolednik 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