CRM_DEBUG2("Adding XML to HA message %s.",
CRM_DEBUG3("Adding XML (%d chars) to HA message %s.", strlen(xml_text),
send_xmlha_message(ll_cluster_t *hb_fd, xmlNodePtr root){	gboolean all_is_good = TRUE;	const char *host_to = NULL;	const char *sys_to = NULL;	FNIN();    	if (root == NULL) {		cl_log(LOG_ERR, "Attempt to send NULL Message via HA failed.");		all_is_good = FALSE;	}	CRM_DEBUG2("Supplied XML data was %s.",		   all_is_good?"present":"empty");	struct ha_msg *msg = NULL;	if (all_is_good) {		msg = ha_msg_new(4); 		ha_msg_add(msg, F_TYPE, "CRM");		ha_msg_add(msg, F_COMMENT, "A CRM xml message");		char *xml_text = dump_xml(root);			if (xml_text == NULL || strlen(xml_text) <= 0) {			cl_log(LOG_ERR,			       "Failed sending an invalid XML Message via HA");			all_is_good = FALSE;			xml_message_debug(root, "Bad message was");					} else {			if(ha_msg_add(msg, "xml", xml_text) == HA_FAIL) {				cl_log(LOG_ERR,				       "Could not add xml to HA message");				all_is_good = FALSE;			}		}				CRM_DEBUG2("Adding XML to HA message %s.",			   all_is_good?"succeeded":"failed");	}	if (all_is_good) {		host_to = xmlGetProp(root, XML_ATTR_HOSTTO);		sys_to = xmlGetProp(root, XML_ATTR_SYSTO);		if (sys_to == NULL || strlen(sys_to) == 0)		{			cl_log(LOG_INFO,			       "You did not specify a destination sub-system"			       " for this message.");			all_is_good = FALSE;		}		CRM_DEBUG3("Destination of HA message is %s@%s",			   all_is_good?sys_to:"invalid",			   host_to==NULL?"<all>":host_to);		}	if (all_is_good) {		int send_result = -1;		gboolean broadcast = FALSE;		CRM_DEBUG("Sending HA Message.");		if (host_to == NULL		    || strlen(host_to) == 0		    || strcmp("dc", sys_to) == 0) {			broadcast = TRUE;			send_result =				hb_fd->llc_ops->sendclustermsg(hb_fd, msg);		}		else			send_result =				hb_fd->llc_ops->sendnodemsg(hb_fd, msg, host_to);#ifdef MSG_LOG			char *msg_text = dump_xml(root);		if(msg_out_strm == NULL) {			msg_out_strm = fopen("/tmp/outbound.log", "w");		}		fprintf(msg_out_strm, "[HA (%s:%d)]\t%s\n",			xmlGetProp(root, XML_ATTR_REFERENCE),			send_result,			msg_text);				fflush(msg_out_strm);		ha_free(msg_text);	#endif		if(send_result != HA_OK) all_is_good = FALSE;				CRM_DEBUG2("Sent a %s HA message.",			   broadcast?"broadcast":"directed");	}//    if(msg) ha_msg_del(msg);	CRM_DEBUG2("Sending of HA message %s.",		   all_is_good?"succeeded":"failed");	xml_message_debug(root, "HA Message was: ");		FNRET(all_is_good);}