return xml_data;
set_xml_property_copy(xml_state, XML_ATTR_ID, fsa_our_uname); xml_result = create_cib_fragment(xml_state, NULL);  return xml_result;
do_lrm_query(void){	int lpc = 0, llpc = 0;	GList *types    = NULL;	GList *classes  = NULL;	GList *op_list  = NULL;	GList *lrm_list = NULL;	state_flag_t cur_state = 0;	const char *this_op = NULL;	xmlNodePtr xml_agent = NULL;	xmlNodePtr xml_data  = create_xml_node(NULL, XML_CIB_TAG_LRM);	xmlNodePtr rsc_list  = create_xml_node(xml_data,XML_LRM_TAG_RESOURCES);	xmlNodePtr xml_agent_list = create_xml_node(xml_data, "lrm_agents");		/* Build a list of supported agents */	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,						xml_agent = create_xml_node(				xml_agent_list, "lrm_agent");						set_xml_property_copy(xml_agent, "class",       class);			set_xml_property_copy(xml_agent, XML_ATTR_TYPE, type);			/* we dont have this yet */			set_xml_property_copy(xml_agent, "version",     NULL);			)		g_list_free(types);		);	g_list_free(classes);	/* Build a list of active (not always running) resources */	lrm_list = fsa_lrm_conn->lrm_ops->get_all_rscs(fsa_lrm_conn);	slist_iter(		the_rsc, lrm_rsc_t, lrm_list, lpc,/* 				GHashTable* 	params; */				xmlNodePtr xml_rsc = create_xml_node(rsc_list, "rsc_state");		const char *status_text = "<unknown>";				set_xml_property_copy(xml_rsc, XML_ATTR_ID, the_rsc->id);		set_xml_property_copy(xml_rsc, "type",      the_rsc->type);		set_xml_property_copy(xml_rsc, "class",     the_rsc->class);		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");		slist_iter(			op, lrm_op_t, op_list, llpc,			this_op = op->op_type;			gboolean found = FALSE;			if(found == FALSE && safe_str_neq(this_op, "status")){				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;				}			}			if(found) {				set_xml_property_copy(					xml_rsc, "rsc_op", this_op);				/* we only want the last one */				break;			}			)		set_xml_property_copy(xml_rsc, "op_result", status_text);				g_list_free(op_list);		);	g_list_free(lrm_list);		return xml_data;}