Commit 98254efa authored by Ondřej Lysoněk's avatar Ondřej Lysoněk

scheduler: Refactor

Signed-off-by: default avatarOndřej Lysoněk <>
parent c170b696
......@@ -607,18 +607,22 @@ class SchedulerPlugin(base.Plugin):
@command_custom("isolated_cores", per_device = False, priority = 10)
def _isolated_cores(self, enabling, value, verify, ignore_missing):
# currently unsupported
if verify:
return None
if enabling:
affinity = None
if value is not None:
isolated = set(self._cmd.cpulist_unpack(value))
present = set(self._cpus)
if not isolated.issubset(present):
if isolated.issubset(present):
affinity = list(present - isolated)
str_cpus = ",".join([str(x) for x in self._cpus])
log.error("invalid isolated_cores specified, '%s' don't match available cores '%s'" % (value, str_cpus))
log.error("Invalid isolated_cores specified, '%s' does not match available cores '%s'"
% (value, str_cpus))
if (enabling or verify) and affinity is None:
return None
affinity = list(present - isolated)
# currently unsupported
if verify:
return None
elif enabling:
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment