disk plugin: ignore loop devices
It doesn't make sense to apply tuning parameters to loop devices, since they point at files that live in other block devices, also subject to tuning. Signed-off-by: Andreas Hasenack <andreas.hasenack@canonical.com>
This commit is contained in:
parent
c082797fd0
commit
afbfb7d0f7
1 changed files with 6 additions and 0 deletions
|
|
@ -132,9 +132,15 @@ class DiskPlugin(hotplug.Plugin):
|
|||
self._hdparm_apm_device_support[device] = True
|
||||
return True
|
||||
|
||||
@staticmethod
|
||||
def _is_loop_device(device):
|
||||
LOOP_DEVICE_MAJOR = 7
|
||||
return os.major(device.device_number) == LOOP_DEVICE_MAJOR
|
||||
|
||||
@classmethod
|
||||
def _device_is_supported(cls, device):
|
||||
return device.device_type == "disk" and \
|
||||
not cls._is_loop_device(device) and \
|
||||
device.attributes.get("removable", None) == b"0" and \
|
||||
(device.parent is None or \
|
||||
device.parent.subsystem in ["scsi", "virtio", "xen", "nvme"])
|
||||
|
|
|
|||
Loading…
Reference in a new issue