g_list_free(lrm_list);
do_lrm_startup_query(void){/*	<node_state id=node1 ...>	id		CDATA #REQUIRED	uname   	CDATA #REQUIRED	state	  	(active|in_ccm|down|shot) #REQUIRED	exp_state	(active|down)      #REQUIRED	source		CDATA #IMPLIED	is_dc		(yes|no) 'no'	timestamp	CDATA #REQUIRED>	    <lrm>		 <lrm_agents>			<lrm_agent class=ocf type=drbd  .../>		 </lrm_agents>		 <lrm_resources>			<rsc_state id=rsc1 rsc_id= node_id= rsc_state=.../>		</lrm_resources>	    </lrm>		 </node_state>*/	GList* lrm_list = NULL;	xmlNodePtr data = create_xml_node(NULL, "lrm");	xmlNodePtr agent_list = create_xml_node(data, "lrm_agents");		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) {			char *rsc_type = (char*)element->data;						xmlNodePtr agent =				create_xml_node(agent_list, "lrm_agent");						set_xml_property_copy(agent, "type", rsc_type);			/* we dont have these yet */			set_xml_property_copy(agent, "class", 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);	xmlNodePtr rsc_list = create_xml_node(data, "lrm_resources");	if (NULL != lrm_list) {		GList* 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,					      "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);						state_flag_t cur_state = 0;			CRM_DEBUG("get_cur_state...");			GList* op_list = the_rsc->ops->get_cur_state(				the_rsc, &cur_state);			printf("\tcurrent state:%s\n",cur_state==LRM_RSC_IDLE?"Idel":"Busy");						const char *this_op = NULL;			GList* node = g_list_first(op_list);						while(NULL != node){				lrm_op_t* op = (lrm_op_t*)node->data;				this_op = op->op_type;/* 	const char* 		op_type; *//* 	GHashTable*		params; *//* 	int			timeout; *//* 	gpointer		user_data; *//* 	/\*output fields*\/ *//* 	lrm_rsc_t*		rsc; *//* 	op_status_t		status; *//* 	char*			app_name; *//* 	char*			data; *//* 	int			rc; *//* 	int			call_id; */								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);				}				node = g_list_next(node);			}			element = g_list_next(element);		}	}	g_list_free(lrm_list);	return data;}