Skip to content

Commit afbfb7d

Browse files
committed
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 <[email protected]>
1 parent c082797 commit afbfb7d

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

tuned/plugins/plugin_disk.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -132,9 +132,15 @@ def _is_hdparm_apm_supported(self, device):
132132
self._hdparm_apm_device_support[device] = True
133133
return True
134134

135+
@staticmethod
136+
def _is_loop_device(device):
137+
LOOP_DEVICE_MAJOR = 7
138+
return os.major(device.device_number) == LOOP_DEVICE_MAJOR
139+
135140
@classmethod
136141
def _device_is_supported(cls, device):
137142
return device.device_type == "disk" and \
143+
not cls._is_loop_device(device) and \
138144
device.attributes.get("removable", None) == b"0" and \
139145
(device.parent is None or \
140146
device.parent.subsystem in ["scsi", "virtio", "xen", "nvme"])

0 commit comments

Comments
 (0)