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: crm by andrew from 
      ([email protected])
   2. Linux-HA CVS: crm by andrew from 
      ([email protected])
   3. Linux-HA CVS: crm by andrew from 
      ([email protected])
   4. Linux-HA CVS: lib by andrew from 
      ([email protected])


----------------------------------------------------------------------

Message: 1
Date: Sat, 11 Mar 2006 12:03:51 -0700 (MST)
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:
        unpack.c 


Log Message:
Change the name of the fail count attr

===================================================================
RCS file: /home/cvs/linux-ha/linux-ha/crm/pengine/unpack.c,v
retrieving revision 1.161
retrieving revision 1.162
diff -u -3 -r1.161 -r1.162
--- unpack.c    9 Mar 2006 21:36:38 -0000       1.161
+++ unpack.c    11 Mar 2006 19:03:51 -0000      1.162
@@ -1,4 +1,4 @@
-/* $Id: unpack.c,v 1.161 2006/03/09 21:36:38 andrew Exp $ */
+/* $Id: unpack.c,v 1.162 2006/03/11 19:03:51 andrew Exp $ */
 /* 
  * Copyright (C) 2004 Andrew Beekhof <[EMAIL PROTECTED]>
  * 
@@ -938,7 +938,7 @@
 
        /* process failure stickiness */
        fail_count = 0;
-       fail_attr = crm_concat(rsc->id, "fail-count", '-');
+       fail_attr = crm_concat("fail-count", rsc->id, '-');
        fail_val = g_hash_table_lookup(node->details->attrs, fail_attr);
        if(fail_val != NULL) {
                crm_debug("%s: %s", fail_attr, fail_val);




------------------------------

Message: 2
Date: Sat, 11 Mar 2006 12:19:17 -0700 (MST)
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/crmd


Modified Files:
        lrm.c 


Log Message:
Fix a typo in the transient set name
Commit the code for setting resource fail counts but leave it disabled.

===================================================================
RCS file: /home/cvs/linux-ha/linux-ha/crm/crmd/lrm.c,v
retrieving revision 1.167
retrieving revision 1.168
diff -u -3 -r1.167 -r1.168
--- lrm.c       20 Feb 2006 19:11:33 -0000      1.167
+++ lrm.c       11 Mar 2006 19:19:17 -0000      1.168
@@ -780,7 +780,7 @@
        } else if(safe_str_eq(operation, CRM_OP_PROBED)
                  || safe_str_eq(crm_op, CRM_OP_REPROBE)) {
                char *attr_id = crm_concat("lrm-probe", fsa_our_uuid, '-');
-               char *attr_set = crm_concat("crmd-transient-", fsa_our_uuid, 
'-');
+               char *attr_set = crm_concat("crmd-transient", fsa_our_uuid,'-');
                const char *probed = XML_BOOLEAN_TRUE;
                if(safe_str_eq(crm_op, CRM_OP_REPROBE)) {
                        probed = XML_BOOLEAN_FALSE;
@@ -1305,21 +1305,78 @@
        return rsc_copy;
 }
 
+static void
+update_failcount(lrm_op_t *op) 
+{
+       const char *probe_s = NULL;
+       int op_status = LRM_OP_DONE;
+       const char *target_rc_s = NULL;
+
+       CRM_DEV_ASSERT(op != NULL);
+       if(crm_is_true(probe_s)) {
+               return;
+       }       
+       
+       probe_s = g_hash_table_lookup(op->params, XML_ATTR_LRM_PROBE);
+       if(crm_is_true(probe_s)) {
+               return;
+       }
+
+       CRM_DEV_ASSERT(op->op_status != LRM_OP_PENDING);
+       if(crm_assert_failed) {
+               return;
+       }
+
+       CRM_DEV_ASSERT(op->op_status != LRM_OP_DONE);
+       if(crm_assert_failed) {
+               return;
+       }
+       
+       op_status = op->op_status;
+       target_rc_s = g_hash_table_lookup(op->params, XML_ATTR_TE_TARGET_RC);
+       
+       if(target_rc_s != NULL) {
+               int target_rc = crm_parse_int(target_rc_s, NULL);
+               if(target_rc == op->rc) {
+                       if(op_status != LRM_OP_DONE) {
+                               op_status = LRM_OP_DONE;
+                       }
+                       
+               } else if(op_status != LRM_OP_ERROR) {
+                       op_status = LRM_OP_ERROR;
+               }
+       }
+       
+       if(op_status != LRM_OP_DONE) {
+               char *attr_set = crm_concat("crmd-transient",fsa_our_uuid, '-');
+               char *attr_name = crm_concat("fail-count", op->rsc_id, '-');
+               char *attr_id = crm_concat(fsa_our_uuid, attr_name,'-');
+               
+               update_attr(fsa_cib_conn, cib_none, XML_CIB_TAG_STATUS,
+                           fsa_our_uuid, attr_set, attr_id, attr_name,
+                           XML_NVPAIR_ATTR_VALUE"++");
+               
+               crm_free(attr_id);
+               crm_free(attr_set);
+               crm_free(attr_name);
+       }       
+}
+
 void
 do_update_resource(lrm_op_t* op)
 {
 /*
   <status>
-  <nodes_status id=uname>
-  <lrm>
-  <lrm_resources>
-  <lrm_resource id=>
-  </...>
+    <nodes_status id=uname>
+      <lrm>
+        <lrm_resources>
+          <lrm_resource id=...>
+          </...>
 */
-       crm_data_t *update, *iter;
-       crm_data_t *fragment;
        int rc = cib_ok;
-
+       crm_data_t *fragment;
+       crm_data_t *update, *iter;
+       
        CRM_DEV_ASSERT(op != NULL);
        if(crm_assert_failed) {
                return;
@@ -1397,7 +1454,8 @@
        const char *probe_s = NULL;
        gboolean is_probe = FALSE;
        int log_rsc_err = LOG_ERR;
-
+       gboolean set_failcount = FALSE;
+       
        if(msg_data->fsa_cause != C_LRM_OP_CALLBACK) {
                register_fsa_error(C_FSA_INTERNAL, I_FAIL, NULL);
                return I_NULL;
@@ -1426,6 +1484,8 @@
                case LRM_OP_ERROR:
                        if(is_probe) {
                                log_rsc_err = LOG_INFO;
+                       } else {
+                               set_failcount = TRUE;
                        }
                        crm_log_maybe(log_rsc_err,
                                      "LRM operation (%d) %s_%d on %s %s: %s",
@@ -1445,6 +1505,7 @@
                        return I_NULL;
                        break;
                case LRM_OP_TIMEOUT:
+                       set_failcount = TRUE;
                        last_op = g_hash_table_lookup(
                                resources_confirmed, crm_strdup(op->rsc_id));
 
@@ -1463,6 +1524,7 @@
                                op_status2text(op->op_status));
                        break;
                case LRM_OP_NOTSUPPORTED:
+                       set_failcount = TRUE;
                        crm_err("LRM operation (%d) %s_%d on %s %s",
                                op->call_id, op->op_type,
                                op->interval,
@@ -1481,7 +1543,11 @@
                             crm_strdup(op->rsc_id), crm_strdup(op->op_type));
 
        do_update_resource(op);
-
+/*
+       if(set_failcount) {
+               update_failcount(op);
+       }
+*/
        if(g_hash_table_size(shutdown_ops) > 0) {
                char *op_id = make_stop_id(op->rsc_id, op->call_id);
                if(g_hash_table_remove(shutdown_ops, op_id)) {




------------------------------

Message: 3
Date: Sat, 11 Mar 2006 12:20:01 -0700 (MST)
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:
Indenting

===================================================================
RCS file: /home/cvs/linux-ha/linux-ha/crm/admin/crm_resource.c,v
retrieving revision 1.15
retrieving revision 1.16
diff -u -3 -r1.15 -r1.16
--- crm_resource.c      22 Feb 2006 19:20:25 -0000      1.15
+++ crm_resource.c      11 Mar 2006 19:20:01 -0000      1.16
@@ -1,4 +1,4 @@
-/* $Id: crm_resource.c,v 1.15 2006/02/22 19:20:25 andrew Exp $ */
+/* $Id: crm_resource.c,v 1.16 2006/03/11 19:20:01 andrew Exp $ */
 
 /* 
  * Copyright (C) 2004 Andrew Beekhof <[EMAIL PROTECTED]>
@@ -111,7 +111,7 @@
                rsc, resource_t, data_set->resources, lpc,
                rsc->fns->print(
                        rsc, NULL, pe_print_printf|pe_print_rsconly, stdout);
-                       found++;
+               found++;
                );
 
        if(found == 0) {




------------------------------

Message: 4
Date: Sat, 11 Mar 2006 14:15:15 -0700 (MST)
From: [email protected]
Subject: [Linux-ha-cvs] Linux-HA CVS: lib by andrew from 
To: [EMAIL PROTECTED]
Message-ID: <[EMAIL PROTECTED]>

linux-ha CVS committal

Author  : andrew
Host    : 
Project : linux-ha
Module  : lib

Dir     : linux-ha/lib/crm/common


Modified Files:
        utils.c 


Log Message:
The error log is sufficient

===================================================================
RCS file: /home/cvs/linux-ha/linux-ha/lib/crm/common/utils.c,v
retrieving revision 1.32
retrieving revision 1.33
diff -u -3 -r1.32 -r1.33
--- utils.c     20 Feb 2006 12:13:00 -0000      1.32
+++ utils.c     11 Mar 2006 21:15:15 -0000      1.33
@@ -1,4 +1,4 @@
-/* $Id: utils.c,v 1.32 2006/02/20 12:13:00 andrew Exp $ */
+/* $Id: utils.c,v 1.33 2006/03/11 21:15:15 andrew Exp $ */
 /* 
  * Copyright (C) 2004 Andrew Beekhof <[EMAIL PROTECTED]>
  * 
@@ -483,7 +483,7 @@
                        atoi_result = (int)strtol(text, &local_end_text, 10);
                }
                
-               CRM_DEV_ASSERT(errno != EINVAL);
+/*             CRM_DEV_ASSERT(errno != EINVAL); */
                if(errno == EINVAL) {
                        crm_err("Conversion of %s failed", text);
                        atoi_result = -1;




------------------------------

_______________________________________________
Linux-ha-cvs mailing list
[email protected]
http://lists.community.tummy.com/mailman/listinfo/linux-ha-cvs


End of Linux-ha-cvs Digest, Vol 28, Issue 21
********************************************

Reply via email to