crm_debug_2("Added %d children to resource %s...",
crm_debug_3("Added %d children to resource %s...",
void incarnation_unpack(resource_t *rsc){	int lpc = 0;	crm_data_t * xml_obj = rsc->xml;	crm_data_t * xml_self = create_xml_node(NULL, XML_CIB_TAG_RESOURCE);	incarnation_variant_data_t *incarnation_data = NULL;	resource_t *self = NULL;	const char *ordered    = crm_element_value(		xml_obj, XML_RSC_ATTR_ORDERED);	const char *interleave = crm_element_value(		xml_obj, XML_RSC_ATTR_INTERLEAVE);	const char *max_incarn      = get_rsc_param(		rsc, XML_RSC_ATTR_INCARNATION_MAX);	const char *max_incarn_node = get_rsc_param(		rsc, XML_RSC_ATTR_INCARNATION_NODEMAX);	crm_debug_2("Processing resource %s...", rsc->id);	crm_malloc0(incarnation_data, sizeof(incarnation_variant_data_t));	incarnation_data->child_list           = NULL;	incarnation_data->interleave           = FALSE;	incarnation_data->ordered              = FALSE;	incarnation_data->active_incarnation   = 0;	incarnation_data->incarnation_max      = crm_atoi(max_incarn,     "1");	incarnation_data->incarnation_max_node = crm_atoi(max_incarn_node,"1");	/* this is a bit of a hack - but simplifies everything else */	copy_in_properties(xml_self, xml_obj);	if(common_unpack(xml_self, &self)) {		incarnation_data->self = self;		self->restart_type = pe_restart_restart;	} else {		crm_log_xml_err(xml_self, "Couldnt unpack dummy child");		return;	}	if(crm_is_true(interleave)) {		incarnation_data->interleave = TRUE;	}	if(crm_is_true(ordered)) {		incarnation_data->ordered = TRUE;	}		xml_child_iter(		xml_obj, xml_obj_child, XML_CIB_TAG_RESOURCE,		char *inc_max = crm_itoa(incarnation_data->incarnation_max);		for(lpc = 0; lpc < incarnation_data->incarnation_max; lpc++) {			resource_t *child_rsc = NULL;			crm_data_t * child_copy = copy_xml_node_recursive(				xml_obj_child);			set_id(child_copy, rsc->id, lpc);						if(common_unpack(child_copy, &child_rsc)) {				char *inc_num = crm_itoa(lpc);				incarnation_data->child_list = g_list_append(					incarnation_data->child_list, child_rsc);								add_rsc_param(					child_rsc, XML_RSC_ATTR_INCARNATION, inc_num);				add_rsc_param(					child_rsc, XML_RSC_ATTR_INCARNATION_MAX, inc_max);				crm_action_debug_3(					print_resource("Added", child_rsc, FALSE));				crm_free(inc_num);							} else {				pe_err("Failed unpacking resource %s",					crm_element_value(child_copy, XML_ATTR_ID));			}		}		crm_free(inc_max);				/* only count the first one */		break;		);		crm_debug_2("Added %d children to resource %s...",		    incarnation_data->incarnation_max, rsc->id);		rsc->variant_opaque = incarnation_data;}