ó ±2öYc@sSddlZddljZddlZejjƒZdejfd„ƒYZdS(iÿÿÿÿNtPlugincBs_eZdZd„Zd„Zd„Zd„Zd„Zd„Zd„Z d„Z d „Z RS( s: Base class for plugins with device hotpluging support. cOs'tt|ƒj||Ž|jƒdS(N(tsuperRt__init__t_hardware_events_init(tselftargstkwargs((s9/usr/lib/python2.7/site-packages/tuned/plugins/hotplug.pyR scCs!tt|ƒjƒ|jƒdS(N(RRtcleanupt_hardware_events_cleanup(R((s9/usr/lib/python2.7/site-packages/tuned/plugins/hotplug.pyRscCs tƒ‚dS(N(tNotImplementedError(R((s9/usr/lib/python2.7/site-packages/tuned/plugins/hotplug.pyRscCs tƒ‚dS(N(R (R((s9/usr/lib/python2.7/site-packages/tuned/plugins/hotplug.pyRscCsd|dkr0tjd|jƒ|j|ƒn0|dkr`tjd|jƒ|j|ƒndS(Ntaddsdevice '%s' addedtremovesdevice '%s' removed(tlogtinfotsys_namet _add_devicet_remove_device(Rteventtdevice((s9/usr/lib/python2.7/site-packages/tuned/plugins/hotplug.pyt_hardware_events_callbacks   cCs |j}||j|jBkr#dSxâ|jjƒD]°\}}t|j||gƒƒdkr3tjd||fƒ|jj |ƒ|j j |ƒ|j ||j d|gƒ|j ||ƒ|j ||jd|gƒPq3q3Wtjd|ƒ|jj |ƒdS(Nis!instance %s: adding new device %stapplysno instance wants %s(Rt_assigned_devicest _free_devicest _instancestitemstlent_get_matching_devicesR R R tdevicest_call_device_scriptt script_pret_added_device_apply_tuningt script_posttdebug(RRt device_namet instance_nametinstance((s9/usr/lib/python2.7/site-packages/tuned/plugins/hotplug.pyR"s !cCsä|j}||j|jBkr#dSxº|jjƒD]™}||jkr3|j||jd|gƒ|j||ƒ|j||j d|gƒ|jj |ƒt |jƒdk|_ |jj |ƒPq3q3W|jj |ƒdS(Ntunapplyi( RRRRtvaluesRRRt_removed_device_unapply_tuningRR Rtactive(RRR!R#((s9/usr/lib/python2.7/site-packages/tuned/plugins/hotplug.pyR4s cCsN|j||gƒ|jrJ|jjtjtjƒrJ|j||ƒndS(N(t_execute_all_device_commandsthas_dynamic_tuningt _global_cfgtgettconststCFG_DYNAMIC_TUNINGtCFG_DEF_DYNAMIC_TUNINGt_instance_apply_dynamic(RR#R!((s9/usr/lib/python2.7/site-packages/tuned/plugins/hotplug.pyREs$cCsN|jr7|jjtjtjƒr7|j||ƒn|j||gƒdS(N(R)R*R+R,R-R.t_instance_unapply_dynamict_cleanup_all_device_commands(RR#R!((s9/usr/lib/python2.7/site-packages/tuned/plugins/hotplug.pyR&Js$( t__name__t __module__t__doc__RRRRRRRRR&(((s9/usr/lib/python2.7/site-packages/tuned/plugins/hotplug.pyRs        ( tbaset tuned.constsR,t tuned.logsttunedtlogsR+R R(((s9/usr/lib/python2.7/site-packages/tuned/plugins/hotplug.pyts