From 66be73be3eef8b16a479fb4325cca9f3c9709597 Mon Sep 17 00:00:00 2001 From: Valentin Schneider Date: Thu, 23 Aug 2018 14:11:10 +0100 Subject: [PATCH] module/hotplug: Add list_hotpluggable_cpus helper This is similar to the list_{online/offline}_cpus helpers from Target --- devlib/module/hotplug.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/devlib/module/hotplug.py b/devlib/module/hotplug.py index d28056a..a71073e 100644 --- a/devlib/module/hotplug.py +++ b/devlib/module/hotplug.py @@ -35,6 +35,10 @@ class HotplugModule(Module): cpu = 'cpu{}'.format(cpu) return target.path.join(cls.base_path, cpu, 'online') + def list_hotpluggable_cpus(self): + return [cpu for cpu in range(self.target.number_of_cpus) + if self.target.file_exists(self._cpu_path(self.target, cpu))] + def online_all(self): self.target._execute_util('hotplug_online_all', # pylint: disable=protected-access as_root=self.target.is_rooted)