Send Linux-ha-cvs mailing list submissions to
[email protected]
To subscribe or unsubscribe via the World Wide Web, visit
http://lists.community.tummy.com/mailman/listinfo/linux-ha-cvs
or, via email, send a message with subject or body 'help' to
[EMAIL PROTECTED]
You can reach the person managing the list at
[EMAIL PROTECTED]
When replying, please edit your Subject line so it is more specific
than "Re: Contents of Linux-ha-cvs digest..."
Today's Topics:
1. Linux-HA CVS: mgmt by zhenh from
([email protected])
2. Linux-HA CVS: lib by lars from ([email protected])
3. Linux-HA CVS: crm by andrew from
([email protected])
4. Linux-HA CVS: crm by andrew from
([email protected])
----------------------------------------------------------------------
Message: 1
Date: Thu, 8 Jun 2006 02:03:58 -0600 (MDT)
From: [email protected]
Subject: [Linux-ha-cvs] Linux-HA CVS: mgmt by zhenh from
To: [EMAIL PROTECTED]
Message-ID: <[EMAIL PROTECTED]>
linux-ha CVS committal
Author : zhenh
Host :
Project : linux-ha
Module : mgmt
Dir : linux-ha/mgmt/daemon
Modified Files:
Makefile.am mgmt_crm.c
Log Message:
change the lib name according to the changes in crm
===================================================================
RCS file: /home/cvs/linux-ha/linux-ha/mgmt/daemon/Makefile.am,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -3 -r1.11 -r1.12
--- Makefile.am 24 Jan 2006 15:35:35 -0000 1.11
+++ Makefile.am 8 Jun 2006 08:03:57 -0000 1.12
@@ -57,6 +57,7 @@
$(top_builddir)/lib/crm/cib/libcib.la \
$(top_builddir)/lib/crm/common/libcrmcommon.la \
$(top_builddir)/lib/apphb/libapphb.la \
- $(top_builddir)/crm/pengine/libpengine.la \
+ $(top_builddir)/lib/crm/pengine/libpe_status.la \
$(top_builddir)/lib/hbclient/libhbclient.la \
+ $(top_builddir)/crm/pengine/libpengine.la \
$(COMMONLIBS) $(CURSESLIBS)
===================================================================
RCS file: /home/cvs/linux-ha/linux-ha/mgmt/daemon/mgmt_crm.c,v
retrieving revision 1.49
retrieving revision 1.50
diff -u -3 -r1.49 -r1.50
--- mgmt_crm.c 6 Jun 2006 05:05:04 -0000 1.49
+++ mgmt_crm.c 8 Jun 2006 08:03:57 -0000 1.50
@@ -33,8 +33,7 @@
#include <crm/cib.h>
#include <crm/msg_xml.h>
-#include <crm/pengine/pengine.h>
-#include <crm/pengine/pe_utils.h>
+#include <crm/pengine/status.h>
extern resource_t *group_find_child(resource_t *rsc, const char *id);
extern crm_data_t * do_calculations(
------------------------------
Message: 2
Date: Thu, 8 Jun 2006 03:12:25 -0600 (MDT)
From: [email protected]
Subject: [Linux-ha-cvs] Linux-HA CVS: lib by lars from
To: [EMAIL PROTECTED]
Message-ID: <[EMAIL PROTECTED]>
linux-ha CVS committal
Author : lars
Host :
Project : linux-ha
Module : lib
Dir : linux-ha/lib/plugins/stonith/external
Modified Files:
ssh.in
Log Message:
Accept "," as a hostname separator too.
===================================================================
RCS file: /home/cvs/linux-ha/linux-ha/lib/plugins/stonith/external/ssh.in,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -3 -r1.9 -r1.10
--- ssh.in 16 May 2006 09:35:44 -0000 1.9
+++ ssh.in 8 Jun 2006 09:12:25 -0000 1.10
@@ -37,6 +37,9 @@
# POWEROFF_COMMAND="echo 'sleep 2; /sbin/poweroff -nf' | SHELL=/bin/sh at now
>/dev/null 2>&1"
POWEROFF_COMMAND="echo 'sleep 2; /sbin/reboot -nf' | SHELL=/bin/sh at now
>/dev/null 2>&1"
+# Rewrite the hostlist to accept "," as a delimeter for hostnames too.
+hostlist=`echo $hostlist | tr ',' ' '`
+
CheckIfDead() {
for j in 1 2 3
do
------------------------------
Message: 3
Date: Thu, 8 Jun 2006 07:36:38 -0600 (MDT)
From: [email protected]
Subject: [Linux-ha-cvs] Linux-HA CVS: crm by andrew from
To: [EMAIL PROTECTED]
Message-ID: <[EMAIL PROTECTED]>
linux-ha CVS committal
Author : andrew
Host :
Project : linux-ha
Module : crm
Dir : linux-ha/crm/admin
Modified Files:
crm_resource.c
Log Message:
Coverity: Use of NULL
===================================================================
RCS file: /home/cvs/linux-ha/linux-ha/crm/admin/crm_resource.c,v
retrieving revision 1.35
retrieving revision 1.36
diff -u -3 -r1.35 -r1.36
--- crm_resource.c 7 Jun 2006 12:46:57 -0000 1.35
+++ crm_resource.c 8 Jun 2006 13:36:37 -0000 1.36
@@ -1,4 +1,4 @@
-/* $Id: crm_resource.c,v 1.35 2006/06/07 12:46:57 andrew Exp $ */
+/* $Id: crm_resource.c,v 1.36 2006/06/08 13:36:37 andrew Exp $ */
/*
* Copyright (C) 2004 Andrew Beekhof <[EMAIL PROTECTED]>
@@ -165,7 +165,7 @@
}
unpack_instance_attributes(
- the_rsc->xml, XML_TAG_ATTR_SETS, current->details->attrs,
+ the_rsc->xml, XML_TAG_ATTR_SETS,
current?current->details->attrs:NULL,
the_rsc->parameters, NULL, data_set->now);
if(the_rsc->parameters != NULL) {
------------------------------
Message: 4
Date: Thu, 8 Jun 2006 07:39:11 -0600 (MDT)
From: [email protected]
Subject: [Linux-ha-cvs] Linux-HA CVS: crm by andrew from
To: [EMAIL PROTECTED]
Message-ID: <[EMAIL PROTECTED]>
linux-ha CVS committal
Author : andrew
Host :
Project : linux-ha
Module : crm
Dir : linux-ha/crm/pengine
Modified Files:
Makefile.am allocate.c allocate.h clone.c graph.c group.c
native.c pengine.c ptest.c regression.sh
Added Files:
utils.c utils.h
Log Message:
Shift more non-status functionality out of the lib directory
===================================================================
RCS file: /home/cvs/linux-ha/linux-ha/crm/pengine/Makefile.am,v
retrieving revision 1.34
retrieving revision 1.35
diff -u -3 -r1.34 -r1.35
--- Makefile.am 7 Jun 2006 12:46:57 -0000 1.34
+++ Makefile.am 8 Jun 2006 13:39:10 -0000 1.35
@@ -56,12 +56,12 @@
halib_PROGRAMS = ptest pengine
## SOURCES
-noinst_HEADERS = allocate.h
+noinst_HEADERS = allocate.h utils.h
#utils.h pengine.h
libpengine_la_LDFLAGS = -version-info 3:0:0
# -L$(top_builddir)/lib/pils -lpils -export-dynamic -module -avoid-version
-libpengine_la_SOURCES = pengine.c allocate.c \
+libpengine_la_SOURCES = pengine.c allocate.c utils.c \
native.c group.c clone.c master.c graph.c
pengine_SOURCES = main.c
===================================================================
RCS file: /home/cvs/linux-ha/linux-ha/crm/pengine/allocate.c,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -3 -r1.1 -r1.2
--- allocate.c 7 Jun 2006 12:46:57 -0000 1.1
+++ allocate.c 8 Jun 2006 13:39:10 -0000 1.2
@@ -1,4 +1,4 @@
-/* $Id: allocate.c,v 1.1 2006/06/07 12:46:57 andrew Exp $ */
+/* $Id: allocate.c,v 1.2 2006/06/08 13:39:10 andrew Exp $ */
/*
* Copyright (C) 2004 Andrew Beekhof <[EMAIL PROTECTED]>
*
@@ -31,11 +31,11 @@
#include <glib.h>
#include <crm/pengine/status.h>
-#include <lib/crm/pengine/pengine.h>
+#include <pengine.h>
#include <allocate.h>
+#include <utils.h>
#include <lib/crm/pengine/utils.h>
-node_t *choose_fencer(action_t *stonith, node_t *node, GListPtr resources);
void set_alloc_actions(pe_working_set_t *data_set);
resource_alloc_functions_t resource_class_alloc_functions[] = {
@@ -174,6 +174,8 @@
cluster_status(data_set);
set_alloc_actions(data_set);
+ data_set->no_color = create_color(data_set, NULL, NULL);
+
unpack_constraints(cib_constraints, data_set);
return TRUE;
}
@@ -214,7 +216,7 @@
* given the current node stati and constraints.
*/
gboolean
-stage2(pe_working_set_t *data_set)
+stage3(pe_working_set_t *data_set)
{
crm_debug_3("Coloring resources");
@@ -222,8 +224,9 @@
/* Take (next) highest resource */
slist_iter(
- lh_resource, resource_t, data_set->resources, lpc,
- lh_resource->cmds->color(lh_resource, data_set);
+ rsc, resource_t, data_set->resources, lpc,
+ rsc->cmds->internal_constraints(rsc, data_set);
+ rsc->cmds->color(rsc, data_set);
);
return TRUE;
@@ -233,7 +236,7 @@
* Check nodes for resources started outside of the LRM
*/
gboolean
-stage3(pe_working_set_t *data_set)
+stage2(pe_working_set_t *data_set)
{
action_t *probe_complete = NULL;
action_t *probe_node_complete = NULL;
@@ -349,6 +352,270 @@
}
+static gboolean
+check_rsc_parameters(resource_t *rsc, node_t *node, crm_data_t *rsc_entry,
+ pe_working_set_t *data_set)
+{
+ int attr_lpc = 0;
+ gboolean force_restart = FALSE;
+ gboolean delete_resource = FALSE;
+
+ const char *value = NULL;
+ const char *old_value = NULL;
+ const char *attr_list[] = {
+ XML_ATTR_TYPE,
+ XML_AGENT_ATTR_CLASS,
+ XML_AGENT_ATTR_PROVIDER
+ };
+
+ for(; attr_lpc < DIMOF(attr_list); attr_lpc++) {
+ value = crm_element_value(rsc->xml, attr_list[attr_lpc]);
+ old_value = crm_element_value(rsc_entry, attr_list[attr_lpc]);
+ if(safe_str_eq(value, old_value)) {
+ continue;
+ }
+
+ force_restart = TRUE;
+ crm_notice("Forcing restart of %s on %s, %s changed: %s -> %s",
+ rsc->id, node->details->uname, attr_list[attr_lpc],
+ crm_str(old_value), crm_str(value));
+ }
+ if(force_restart) {
+ /* make sure the restart happens */
+ stop_action(rsc, node, FALSE);
+ rsc->start_pending = TRUE;
+ delete_resource = TRUE;
+ }
+ return delete_resource;
+}
+
+static gboolean
+check_action_definition(resource_t *rsc, node_t *active_node, crm_data_t
*xml_op,
+ pe_working_set_t *data_set)
+{
+ char *key = NULL;
+ int interval = 0;
+ const char *interval_s = NULL;
+
+ gboolean did_change = FALSE;
+
+ crm_data_t *pnow = NULL;
+ GHashTable *local_rsc_params = NULL;
+
+ char *pnow_digest = NULL;
+ const char *param_digest = NULL;
+ char *local_param_digest = NULL;
+
+#if CRM_DEPRECATED_SINCE_2_0_4
+ crm_data_t *params = NULL;
+#endif
+
+ action_t *action = NULL;
+ const char *task = crm_element_value(xml_op, XML_LRM_ATTR_TASK);
+ const char *op_version = crm_element_value(xml_op,
XML_ATTR_CRM_VERSION);
+
+ CRM_CHECK(active_node != NULL, return FALSE);
+
+ interval_s = get_interval(xml_op);
+ interval = crm_parse_int(interval_s, "0");
+ key = generate_op_key(rsc->id, task, interval);
+
+ if(interval > 0) {
+ crm_data_t *op_match = NULL;
+
+ crm_debug_2("Checking parameters for %s %s", key, task);
+ op_match = find_rsc_op_entry(rsc, key);
+
+ if(op_match == NULL && data_set->stop_action_orphans) {
+ /* create a cancel action */
+ action_t *cancel = NULL;
+ crm_info("Orphan action will be stopped: %s on %s",
+ key, active_node->details->uname);
+
+ crm_free(key);
+ key = generate_op_key(rsc->id, CRMD_ACTION_CANCEL,
interval);
+
+ cancel = custom_action(
+ rsc, key, CRMD_ACTION_CANCEL, active_node,
+ FALSE, TRUE, data_set);
+
+ add_hash_param(cancel->meta, XML_LRM_ATTR_TASK, task);
+ add_hash_param(cancel->meta,
+ XML_LRM_ATTR_INTERVAL, interval_s);
+
+ custom_action_order(
+ rsc, NULL, cancel,
+ rsc, stop_key(rsc), NULL,
+ pe_ordering_optional, data_set);
+ }
+ if(op_match == NULL) {
+ crm_debug("Orphan action detected: %s on %s",
+ key, active_node->details->uname);
+ return TRUE;
+ }
+ }
+
+ action = custom_action(rsc, key, task, active_node, TRUE, FALSE,
data_set);
+
+ local_rsc_params = g_hash_table_new_full(
+ g_str_hash, g_str_equal,
+ g_hash_destroy_str, g_hash_destroy_str);
+
+ unpack_instance_attributes(
+ rsc->xml, XML_TAG_ATTR_SETS, active_node->details->attrs,
+ local_rsc_params, NULL, data_set->now);
+
+ pnow = create_xml_node(NULL, XML_TAG_PARAMS);
+ g_hash_table_foreach(action->extra, hash2field, pnow);
+ g_hash_table_foreach(rsc->parameters, hash2field, pnow);
+ g_hash_table_foreach(local_rsc_params, hash2field, pnow);
+
+ filter_action_parameters(pnow, op_version);
+ pnow_digest = calculate_xml_digest(pnow, TRUE);
+ param_digest = crm_element_value(xml_op, XML_LRM_ATTR_OP_DIGEST);
+
+#if CRM_DEPRECATED_SINCE_2_0_4
+ if(param_digest == NULL) {
+ params = find_xml_node(xml_op, XML_TAG_PARAMS, TRUE);
+ }
+ if(params != NULL) {
+ crm_data_t *local_params = copy_xml(params);
+
+ crm_warn("Faking parameter digest creation for %s",
ID(xml_op));
+ filter_action_parameters(local_params, op_version);
+ xml_remove_prop(local_params, "interval");
+ xml_remove_prop(local_params, "timeout");
+ crm_log_xml_warn(local_params, "params:used");
+
+ local_param_digest = calculate_xml_digest(local_params, TRUE);
+ param_digest = local_param_digest;
+
+ free_xml(local_params);
+ }
+#endif
+
+ if(safe_str_neq(pnow_digest, param_digest)) {
+#if CRM_DEPRECATED_SINCE_2_0_4
+ if(params) {
+ crm_data_t *local_params = copy_xml(params);
+ filter_action_parameters(local_params, op_version);
+ xml_remove_prop(local_params, "interval");
+ xml_remove_prop(local_params, "timeout");
+
+ free_xml(local_params);
+ }
+#endif
+ did_change = TRUE;
+ crm_log_xml_info(pnow, "params:calc");
+ crm_warn("Parameters to %s on %s changed: recorded %s vs.
calculated %s",
+ ID(xml_op), active_node->details->uname,
+ crm_str(param_digest), pnow_digest);
+
+ key = generate_op_key(rsc->id, task, interval);
+ custom_action(rsc, key, task, NULL, FALSE, TRUE, data_set);
+ }
+
+ free_xml(pnow);
+ crm_free(pnow_digest);
+ crm_free(local_param_digest);
+ g_hash_table_destroy(local_rsc_params);
+
+ pe_free_action(action);
+
+ return did_change;
+}
+
+extern gboolean DeleteRsc(resource_t *rsc, node_t *node, pe_working_set_t
*data_set);
+
+static void
+check_actions_for(crm_data_t *rsc_entry, node_t *node, pe_working_set_t
*data_set)
+{
+ const char *id = NULL;
+ const char *task = NULL;
+ int interval = 0;
+ const char *interval_s = NULL;
+ GListPtr op_list = NULL;
+ GListPtr sorted_op_list = NULL;
+ const char *rsc_id = ID(rsc_entry);
+ gboolean is_probe = FALSE;
+ resource_t *rsc = pe_find_resource(data_set->resources, rsc_id);
+
+ CRM_CHECK(rsc_id != NULL, return);
+ CRM_CHECK(rsc != NULL, return);
+
+ if(rsc->orphan) {
+ crm_debug_2("Skipping param check for orphan: %s %s",
+ rsc->id, task);
+ return;
+ }
+
+ crm_debug_2("Processing %s on %s", rsc->id, node->details->uname);
+
+ if(check_rsc_parameters(rsc, node, rsc_entry, data_set)) {
+ DeleteRsc(rsc, node, data_set);
+ }
+
+ xml_child_iter_filter(
+ rsc_entry, rsc_op, XML_LRM_TAG_RSC_OP,
+ op_list = g_list_append(op_list, rsc_op);
+ );
+
+ sorted_op_list = g_list_sort(op_list, sort_op_by_callid);
+ slist_iter(
+ rsc_op, crm_data_t, sorted_op_list, lpc,
+
+ id = ID(rsc_op);
+ is_probe = FALSE;
+ task = crm_element_value(rsc_op, XML_LRM_ATTR_TASK);
+
+ interval_s = get_interval(rsc_op);
+ interval = crm_parse_int(interval_s, "0");
+
+ if(interval == 0 && safe_str_eq(task, CRMD_ACTION_STATUS)) {
+ is_probe = TRUE;
+ }
+
+ if(is_probe || safe_str_eq(task, CRMD_ACTION_START) || interval
> 0) {
+ crm_debug("Checking resource definition: %s", rsc->id);
+ check_action_definition(rsc, node, rsc_op, data_set);
+ }
+ crm_debug_3("Ignoring %s params: %s", task, id);
+ );
+
+ g_list_free(sorted_op_list);
+
+}
+
+static void
+check_actions(pe_working_set_t *data_set)
+{
+ const char *id = NULL;
+ node_t *node = NULL;
+ crm_data_t *lrm_rscs = NULL;
+ crm_data_t *status = get_object_root(XML_CIB_TAG_STATUS,
data_set->input);
+
+ xml_child_iter_filter(
+ status, node_state, XML_CIB_TAG_STATE,
+
+ id = crm_element_value(node_state, XML_ATTR_ID);
+ lrm_rscs = find_xml_node(node_state, XML_CIB_TAG_LRM, FALSE);
+ lrm_rscs = find_xml_node(lrm_rscs, XML_LRM_TAG_RESOURCES,
FALSE);
+
+ node = pe_find_node_id(data_set->nodes, id);
+
+ if(node == NULL) {
+ continue;
+ }
+ crm_debug("Processing node %s", node->details->uname);
+ if(node->details->online || data_set->stonith_enabled) {
+ xml_child_iter_filter(
+ lrm_rscs, rsc_entry, XML_LRM_TAG_RESOURCE,
+ check_actions_for(rsc_entry, node, data_set);
+ );
+ }
+ );
+}
+
/*
* Attach nodes to the actions that need to be taken
@@ -362,14 +629,16 @@
stage5(pe_working_set_t *data_set)
{
crm_debug_3("Creating actions and internal ording constraints");
+
+ check_actions(data_set);
slist_iter(
rsc, resource_t, data_set->resources, lpc,
rsc->cmds->create_actions(rsc, data_set);
- rsc->cmds->internal_constraints(rsc, data_set);
);
return TRUE;
}
+
/*
* Create dependacies for stonith and shutdown operations
*/
@@ -378,6 +647,7 @@
{
action_t *dc_down = NULL;
action_t *stonith_op = NULL;
+ gboolean integrity_lost = FALSE;
crm_debug_3("Processing fencing and shutdown cases");
@@ -430,17 +700,22 @@
}
if(node->details->unclean && stonith_op == NULL) {
- pe_err("Node %s is unclean!", node->details->uname);
- pe_warn("YOUR RESOURCES ARE NOW LIKELY COMPROMISED");
- if(data_set->stonith_enabled == FALSE) {
- pe_warn("ENABLE STONITH TO KEEP YOUR RESOURCES
SAFE");
- } else {
- CRM_CHECK(data_set->have_quorum == FALSE, ;);
- crm_notice("Cannot fence until quorum is
attained (or no_quorum_policy is set to ignore)");
- }
+ integrity_lost = TRUE;
+ pe_warn("Node %s is unclean!", node->details->uname);
}
);
+ if(integrity_lost) {
+ if(data_set->have_quorum == FALSE) {
+ crm_notice("Cannot fence unclean nodes until quorum is"
+ " attained (or no_quorum_policy is set to
ignore)");
+
+ } else if(data_set->stonith_enabled == FALSE) {
+ pe_warn("YOUR RESOURCES ARE NOW LIKELY COMPROMISED");
+ pe_err("ENABLE STONITH TO KEEP YOUR RESOURCES SAFE");
+ }
+ }
+
if(dc_down != NULL) {
GListPtr shutdown_matches = find_actions(
data_set->actions, CRM_OP_SHUTDOWN, NULL);
@@ -650,3 +925,537 @@
return TRUE;
}
+void
+cleanup_alloc_calculations(pe_working_set_t *data_set)
+{
+ if(data_set == NULL) {
+ return;
+ }
+
+ crm_debug_3("deleting order cons");
+ pe_free_ordering(data_set->ordering_constraints);
+
+ crm_debug_3("deleting colors");
+ pe_free_colors(data_set->colors);
+
+ crm_debug_3("deleting node cons");
+ pe_free_rsc_to_node(data_set->placement_constraints);
+
+ cleanup_calculations(data_set);
+}
+
+gboolean
+unpack_constraints(crm_data_t * xml_constraints, pe_working_set_t *data_set)
+{
+ crm_data_t *lifetime = NULL;
+ crm_debug_2("Begining unpack... %s",
+ xml_constraints?crm_element_name(xml_constraints):"<none>");
+ xml_child_iter(
+ xml_constraints, xml_obj,
+
+ const char *id = crm_element_value(xml_obj, XML_ATTR_ID);
+ if(id == NULL) {
+ pe_config_err("Constraint <%s...> must have an id",
+ crm_element_name(xml_obj));
+ continue;
+ }
+
+ crm_debug_3("Processing constraint %s %s",
+ crm_element_name(xml_obj),id);
+
+ lifetime = cl_get_struct(xml_obj, "lifetime");
+
+ if(test_ruleset(lifetime, NULL, data_set->now) == FALSE) {
+ crm_info("Constraint %s %s is not active",
+ crm_element_name(xml_obj), id);
+
+ } else if(safe_str_eq(XML_CONS_TAG_RSC_ORDER,
+ crm_element_name(xml_obj))) {
+ unpack_rsc_order(xml_obj, data_set);
+
+ } else if(safe_str_eq(XML_CONS_TAG_RSC_DEPEND,
+ crm_element_name(xml_obj))) {
+ unpack_rsc_colocation(xml_obj, data_set);
+
+ } else if(safe_str_eq(XML_CONS_TAG_RSC_LOCATION,
+ crm_element_name(xml_obj))) {
+ unpack_rsc_location(xml_obj, data_set);
+
+ } else {
+ pe_err("Unsupported constraint type: %s",
+ crm_element_name(xml_obj));
+ }
+ );
+
+ return TRUE;
+}
+
+static const char *
+invert_action(const char *action)
+{
+ if(safe_str_eq(action, CRMD_ACTION_START)) {
+ return CRMD_ACTION_STOP;
+
+ } else if(safe_str_eq(action, CRMD_ACTION_STOP)) {
+ return CRMD_ACTION_START;
+
+ } else if(safe_str_eq(action, CRMD_ACTION_PROMOTE)) {
+ return CRMD_ACTION_DEMOTE;
+
+ } else if(safe_str_eq(action, CRMD_ACTION_DEMOTE)) {
+ return CRMD_ACTION_PROMOTE;
+
+ } else if(safe_str_eq(action, CRMD_ACTION_STARTED)) {
+ return CRMD_ACTION_STOPPED;
+
+ } else if(safe_str_eq(action, CRMD_ACTION_STOPPED)) {
+ return CRMD_ACTION_STARTED;
+
+ }
+ pe_err("Unknown action: %s", action);
+ return NULL;
+}
+
+gboolean
+unpack_rsc_order(crm_data_t * xml_obj, pe_working_set_t *data_set)
+{
+ gboolean symmetrical_bool = TRUE;
+
+ const char *id = crm_element_value(xml_obj, XML_ATTR_ID);
+ const char *type = crm_element_value(xml_obj, XML_ATTR_TYPE);
+ const char *id_rh = crm_element_value(xml_obj, XML_CONS_ATTR_TO);
+ const char *id_lh = crm_element_value(xml_obj, XML_CONS_ATTR_FROM);
+ const char *action = crm_element_value(xml_obj, XML_CONS_ATTR_ACTION);
+ const char *action_rh = crm_element_value(xml_obj,
XML_CONS_ATTR_TOACTION);
+
+ const char *symmetrical = crm_element_value(
+ xml_obj, XML_CONS_ATTR_SYMMETRICAL);
+
+ resource_t *rsc_lh = NULL;
+ resource_t *rsc_rh = NULL;
+
+ if(xml_obj == NULL) {
+ pe_config_err("No constraint object to process.");
+ return FALSE;
+
+ } else if(id == NULL) {
+ pe_config_err("%s constraint must have an id",
+ crm_element_name(xml_obj));
+ return FALSE;
+
+ } else if(id_lh == NULL || id_rh == NULL) {
+ pe_config_err("Constraint %s needs two sides lh: %s rh: %s",
+ id, crm_str(id_lh), crm_str(id_rh));
+ return FALSE;
+ }
+
+ if(action == NULL) {
+ action = CRMD_ACTION_START;
+ }
+ if(action_rh == NULL) {
+ action_rh = action;
+ }
+ CRM_CHECK(action != NULL, return FALSE);
+ CRM_CHECK(action_rh != NULL, return FALSE);
+
+ if(safe_str_eq(type, "before")) {
+ id_lh = crm_element_value(xml_obj, XML_CONS_ATTR_TO);
+ id_rh = crm_element_value(xml_obj, XML_CONS_ATTR_FROM);
+ action = crm_element_value(xml_obj, XML_CONS_ATTR_TOACTION);
+ action_rh = crm_element_value(xml_obj, XML_CONS_ATTR_ACTION);
+ if(action_rh == NULL) {
+ action_rh = CRMD_ACTION_START;
+ }
+ if(action == NULL) {
+ action = action_rh;
+ }
+ }
+
+ CRM_CHECK(action != NULL, return FALSE);
+ CRM_CHECK(action_rh != NULL, return FALSE);
+
+ rsc_lh = pe_find_resource(data_set->resources, id_rh);
+ rsc_rh = pe_find_resource(data_set->resources, id_lh);
+
+ if(rsc_lh == NULL) {
+ pe_config_err("Constraint %s: no resource found for LHS of %s",
id, id_lh);
+ return FALSE;
+
+ } else if(rsc_rh == NULL) {
+ pe_config_err("Constraint %s: no resource found for RHS of %s",
id, id_rh);
+ return FALSE;
+ }
+
+ custom_action_order(
+ rsc_lh, generate_op_key(rsc_lh->id, action, 0), NULL,
+ rsc_rh, generate_op_key(rsc_rh->id, action_rh, 0), NULL,
+ pe_ordering_optional, data_set);
+
+ if(rsc_rh->restart_type == pe_restart_restart
+ && safe_str_eq(action, action_rh)) {
+ if(safe_str_eq(action, CRMD_ACTION_START)) {
+ crm_debug_2("Recover start-start: %s-%s",
+ rsc_lh->id, rsc_rh->id);
+ order_start_start(rsc_lh, rsc_rh, pe_ordering_recover);
+ } else if(safe_str_eq(action, CRMD_ACTION_STOP)) {
+ crm_debug_2("Recover stop-stop: %s-%s",
+ rsc_rh->id, rsc_lh->id);
+ order_stop_stop(rsc_rh, rsc_lh, pe_ordering_recover);
+ }
+ }
+
+ cl_str_to_boolean(symmetrical, &symmetrical_bool);
+ if(symmetrical_bool == FALSE) {
+ return TRUE;
+ }
+
+ action = invert_action(action);
+ action_rh = invert_action(action_rh);
+
+ custom_action_order(
+ rsc_rh, generate_op_key(rsc_rh->id, action_rh, 0), NULL,
+ rsc_lh, generate_op_key(rsc_lh->id, action, 0), NULL,
+ pe_ordering_optional, data_set);
+
+ if(rsc_lh->restart_type == pe_restart_restart
+ && safe_str_eq(action, action_rh)) {
+ if(safe_str_eq(action, CRMD_ACTION_START)) {
+ crm_debug_2("Recover start-start (2): %s-%s",
+ rsc_lh->id, rsc_rh->id);
+ order_start_start(rsc_lh, rsc_rh, pe_ordering_recover);
+ } else if(safe_str_eq(action, CRMD_ACTION_STOP)) {
+ crm_debug_2("Recover stop-stop (2): %s-%s",
+ rsc_rh->id, rsc_lh->id);
+ order_stop_stop(rsc_rh, rsc_lh, pe_ordering_recover);
+ }
+ }
+
+ return TRUE;
+}
+
+gboolean
+unpack_rsc_location(crm_data_t * xml_obj, pe_working_set_t *data_set)
+{
+ const char *id_lh = crm_element_value(xml_obj, "rsc");
+ const char *id = crm_element_value(xml_obj, XML_ATTR_ID);
+ resource_t *rsc_lh = pe_find_resource(data_set->resources, id_lh);
+
+ if(rsc_lh == NULL) {
+ /* only a warn as BSC adds the constraint then the resource */
+ pe_config_warn("No resource (con=%s, rsc=%s)", id, id_lh);
+ return FALSE;
+
+ } else if(rsc_lh->is_managed == FALSE) {
+ crm_debug_2("Ignoring constraint %s: resource %s not managed",
+ id, id_lh);
+ return FALSE;
+ }
+
+ xml_child_iter_filter(
+ xml_obj, rule_xml, XML_TAG_RULE,
+ crm_debug_2("Unpacking %s/%s", id, ID(rule_xml));
+ generate_location_rule(rsc_lh, rule_xml, data_set);
+ );
+ return TRUE;
+}
+
+rsc_to_node_t *
+generate_location_rule(
+ resource_t *rsc, crm_data_t *rule_xml, pe_working_set_t *data_set)
+{
+ const char *rule_id = NULL;
+ const char *score = NULL;
+ const char *boolean = NULL;
+ const char *role = NULL;
+ const char *attr_score = NULL;
+
+ GListPtr match_L = NULL;
+
+ int score_f = 0;
+ gboolean do_and = TRUE;
+ gboolean accept = TRUE;
+ gboolean raw_score = TRUE;
+
+ rsc_to_node_t *location_rule = NULL;
+
+ rule_id = crm_element_value(rule_xml, XML_ATTR_ID);
+ boolean = crm_element_value(rule_xml, XML_RULE_ATTR_BOOLEAN_OP);
+ role = crm_element_value(rule_xml, XML_RULE_ATTR_ROLE);
+
+ crm_debug_2("Processing rule: %s", rule_id);
+
+ if(role != NULL && text2role(role) == RSC_ROLE_UNKNOWN) {
+ pe_err("Bad role specified for %s: %s", rule_id, role);
+ return NULL;
+ }
+
+ score = crm_element_value(rule_xml, XML_RULE_ATTR_SCORE);
+ if(score != NULL) {
+ score_f = char2score(score);
+
+ } else {
+ score = crm_element_value(
+ rule_xml, XML_RULE_ATTR_SCORE_ATTRIBUTE);
+ if(score == NULL) {
+ score = crm_element_value(
+ rule_xml, XML_RULE_ATTR_SCORE_MANGLED);
+ }
+ if(score != NULL) {
+ raw_score = FALSE;
+ }
+ }
+
+ if(safe_str_eq(boolean, "or")) {
+ do_and = FALSE;
+ }
+
+ location_rule = rsc2node_new(rule_id, rsc, 0, NULL, data_set);
+
+ if(location_rule == NULL) {
+ return NULL;
+ }
+ if(role != NULL) {
+ crm_debug_2("Setting role filter: %s", role);
+ location_rule->role_filter = text2role(role);
+ }
+ if(do_and) {
+ match_L = node_list_dup(data_set->nodes, TRUE, FALSE);
+ slist_iter(
+ node, node_t, match_L, lpc,
+ node->weight = score_f;
+ );
+ }
+
+ xml_child_iter(
+ rule_xml, expr,
+
+ enum expression_type type = find_expression_type(expr);
+ if(type == not_expr) {
+ pe_err("Expression <%s id=%s...> is not valid",
+ crm_element_name(expr), crm_str(ID(expr)));
+ continue;
+ }
+
+ slist_iter(
+ node, node_t, data_set->nodes, lpc,
+
+ if(type == nested_rule) {
+ accept = test_rule(
+ expr, node->details->attrs,
+ RSC_ROLE_UNKNOWN, data_set->now);
+ } else {
+ accept = test_expression(
+ expr, node->details->attrs,
+ RSC_ROLE_UNKNOWN, data_set->now);
+ }
+
+ if(raw_score == FALSE) {
+ attr_score = g_hash_table_lookup(
+ node->details->attrs, score);
+ if(attr_score == NULL) {
+ accept = FALSE;
+ pe_warn("node %s did not have a value"
+ " for %s",
+ node->details->uname, score);
+ } else {
+ score_f = char2score(score);
+ }
+ }
+
+ if(!do_and && accept) {
+ node_t *local = pe_find_node_id(
+ match_L, node->details->id);
+ if(local == NULL) {
+ local = node_copy(node);
+ match_L = g_list_append(match_L, local);
+ }
+ local->weight = merge_weights(
+ local->weight, score_f);
+ crm_debug_5("node %s already matched",
+ node->details->uname);
+
+ } else if(do_and && !accept) {
+ /* remove it */
+ node_t *delete = pe_find_node_id(
+ match_L, node->details->id);
+ if(delete != NULL) {
+ match_L = g_list_remove(match_L,delete);
+ crm_debug_5("node %s did not match",
+ node->details->uname);
+ }
+ crm_free(delete);
+ }
+ );
+ );
+
+ location_rule->node_list_rh = match_L;
+ if(location_rule->node_list_rh == NULL) {
+ crm_debug_2("No matching nodes for rule %s", rule_id);
+ return NULL;
+ }
+
+ crm_debug_3("%s: %d nodes matched",
+ rule_id, g_list_length(location_rule->node_list_rh));
+ crm_action_debug_3(print_rsc_to_node("Added", location_rule, FALSE));
+ return location_rule;
+}
+
+gboolean
+rsc_colocation_new(const char *id, enum con_strength strength,
+ resource_t *rsc_lh, resource_t *rsc_rh,
+ const char *state_lh, const char *state_rh)
+{
+ rsc_colocation_t *new_con = NULL;
+ rsc_colocation_t *inverted_con = NULL;
+
+ if(rsc_lh == NULL){
+ pe_config_err("No resource found for LHS %s", id);
+ return FALSE;
+
+ } else if(rsc_rh == NULL){
+ pe_config_err("No resource found for RHS of %s", id);
+ return FALSE;
+ }
+
+ crm_malloc0(new_con, sizeof(rsc_colocation_t));
+ if(new_con == NULL) {
+ return FALSE;
+ }
+ if(safe_str_eq(state_lh, CRMD_ACTION_STARTED)) {
+ state_lh = NULL;
+ }
+ if(safe_str_eq(state_rh, CRMD_ACTION_STARTED)) {
+ state_rh = NULL;
+ }
+
+ new_con->id = id;
+ new_con->rsc_lh = rsc_lh;
+ new_con->rsc_rh = rsc_rh;
+ new_con->strength = strength;
+ new_con->state_lh = state_lh;
+ new_con->state_rh = state_rh;
+
+ inverted_con = invert_constraint(new_con);
+
+ crm_debug_4("Adding constraint %s (%p) to %s",
+ new_con->id, new_con, rsc_lh->id);
+
+ rsc_lh->rsc_cons = g_list_insert_sorted(
+ rsc_lh->rsc_cons, new_con, sort_cons_strength);
+
+ crm_debug_4("Adding constraint %s (%p) to %s",
+ inverted_con->id, inverted_con, rsc_rh->id);
+
+ rsc_rh->rsc_cons = g_list_insert_sorted(
+ rsc_rh->rsc_cons, inverted_con, sort_cons_strength);
+
+ return TRUE;
+}
+
+/* LHS before RHS */
+gboolean
+custom_action_order(
+ resource_t *lh_rsc, char *lh_action_task, action_t *lh_action,
+ resource_t *rh_rsc, char *rh_action_task, action_t *rh_action,
+ enum pe_ordering type, pe_working_set_t *data_set)
+{
+ order_constraint_t *order = NULL;
+
+ if((lh_action == NULL && lh_rsc == NULL)
+ || (rh_action == NULL && rh_rsc == NULL)){
+ pe_config_err("Invalid inputs lh_rsc=%p, lh_a=%p,"
+ " rh_rsc=%p, rh_a=%p",
+ lh_rsc, lh_action, rh_rsc, rh_action);
+ crm_free(lh_action_task);
+ crm_free(rh_action_task);
+ return FALSE;
+ }
+
+ crm_malloc0(order, sizeof(order_constraint_t));
+ if(order == NULL) { return FALSE; }
+
+ order->id = data_set->order_id++;
+ order->type = type;
+ order->lh_rsc = lh_rsc;
+ order->rh_rsc = rh_rsc;
+ order->lh_action = lh_action;
+ order->rh_action = rh_action;
+ order->lh_action_task = lh_action_task;
+ order->rh_action_task = rh_action_task;
+
+ data_set->ordering_constraints = g_list_append(
+ data_set->ordering_constraints, order);
+
+ if(lh_rsc != NULL && rh_rsc != NULL) {
+ crm_debug_4("Created ordering constraint %d (%s):"
+ " %s/%s before %s/%s",
+ order->id, ordering_type2text(order->type),
+ lh_rsc->id, lh_action_task,
+ rh_rsc->id, rh_action_task);
+
+ } else if(lh_rsc != NULL) {
+ crm_debug_4("Created ordering constraint %d (%s):"
+ " %s/%s before action %d (%s)",
+ order->id, ordering_type2text(order->type),
+ lh_rsc->id, lh_action_task,
+ rh_action->id, rh_action_task);
+
+ } else if(rh_rsc != NULL) {
+ crm_debug_4("Created ordering constraint %d (%s):"
+ " action %d (%s) before %s/%s",
+ order->id, ordering_type2text(order->type),
+ lh_action->id, lh_action_task,
+ rh_rsc->id, rh_action_task);
+
+ } else {
+ crm_debug_4("Created ordering constraint %d (%s):"
+ " action %d (%s) before action %d (%s)",
+ order->id, ordering_type2text(order->type),
+ lh_action->id, lh_action_task,
+ rh_action->id, rh_action_task);
+ }
+
+ return TRUE;
+}
+
+gboolean
+unpack_rsc_colocation(crm_data_t * xml_obj, pe_working_set_t *data_set)
+{
+ enum con_strength strength_e = pecs_ignore;
+
+ const char *id = crm_element_value(xml_obj, XML_ATTR_ID);
+ const char *id_rh = crm_element_value(xml_obj, XML_CONS_ATTR_TO);
+ const char *id_lh = crm_element_value(xml_obj, XML_CONS_ATTR_FROM);
+ const char *score = crm_element_value(xml_obj, XML_RULE_ATTR_SCORE);
+ const char *state_lh = crm_element_value(xml_obj,
XML_RULE_ATTR_FROMSTATE);
+ const char *state_rh = crm_element_value(xml_obj,
XML_RULE_ATTR_TOSTATE);
+
+ resource_t *rsc_lh = pe_find_resource(data_set->resources, id_lh);
+ resource_t *rsc_rh = pe_find_resource(data_set->resources, id_rh);
+
+ if(rsc_lh == NULL) {
+ pe_config_err("No resource (con=%s, rsc=%s)", id, id_lh);
+ return FALSE;
+
+ } else if(rsc_rh == NULL) {
+ pe_config_err("No resource (con=%s, rsc=%s)", id, id_rh);
+ return FALSE;
+ }
+
+ /* the docs indicate that only +/- INFINITY are allowed,
+ * but no-one ever reads the docs so all positive values will
+ * count as "must" and negative values as "must not"
+ */
+ if(score == NULL || score[0] != '-') {
+ strength_e = pecs_must;
+ } else {
+ strength_e = pecs_must_not;
+ }
+ return rsc_colocation_new(id, strength_e, rsc_lh, rsc_rh,
+ state_lh, state_rh);
+}
+
+gboolean is_active(rsc_to_node_t *cons)
+{
+ return TRUE;
+}
===================================================================
RCS file: /home/cvs/linux-ha/linux-ha/crm/pengine/allocate.h,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -3 -r1.1 -r1.2
--- allocate.h 7 Jun 2006 12:46:57 -0000 1.1
+++ allocate.h 8 Jun 2006 13:39:10 -0000 1.2
@@ -1,4 +1,4 @@
-/* $Id: allocate.h,v 1.1 2006/06/07 12:46:57 andrew Exp $ */
+/* $Id: allocate.h,v 1.2 2006/06/08 13:39:10 andrew Exp $ */
/*
* Copyright (C) 2004 Andrew Beekhof <[EMAIL PROTECTED]>
*
@@ -23,7 +23,7 @@
#include <crm/common/xml.h>
#include <crm/pengine/status.h>
#include <crm/pengine/complex.h>
-#include <lib/crm/pengine/pengine.h>
+#include <pengine.h>
typedef struct notify_entry_s {
resource_t *rsc;
@@ -171,4 +171,16 @@
GListPtr node_list, lrm_agent_t *agent, const char *id);
+extern gboolean unpack_rsc_to_attr(crm_data_t *xml_obj, pe_working_set_t
*data_set);
+
+extern gboolean unpack_rsc_to_node(crm_data_t *xml_obj, pe_working_set_t
*data_set);
+
+extern gboolean unpack_rsc_order(crm_data_t *xml_obj, pe_working_set_t
*data_set);
+
+extern gboolean unpack_rsc_colocation(crm_data_t *xml_obj, pe_working_set_t
*data_set);
+
+extern gboolean unpack_rsc_location(crm_data_t *xml_obj, pe_working_set_t
*data_set);
+
+extern void cleanup_alloc_calculations(pe_working_set_t *data_set);
+
#endif
===================================================================
RCS file: /home/cvs/linux-ha/linux-ha/crm/pengine/clone.c,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -3 -r1.1 -r1.2
--- clone.c 7 Jun 2006 12:46:57 -0000 1.1
+++ clone.c 8 Jun 2006 13:39:10 -0000 1.2
@@ -1,4 +1,4 @@
-/* $Id: clone.c,v 1.1 2006/06/07 12:46:57 andrew Exp $ */
+/* $Id: clone.c,v 1.2 2006/06/08 13:39:10 andrew Exp $ */
/*
* Copyright (C) 2004 Andrew Beekhof <[EMAIL PROTECTED]>
*
@@ -21,6 +21,7 @@
#include <crm/msg_xml.h>
#include <allocate.h>
+#include <utils.h>
#include <lib/crm/pengine/utils.h>
void clone_create_notifications(
===================================================================
RCS file: /home/cvs/linux-ha/linux-ha/crm/pengine/graph.c,v
retrieving revision 1.97
retrieving revision 1.98
diff -u -3 -r1.97 -r1.98
--- graph.c 7 Jun 2006 12:46:57 -0000 1.97
+++ graph.c 8 Jun 2006 13:39:10 -0000 1.98
@@ -1,4 +1,4 @@
-/* $Id: graph.c,v 1.97 2006/06/07 12:46:57 andrew Exp $ */
+/* $Id: graph.c,v 1.98 2006/06/08 13:39:10 andrew Exp $ */
/*
* Copyright (C) 2004 Andrew Beekhof <[EMAIL PROTECTED]>
*
@@ -28,8 +28,9 @@
#include <glib.h>
-#include <lib/crm/pengine/utils.h>
#include <allocate.h>
+#include <lib/crm/pengine/utils.h>
+#include <utils.h>
gboolean update_action(action_t *action);
@@ -522,6 +523,24 @@
return TRUE;
}
+/* lowest to highest */
+static gint sort_action_id(gconstpointer a, gconstpointer b)
+{
+ const action_wrapper_t *action_wrapper2 = (const action_wrapper_t*)a;
+ const action_wrapper_t *action_wrapper1 = (const action_wrapper_t*)b;
+
+ if(a == NULL) { return 1; }
+ if(b == NULL) { return -1; }
+
+ if(action_wrapper1->action->id > action_wrapper2->action->id) {
+ return -1;
+ }
+
+ if(action_wrapper1->action->id < action_wrapper2->action->id) {
+ return 1;
+ }
+ return 0;
+}
void
graph_element_from_action(action_t *action, pe_working_set_t *data_set)
@@ -589,3 +608,4 @@
);
}
+
===================================================================
RCS file: /home/cvs/linux-ha/linux-ha/crm/pengine/group.c,v
retrieving revision 1.64
retrieving revision 1.65
diff -u -3 -r1.64 -r1.65
--- group.c 7 Jun 2006 12:46:57 -0000 1.64
+++ group.c 8 Jun 2006 13:39:10 -0000 1.65
@@ -1,4 +1,4 @@
-/* $Id: group.c,v 1.64 2006/06/07 12:46:57 andrew Exp $ */
+/* $Id: group.c,v 1.65 2006/06/08 13:39:10 andrew Exp $ */
/*
* Copyright (C) 2004 Andrew Beekhof <[EMAIL PROTECTED]>
*
@@ -19,7 +19,7 @@
#include <portability.h>
-#include <lib/crm/pengine/pengine.h>
+#include <pengine.h>
#include <lib/crm/pengine/utils.h>
#include <crm/msg_xml.h>
#include <clplumbing/cl_misc.h>
@@ -199,6 +199,13 @@
child_rsc->cmds->internal_constraints(child_rsc, data_set);
+ if(group_data->colocated) {
+ rsc_colocation_new(
+ "pe_group_internal_colo", pecs_must,
+ group_data->self, child_rsc,
+ NULL, NULL);
+ }
+
if(group_data->ordered == FALSE) {
order_start_start(
group_data->self, child_rsc,
pe_ordering_optional);
===================================================================
RCS file: /home/cvs/linux-ha/linux-ha/crm/pengine/native.c,v
retrieving revision 1.149
retrieving revision 1.150
diff -u -3 -r1.149 -r1.150
--- native.c 7 Jun 2006 12:46:59 -0000 1.149
+++ native.c 8 Jun 2006 13:39:10 -0000 1.150
@@ -1,4 +1,4 @@
-/* $Id: native.c,v 1.149 2006/06/07 12:46:59 andrew Exp $ */
+/* $Id: native.c,v 1.150 2006/06/08 13:39:10 andrew Exp $ */
/*
* Copyright (C) 2004 Andrew Beekhof <[EMAIL PROTECTED]>
*
@@ -19,11 +19,12 @@
#include <portability.h>
-#include <lib/crm/pengine/pengine.h>
+#include <pengine.h>
#include <crm/pengine/rules.h>
#include <lib/crm/pengine/utils.h>
#include <crm/msg_xml.h>
#include <allocate.h>
+#include <utils.h>
#define DELETE_THEN_REFRESH 1
@@ -440,6 +441,14 @@
custom_action_order(rsc, start_key(rsc), NULL,
rsc, promote_key(rsc), NULL,
pe_ordering_optional, data_set);
+
+ custom_action_order(
+ rsc, stop_key(rsc), NULL, rsc, delete_key(rsc), NULL,
+ pe_ordering_optional, data_set);
+
+ custom_action_order(
+ rsc, delete_key(rsc), NULL, rsc, start_key(rsc), NULL,
+ pe_ordering_manditory, data_set);
}
void native_rsc_colocation_lh(
===================================================================
RCS file: /home/cvs/linux-ha/linux-ha/crm/pengine/pengine.c,v
retrieving revision 1.114
retrieving revision 1.115
diff -u -3 -r1.114 -r1.115
--- pengine.c 7 Jun 2006 12:46:59 -0000 1.114
+++ pengine.c 8 Jun 2006 13:39:10 -0000 1.115
@@ -1,4 +1,4 @@
-/* $Id: pengine.c,v 1.114 2006/06/07 12:46:59 andrew Exp $ */
+/* $Id: pengine.c,v 1.115 2006/06/08 13:39:10 andrew Exp $ */
/*
* Copyright (C) 2004 Andrew Beekhof <[EMAIL PROTECTED]>
*
@@ -30,7 +30,8 @@
#include <glib.h>
#include <crm/pengine/status.h>
-#include <lib/crm/pengine/pengine.h>
+#include <pengine.h>
+#include <allocate.h>
#include <lib/crm/pengine/utils.h>
crm_data_t * do_calculations(
@@ -131,7 +132,7 @@
}
data_set.input = NULL;
- cleanup_calculations(&data_set);
+ cleanup_alloc_calculations(&data_set);
if(is_ipc_empty(sender) && crm_mem_stats(NULL)) {
pe_warn("Unfree'd memory");
===================================================================
RCS file: /home/cvs/linux-ha/linux-ha/crm/pengine/ptest.c,v
retrieving revision 1.76
retrieving revision 1.77
diff -u -3 -r1.76 -r1.77
--- ptest.c 7 Jun 2006 12:46:59 -0000 1.76
+++ ptest.c 8 Jun 2006 13:39:10 -0000 1.77
@@ -1,4 +1,4 @@
-/* $Id: ptest.c,v 1.76 2006/06/07 12:46:59 andrew Exp $ */
+/* $Id: ptest.c,v 1.77 2006/06/08 13:39:10 andrew Exp $ */
/*
* Copyright (C) 2004 Andrew Beekhof <[EMAIL PROTECTED]>
@@ -42,8 +42,9 @@
# include <getopt.h>
#endif
#include <glib.h>
-#include <lib/crm/pengine/pengine.h>
+#include <pengine.h>
#include <lib/crm/pengine/utils.h>
+#include <allocate.h>
gboolean use_stdin = FALSE;
gboolean inhibit_exit = FALSE;
@@ -398,7 +399,7 @@
}
data_set.input = NULL;
- cleanup_calculations(&data_set);
+ cleanup_alloc_calculations(&data_set);
destroy_graph(transition);
crm_mem_stats(NULL);
===================================================================
RCS file: /home/cvs/linux-ha/linux-ha/crm/pengine/regression.sh,v
retrieving revision 1.82
retrieving revision 1.83
diff -u -3 -r1.82 -r1.83
--- regression.sh 7 Jun 2006 09:01:23 -0000 1.82
+++ regression.sh 8 Jun 2006 13:39:10 -0000 1.83
@@ -18,7 +18,6 @@
#
. regression.core.sh
-
create_mode="true"
echo Generating test outputs for these tests...
echo ""
------------------------------
_______________________________________________
Linux-ha-cvs mailing list
[email protected]
http://lists.community.tummy.com/mailman/listinfo/linux-ha-cvs
End of Linux-ha-cvs Digest, Vol 31, Issue 23
********************************************