set_xml_property_copy(iter, "id", fsa_our_uname);
set_xml_property_copy(state, "id", fsa_our_uname);
do_lrm_invoke(long long action,	      enum crmd_fsa_cause cause,	      enum crmd_fsa_state cur_state,	      enum crmd_fsa_input current_input,	      void *data){	enum crmd_fsa_input next_input = I_NULL;	xmlNodePtr fragment, tmp1;	xmlNodePtr msg;	const char *rsc_path[] = 		{			"msg_data",			"rsc_op",			"resource",			"instance_attributes",			"parameters"		};	const char *operation = NULL;	rsc_id_t rid;	const char *id_from_cib = NULL;	const char *crm_op = NULL;	lrm_rsc_t *rsc = NULL;	lrm_mon_t* mon = NULL;	lrm_op_t* op = NULL;		FNIN();#ifdef USE_FAKE_LRM	msg = (xmlNodePtr)data;			operation = get_xml_attr_nested(msg, rsc_path, DIMOF(rsc_path) -3,					"task", TRUE);		id_from_cib = get_xml_attr_nested(msg, rsc_path, DIMOF(rsc_path) -2,					  "id", TRUE);		crm_op = get_xml_attr(msg, XML_TAG_OPTIONS, XML_ATTR_OP, TRUE);	if(safe_str_eq(crm_op, "rsc_op")) {			CRM_DEBUG("performing op %s...", operation);		xmlNodePtr update = NULL;		xmlNodePtr state = create_xml_node(NULL, XML_CIB_TAG_STATE);		xmlNodePtr iter = create_xml_node(state, "lrm");		iter = create_xml_node(iter, "lrm_resources");		iter = create_xml_node(iter, "lrm_resource");			set_xml_property_copy(iter, "id", fsa_our_uname);		set_xml_property_copy(iter, XML_ATTR_ID, id_from_cib);		set_xml_property_copy(iter, "last_op", operation);		if(safe_str_eq(operation, "start")){			set_xml_property_copy(iter, "op_status", "started");		} else {			set_xml_property_copy(iter, "op_status", "stopped");		}				set_xml_property_copy(iter, "op_code", "0");		set_xml_property_copy(iter, "op_node", fsa_our_uname);		update = create_cib_fragment(state, NULL);				send_request(NULL, update, "update",			     NULL, CRM_SYSTEM_DCIB);	}		FNRET(I_NULL);#endif	if(action & A_UPDATE_NODESTATUS) {		xmlNodePtr data = do_lrm_query();		set_xml_property_copy(data, "replace_lrm", "true");		tmp1 = create_xml_node(NULL, XML_CIB_TAG_STATE);		set_xml_property_copy(tmp1, XML_ATTR_ID, fsa_our_uname);		fragment = create_cib_fragment(tmp1, NULL);		set_xml_property_copy(data, "replace_lrm", "true");		add_node_copy(tmp1, data);		send_request(NULL, fragment, CRM_OPERATION_UPDATE,			     NULL, CRM_SYSTEM_DC);		free_xml(fragment);		free_xml(tmp1);		free_xml(data);		FNRET(next_input);	}		cl_log(LOG_WARNING, "Action %s (%.16llx) only kind of supported\n",	       fsa_action2string(action), action);	msg = (xmlNodePtr)data;			operation = get_xml_attr_nested(msg, rsc_path, DIMOF(rsc_path) -3,					XML_ATTR_OP, TRUE);			id_from_cib = get_xml_attr_nested(msg, rsc_path, DIMOF(rsc_path) -2,					  "id", TRUE);		// only the first 16 chars are used by the LRM	strncpy(rid, id_from_cib, 16);			crm_op = get_xml_attr(msg, XML_TAG_OPTIONS, XML_ATTR_OP, TRUE);		rsc = fsa_lrm_conn->lrm_ops->get_rsc(fsa_lrm_conn, rid);		if(crm_op != NULL && strcmp(crm_op, "lrm_query") == 0) {		xmlNodePtr data, tmp1, tmp2, reply;		tmp1 = create_xml_node(NULL, XML_CIB_TAG_STATE);		set_xml_property_copy(tmp1, XML_ATTR_ID, fsa_our_uname);				data = create_cib_fragment(tmp1, NULL);		tmp2 = do_lrm_query();		add_node_copy(tmp1, tmp2);		reply = create_reply(msg, data);		relay_message(reply, TRUE);		free_xml(data);		free_xml(reply);		free_xml(tmp2);		free_xml(tmp1);	} else if(operation != NULL && strcmp(operation, "monitor") == 0) {		if(rsc == NULL) {			cl_log(LOG_ERR, "Could not find resource to monitor");			FNRET(I_FAIL);		}				mon = g_new(lrm_mon_t, 1);		mon->op_type = "status";		mon->params = NULL;		mon->timeout = 0;		mon->user_data = rsc;		mon->mode = LRM_MONITOR_SET;		mon->interval = 2;		mon->target = 1;		rsc->ops->set_monitor(rsc,mon);		mon = g_new(lrm_mon_t, 1);	} else if(operation != NULL) {		if(rsc == NULL) {			// add it to the list			CRM_DEBUG("add_rsc...");			fsa_lrm_conn->lrm_ops->add_rsc(				fsa_lrm_conn, rid,				get_xml_attr_nested(msg, 						    rsc_path,						    DIMOF(rsc_path) -2,						    "class", TRUE),				get_xml_attr_nested(msg, 						    rsc_path,						    DIMOF(rsc_path) -2,						    "type", TRUE),				NULL);						rsc = fsa_lrm_conn->lrm_ops->get_rsc(				fsa_lrm_conn, rid);		}		if(rsc == NULL) {			cl_log(LOG_ERR, "Could not add resource to LRM");			FNRET(I_FAIL);		}				// now do the op		CRM_DEBUG("performing op %s...", operation);		op = g_new(lrm_op_t, 1);		op->op_type = operation;		op->params = xml2list(msg, rsc_path, DIMOF(rsc_path));		op->timeout = 0;		op->user_data = rsc;		rsc->ops->perform_op(rsc, op);	}	FNRET(next_input);}