aboutsummaryrefslogtreecommitdiffstats
path: root/vnfs/qemu
diff options
context:
space:
mode:
authorMartin Klozik <martinx.klozik@intel.com>2018-03-16 05:24:21 +0000
committerGerrit Code Review <gerrit@opnfv.org>2018-03-16 05:24:21 +0000
commit321da7d6f423439dd0772b3c96150e92f484541e (patch)
treec2cb02edf365b118a055c7c54a743c1d7133b08e /vnfs/qemu
parent4a4ee678acca263ac39a67068822f3ffee8ecaf2 (diff)
parent05f108f9bf0a036565af444f5ae709dc12ac2967 (diff)
Merge "trex: Tests with T-Rex in VM"
Diffstat (limited to 'vnfs/qemu')
-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: