HA_Message *update_msg = ha_msg_new(8);
HA_Message *update_msg = NULL;
do_cib_notify(	int options, const char *op, crm_data_t *update,	enum cib_errors result, crm_data_t *result_data, const char *msg_type) {	HA_Message *update_msg = ha_msg_new(8);	char *type = NULL;	char *id = NULL;	if(options & cib_inhibit_notify) {		crm_debug_2("Inhibiting notify.");		return;	}	if(update != NULL && crm_element_value(result_data, XML_ATTR_ID) != NULL){		id = crm_element_value_copy(result_data, XML_ATTR_ID);	}		ha_msg_add(update_msg, F_TYPE, T_CIB_NOTIFY);	ha_msg_add(update_msg, F_SUBTYPE, msg_type);	ha_msg_add(update_msg, F_CIB_OPERATION, op);	ha_msg_add_int(update_msg, F_CIB_RC, result);		if(id != NULL) {		ha_msg_add(update_msg, F_CIB_OBJID, id);	}	if(update != NULL) {		crm_debug_4("Setting type to update->name: %s",			    crm_element_name(update));		ha_msg_add(update_msg, F_CIB_OBJTYPE, crm_element_name(update));		type = crm_strdup(crm_element_name(update));	} else if(result_data != NULL) {		crm_debug_4("Setting type to new_obj->name: %s",			    crm_element_name(result_data));		ha_msg_add(update_msg, F_CIB_OBJTYPE, crm_element_name(result_data));		type = crm_strdup(crm_element_name(result_data));			} else {		crm_debug_4("Not Setting type");	}	attach_cib_generation(update_msg, "cib_generation", the_cib);	if(update != NULL) {		add_message_xml(update_msg, F_CIB_UPDATE, update);	}	if(result_data != NULL) {		add_message_xml(update_msg, F_CIB_UPDATE_RESULT, result_data);	}	crm_debug_3("Notifying clients");	g_hash_table_foreach(client_list, cib_notify_client, update_msg);	if(update == NULL) {		if(result == cib_ok) {			crm_debug_2("Operation %s (on section=%s) completed",				    op, crm_str(type));					} else {			crm_warn("Operation %s (on section=%s) FAILED: (%d) %s",				 op, crm_str(type), result,				 cib_error2string(result));		}			} else {		if(result == cib_ok) {			crm_debug_2("Completed %s of <%s %s%s>",				    op, crm_str(type), id?"id=":"", id?id:"");					} else {			crm_warn("%s of <%s %s%s> FAILED: %s", op,crm_str(type),				 id?"id=":"", id?id:"", cib_error2string(result));		}	}	crm_free(id);	crm_free(type);	crm_msg_del(update_msg);	crm_debug_3("Notify complete");}