if(failed) { action_t *stop = stop_action(rsc, node); stop->optional = FALSE; rsc->recover = TRUE; }
unpack_lrm_rsc_state(node_t *node, crm_data_t * lrm_rsc_list,		     pe_working_set_t *data_set){	const char *rsc_id    = NULL;	const char *node_id   = node->details->uname;	const char *rsc_state = NULL;	int max_call_id = -1;	gboolean failed  = FALSE;	gboolean running = FALSE;	resource_t *rsc   = NULL;	GListPtr op_list = NULL;	GListPtr sorted_op_list = NULL;		CRM_DEV_ASSERT(node != NULL);	if(crm_assert_failed) {		return FALSE;	}		xml_child_iter(		lrm_rsc_list, rsc_entry, XML_LRM_TAG_RESOURCE,				rsc_id    = crm_element_value(rsc_entry, XML_ATTR_ID);		rsc_state = crm_element_value(rsc_entry, XML_LRM_ATTR_RSCSTATE);				rsc    = pe_find_resource(data_set->resources, rsc_id);		crm_debug_3("[%s] Processing %s on %s (%s)",			    crm_element_name(rsc_entry),			    rsc_id, node_id, rsc_state);		if(rsc == NULL) {			pe_err("Could not find a match for resource"				" %s in %s's status section",				rsc_id, node_id);			crm_log_xml_debug(rsc_entry, "Invalid status entry");			continue;		}		failed  = FALSE;		running = FALSE;		max_call_id = -1;		op_list = NULL;		sorted_op_list = NULL;				xml_child_iter(			rsc_entry, rsc_op, XML_LRM_TAG_RSC_OP,			op_list = g_list_append(op_list, rsc_op);			);		if(op_list == NULL) {			continue;		}				sorted_op_list = g_list_sort(op_list, sort_op_by_callid);		slist_iter(			rsc_op, crm_data_t, sorted_op_list, lpc,			unpack_rsc_op(rsc, node, rsc_op,				      &running, &failed, &max_call_id,				      data_set);			);		/* no need to free the contents */		g_list_free(sorted_op_list);		if(running) {			native_add_running(rsc, node);			if(failed) {				action_t *stop = stop_action(rsc, node);				stop->optional = FALSE;				rsc->recover = TRUE;			}		}		);		return TRUE;}