1
0
Fork 0
This commit is contained in:
Andreas Hasenack 2026-05-17 10:04:00 +00:00 committed by GitHub
commit ff121e8b12
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -129,9 +129,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",