Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions tuned/plugins/plugin_disk.py
Original file line number Diff line number Diff line change
Expand Up @@ -132,9 +132,15 @@ def _is_hdparm_apm_supported(self, device):
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"])
Expand Down