const char *vote_from = xmlGetProp(vote, XML_ATTR_HOSTFROM);
const char *vote_from    = xmlGetProp(vote, XML_ATTR_HOSTFROM); const char *your_version = get_xml_attr( vote, XML_TAG_OPTIONS, XML_ATTR_VERSION, TRUE);
do_election_count_vote(long long action,		       enum crmd_fsa_cause cause,		       enum crmd_fsa_state cur_state,		       enum crmd_fsa_input current_input,		       void *data){	gboolean we_loose = FALSE;	xmlNodePtr vote = (xmlNodePtr)data;	enum crmd_fsa_input election_result = I_NULL;	const char *vote_from = xmlGetProp(vote, XML_ATTR_HOSTFROM);	oc_node_t *our_node = NULL, * your_node = NULL;	struct election_data_s election_data;	if(vote_from == NULL || strcmp(vote_from, fsa_our_uname) == 0) {		// dont count our own vote		return election_result;	}	if(fsa_membership_copy->members_size < 1) {		// if even we are not in the cluster then we should not vote		return I_FAIL;			}	our_node = (oc_node_t*)		g_hash_table_lookup(fsa_membership_copy->members, fsa_our_uname);	your_node = (oc_node_t*)		g_hash_table_lookup(fsa_membership_copy->members, vote_from);#if 0	crm_debug("%s (bornon=%d), our bornon (%d)",		   vote_from, our_node->born, my_born);	crm_debug("%s %s %s",	       fsa_our_uname,	       strcmp(fsa_our_uname, vote_from) < 0?"<":">=",	       vote_from);#endif		if(is_set(fsa_input_register, R_SHUTDOWN)) {		crm_debug("Election fail: we are shutting down");		we_loose = TRUE;	} else if(our_node == NULL) {		crm_debug("Election fail: we dont exist in the CCM list");		we_loose = TRUE;			} else if(your_node == NULL) {		crm_err("The other side doesnt exist in the CCM list");			} else if(your_node->node_born_on < our_node->node_born_on) {		crm_debug("Election fail: born_on");		we_loose = TRUE;	} else if(your_node->node_born_on == our_node->node_born_on		  && strcmp(fsa_our_uname, vote_from) > 0) {		crm_debug("Election fail: uname");		we_loose = TRUE;	} else {		election_data.winning_uname = NULL;		election_data.winning_bornon = -1; // maximum integer				crm_trace("We might win... we should vote (possibly again)");		election_result = I_DC_TIMEOUT; // new "default"		g_hash_table_foreach(fsa_membership_copy->members,				     ghash_count_vote, &election_data);				crm_debug("Election winner should be %s (born_on=%d)",		       election_data.winning_uname, election_data.winning_bornon);					if(safe_str_eq(election_data.winning_uname, fsa_our_uname)){			crm_debug("Election win: lowest born_on and uname");			election_result = I_ELECTION_DC;		}	}		if(we_loose) {		if(fsa_input_register & R_THE_DC) {			crm_debug("Give up the DC");			election_result = I_RELEASE_DC;					} else {			crm_debug("We werent the DC anyway");			election_result = I_NOT_DC;					}	}	if(we_loose || election_result == I_ELECTION_DC) {		// cancel timer, its been decided		stopTimer(election_timeout);	}		return election_result;}