crm_debug("\tDependancy restart handling: restart");
crm_debug_2("\tDependancy restart handling: restart");
common_unpack(crm_data_t * xml_obj, resource_t **rsc){	const char *id       = crm_element_value(xml_obj, XML_ATTR_ID);	const char *stopfail = crm_element_value(xml_obj, XML_RSC_ATTR_STOPFAIL);	const char *restart  = crm_element_value(xml_obj, XML_RSC_ATTR_RESTART);	const char *multiple = crm_element_value(xml_obj, "multiple_active");	const char *priority = NULL;	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_2("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, (*rsc)->parameters);	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)->schedule_recurring = FALSE;	(*rsc)->starting	   = FALSE; 	(*rsc)->stopping	   = FALSE; 	(*rsc)->candidate_colors   = NULL;	(*rsc)->rsc_cons	   = NULL; 	(*rsc)->actions            = NULL;	crm_debug("Options for %s", id);	if(stopfail == NULL && stonith_enabled) {		(*rsc)->stopfail_type = pesf_stonith;		crm_debug("\tFailed stop handling handling: fence (default)");	} else if(stopfail == NULL) {		(*rsc)->stopfail_type = pesf_block;		crm_debug("\tFailed stop handling handling: block (default)");			} else if(safe_str_eq(stopfail, "ignore")) {		(*rsc)->stopfail_type = pesf_ignore;		crm_debug("\tFailed stop handling handling: ignore");			} else if(safe_str_eq(stopfail, "fence")) {		(*rsc)->stopfail_type = pesf_stonith;		crm_debug("\tFailed stop handling handling: fence");	} else {		(*rsc)->stopfail_type = pesf_block;		crm_debug("\tFailed stop handling handling: block");	}		if(safe_str_eq(restart, "restart")) {		(*rsc)->restart_type = pe_restart_restart;		crm_debug("\tDependancy restart handling: restart");	} else {		(*rsc)->restart_type = pe_restart_ignore;		crm_debug("\tDependancy restart handling: ignore");	}	if(safe_str_eq(multiple, "stop_only")) {		(*rsc)->recovery_type = recovery_stop_only;		crm_debug("\tMultiple running resource recovery: stop only");	} else if(safe_str_eq(multiple, "block")) {		(*rsc)->recovery_type = recovery_block;		crm_debug("\tMultiple running resource recovery: block");	} else {				(*rsc)->recovery_type = recovery_stop_start;		crm_debug("\tMultiple running resource recovery: stop/start");			}		(*rsc)->fns->unpack(*rsc);	return TRUE;}