[V5,2/2] framework/virt_base: add pin_threads parameter when start VM

Message ID 20221213070847.3355391-1-weix.ling@intel.com (mailing list archive)
State Superseded
Headers
Series support pin VM's thread to vhost CPU lcore |

Checks

Context Check Description
ci/Intel-dts-format-test success Testing OK
ci/Intel-dts-pylama-test fail Testing issues
ci/Intel-dts-suite-test fail Testing issues

Commit Message

Ling, WeiX Dec. 13, 2022, 7:08 a.m. UTC
  Add pin_threads parameter when start VM default pin_threads=True.

Signed-off-by: Wei Ling <weix.ling@intel.com>
---
 framework/virt_base.py | 13 ++++++++++---
 1 file changed, 10 insertions(+), 3 deletions(-)
  

Patch

diff --git a/framework/virt_base.py b/framework/virt_base.py
index a7fc8c4e..04b712e1 100644
--- a/framework/virt_base.py
+++ b/framework/virt_base.py
@@ -273,7 +273,14 @@  class VirtBase(object):
         self._attach_vm()
         return None
 
-    def start(self, load_config=True, set_target=True, cpu_topo="", bind_dev=True):
+    def start(
+        self,
+        load_config=True,
+        set_target=True,
+        cpu_topo="",
+        bind_dev=True,
+        pin_threads=True,
+    ):
         """
         Start VM and instantiate the VM with VirtDut.
         """
@@ -284,7 +291,7 @@  class VirtBase(object):
             self.compose_boot_param()
 
             # start virtual machine
-            self._start_vm()
+            self._start_vm(pin_threads=pin_threads)
 
             if self.vm_status is ST_RUNNING:
                 # connect vm dut and init running environment
@@ -382,7 +389,7 @@  class VirtBase(object):
         else:
             return False
 
-    def _start_vm(self):
+    def _start_vm(self, pin_threads=True):
         """
         Start VM.
         """