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


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

Message: 1
Date: Wed, 31 May 2006 00:01:44 -0600 (MDT)
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:
        xml.c 


Log Message:
Matching of hidden fields should be case sensitive
Fix compile error when libxml is not available

===================================================================
RCS file: /home/cvs/linux-ha/linux-ha/lib/crm/common/xml.c,v
retrieving revision 1.88
retrieving revision 1.89
diff -u -3 -r1.88 -r1.89
--- xml.c       30 May 2006 12:26:33 -0000      1.88
+++ xml.c       31 May 2006 06:01:43 -0000      1.89
@@ -1,4 +1,4 @@
-/* $Id: xml.c,v 1.88 2006/05/30 12:26:33 andrew Exp $ */
+/* $Id: xml.c,v 1.89 2006/05/31 06:01:43 andrew Exp $ */
 /* 
  * Copyright (C) 2004 Andrew Beekhof <[EMAIL PROTECTED]>
  * 
@@ -837,7 +837,7 @@
                } else if(hidden != NULL
                          && prop_name != NULL
                          && strlen(prop_name) > 0
-                         && strcasestr(hidden, prop_name) != NULL) {
+                         && strstr(hidden, prop_name) != NULL) {
                        prop_value = "*****";
                }
                
@@ -2474,9 +2474,9 @@
 gboolean
 validate_with_dtd(crm_data_t *xml_blob, const char *dtd_file) 
 {
+       gboolean valid = TRUE;
 #if HAVE_LIBXML2
        char *buffer = NULL;
-       gboolean valid = TRUE;
 
        xmlDocPtr doc = NULL;
        xmlDtdPtr dtd = NULL;




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

Message: 2
Date: Wed, 31 May 2006 00:32:28 -0600 (MDT)
From: [email protected]
Subject: [Linux-ha-cvs] Linux-HA CVS: heartbeat by zhenh from 
To: [EMAIL PROTECTED]
Message-ID: <[EMAIL PROTECTED]>

linux-ha CVS committal

Author  : zhenh
Host    : 
Project : linux-ha
Module  : heartbeat

Dir     : linux-ha/heartbeat


Modified Files:
        heartbeat.c 


Log Message:
To work with nodes in 2.0.5, we have to deal with the T_REPNODES message 
without F_DELNODELIST field.
===================================================================
RCS file: /home/cvs/linux-ha/linux-ha/heartbeat/heartbeat.c,v
retrieving revision 1.510
retrieving revision 1.511
diff -u -3 -r1.510 -r1.511
--- heartbeat.c 28 May 2006 00:54:19 -0000      1.510
+++ heartbeat.c 31 May 2006 06:32:27 -0000      1.511
@@ -1,4 +1,4 @@
-/* $Id: heartbeat.c,v 1.510 2006/05/28 00:54:19 zhenh Exp $ */
+/* $Id: heartbeat.c,v 1.511 2006/05/31 06:32:27 zhenh Exp $ */
 /*
  * heartbeat: Linux-HA heartbeat code
  *
@@ -2769,110 +2769,99 @@
                /*our own REPNODES msg*/
                return;
        }
-
-       if (nodelist == NULL){
-               cl_log(LOG_ERR, "%s: nodelist not found",
-                       __FUNCTION__);
-               return;
-       }
-       memset(nodes, 0, MAXNODE);
-
-       if (getnodes(nodelist, nodes, &num) != HA_OK){
-               cl_log(LOG_ERR, "%s: get nodes from nodelist failed",
-                       __FUNCTION__);
-               return;
-       }
        
-       if (getnodes(delnodelist, delnodes, &delnum) != HA_OK){        
-               cl_log(LOG_ERR, "%s: get del nodes from nodelist failed",
-                       __FUNCTION__);
-               return;
-       }
-
-       /* term definition*/
-       /* added: a node in config->nodes[] 
-          deleted: a node in del_node_list
-          removed: remove a node either from config->nodes[] or del_node_list
-       */
-
-
-
-       /* process delnodelist*/
-       /* update our del node list to be the exact same list as the received 
one
-        */
-       
-       dellist_destroy();
-       for (i = 0; i < delnum; i++){
-               dellist_add(delnodes[i]);
-       }       
-       
-
-
        /* process nodelist*/
        /* our local node list is outdated
         * any node that is in nodelist but not in local node list should be 
added
         * any node that is in local node list but not in nodelist should be 
removed
         * (but not deleted)
         */
-       if (ANYDEBUG){
-               cl_log(LOG_DEBUG, "nodelist received:%s", nodelist);
-               cl_log(LOG_DEBUG, "delnodelist received:%s", delnodelist);
-       }
-       for (i =0; i < num; i++){
-               for (j = 0; j < config->nodecount; j++){
-                       if (strncmp(nodes[i], config->nodes[j].nodename,
-                                   HOSTLENG) == 0){
-                               break;
-                       }
+       
+       /* term definition*/
+       /* added: a node in config->nodes[] 
+          deleted: a node in del_node_list
+          removed: remove a node either from config->nodes[] or del_node_list
+       */
+
+       if (nodelist != NULL){
+               memset(nodes, 0, MAXNODE);
+               if (ANYDEBUG){
+                       cl_log(LOG_DEBUG, "nodelist received:%s", nodelist);
+               }
+               if (getnodes(nodelist, nodes, &num) != HA_OK){
+                       cl_log(LOG_ERR, "%s: get nodes from nodelist failed",
+                               __FUNCTION__);
+                       return;
                }
-               if ( j == config->nodecount){
-                       /*this node is not found in config
-                        * we need to add it 
-                        */
-                       hb_add_one_node(nodes[i]);              
+               for (i =0; i < num; i++){
+                       for (j = 0; j < config->nodecount; j++){
+                               if (strncmp(nodes[i], config->nodes[j].nodename,
+                                       HOSTLENG) == 0){
+                                       break;
+                               }
+                       }
+                       if ( j == config->nodecount){
+                               /*this node is not found in config
+                               * we need to add it 
+                               */
+                               hb_add_one_node(nodes[i]);              
+                       }
                }
-       }
-       
-       for (i =0; i < config->nodecount; i++){
-               for (j=0;j < num; j++){
-                       if ( strncmp(config->nodes[i].nodename,
-                                    nodes[j], HOSTLENG) == 0){
-                               break;
-                       }       
+               
+               for (i =0; i < config->nodecount; i++){
+                       for (j=0;j < num; j++){
+                               if ( strncmp(config->nodes[i].nodename,
+                                       nodes[j], HOSTLENG) == 0){
+                                       break;
+                               }       
+                       }
+                       if (j == num){
+                               /* This node is not found in incoming nodelist,
+                               * therefore, we need to remove it from 
config->nodes[]
+                               *
+                               * Of course, this assumes everyone has correct 
node
+                               * lists - which may not be the case :-(  
FIXME???
+                               * And it assumes autojoin is on - which it may
+                               * not be...
+                               */
+                               hb_remove_one_node(config->nodes[i].nodename, 
FALSE);
+                               
+                       }
                }
-               if (j == num){
-                       /* This node is not found in incoming nodelist,
-                        * therefore, we need to remove it from config->nodes[]
-                        *
-                        * Of course, this assumes everyone has correct node
-                        * lists - which may not be the case :-(  FIXME???
-                        * And it assumes autojoin is on - which it may
-                        * not be...
-                        */
-                       hb_remove_one_node(config->nodes[i].nodename, FALSE);
-                       
+               for (i = 0; i< num; i++){
+                       if (nodes[i]){
+                               ha_free(nodes[i]);
+                               nodes[i] = NULL;
+                       }
                }
+               get_reqnodes_reply = TRUE;
+               write_cache_file(config);
        }
 
-
-       
-       for (i = 0; i< num; i++){
-               if (nodes[i]){
-                       ha_free(nodes[i]);
-                       nodes[i] = NULL;
+       if (delnodelist != NULL) {      
+               memset(delnodes, 0, MAXNODE);
+               if (getnodes(delnodelist, delnodes, &delnum) != HA_OK){        
+                       cl_log(LOG_ERR, "%s: get del nodes from nodelist 
failed",
+                               __FUNCTION__);
+                       return;
                }
-       }
-
-       for (i = 0; i < delnum; i++){
-               if (delnodes[i]){
-                       ha_free(delnodes[i]);
-                       delnodes[i] = NULL;
+               /* process delnodelist*/
+               /* update our del node list to be the exact same list as the 
received one
+               */
+               dellist_destroy();
+               for (i = 0; i < delnum; i++){
+                       dellist_add(delnodes[i]);
+               }       
+       
+               for (i = 0; i < delnum; i++){
+                       if (delnodes[i]){
+                               ha_free(delnodes[i]);
+                               delnodes[i] = NULL;
+                       }
                }
+               get_reqnodes_reply = TRUE;
+               write_delnode_file(config);
        }
-
-       get_reqnodes_reply = TRUE;
-       write_cache_file(config);
-       write_delnode_file(config);
        comm_now_up();
         return;
 }
@@ -6347,6 +6336,9 @@
 
 /*
  * $Log: heartbeat.c,v $
+ * Revision 1.511  2006/05/31 06:32:27  zhenh
+ * To work with nodes in 2.0.5, we have to deal with the T_REPNODES message 
without F_DELNODELIST field.
+ *
  * Revision 1.510  2006/05/28 00:54:19  zhenh
  * add message handlers for setting the weight and site of node
  *




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

Message: 3
Date: Wed, 31 May 2006 03:22:51 -0600 (MDT)
From: [email protected]
Subject: [Linux-ha-cvs] Linux-HA CVS: lib by sunjd from 
To: [EMAIL PROTECTED]
Message-ID: <[EMAIL PROTECTED]>

linux-ha CVS committal

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

Dir     : linux-ha/lib/fencing


Modified Files:
        stonithd_lib.c 


Log Message:
judge the signon/signoff status more accuratly
===================================================================
RCS file: /home/cvs/linux-ha/linux-ha/lib/fencing/stonithd_lib.c,v
retrieving revision 1.21
retrieving revision 1.22
diff -u -3 -r1.21 -r1.22
--- stonithd_lib.c      29 May 2006 13:07:13 -0000      1.21
+++ stonithd_lib.c      31 May 2006 09:22:50 -0000      1.22
@@ -42,12 +42,10 @@
 #include <fencing/stonithd_api.h>
 #include <fencing/stonithd_msg.h>
 
-
 static const char * CLIENT_NAME = NULL;
 static pid_t CLIENT_PID = 0;
 static char CLIENT_PID_STR[16];
 static gboolean DEBUG_MODE        = FALSE;
-static gboolean SIGNONED_TO_STONITHD = FALSE;
 static IPC_Channel * chan         = NULL;
 
 static gboolean INT_BY_ALARM = FALSE;
@@ -91,31 +89,26 @@
        gid_t   my_egid;
        const char * tmpstr;
 
-       if ( SIGNONED_TO_STONITHD ) {
-               /* if server is broken, then signoff and signon? important */
-               stdlib_log(LOG_DEBUG, "stonithd_signon: has sigoned to "
-                          "stonithd.");
-               return ST_OK;
-       }
+       if (chan == NULL || chan->ch_status == IPC_DISCONNECT) {
+               wchanattrs = g_hash_table_new(g_str_hash, g_str_equal);
+               g_hash_table_insert(wchanattrs, path, sock);
+               /* Connect to the stonith deamon */
+               chan = ipc_channel_constructor(IPC_ANYTYPE, wchanattrs);
+               g_hash_table_destroy(wchanattrs);
+       
+               if (chan == NULL) {
+                       stdlib_log(LOG_ERR, "stonithd_signon: Can't connect "
+                                  " to stonithd");
+                       return ST_FAIL;
+               }
 
-       wchanattrs = g_hash_table_new(g_str_hash, g_str_equal);
-        g_hash_table_insert(wchanattrs, path, sock);
-       /* Connect to the stonith deamon */
-       chan = ipc_channel_constructor(IPC_ANYTYPE, wchanattrs);
-       g_hash_table_destroy(wchanattrs);
-       
-       if (chan == NULL) {
-               stdlib_log(LOG_ERR, "stonithd_signon: Can't connect to "
-                          "stonithd");
-               return ST_FAIL;
+               if (chan->ops->initiate_connection(chan) != IPC_OK) {
+                       stdlib_log(LOG_ERR, "stonithd_signon: Can't initiate "
+                                  "connection to stonithd");
+                       return ST_FAIL;
+                       }
        }
 
-        if (chan->ops->initiate_connection(chan) != IPC_OK) {
-               stdlib_log(LOG_ERR, "stonithd_signon: Can't initiate "
-                          "connection to stonithd");
-                return ST_FAIL;
-        }
-
        CLIENT_PID = getpid();
        snprintf(CLIENT_PID_STR, sizeof(CLIENT_PID_STR), "%d", CLIENT_PID);
        if ( client_name != NULL ) {
@@ -167,7 +160,6 @@
                             F_STONITHD_APIRPL, ST_RSIGNON) ) {
                if ( ((tmpstr=cl_get_string(reply, F_STONITHD_APIRET)) != NULL)
                    && (STRNCMP_CONST(tmpstr, ST_APIOK) == 0) ) {
-                       SIGNONED_TO_STONITHD = TRUE;
                        rc = ST_OK;
                        stdlib_log(LOG_DEBUG, "signoned to the stonithd.");
                } else {
@@ -191,7 +183,7 @@
        struct ha_msg * request, * reply;
        const char * tmpstr;
        
-       if (SIGNONED_TO_STONITHD == FALSE) {
+       if (chan == NULL || chan->ch_status == IPC_DISCONNECT) {
                stdlib_log(LOG_NOTICE, "Has been in signoff status.");
                return ST_OK;
        }
@@ -228,7 +220,8 @@
                             F_STONITHD_APIRPL, ST_RSIGNOFF) ) {
                if ( ((tmpstr=cl_get_string(reply, F_STONITHD_APIRET)) != NULL)
                    && (STRNCMP_CONST(tmpstr, ST_APIOK) == 0) ) {
-                       SIGNONED_TO_STONITHD = FALSE;
+                       chan->ops->destroy(chan);
+                       chan = NULL;
                        CLIENT_NAME = NULL;
                        rc = ST_OK;
                        stdlib_log(LOG_DEBUG, "succeeded to sign off the "
@@ -248,11 +241,11 @@
 IPC_Channel *
 stonithd_input_IPC_channel(void)
 {
-       if ( SIGNONED_TO_STONITHD == TRUE ) {
-               return chan;
-       } else {
+       if ( chan == NULL || chan->ch_status == IPC_DISCONNECT ) {
                stdlib_log(LOG_ERR, "stonithd_input_IPC_channel: not signon.");
                return NULL;
+       } else {
+               return chan;
        }
 }
 
@@ -268,7 +261,7 @@
                return ST_FAIL;
        }
        
-       if (SIGNONED_TO_STONITHD == FALSE) {
+       if (chan == NULL || chan->ch_status == IPC_DISCONNECT) {
                stdlib_log(LOG_NOTICE, "Has been in signoff status.");
                return ST_FAIL;
        }
@@ -344,18 +337,12 @@
 gboolean 
 stonithd_op_result_ready(void)
 {
-       if ( SIGNONED_TO_STONITHD == FALSE ) {
+       if ( chan == NULL || chan->ch_status == IPC_DISCONNECT ) {
                stdlib_log(LOG_ERR, "stonithd_op_result_ready: "
                           "failed due to not on signon status.");
                return FALSE;
        }
        
-       if ( chan == NULL ) {
-               stdlib_log(LOG_ERR, "stonithd_op_result_ready: "
-                          "failed due to IPC channel chan == NULL.");
-               return FALSE;
-       }
-       
        /* 
         * Regards IPC_DISCONNECT as a special result, so to prevent the caller
         * from the possible endless waiting. That can be caused by the way
@@ -573,13 +560,13 @@
 int
 stonithd_set_stonith_ops_callback(stonith_ops_callback_t callback)
 {
-       if ( SIGNONED_TO_STONITHD == TRUE ) {
-               stonith_ops_cb = callback;
-               stdlib_log(LOG_DEBUG, "setted stonith ops callback.");
-       } else {
+       if ( chan == NULL || chan->ch_status == IPC_DISCONNECT ) {
                stdlib_log(LOG_ERR, "stonithd_set_stonith_ops_callback: "\
                 "failed due to not on signon status.");
                return ST_FAIL;
+       } else {
+               stonith_ops_cb = callback;
+               stdlib_log(LOG_DEBUG, "setted stonith ops callback.");
        }
        
        return ST_OK;
@@ -605,7 +592,7 @@
                return ST_FAIL;
        }
        
-       if (SIGNONED_TO_STONITHD == FALSE) {
+       if (chan == NULL || chan->ch_status == IPC_DISCONNECT) {
                stdlib_log(LOG_ERR, "Not in signon status.");
                return ST_FAIL;
        }
@@ -686,14 +673,14 @@
 stonithd_set_stonithRA_ops_callback(stonithRA_ops_callback_t callback,
                                    void * private_data)
 {
-       if ( SIGNONED_TO_STONITHD == TRUE ) {
-               stonithRA_ops_cb = callback;
-               stonithRA_ops_cb_private_data = private_data;
-               stdlib_log(LOG_DEBUG, "setted stonith ops callback.");
-       } else {
+       if ( chan == NULL || chan->ch_status == IPC_DISCONNECT ) {
                stdlib_log(LOG_ERR, "stonithd_set_stonithRA_ops_callback: "
                 "failed due to not on signon status.");
                return ST_FAIL;
+       } else {
+               stonithRA_ops_cb = callback;
+               stonithRA_ops_cb_private_data = private_data;
+               stdlib_log(LOG_DEBUG, "setted stonith ops callback.");
        }
        
        return ST_OK;
@@ -705,7 +692,7 @@
        struct ha_msg * request, * reply;
        const char * tmpstr;
 
-       if (SIGNONED_TO_STONITHD == FALSE) {
+       if (chan == NULL || chan->ch_status == IPC_DISCONNECT) {
                stdlib_log(LOG_ERR, "Not in signon status.");
                return ST_FAIL;
        }




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

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


End of Linux-ha-cvs Digest, Vol 30, Issue 107
*********************************************

Reply via email to