[Pacemaker] About the difference in handling of "sequential".

renayama19661014 at ybb.ne.jp renayama19661014 at ybb.ne.jp
Wed Feb 12 07:10:42 UTC 2014


Hi All,

There is difference in two between handling of "sequential" of "resouce_set" of colocation.

Is either one not a mistake?

------------------------
static gboolean
unpack_colocation_set(xmlNode * set, int score, pe_working_set_t * data_set)
{
    xmlNode *xml_rsc = NULL;
    resource_t *with = NULL;
    resource_t *resource = NULL;
    const char *set_id = ID(set);
    const char *role = crm_element_value(set, "role");
    const char *sequential = crm_element_value(set, "sequential");
    int local_score = score;

    const char *score_s = crm_element_value(set, XML_RULE_ATTR_SCORE);

    if (score_s) {
        local_score = char2score(score_s);
    }

/* When "sequential" is not set, "sequential" is treat as TRUE. */

    if (sequential != NULL && crm_is_true(sequential) == FALSE) {
        return TRUE;
(snip)
static gboolean
colocate_rsc_sets(const char *id, xmlNode * set1, xmlNode * set2, int score,
                  pe_working_set_t * data_set)
{
    xmlNode *xml_rsc = NULL;
    resource_t *rsc_1 = NULL;
    resource_t *rsc_2 = NULL;

    const char *role_1 = crm_element_value(set1, "role");
    const char *role_2 = crm_element_value(set2, "role");

    const char *sequential_1 = crm_element_value(set1, "sequential");
    const char *sequential_2 = crm_element_value(set2, "sequential");

/* When "sequential" is not set, "sequential" is treat as FALSE. */

    if (crm_is_true(sequential_1)) {
        /* get the first one */
        for (xml_rsc = __xml_first_child(set1); xml_rsc != NULL; xml_rsc = __xml_next(xml_rsc)) {
            if (crm_str_eq((const char *)xml_rsc->name, XML_TAG_RESOURCE_REF, TRUE)) {
                EXPAND_CONSTRAINT_IDREF(id, rsc_1, ID(xml_rsc));
                break;
            }
        }
    }

    if (crm_is_true(sequential_2)) {
        /* get the last one */
(snip)

------------------------

Best Regards,
Hideo Yamauchi.





More information about the Pacemaker mailing list