action_start->timeout = timeout;
unpack_resources(xmlNodePtr xml_resources,		 GListPtr *resources,		 GListPtr *actions,		 GListPtr *action_cons,		 GListPtr all_nodes){	crm_verbose("Begining unpack...");	xml_child_iter(		xml_resources, xml_obj, XML_CIB_TAG_RESOURCE,		action_t *action_stop  = NULL;		action_t *action_start = NULL;		const char *id         = xmlGetProp(xml_obj, XML_ATTR_ID);		const char *stopfail   = xmlGetProp(xml_obj, "on_stopfail");		const char *restart    = xmlGetProp(xml_obj, "restart_type");		const char *max_instances      = xmlGetProp(			xml_obj, "max_instances");		const char *max_node_instances = xmlGetProp(			xml_obj, "max_node_instances");		const char *max_masters      = xmlGetProp(			xml_obj, "max_masters");		const char *max_node_masters = xmlGetProp(			xml_obj, "max_node_masters");		const char *version    = xmlGetProp(xml_obj, XML_ATTR_VERSION);		resource_t *new_rsc = NULL;		const char *priority   = xmlGetProp(			xml_obj, XML_CIB_ATTR_PRIORITY);		crm_verbose("Processing resource...");				if(id == NULL) {			crm_err("Must specify id tag in <resource>");			continue;		}		crm_malloc(new_rsc, sizeof(resource_t));		if(new_rsc == NULL) {			return FALSE;		}				new_rsc->id		= id;		new_rsc->xml		= xml_obj;		crm_malloc(new_rsc->agent, sizeof(lrm_agent_t));		new_rsc->agent->class	= xmlGetProp(xml_obj, "class");		new_rsc->agent->type	= xmlGetProp(xml_obj, "type");		new_rsc->agent->version	= version?version:"0.0";		new_rsc->priority	    = atoi(priority?priority:"0"); 		new_rsc->effective_priority = new_rsc->priority;		new_rsc->max_instances	    = atoi(			max_instances?max_instances:"1"); 		new_rsc->max_node_instances = atoi(			max_node_instances?max_node_instances:"1"); 		new_rsc->max_masters	    = atoi(			max_masters?max_masters:"0"); 		new_rsc->max_node_masters   = atoi(			max_node_masters?max_node_masters:"0"); 		new_rsc->candidate_colors   = NULL;		new_rsc->actions            = NULL;		new_rsc->color		= NULL; 		new_rsc->runnable	= TRUE; 		new_rsc->provisional	= TRUE; 		new_rsc->allowed_nodes	= NULL;		new_rsc->rsc_cons	= NULL; 		new_rsc->node_cons	= NULL; 		new_rsc->cur_node	= NULL;				if(safe_str_eq(stopfail, "ignore")) {			new_rsc->stopfail_type = pesf_ignore;		} else if(safe_str_eq(stopfail, "stonith")) {			new_rsc->stopfail_type = pesf_stonith;		} else {			new_rsc->stopfail_type = pesf_block;		}		if(safe_str_eq(restart, "restart")) {			new_rsc->restart_type = pe_restart_restart;		} else if(safe_str_eq(restart, "recover")) {			new_rsc->restart_type = pe_restart_recover;		} else {			new_rsc->restart_type = pe_restart_ignore;		}		action_stop    = action_new(new_rsc, stop_rsc);		*actions       = g_list_append(*actions, action_stop);		new_rsc->stop  = action_stop;		new_rsc->actions =			g_list_append(new_rsc->actions, action_stop);		action_start   = action_new(new_rsc, start_rsc);		*actions       = g_list_append(*actions, action_start);		new_rsc->start = action_start;		new_rsc->actions =			g_list_append(new_rsc->actions, action_start);		order_new(action_stop,action_start,pecs_startstop,action_cons);		*resources = g_list_append(*resources, new_rsc);			crm_debug_action(print_resource("Added", new_rsc, FALSE));		);		*resources = g_list_sort(*resources, sort_rsc_priority);	return TRUE;}