1
0
mirror of https://github.com/ARM-software/workload-automation.git synced 2024-10-05 18:31:12 +01:00

Fix hotplugging all cores on a cluster.

When attempting to set number of cores on a cluster to 0, make
sure at least one core is enabled on the other cluster beforehand.
This commit is contained in:
Sergei Trofimov 2015-03-27 12:54:26 +00:00
parent 58ab762131
commit 925c354551

View File

@ -697,6 +697,17 @@ class BaseLinuxDevice(Device): # pylint: disable=abstract-method
if number > max_cores:
message = 'Attempting to set the number of active {} to {}; maximum is {}'
raise ValueError(message.format(core, number, max_cores))
if not number:
# make sure at least one other core is enabled to avoid trying to
# hotplug everything.
for i, c in enumerate(self.core_names):
if c != core:
self.enable_cpu(i)
break
else: # did not find one
raise ValueError('Cannot hotplug all cpus on the device!')
for i in xrange(0, number):
self.enable_cpu(core_ids[i])
for i in xrange(number, max_cores):