if(ret) { 
if(send_command) { 
initiate_action(action_t *action) {	gboolean ret = FALSE;	const char *on_node   = NULL;	const char *id        = NULL;	const char *task      = NULL;	const char *timeout   = NULL;	const char *destination = NULL;	const char *msg_task    = XML_GRAPH_TAG_RSC_OP;	crm_data_t *rsc_op  = NULL;	on_node  = crm_element_value(action->xml, XML_LRM_ATTR_TARGET);	id       = crm_element_value(action->xml, XML_ATTR_ID);	task     = crm_element_value(action->xml, XML_LRM_ATTR_TASK);	timeout  = crm_element_value(action->xml, XML_ATTR_TIMEOUT);	if(id == NULL || strlen(id) == 0	   || task == NULL || strlen(task) == 0) {		/* error */#ifdef TESTING		fprintf(stderr,"Failed on corrupted command: %s (id=%s) %s",			crm_element_name(action->xml),			crm_str(id), crm_str(task));#endif					crm_err("Failed on corrupted command: %s (id=%s) %s",			crm_element_name(action->xml),			crm_str(id), crm_str(task));	} else if(action->type == action_type_pseudo){#ifdef TESTING		fprintf(stderr,"Executing pseudo-event (%d): %s on %s",			action->id, task, on_node);#endif					crm_info("Executing pseudo-event (%d): "			 "%s on %s", action->id, task, on_node);				action->complete = TRUE;		process_trigger(action->id);		ret = TRUE;	} else if(action->type == action_type_crm		  && safe_str_eq(task, XML_CIB_ATTR_STONITH)){		/*         <args target="node1"/> */		crm_data_t *action_args = find_xml_node(			action->xml, XML_TAG_ATTRS, TRUE);		const char *uuid = NULL;		const char *target = NULL;		const char *name = NULL;		xml_child_iter(			action_args, nvpair, XML_CIB_TAG_NVPAIR,			name = crm_element_value(nvpair, XML_NVPAIR_ATTR_NAME);			if(safe_str_eq(name, XML_LRM_ATTR_TARGET)) {				target = crm_element_value(					nvpair, XML_NVPAIR_ATTR_VALUE);			} else if(safe_str_eq(name, XML_LRM_ATTR_TARGET_UUID)) {				uuid = crm_element_value(					nvpair, XML_NVPAIR_ATTR_VALUE);			} 			);		CRM_DEV_ASSERT(target != NULL);		CRM_DEV_ASSERT(uuid != NULL);		#ifdef TESTING		crm_info("Executing fencing operation (%s) on %s", id, target);		fprintf(stderr, "Executing fencing operation (%s) on %s\n",			id, target);		ret = TRUE;		action->complete = TRUE;#else		stonith_ops_t * st_op = NULL;		crm_malloc(st_op, sizeof(stonith_ops_t));		st_op->optype = RESET;		st_op->timeout = crm_atoi(timeout, "100"); /* ten seconds */		st_op->node_name = crm_strdup(target);		st_op->node_uuid = crm_strdup(uuid);		crm_info("Executing fencing operation (%s) on %s", id, target);		if(stonithd_input_IPC_channel() == NULL) {			crm_err("Cannot fence %s - stonith not available",				target);					} else if (ST_OK == stonithd_node_fence( st_op )) {			ret = TRUE;		}		return ret;#endif			} else if(on_node == NULL || strlen(on_node) == 0) {		/* error */#ifdef TESTING		fprintf(stderr,			"Failed on corrupted command: %s (id=%s) %s on %s\n",			crm_element_name(action->xml), crm_str(id),			crm_str(task), crm_str(on_node));#endif		crm_err("Failed on corrupted command: %s (id=%s) %s on %s",			crm_element_name(action->xml), crm_str(id),			crm_str(task), crm_str(on_node));				} else if(action->type == action_type_crm){#ifdef TESTING		fprintf(stderr, "Executing crm-event (%s): %s on %s\n",			 id, task, on_node);#endif		crm_info("Executing crm-event (%s): %s on %s",id,task,on_node);		action->complete = TRUE;		destination = CRM_SYSTEM_CRMD;		msg_task = task;		ret = TRUE;	} else if(action->type == action_type_rsc){		crm_data_t *rsc = find_xml_node(			action->xml, XML_CIB_TAG_RESOURCE, TRUE);#ifdef TESTING		fprintf(stderr, "Executing rsc-op (%s): %s %s on %s\n",			 id, task,			 crm_element_value(rsc, XML_ATTR_ID),			 on_node);#endif		crm_info("Executing rsc-op (%s): %s %s on %s",			 id, task, crm_element_value(rsc,XML_ATTR_ID), on_node);		/* let everyone know this was invoked */		if(safe_str_eq(CRMD_RSCSTATE_MON, task)) {			/* no update required for monitor ops */			action->complete = TRUE;					} else {			do_update_cib(action->xml, -1);		}				/*		  <msg_data>		  <rsc_op id="operation number" on_node="" task="">		  <resource>...</resource>		*/#if 1		rsc_op  = copy_xml_node_recursive(action->xml);#else		rsc_op = create_xml_node(NULL, XML_GRAPH_TAG_RSC_OP);				set_xml_property_copy(rsc_op, XML_ATTR_ID, id);		set_xml_property_copy(rsc_op, XML_LRM_ATTR_TASK, task);		set_xml_property_copy(rsc_op, XML_LRM_ATTR_TARGET, on_node);		add_node_copy(rsc_op, rsc);#endif		destination = CRM_SYSTEM_LRMD;		ret = TRUE;				} else {#ifdef TESTING		fprintf(stderr, "Failed on unsupported command type: "			"%s, %s (id=%s) on %s", crm_element_name(action->xml),			task, id, on_node);#endif		crm_err("Failed on unsupported command type: "			"%s, %s (id=%s) on %s",			crm_element_name(action->xml), task, id, on_node);	}	if(ret) {		HA_Message *cmd = NULL;		char *counter = crm_itoa(transition_counter);		if(rsc_op != NULL) {			crm_xml_debug(rsc_op, "Performing");		}		cmd = create_request(msg_task, rsc_op, on_node, destination,				     CRM_SYSTEM_TENGINE, NULL);		ha_msg_add(cmd, "transition_id", crm_str(counter));#ifndef TESTING		send_ipc_message(crm_ch, cmd);#else		crm_log_message(LOG_INFO, cmd);#endif		crm_free(counter);		if(action->timeout > 0) {			crm_devel("Setting timer for action %d",action->id);			start_te_timer(action->timer);		}	}	free_xml(rsc_op);	return ret;}
8182	/local/tlutelli/issta_data/temp/c/2005_temp/2005/8182/91cb732418da1613841171ab7561930c57d4a96f/tengine.c/clean/crm/tengine/tengine.c