HEX
Server: LiteSpeed
System: Linux kapuas.iixcp.rumahweb.net 5.14.0-427.42.1.el9_4.x86_64 #1 SMP PREEMPT_DYNAMIC Fri Nov 1 14:58:02 EDT 2024 x86_64
User: mirz4654 (1666)
PHP: 8.1.33
Disabled: system,exec,escapeshellarg,escapeshellcmd,passthru,proc_close,proc_get_status,proc_nice,proc_open,proc_terminate,shell_exec,popen,pclose,dl,pfsockopen,leak,apache_child_terminate,posix_kill,posix_mkfifo,posix_setsid,posix_setuid,posix_setpgid,ini_alter,show_source,define_syslog_variables,symlink,syslog,openlog,openlog,closelog,ocinumcols,listen,chgrp,apache_note,apache_setenv,debugger_on,debugger_off,ftp_exec,dll,ftp,myshellexec,socket_bind,mail,posix_getwpuid
Upload Files
File: //usr/lib/python3.9/site-packages/tuned/plugins/__pycache__/hotplug.cpython-39.pyc
a

,�g��@s@ddlmZddlmZddlZej��ZGdd�dej	�Z	dS)�)�base�Ncs�eZdZdZ�fdd�Z�fdd�Zdd�Zdd	�Zd
d�Zdd
�Z	dd�Z
dd�Zdd�Zdd�Z
dd�Zdd�Zdd�Zdd�Zdd�Z�ZS) �Pluginz:
	Base class for plugins with device hotpluging support.
	cstt|�j|i|��dS�N)�superr�__init__)�self�args�kwargs��	__class__��9/usr/lib/python3.9/site-packages/tuned/plugins/hotplug.pyrszPlugin.__init__cstt|���|��dSr)rr�cleanup�_hardware_events_cleanup�rrr
rrszPlugin.cleanupcCsdSrr
rr
r
r�_hardware_events_initszPlugin._hardware_events_initcCsdSrr
rr
r
rrszPlugin._hardware_events_cleanupcCs|��dSr)rrr
r
r�
_init_devicesszPlugin._init_devicescCst|dkr&t�d|j�|�|j�nJ|dkrLt�d|j�|�|j�n$|dkrpt�d|j�|�|j�dS)N�addzdevice '%s', add event�removezdevice '%s', remove event�movez-device: '%s', rename event, reported new name)�log�infoZsys_name�_add_device�_remove_device�_move_device)rZeventZdevicer
r
r�_hardware_events_callbacksz Plugin._hardware_events_callbackcCsdt�d|j|f�|j�|�|�||jd|g�|�||�|�||jd|g�|j	�|�dS)Nz!instance %s: adding new device %sZapply)
rr�name�_assigned_devicesr�_call_device_script�
script_pre�_added_device_apply_tuning�script_post�processed_devices�r�instance�device_namer
r
r�_add_device_process'szPlugin._add_device_processcCsp||j|jBvrdSt|j���D].\}}t|�||g��dkr"|�||�qlq"t�	d|�|j�
|�dS)Nrzno instance wants %s)r�
_free_devices�list�
_instances�items�lenZ_get_matching_devicesr'r�debugr)rr&Z
instance_namer%r
r
rr/szPlugin._add_devicecCs4|D]}|�||�qt|j�t|j�dk|_dS)zN
		Add devices specified by the set to the instance, no check is performed.
		rN)r'r,r#�assigned_devices�active�rr%Zdevice_names�devr
r
r�_add_devices_nocheck;s��zPlugin._add_devices_nocheckcCsx||jvrt|�||jd|g�|�||�|�||jd|g�|j�|�t|j�t|j�dk|_|j	�|�dSdS)NZunapplyrTF)
r#rr"�_removed_device_unapply_tuningr rr,r.r/rr$r
r
r�_remove_device_processFs
��zPlugin._remove_device_processcCsdS)aeRename device in the instance, this probably applies only
		to network interfaces. The udev device environment is
		mostly unchanged (except the name) and the old device name
		isn't announced, thus the rename functionality is plugin
		dependant and has to be implemented in the child plugin class.

		Parameters:
		device_name -- new name of the device

		Nr
)rr&r
r
rrTszPlugin._move_devicecCsH||j|jBvrdSt|j���D]}|�||�r"qDq"|j�|�dS)zVRemove device from the instance

		Parameters:
		device_name -- name of the device

		N)rr(r)r*�valuesr4r)rr&r%r
r
rraszPlugin._remove_devicecCs|D]}|�||�qdS)zS
		Remove devices specified by the set from the instance, no check is performed.
		N)r4r0r
r
r�_remove_devices_nocheckqszPlugin._remove_devices_nocheckcCs6|�||g�|jr2|j�tjtj�r2|�||�dSr)Z_execute_all_device_commands�has_dynamic_tuning�_global_cfg�get�consts�CFG_DYNAMIC_TUNING�CFG_DEF_DYNAMIC_TUNINGZ_instance_apply_dynamicr$r
r
rr!xsz!Plugin._added_device_apply_tuningcCs:|jr$|j�tjtj�r$|�||�|j||gdd�dS)NT)r)r7r8r9r:r;r<Z_instance_unapply_dynamicZ_cleanup_all_device_commandsr$r
r
rr3}sz%Plugin._removed_device_unapply_tuning)�__name__�
__module__�__qualname__�__doc__rrrrrrr'rr2r4rrr6r!r3�
__classcell__r
r
rrrs 
r)
�rZtuned.constsr:Z
tuned.logsZtunedZlogsr9rrr
r
r
r�<module>s