update_attr(fsa_cib_conn, XML_CIB_TAG_STATUS, our_uuid,
update_attr(fsa_cib_conn, cib_none, XML_CIB_TAG_STATUS, our_uuid,
do_lrm_invoke(long long action,	      enum crmd_fsa_cause cause,	      enum crmd_fsa_state cur_state,	      enum crmd_fsa_input current_input,	      fsa_data_t *msg_data){	const char *crm_op = NULL;	const char *operation = NULL;	enum crmd_fsa_input next_input = I_NULL;	ha_msg_input_t *input = fsa_typed_data(fsa_dt_ha_msg);	crm_op = cl_get_string(input->msg, F_CRM_TASK);	if(safe_str_eq(crm_op, CRM_OP_LRM_DELETE)) {		operation = CRMD_ACTION_DELETE;	} else if(input->xml != NULL) {		operation = crm_element_value(input->xml, XML_LRM_ATTR_TASK);	}	if(crm_op != NULL && safe_str_eq(crm_op, CRM_OP_LRM_REFRESH)) {		enum cib_errors rc = cib_ok;		crm_data_t *fragment = do_lrm_query(TRUE);		crm_info("Forcing a local LRM refresh");		rc = fsa_cib_conn->cmds->update(			fsa_cib_conn, XML_CIB_TAG_STATUS, fragment, NULL,			cib_quorum_override);		free_xml(fragment);			} else if(crm_op != NULL && safe_str_eq(crm_op, CRM_OP_LRM_QUERY)) {		crm_data_t *data = do_lrm_query(FALSE);		HA_Message *reply = create_reply(input->msg, data);		if(relay_message(reply, TRUE) == FALSE) {			crm_err("Unable to route reply");			crm_log_message(LOG_ERR, reply);			crm_msg_del(reply);		}		free_xml(data);	} else if(safe_str_eq(operation, CRM_OP_PROBED)		  || safe_str_eq(crm_op, CRM_OP_REPROBE)) {		const char *our_uuid = get_uuid(fsa_cluster_conn,fsa_our_uname);		char *attr_id = crm_concat("lrm-probe", our_uuid, '-');		char *attr_set = crm_concat("crmd-transient-", our_uuid, '-');		const char *probed = XML_BOOLEAN_TRUE;		if(safe_str_eq(crm_op, CRM_OP_REPROBE)) {			probed = XML_BOOLEAN_FALSE;		}				update_attr(fsa_cib_conn, XML_CIB_TAG_STATUS, our_uuid,			    attr_set, attr_id, CRM_OP_PROBED, probed);		crm_free(attr_id);		crm_free(attr_set);	} else if(operation != NULL) {		char rid[64];		lrm_rsc_t *rsc = NULL;		const char *id_from_cib = NULL;		crm_data_t *xml_rsc = find_xml_node(			input->xml, XML_CIB_TAG_RESOURCE, TRUE);		CRM_DEV_ASSERT(xml_rsc != NULL);		if(crm_assert_failed) {			crm_log_xml_err(input->xml, "Bad resource");			return I_NULL;		}				id_from_cib = crm_element_value(xml_rsc, XML_ATTR_ID);		CRM_DEV_ASSERT(id_from_cib != NULL);		if(crm_assert_failed) {			crm_err("No value for %s in %s",				XML_ATTR_ID, crm_element_name(xml_rsc));			crm_log_xml_err(input->xml, "Bad command");			return I_NULL;		}				/* only the first 16 chars are used by the LRM */		strncpy(rid, id_from_cib, 64);		rid[63] = 0;				rsc = fsa_lrm_conn->lrm_ops->get_rsc(fsa_lrm_conn, rid);		if(safe_str_eq(operation, CRMD_ACTION_CANCEL)) {			lrm_op_t* op = construct_op(				input->xml, id_from_cib, operation);			const char *op_key = crm_element_value(				xml_rsc, "operation_key");			if(op_key == NULL) {				crm_err("No operation to cancel");				crm_log_message(LOG_ERR, input->msg);							} else if(rsc != NULL) {				cancel_monitor(rsc, op_key);			}			op->op_status = LRM_OP_DONE;			op->rc = EXECRA_OK;			send_direct_ack(op, rsc->id);			free_lrm_op(op);								} else if(safe_str_eq(operation, CRMD_ACTION_DELETE)) {			int rc = HA_OK;			lrm_op_t* op = NULL;			op = construct_op(input->xml, id_from_cib, operation);			op->op_status = LRM_OP_DONE;			op->rc = EXECRA_OK;			if(rsc == NULL) {				crm_debug("Resource %s was already removed",					 id_from_cib);			} else {				crm_info("Removing resource %s from the LRM",					 rsc->id);				rc = fsa_lrm_conn->lrm_ops->delete_rsc(					fsa_lrm_conn, rid);				if(rc != HA_OK) {					crm_err("Failed to remove resource %s",						rid);					op->op_status = LRM_OP_ERROR;					op->rc = EXECRA_UNKNOWN_ERROR;				}			}			send_direct_ack(op, id_from_cib);			free_lrm_op(op);								} else {			next_input = do_lrm_rsc_op(				rsc, rid, operation, input->xml, input->msg);		}		lrm_free_rsc(rsc);			} else {		crm_err("Operation was neither a lrm_query, nor a rsc op.  %s",			crm_str(crm_op));		register_fsa_error(C_FSA_INTERNAL, I_ERROR, NULL);	}	return next_input;}