Merge afbfb7d0f7 into 0eb28ac3d8
This commit is contained in:
commit
ff121e8b12
1 changed files with 6 additions and 0 deletions
|
|
@ -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",
|
||||
|
|
|
|||
Loading…
Reference in a new issue