if(fsa_cluster_conn->llc_ops->get_uuid_by_name( fsa_cluster_conn, join_from, uuid_raw) == HA_FAIL) { crm_err("Could not calculate UUID for %s", join_from); crm_free(uuid_calc); uuid_calc = crm_strdup(join_from);  } else { uuid_unparse(uuid_raw, uuid_calc); }  
do_process_welcome_ack(long long action,		    enum crmd_fsa_cause cause,		    enum crmd_fsa_state cur_state,		    enum crmd_fsa_input current_input,		    void *data){	xmlNodePtr tmp1;	xmlNodePtr tmp2;	xmlNodePtr cib_fragment;	xmlNodePtr msg_cib;	xmlNodePtr join_ack = (xmlNodePtr)data;	gboolean is_a_member  = FALSE;	const char *join_from = xmlGetProp(join_ack, XML_ATTR_HOSTFROM);	const char *ref       = xmlGetProp(join_ack, XML_ATTR_REFERENCE);	uuid_t uuid_raw;	char *uuid_calc = NULL;	gpointer join_node =		g_hash_table_lookup(fsa_membership_copy->members, join_from);	if(join_node != NULL) {		is_a_member = TRUE;	}		cib_fragment = find_xml_node(join_ack, XML_TAG_FRAGMENT);	crm_debug("Welcoming node %s after ACK (ref %s)",	       join_from, ref);		if(is_a_member == FALSE) {		crm_err("Node %s is not known to us (ref %s)",		       join_from, ref);		/* make sure any information from this node is discarded,		 * it is invalid		 */		free_xml(cib_fragment);		return I_FAIL;	}		/* add them to our list of CRMD_STATE_ACTIVE nodes	   TODO: still used?	   TODO: check its not already there	*/	g_hash_table_insert(joined_nodes, strdup(join_from),strdup(join_from));	if(cib_fragment == NULL) {		crm_err("No status information was part of the"			" Welcome ACK from %s",			join_from);		return I_NULL;	}	create_node_entry(join_from, join_from, "member");	uuid_calc = (char*)crm_malloc(sizeof(char)*50);		if(fsa_cluster_conn->llc_ops->get_uuid_by_name(		   fsa_cluster_conn, join_from, uuid_raw) == HA_FAIL) {		crm_err("Could not calculate UUID for %s", join_from);		crm_free(uuid_calc);		uuid_calc = crm_strdup(join_from);	} else {		uuid_unparse(uuid_raw, uuid_calc);	}	/* Make changes so that exp_state=active for this node when the update	 *  is processed by A_CIB_INVOKE	 */	msg_cib = find_xml_node(cib_fragment, XML_TAG_CIB);	tmp1 = get_object_root(XML_CIB_TAG_STATUS, msg_cib);	tmp2 = find_entity(tmp1, XML_CIB_TAG_STATE, uuid_calc, FALSE);	if(tmp2 == NULL) {		crm_err("Status entry for %s not found in update, adding",			join_from);				tmp2 = create_xml_node(tmp1, XML_CIB_TAG_STATE);		set_xml_property_copy(tmp2, XML_ATTR_UUID,  uuid_calc);		set_xml_property_copy(tmp2, XML_ATTR_UNAME, join_from);	}		crm_free(uuid_calc);		/* make sure these values are correct in the CIB */	set_xml_property_copy(		tmp2, XML_CIB_ATTR_EXPSTATE, CRMD_STATE_ACTIVE);	set_xml_property_copy(		tmp2, XML_CIB_ATTR_JOINSTATE,CRMD_JOINSTATE_MEMBER);/* No point hanging around in S_INTEGRATION if we're the only ones here! */	if(g_hash_table_size(joined_nodes)		  >= (fsa_membership_copy->members_size -1)) {		crm_info("That was the last outstanding join ack");		return I_SUCCESS;	}	/* dont waste time by invoking the pe yet; */	crm_debug("Still waiting on %d outstanding join acks",		  fsa_membership_copy->members_size		  - g_hash_table_size(joined_nodes) - 1);		return I_CIB_OP;}
8182	/local/tlutelli/issta_data/temp/c/2005_temp/2005/8182/69f8a14658aeeee09c5c270dd118170c371c0ecf/join.c/clean/crm/crmd/join.c