xmlNodePtr tmp1 = NULL, update = NULL; xmlNodePtr join_ack = (xmlNodePtr)msg_data->data; const char *join_from = xmlGetProp(join_ack, XML_ATTR_HOSTFROM); xmlNodePtr options = find_xml_node(join_ack, XML_TAG_OPTIONS, TRUE); const char *op = xmlGetProp(options, XML_ATTR_OP);
xmlNodePtr update = NULL; ha_msg_input_t *join_ack = fsa_typed_data(fsa_dt_ha_msg); const char *join_from = cl_get_string(join_ack->msg, F_CRM_HOST_FROM); const char *op = cl_get_string(join_ack->msg, F_CRM_TASK);
do_dc_join_ack(long long action,	       enum crmd_fsa_cause cause,	       enum crmd_fsa_state cur_state,	       enum crmd_fsa_input current_input,	       fsa_data_t *msg_data){	/* now update them to "member" */	xmlNodePtr tmp1 = NULL, update = NULL;	xmlNodePtr join_ack = (xmlNodePtr)msg_data->data;	const char *join_from = xmlGetProp(join_ack, XML_ATTR_HOSTFROM);	xmlNodePtr options = find_xml_node(join_ack, XML_TAG_OPTIONS, TRUE);	const char *op = xmlGetProp(options, XML_ATTR_OP);	const char *join_state = NULL;	if(safe_str_neq(op, CRM_OP_JOINACK)) {		crm_warn("Ignoring op=%s message", op);		return I_NULL;	}		crm_debug("Processing ack from %s", join_from);	join_state = (const char *)		g_hash_table_lookup(join_requests, join_from);		if(join_state == NULL) {		crm_err("Join not in progress: ignoring join from %s",			join_from);		return I_FAIL;			} else if(safe_str_neq(join_state, CRMD_JOINSTATE_MEMBER)) {		crm_err("Node %s wasnt invited to join the cluster",join_from);		return I_NULL;	}		g_hash_table_insert(confirmed_nodes, crm_strdup(join_from),			    crm_strdup(CRMD_JOINSTATE_MEMBER));	/* update node entry in the status section  */	crm_debug("Updating node state to %s for %s", join_state, join_from);	update = create_node_state(		join_from, join_from,		ACTIVESTATUS, NULL, ONLINESTATUS, join_state, join_state);	set_xml_property_copy(update,XML_CIB_ATTR_EXPSTATE, CRMD_STATE_ACTIVE);	tmp1 = create_cib_fragment(update, NULL);	update_local_cib(tmp1, TRUE);	free_xml(tmp1);	/* update CIB with the current LRM status from the node */	tmp1 = find_xml_node(join_ack, XML_TAG_FRAGMENT, TRUE);	update_local_cib(tmp1, TRUE);	if(num_join_invites <= g_hash_table_size(confirmed_nodes)) {		crm_info("That was the last outstanding join confirmation");		register_fsa_input_later(C_FSA_INTERNAL, I_FINALIZED, NULL);		return I_NULL;	}	/* dont waste time by invoking the pe yet; */	crm_debug("Still waiting on %d outstanding join confirmations",		  num_join_invites - g_hash_table_size(confirmed_nodes));		return I_NULL;}