aboutsummaryrefslogtreecommitdiffstats
path: root/vnfs/qemu/qemu.py
diff options
context:
space:
mode:
authorMartin Klozik <martinx.klozik@intel.com>2018-02-12 14:20:45 +0000
committerMartin Klozik <martinx.klozik@intel.com>2018-03-12 09:22:49 +0000
commit05f108f9bf0a036565af444f5ae709dc12ac2967 (patch)
treefcbe255c436797d0e2c0bf06056624f5db4bf1f2 /vnfs/qemu/qemu.py
parentb8ef508a78181e017071d9189bb0030305fd1080 (diff)
trex: Tests with T-Rex in VM
Patch introduces a set of testcases with T-Rex running inside VM. JIRA: VSPERF-560 Change-Id: I5b0a0220a2d72428ae1210ee9590d39abdfb9c1d Signed-off-by: Martin Klozik <martinx.klozik@intel.com> Signed-off-by: RadoslawX Glombiowski <radoslawx.glombiowski@intel.com> Reviewed-by: Al Morton <acmorton@att.com> Reviewed-by: Christian Trautman <ctrautma@redhat.com> Reviewed-by: Sridhar Rao <sridhar.rao@spirent.com>
Diffstat (limited to 'vnfs/qemu/qemu.py')
-rw-r--r--vnfs/qemu/qemu.py8
1 files changed, 7 insertions, 1 deletions
diff --git a/vnfs/qemu/qemu.py b/vnfs/qemu/qemu.py
index 8e3d44de..a0128f44 100644
--- a/vnfs/qemu/qemu.py
+++ b/vnfs/qemu/qemu.py
@@ -222,7 +222,13 @@ class IVnfQemu(IVnf):
stdin=proc.stdout)
proc.wait()
- for cpu in range(0, int(S.getValue('GUEST_SMP')[self._number])):
+ # calculate the number of CPUs in SMP topology specified by GUEST_SMP
+ # e.g. "sockets=2,cores=3", "4", etc.
+ cpu_nr = 1
+ for i in re.findall(r'\d', S.getValue('GUEST_SMP')[self._number]):
+ cpu_nr = cpu_nr * int(i)
+ # pin each GUEST's core to host core based on configured BINDING
+ for cpu in range(0, cpu_nr):
match = None
guest_thread_binding = S.getValue('GUEST_THREAD_BINDING')[self._number]
if guest_thread_binding is None: