Example #1
0
void
clone_free(resource_t * rsc)
{
    GListPtr gIter = rsc->children;
    clone_variant_data_t *clone_data = NULL;

    get_clone_variant_data(clone_data, rsc);

    pe_rsc_trace(rsc, "Freeing %s", rsc->id);

    for (; gIter != NULL; gIter = gIter->next) {
        resource_t *child_rsc = (resource_t *) gIter->data;

        CRM_ASSERT(child_rsc);
        pe_rsc_trace(child_rsc, "Freeing child %s", child_rsc->id);
        free_xml(child_rsc->xml);
        child_rsc->xml = NULL;
        /* There could be a saved unexpanded xml */
        free_xml(child_rsc->orig_xml);
        child_rsc->orig_xml = NULL;
        child_rsc->fns->free(child_rsc);
    }

    g_list_free(rsc->children);

    if (clone_data) {
        CRM_ASSERT(clone_data->demote_notify == NULL);
        CRM_ASSERT(clone_data->stop_notify == NULL);
        CRM_ASSERT(clone_data->start_notify == NULL);
        CRM_ASSERT(clone_data->promote_notify == NULL);
    }

    common_free(rsc);
}
Example #2
0
void
group_free(resource_t * rsc)
{
    GListPtr gIter = rsc->children;
    group_variant_data_t *group_data = NULL;

    CRM_CHECK(rsc != NULL, return);
    get_group_variant_data(group_data, rsc);

    crm_debug_3("Freeing %s", rsc->id);

    for (; gIter != NULL; gIter = gIter->next) {
        resource_t *child_rsc = (resource_t *) gIter->data;

        crm_debug_3("Freeing child %s", child_rsc->id);
        child_rsc->fns->free(child_rsc);
    }

    crm_debug_3("Freeing child list");
    g_list_free(rsc->children);

    if (group_data->self != NULL) {
        free_xml(group_data->self->xml);
        group_data->self->fns->free(group_data->self);
    }

    common_free(rsc);
}
Example #3
0
void print_threadAction(void)
{
    t_threadActionListInfo  actionListInfo;
    common_memset(&actionListInfo, 0x00, sizeof(t_threadActionListInfo));

#if 0
    void* handle = dlopen(NULL, RTLD_LAZY);
#endif

    config_getThreadAction("inputfile/threadAction.xml", &actionListInfo);

    int threadCount = 0;
#if 0
    fprintf(stdout, "threadCount=%d\n", actionListInfo.threadCount);
    for( threadCount = 0; threadCount < actionListInfo.threadCount; threadCount++) {
        t_threadActionList* actionList = &actionListInfo.list[threadCount];
        fprintf(stdout, "threadID=%d arrayCount=%d\n", actionList->threadId, actionList->arrayCount);
        int arrayIdx = 0;
        for( arrayIdx = 0; arrayIdx < actionList->arrayCount; arrayIdx++) {
            t_threadAction* action = &actionList->array[arrayIdx];
            fprintf(stdout, "name=%s\n", action->name);
            fprintf(stdout, "%p\n", dlsym(handle, action->name)); 
        }
    }
#endif

    threadCount = 0;
    for( threadCount = 0; threadCount < actionListInfo.threadCount; threadCount++) {
        t_threadActionList* actionList = &actionListInfo.list[threadCount];
        common_free(actionList->array);
    }
    common_free(actionListInfo.list);

#if 0
    dlclose(handle);
#endif
}
Example #4
0
void print_threadConfig(void)
{
    t_threadConfigList threadConfigList;
    common_memset(&threadConfigList, 0x00, sizeof(t_threadConfigList));
    config_getThreadConifg("inputfile/threadConfig.xml",&threadConfigList);

    int i = 0;
    fprintf(stdout, "count=%d\n", threadConfigList.threadCount);
    for( i=0; i < threadConfigList.threadCount; i++) {
        fprintf(stdout, "threadConfig[%d].id=%d\n", i, threadConfigList.list[i].id);
        fprintf(stdout, "threadConfig[%d].parentId=%d\n", i, threadConfigList.list[i].parentId);
    }

    common_free(threadConfigList.list);
}
Example #5
0
void
group_free(resource_t * rsc)
{
    GListPtr gIter = rsc->children;

    CRM_CHECK(rsc != NULL, return);

    pe_rsc_trace(rsc, "Freeing %s", rsc->id);

    for (; gIter != NULL; gIter = gIter->next) {
        resource_t *child_rsc = (resource_t *) gIter->data;

        pe_rsc_trace(child_rsc, "Freeing child %s", child_rsc->id);
        child_rsc->fns->free(child_rsc);
    }

    pe_rsc_trace(rsc, "Freeing child list");
    g_list_free(rsc->children);

    common_free(rsc);
}