File: //lib/python3.12/site-packages/tuned/plugins/__pycache__/plugin_scsi_host.cpython-312.pyc
�
�]�i� � � � d dl Z ddlmZ ddl� d dlZd dlmZ d dlm Z d dl
Z
d dlZej j � Z G d� dej � Zy)� N� )�hotplug)�*)�commandsc �� � � e Zd ZdZ� fd�Z� fd�Zd� Zed� � Zd� Z d� Z
� fd�Z� fd �Z� fd
�Z
ed� � Zd� Zd
� Zd� Zd� Zd� Z edd�� d� � Z ed� dd�� Z� xZS )�SCSIHostPlugina�
Tunes options for SCSI hosts.
The plug-in sets Aggressive Link Power Management (ALPM) to the value specified
by the [option]`alpm` option. The option takes one of four values:
`min_power`, `med_power_with_dipm`, `medium_power` and `max_performance`.
NOTE: ALPM is only available on SATA controllers that use the Advanced
Host Controller Interface (AHCI).
.ALPM setting when extended periods of idle time are expected
====
----
[scsi_host]
alpm=med_power_with_dipm
----
====
c �J �� t t | �
|i |�� t � | _ y �N)�superr �__init__r �_cmd)�self�args�kwargs� __class__s ��C/usr/lib/python3.12/site-packages/tuned/plugins/plugin_scsi_host.pyr zSCSIHostPlugin.__init__ s �� ����&��7��7��j�$�)� c �" �� t t | � � d| _ t � | _ | j j d� D ]9 }| j |� s�| j
j |j � �; t � | _ y )NT�scsi)r r �
_init_devices�_devices_supported�set�
_free_devices�_hardware_inventory�get_devices�_device_is_supported�add�sys_name�_assigned_devices)r �devicer s �r r zSCSIHostPlugin._init_devices% so �� ����+�-� �$���u�$���(�(�4�4�V�<�f�
����'������6�?�?�+� =� �5�$�r c �` � |D �cg c] }| j j d|� �� c}S c c}w �Nr )r �
get_device)r �devices�xs r �_get_device_objectsz"SCSIHostPlugin._get_device_objects/ s- � �BI� J�'�Q�$�
"�
"�
-�
-�f�a�
8�'� J�J�� Js �#+c � � |j dk( S )N� scsi_host)�device_type)�clsr s r r z#SCSIHostPlugin._device_is_supported2 s � �
�
�
��
+�+r c �R � | j j | d| j � y r"