예제 #1
0
파일: event.c 프로젝트: Xolgrim/server
static void free_handler(attrib * a)
{
    handler_info *hi = (handler_info *)a->data.v;
    free_triggers(hi->triggers);
    free(hi->event);
    free(hi);
}
예제 #2
0
static void policy_run_cfg_free(void *config)
{
    policy_run_config_list_t *cfg = (policy_run_config_list_t *) config;

    if (cfg != NULL) {
        int i;

        if (cfg->configs != NULL) {
            for (i = 0; i < cfg->count; i++) {
                if (cfg->configs[i].trigger_list != NULL)
                    free_triggers(cfg->configs[i].trigger_list,
                                  cfg->configs[i].trigger_count);
                rbh_params_free(&cfg->configs[i].action_params);
            }
            free(cfg->configs);
        }
        free(cfg);
    }
}
예제 #3
0
int Reload_ResourceMon_Config( void *module_config )
{
    resource_monitor_config_t *conf = ( resource_monitor_config_t * ) module_config;

    /* parameters that can't be modified dynamically */

    if ( resmon_config.nb_threads_purge != conf->nb_threads_purge )
        DisplayLog( LVL_MAJOR, RESMONCFG_TAG, PURGE_PARAM_BLOCK
                    "::nb_threads_purge changed in config file, but cannot be modified dynamically");

    if ( resmon_config.purge_queue_size != conf->purge_queue_size )
        DisplayLog( LVL_MAJOR, RESMONCFG_TAG, PURGE_PARAM_BLOCK
                    "::purge_queue_size changed in config file, but cannot be modified dynamically");

#ifdef _TMP_FS_MGR
    if (strcmp(conf->purge_command, resmon_config.purge_command))
        DisplayLog(LVL_MAJOR, RESMONCFG_TAG, PURGE_PARAM_BLOCK
                   "::purge_command changed in config file, but cannot be modified dynamically");
#endif

    /* dynamic parameters */

    if ( resmon_config.post_purge_df_latency != conf->post_purge_df_latency )
    {
        DisplayLog( LVL_EVENT, RESMONCFG_TAG, PURGE_PARAM_BLOCK
                    "::post_purge_df_latency updated: %lu->%lu",
                    resmon_config.post_purge_df_latency, conf->post_purge_df_latency );
        resmon_config.post_purge_df_latency = conf->post_purge_df_latency;
    }

    if ( resmon_config.db_request_limit != conf->db_request_limit )
    {
        DisplayLog( LVL_EVENT, RESMONCFG_TAG, PURGE_PARAM_BLOCK
                    "::db_result_size_max updated: %u->%u",
                    resmon_config.db_request_limit, conf->db_request_limit );
        resmon_config.db_request_limit = conf->db_request_limit;
    }

#ifdef ATTR_INDEX_status
    if ( resmon_config.check_purge_status_on_startup != conf->check_purge_status_on_startup )
    {
        DisplayLog( LVL_EVENT, RESMONCFG_TAG, PURGE_PARAM_BLOCK
                    "::check_purge_status_on_startup updated: %u->%u",
                    resmon_config.check_purge_status_on_startup,
                    conf->check_purge_status_on_startup );
        resmon_config.check_purge_status_on_startup = conf->check_purge_status_on_startup;
    }
#endif
    if ( resmon_config.recheck_ignored_classes != conf->recheck_ignored_classes )
    {
        DisplayLog( LVL_EVENT, RESMONCFG_TAG, PURGE_PARAM_BLOCK
                    "::recheck_ignored_classes updated: %u->%u",
                    resmon_config.recheck_ignored_classes, conf->recheck_ignored_classes );
        resmon_config.recheck_ignored_classes = conf->recheck_ignored_classes;
    }


    update_triggers( conf->trigger_list, conf->trigger_count );

    free_triggers( conf->trigger_list, conf->trigger_count );

    return 0;
}