404

[ Avaa Bypassed ]




Upload:

Command:

elspacio@18.117.104.4: ~ $
3

�<�eQ�@sjddlZddlmZddlTddlZddljZddlm	Z	ddl
Z
ddlZejj
�ZGdd�dej�ZdS)�N�)�hotplug)�*)�commandscs�eZdZdZ�fdd�Z�fdd�Zdd�Zedd	��Zd
d�Z	dd
�Z
�fdd�Z�fdd�Z�fdd�Z
edd��Zdd�Zdd�Zdd�Zeddd�dd ��Zed�d$d"d#��Z�ZS)%�SCSIHostPlugina�
	`scsi_host`::
	
	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 three values:
	`min_power`, `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=min_power
	----
	====
	cstt|�j||�t�|_dS)N)�superr�__init__r�_cmd)�self�args�kwargs)�	__class__��&/usr/lib/python3.6/plugin_scsi_host.pyr"szSCSIHostPlugin.__init__csVtt|�j�d|_t�|_x,|jjd�D]}|j|�r*|jj	|j
�q*Wt�|_dS)NT�scsi)rr�
_init_devicesZ_devices_supported�setZ
_free_devices�_hardware_inventoryZget_devices�_device_is_supported�addZsys_nameZ_assigned_devices)r
�device)r
rrr's
zSCSIHostPlugin._init_devicescs�fdd�|D�S)Ncsg|]}�jjd|��qS)r)rZ
get_device)�.0�x)r
rr�
<listcomp>2sz6SCSIHostPlugin._get_device_objects.<locals>.<listcomp>r)r
Zdevicesr)r
r�_get_device_objects1sz"SCSIHostPlugin._get_device_objectscCs
|jdkS)NZ	scsi_host)Zdevice_type)�clsrrrrr4sz#SCSIHostPlugin._device_is_supportedcCs|jj|d|j�dS)Nr)rZ	subscribe�_hardware_events_callback)r
rrr�_hardware_events_init8sz$SCSIHostPlugin._hardware_events_initcCs|jj|�dS)N)rZunsubscribe)r
rrr�_hardware_events_cleanup;sz'SCSIHostPlugin._hardware_events_cleanupcs |j|�rtt|�j||�dS)N)rrrr)r
Zeventr)r
rrr>s
z(SCSIHostPlugin._hardware_events_callbackcstt|�j||�dS)N)rr�_added_device_apply_tuning)r
�instance�device_name)r
rrrBsz)SCSIHostPlugin._added_device_apply_tuningcstt|�j||�dS)N)rr�_removed_device_unapply_tuning)r
r r!)r
rrr"Esz-SCSIHostPlugin._removed_device_unapply_tuningcCsddiS)N�alpmr)rrrr�_get_config_optionsHsz"SCSIHostPlugin._get_config_optionscCsd|_d|_dS)NTF)Z_has_static_tuningZ_has_dynamic_tuning)r
r rrr�_instance_initNszSCSIHostPlugin._instance_initcCsdS)Nr)r
r rrr�_instance_cleanupRsz SCSIHostPlugin._instance_cleanupcCstjjdt|�d�S)Nz/sys/class/scsi_host/Zlink_power_management_policy)�os�path�join�str)r
rrrr�_get_alpm_policy_fileUsz$SCSIHostPlugin._get_alpm_policy_filer#T)Z
per_devicecCsd|dkrdS|j|�}|s`tjj|�rF|jj|||r<tjgndd�ntj	d|t
|�f�dS|S)NF)�no_errorzBALPM control file ('%s') not found, skipping ALPM setting for '%s')r+r'r(�existsr	Z
write_to_file�errno�ENOENT�log�infor*)r
�policyrZsim�remove�policy_filerrr�	_set_alpmXs

zSCSIHostPlugin._set_alpmFcCs.|j|�}|jj|dd�j�}|dkr*|SdS)NT)r,�)r+r	Z	read_file�strip)r
rZignore_missingr4r2rrr�	_get_alpmfs
zSCSIHostPlugin._get_alpm)F)�__name__�
__module__�__qualname__�__doc__rrr�classmethodrrrrrr"r$r%r&r+Zcommand_setr5Zcommand_getr8�
__classcell__rr)r
rrs"
r)r.r6rZ
decoratorsZ
tuned.logsZtunedZtuned.constsZconstsZtuned.utils.commandsrr'�reZlogs�getr0ZPluginrrrrr�<module>s



Filemanager

Name Type Size Permission Actions
__init__.cpython-36.opt-1.pyc File 173 B 0644
__init__.cpython-36.pyc File 173 B 0644
base.cpython-36.opt-1.pyc File 21.13 KB 0644
base.cpython-36.pyc File 21.13 KB 0644
decorators.cpython-36.opt-1.pyc File 1.06 KB 0644
decorators.cpython-36.pyc File 1.06 KB 0644
exceptions.cpython-36.opt-1.pyc File 354 B 0644
exceptions.cpython-36.pyc File 354 B 0644
hotplug.cpython-36.opt-1.pyc File 4.23 KB 0644
hotplug.cpython-36.pyc File 4.23 KB 0644
plugin_acpi.cpython-36.opt-1.pyc File 3.35 KB 0644
plugin_acpi.cpython-36.pyc File 3.35 KB 0644
plugin_audio.cpython-36.opt-1.pyc File 4.03 KB 0644
plugin_audio.cpython-36.pyc File 4.03 KB 0644
plugin_bootloader.cpython-36.opt-1.pyc File 24.45 KB 0644
plugin_bootloader.cpython-36.pyc File 24.45 KB 0644
plugin_cpu.cpython-36.opt-1.pyc File 26.03 KB 0644
plugin_cpu.cpython-36.pyc File 26.06 KB 0644
plugin_disk.cpython-36.opt-1.pyc File 16.35 KB 0644
plugin_disk.cpython-36.pyc File 16.35 KB 0644
plugin_eeepc_she.cpython-36.opt-1.pyc File 3.43 KB 0644
plugin_eeepc_she.cpython-36.pyc File 3.43 KB 0644
plugin_irqbalance.cpython-36.opt-1.pyc File 4.51 KB 0644
plugin_irqbalance.cpython-36.pyc File 4.51 KB 0644
plugin_modules.cpython-36.opt-1.pyc File 5.45 KB 0644
plugin_modules.cpython-36.pyc File 5.45 KB 0644
plugin_mounts.cpython-36.opt-1.pyc File 5.5 KB 0644
plugin_mounts.cpython-36.pyc File 5.5 KB 0644
plugin_net.cpython-36.opt-1.pyc File 23.21 KB 0644
plugin_net.cpython-36.pyc File 23.21 KB 0644
plugin_rtentsk.cpython-36.opt-1.pyc File 1.34 KB 0644
plugin_rtentsk.cpython-36.pyc File 1.34 KB 0644
plugin_scheduler.cpython-36.opt-1.pyc File 53.44 KB 0644
plugin_scheduler.cpython-36.pyc File 53.44 KB 0644
plugin_script.cpython-36.opt-1.pyc File 4.26 KB 0644
plugin_script.cpython-36.pyc File 4.31 KB 0644
plugin_scsi_host.cpython-36.opt-1.pyc File 4.56 KB 0644
plugin_scsi_host.cpython-36.pyc File 4.56 KB 0644
plugin_selinux.cpython-36.opt-1.pyc File 3 KB 0644
plugin_selinux.cpython-36.pyc File 3 KB 0644
plugin_service.cpython-36.opt-1.pyc File 13.84 KB 0644
plugin_service.cpython-36.pyc File 13.84 KB 0644
plugin_sysctl.cpython-36.opt-1.pyc File 6.7 KB 0644
plugin_sysctl.cpython-36.pyc File 6.7 KB 0644
plugin_sysfs.cpython-36.opt-1.pyc File 3.64 KB 0644
plugin_sysfs.cpython-36.pyc File 3.64 KB 0644
plugin_systemd.cpython-36.opt-1.pyc File 5.92 KB 0644
plugin_systemd.cpython-36.pyc File 5.92 KB 0644
plugin_uncore.cpython-36.opt-1.pyc File 4.75 KB 0644
plugin_uncore.cpython-36.pyc File 4.75 KB 0644
plugin_usb.cpython-36.opt-1.pyc File 2.95 KB 0644
plugin_usb.cpython-36.pyc File 2.95 KB 0644
plugin_video.cpython-36.opt-1.pyc File 4.13 KB 0644
plugin_video.cpython-36.pyc File 4.13 KB 0644
plugin_vm.cpython-36.opt-1.pyc File 4.11 KB 0644
plugin_vm.cpython-36.pyc File 4.11 KB 0644
repository.cpython-36.opt-1.pyc File 1.87 KB 0644
repository.cpython-36.pyc File 1.92 KB 0644