crm_debug_2("\tNotification of start/stop actions: %s", (*rsc)->notify?"required":"not required");
common_unpack(	crm_data_t * xml_obj, resource_t **rsc, pe_working_set_t *data_set){	const char *id       = crm_element_value(xml_obj, XML_ATTR_ID);	const char *restart  = crm_element_value(xml_obj, XML_RSC_ATTR_RESTART);	const char *multiple = crm_element_value(xml_obj, "multiple_active");	const char *placement= crm_element_value(xml_obj, "resource_stickiness");	const char *priority = NULL;	const char *is_managed = NULL;	const char *allowed_attrs[] = {		XML_CIB_ATTR_PRIORITY,		XML_RSC_ATTR_INCARNATION_MAX,		XML_RSC_ATTR_INCARNATION_NODEMAX	};	crm_log_xml_debug_2(xml_obj, "Processing resource input...");		if(id == NULL) {		pe_err("Must specify id tag in <resource>");		return FALSE;			} else if(rsc == NULL) {		pe_err("Nowhere to unpack resource into");		return FALSE;			}	crm_malloc0(*rsc, sizeof(resource_t));		if(*rsc == NULL) {		return FALSE;	}		(*rsc)->id  = id;	(*rsc)->xml = xml_obj;	(*rsc)->ops_xml = find_xml_node(xml_obj, "operations", FALSE);	(*rsc)->variant = get_resource_type(crm_element_name(xml_obj));		if((*rsc)->variant == pe_unknown) {		pe_err("Unknown resource type: %s", crm_element_name(xml_obj));		crm_free(*rsc);		return FALSE;	}		(*rsc)->fns = &resource_class_functions[(*rsc)->variant];	crm_debug_3("Unpacking resource...");		(*rsc)->parameters = g_hash_table_new_full(		g_str_hash,g_str_equal, g_hash_destroy_str,g_hash_destroy_str);	unpack_instance_attributes(xml_obj, NULL, (*rsc)->parameters,				   allowed_attrs, DIMOF(allowed_attrs));	priority = get_rsc_param(*rsc, XML_CIB_ATTR_PRIORITY);	(*rsc)->priority	   = atoi(priority?priority:"0"); 	(*rsc)->effective_priority = (*rsc)->priority;	(*rsc)->recovery_type      = recovery_stop_start;	(*rsc)->runnable	   = TRUE; 	(*rsc)->provisional	   = TRUE; 	(*rsc)->start_pending	   = FALSE; 	(*rsc)->starting	   = FALSE; 	(*rsc)->stopping	   = FALSE; 	(*rsc)->candidate_colors   = NULL;	(*rsc)->rsc_cons	   = NULL; 	(*rsc)->actions            = NULL;	(*rsc)->is_managed	   = TRUE;	(*rsc)->stickiness         = data_set->default_resource_stickiness;	is_managed = crm_element_value((*rsc)->xml, "is_managed");	if(is_managed != NULL && crm_is_true(is_managed) == FALSE) {		(*rsc)->is_managed = FALSE;		crm_warn("Resource %s is currently not managed", (*rsc)->id);#if 0				rsc_to_node_t *new_con = NULL;		/* prevent this resource from running anywhere */		new_con = rsc2node_new(			"is_managed_default", *rsc, -INFINITY, NULL, data_set);		new_con->node_list_rh = node_list_dup(data_set->nodes, FALSE);#endif		} else if((*rsc)->is_managed && data_set->symmetric_cluster) {		rsc_to_node_t *new_con = rsc2node_new(			"symmetric_default", *rsc, 0, NULL, data_set);		new_con->node_list_rh = node_list_dup(data_set->nodes, FALSE);	}		crm_debug_2("Options for %s", id);		if(safe_str_eq(restart, "restart")) {		(*rsc)->restart_type = pe_restart_restart;		crm_debug_2("\tDependancy restart handling: restart");	} else {		(*rsc)->restart_type = pe_restart_ignore;		crm_debug_2("\tDependancy restart handling: ignore");	}	if(safe_str_eq(multiple, "stop_only")) {		(*rsc)->recovery_type = recovery_stop_only;		crm_debug_2("\tMultiple running resource recovery: stop only");	} else if(safe_str_eq(multiple, "block")) {		(*rsc)->recovery_type = recovery_block;		crm_debug_2("\tMultiple running resource recovery: block");	} else {				(*rsc)->recovery_type = recovery_stop_start;		crm_debug_2("\tMultiple running resource recovery: stop/start");			}	if(placement != NULL) {		if(safe_str_eq(placement, INFINITY_S)) {			(*rsc)->stickiness = INFINITY;		} else if(safe_str_eq(placement, MINUS_INFINITY_S)) {			(*rsc)->stickiness = -INFINITY;		} else {			(*rsc)->stickiness = atoi(placement);		}	}	if((*rsc)->stickiness > 0) {		crm_debug_2("\tPlacement: prefer current location%s",			    placement == NULL?" (default)":"");	} else if((*rsc)->stickiness < 0) {		crm_warn("\tPlacement: always move from the current location%s",			    placement == NULL?" (default)":"");	} else {		crm_debug_2("\tPlacement: optimal%s",			    placement == NULL?" (default)":"");	}		(*rsc)->fns->unpack(*rsc, data_set);	return TRUE;}