lrm_list = fsa_lrm_conn->lrm_ops->get_ra_supported(fsa_lrm_conn); if (NULL != lrm_list) { GList* element = g_list_first(lrm_list); while (NULL != element) { rsc_type = (char*)element->data;
classes = fsa_lrm_conn->lrm_ops->get_rsc_class_supported( fsa_lrm_conn);  slist_iter( class, char, classes, lpc,  types = fsa_lrm_conn->lrm_ops->get_rsc_type_supported( fsa_lrm_conn, class);  slist_iter( type, char, types, llpc,
do_lrm_query(void){	GList* lrm_list = NULL;	GList* element = NULL;	GList* op_list = NULL;	xmlNodePtr agent = NULL;	xmlNodePtr data = create_xml_node(NULL, XML_CIB_TAG_LRM);	xmlNodePtr agent_list = create_xml_node(data, "lrm_agents");	xmlNodePtr rsc_list;	char *rsc_type = NULL;	state_flag_t cur_state = 0;	const char *this_op = NULL;	GList* node = NULL;		lrm_list = fsa_lrm_conn->lrm_ops->get_ra_supported(fsa_lrm_conn);	if (NULL != lrm_list) {		GList* element = g_list_first(lrm_list);		while (NULL != element) {			rsc_type = (char*)element->data;						agent =				create_xml_node(agent_list, "lrm_agent");						set_xml_property_copy(agent, "class",   rsc_type);			/* we dont have these yet */			set_xml_property_copy(agent, XML_ATTR_TYPE,    NULL);			set_xml_property_copy(agent, "version", NULL);						element = g_list_next(element);		}	}		g_list_free(lrm_list);	lrm_list = fsa_lrm_conn->lrm_ops->get_all_rscs(fsa_lrm_conn);	rsc_list = create_xml_node(data, XML_LRM_TAG_RESOURCES);	if (NULL != lrm_list) {		element = g_list_first(lrm_list);	}		while (NULL != element) {		lrm_rsc_t *the_rsc = (lrm_rsc_t*)element->data;		/* 				const char*	ra_type; *//* 				GHashTable* 	params; */				xmlNodePtr xml_rsc = create_xml_node(rsc_list, "rsc_state");				set_xml_property_copy(xml_rsc, XML_ATTR_ID,     the_rsc->id);		set_xml_property_copy(xml_rsc, "rsc_id", the_rsc->name);		set_xml_property_copy(xml_rsc, "node_id",fsa_our_uname);				op_list = the_rsc->ops->get_cur_state(the_rsc,						      &cur_state);		crm_verbose("\tcurrent state:%s\n",			  cur_state==LRM_RSC_IDLE?"Idle":"Busy");				node = g_list_first(op_list);				while(NULL != node){			lrm_op_t* op = (lrm_op_t*)node->data;			this_op = op->op_type;			if(this_op == NULL			   || strcmp(this_op, "status") != 0){								const char *status_text = "<unknown>";				switch(op->status) {					case LRM_OP_DONE:						status_text = "done";						break;					case LRM_OP_CANCELLED:						status_text = "cancelled";						break;					case LRM_OP_TIMEOUT:						status_text = "timeout";						break;					case LRM_OP_NOTSUPPORTED:						status_text = "not suported";						break;					case LRM_OP_ERROR:						status_text = "error";						break;				}												set_xml_property_copy(xml_rsc,						      "op_result",						      status_text);								set_xml_property_copy(xml_rsc,						      "rsc_op",						      this_op);								// we only want the last one				break;			}						node = g_list_next(node);		}				element = g_list_next(element);	}	if (NULL != lrm_list) {		g_list_free(lrm_list);	}		return data;}