dbus: ensure that hotplug operations only work on hotplug plugins
This adds a check to instance_acquire_devices to ensure that the plugin actually supports the requested operation. Signed-off-by: Adriaan Schmidt <adriaan.schmidt@siemens.com>
This commit is contained in:
parent
b10bafce48
commit
6c48757c2f
1 changed files with 5 additions and 0 deletions
|
|
@ -5,6 +5,7 @@ from tuned.exceptions import TunedException
|
|||
import threading
|
||||
import tuned.consts as consts
|
||||
from tuned.utils.commands import commands
|
||||
from tuned.plugins import hotplug
|
||||
|
||||
__all__ = ["Controller"]
|
||||
|
||||
|
|
@ -352,6 +353,10 @@ class Controller(tuned.exports.interfaces.ExportableInterface):
|
|||
rets = "Instance '%s' not found" % instance_name
|
||||
log.error(rets)
|
||||
return (False, rets)
|
||||
if not isinstance(instance_target.plugin, hotplug.Plugin):
|
||||
rets = "Plugin '%s' does not support hotplugging or dynamic instances." % instance_target.plugin.name
|
||||
log.error(rets)
|
||||
return (False, rets)
|
||||
devs = set(self._cmd.devstr2devs(devices))
|
||||
log.debug("Instance '%s' trying to acquire devices '%s'." % (instance_target.name, str(devs)))
|
||||
for instance in self._daemon._unit_manager.instances:
|
||||
|
|
|
|||
Loading…
Reference in a new issue