]> rtime.felk.cvut.cz Git - jailhouse.git/commitdiff
tools: config-create: fix cpu counting
authorHenning Schild <henning.schild@siemens.com>
Fri, 11 Jul 2014 12:56:13 +0000 (14:56 +0200)
committerJan Kiszka <jan.kiszka@siemens.com>
Tue, 22 Jul 2014 13:49:34 +0000 (15:49 +0200)
Count the number of cpus based on another file to detect offline ones as
well. (cpu*/topology/core_id does not exists for offline cpus)

Signed-off-by: Henning Schild <henning.schild@siemens.com>
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
tools/jailhouse-config-create

index fc594ba2baf86fc1a7e40c3332cf101e161eccab..a82759b1b37464505a636d6afcf9f92a67cb34b2 100755 (executable)
@@ -238,7 +238,7 @@ def alloc_mem(regions, size):
 
 
 def count_cpus():
-    list = input_listdir('/sys/devices/system/cpu', ['cpu*/topology/core_id'])
+    list = input_listdir('/sys/devices/system/cpu', ['cpu*/uevent'])
     count = 0
     for f in list:
         if re.match(r'cpu[0-9]+', f):