From: Satheesh Rajendran <[email protected]>

Signed-off-by: Satheesh Rajendran <[email protected]>
---
 client/shared/base_utils.py |   12 ++++++++++++
 1 files changed, 12 insertions(+), 0 deletions(-)

diff --git a/client/shared/base_utils.py b/client/shared/base_utils.py
index b262f5d..6ba4a46 100644
--- a/client/shared/base_utils.py
+++ b/client/shared/base_utils.py
@@ -2008,6 +2008,18 @@ def display_data_size(size):
     return '%.2f %s' % (size, prefixes[i])
 
 
+def cpu_affinity_by_task(pid, vcpu_pid):
+    """
+    This function returns the allowed cpus from the proc entry
+    for each vcpu's through its task id for a pid(of a VM)
+    """
+
+    cmd = "cat /proc/%s/task/%s/status|grep Cpus_allowed:| awk '{print $2}'" % 
(pid,vcpu_pid)
+    output = system_output(cmd, ignore_status=False)
+    return output
+
+
+
 def convert_data_size(size, default_sufix='B'):
     '''
     Convert data size from human readable units to an int of arbitrary size.
-- 
1.7.5.4

_______________________________________________
Autotest-kernel mailing list
[email protected]
https://www.redhat.com/mailman/listinfo/autotest-kernel

Reply via email to