Francesco Romani has uploaded a new change for review.

Change subject: numa: reformat to be pep8-friendlier
......................................................................

numa: reformat to be pep8-friendlier

reformat and make the code more pep8 compliant
to improve readability, with no changes in
behaviour.

Change-Id: Ie6a2f726a6cbfb3fdf0a46e212d83e004bee6b06
Signed-off-by: Francesco Romani <[email protected]>
---
M vdsm/numaUtils.py
1 file changed, 12 insertions(+), 8 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/60/37160/1

diff --git a/vdsm/numaUtils.py b/vdsm/numaUtils.py
index 3b0cf8a..bdc3988 100644
--- a/vdsm/numaUtils.py
+++ b/vdsm/numaUtils.py
@@ -66,22 +66,26 @@
     """
 
     vmNumaNodeRuntimeMap = {}
+
     if 'guestNumaNodes' in vm.conf:
         vcpu_to_pcpu = _get_mapping_vcpu_to_pcpu(vm)
         if vcpu_to_pcpu:
             vm_numa_placement = defaultdict(set)
-            vmName = vm.conf['vmName'].encode('utf-8')
-            vcpu_to_pnode = \
-                supervdsm.getProxy().getVcpuNumaMemoryMapping(vmName)
+
+            vcpu_to_pnode = supervdsm.getProxy().getVcpuNumaMemoryMapping(
+                vm.conf['vmName'].encode('utf-8'))
             pcpu_to_pnode = _get_mapping_pcpu_to_pnode()
             vcpu_to_vnode = _get_mapping_vcpu_to_vnode(vm)
-            for vCpu, pCpu in vcpu_to_pcpu.iteritems():
-                vNodeIndex = str(vcpu_to_vnode[vCpu])
-                vm_numa_placement[vNodeIndex].add(pcpu_to_pnode[pCpu])
-                vm_numa_placement[vNodeIndex].update(
-                    vcpu_to_pnode.get(vCpu, ()))
+
+            for vcpu_id, pcpu_id in vcpu_to_pcpu.iteritems():
+                vnode_index = str(vcpu_to_vnode[vcpu_id])
+                vm_numa_placement[vnode_index].add(pcpu_to_pnode[pcpu_id])
+                vm_numa_placement[vnode_index].update(
+                    vcpu_to_pnode.get(vcpu_id, ()))
+
             vmNumaNodeRuntimeMap = dict((k, list(v)) for k, v in
                                         vm_numa_placement.iteritems())
+
     return vmNumaNodeRuntimeMap
 
 


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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ie6a2f726a6cbfb3fdf0a46e212d83e004bee6b06
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Francesco Romani <[email protected]>
_______________________________________________
vdsm-patches mailing list
[email protected]
https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches

Reply via email to