← Back
Editing: hotplug.cpython-312.pyc
� �]�i � � � d dl mZ ddlmZ ddlZej j � Z G d� dej � Z y)� )�base� Nc �z � � e Zd ZdZ� fd�Z� fd�Zd� Zd� Zd� Zd� Z d� Z d � Zd � Zd� Z d� Zd � Zd� Zd� Zd� Z� xZS )�Pluginz: Base class for plugins with device hotpluging support. c �, �� t t | � |i |�� y �N)�superr �__init__)�self�args�kwargs� __class__s ��:/usr/lib/python3.12/site-packages/tuned/plugins/hotplug.pyr zPlugin.__init__ s �� ������/��/� c �J �� | j � t t | � � y r )�_hardware_events_cleanupr r �cleanup)r r s �r r zPlugin.cleanup s �� ����!�����r c � � y r � �r s r �_hardware_events_initzPlugin._hardware_events_init � � �r c � � y r r r s r r zPlugin._hardware_events_cleanup r r c �$ � | j � y r )r r s r � _init_deviceszPlugin._init_devices s � ����r c � � |dk( r>t j d|j z � | j |j � y |dk( r>t j d|j z � | j |j � y |dk( r>t j d|j z � | j |j � y y )N�addzdevice '%s', add event�removezdevice '%s', remove event�movez-device: '%s', rename event, reported new name)�log�info�sys_name�_add_device�_remove_device�_move_device)r �event�devices r �_hardware_events_callbackz Plugin._hardware_events_callback s� � � �e�^��8�8�$�v���6�7����F�O�O�$�����8�8�'�&�/�/�9�:����v���'�����8�8�;�f�o�o�M�N����V�_�_�%� r c �Z � t j d|j �d|��� | j j |� | j ||j d|g� | j ||� | j ||j d|g� |j j |� y )Nz instance z: adding new device �apply) r r! �name�_assigned_devicesr �_call_device_script� script_pre�_added_device_apply_tuning�script_post�processed_devices�r �instance�device_names r �_add_device_processzPlugin._add_device_process'