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: cim by panjiam from 
      ([email protected])
   2. Linux-HA CVS: membership by zhenh from 
      ([email protected])


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

Message: 1
Date: Thu, 13 Apr 2006 02:35:17 -0600 (MDT)
From: [email protected]
Subject: [Linux-ha-cvs] Linux-HA CVS: cim by panjiam from 
To: [EMAIL PROTECTED]
Message-ID: <[EMAIL PROTECTED]>

linux-ha CVS committal

Author  : panjiam
Host    : 
Project : linux-ha
Module  : cim

Dir     : linux-ha/cim


Modified Files:
        primitive_resource_provider.c simple_test.c 
        subresource_provider.c 


Log Message:
other fixes
===================================================================
RCS file: /home/cvs/linux-ha/linux-ha/cim/primitive_resource_provider.c,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -3 -r1.3 -r1.4
--- primitive_resource_provider.c       10 Apr 2006 10:25:05 -0000      1.3
+++ primitive_resource_provider.c       13 Apr 2006 08:35:16 -0000      1.4
@@ -150,8 +150,11 @@
         classname = CMGetClassName(ref, &rc);
         if(strcasecmp(CMGetCharPtr(classname), ClassName) == 0 &&
            strcasecmp(METHOD_ADD_OPERATION, method_name) == 0 ){
+#if 0
                ret = resource_add_operation(Broker, ClassName, ctx, rslt, 
                        ref, TID_RES_PRIMITIVE, in, out, &rc);
+#endif
+               ret = HA_OK;
         }
 
         CMReturnData(rslt, &ret, CMPI_uint32);
===================================================================
RCS file: /home/cvs/linux-ha/linux-ha/cim/simple_test.c,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -3 -r1.2 -r1.3
--- simple_test.c       10 Apr 2006 10:28:30 -0000      1.2
+++ simple_test.c       13 Apr 2006 08:35:16 -0000      1.3
@@ -34,79 +34,18 @@
 #include <ha_msg.h>
 #include <hb_api.h>
 #include <unistd.h>
-/* #include <clplumbing/tracer.h> */
 #include "utils.h"
 #include "cluster_info.h"
 #include "mgmt_client.h"
 
-#if 0
-static int testfunc1(void)
-{
-       unsigned int i;
-       i = call0(unsigned int, sleep, 1);
-       return 0;
-}
-
-static void testfunc2(int i)
-{
-       sleep(i);
-}
-
-static int testfunc3(int k)
-{
-       sleep(k);
-}
-
-#endif
 
 int main(int argc, char * argv[])
 {
-
-#if 0
-       CIMTable *   t;
-       CIMArray *      a;
-       char test[1024]="hello\n";
-       int i;
-       
-       t = cim_table_new();
-       a = cim_table_lookup_v(t, "nosuchthing").v.array;
-       split_string(test, &i, "\n");
-       printf("len = %d\n", i);
-       time_trace_init(NULL, dump_current_cb);
-       void_call_full("printf", printf("%d", call_full("testfunc1", int, 
testfunc1())));
-        void_call(testfunc2(2));
-        call(int, testfunc3(1));
-       time_trace_destroy();
-#endif
-
-       struct ha_msg *msg;
+       struct ha_msg *m;
+       //cim_query_dispatch(16, "child_DoFencing:1", NULL);
        cim_init_logger("test");
-       msg = ha_msg_new(1);
-       cl_msg_list_add_string(msg, "key", "hello");
-       cl_msg_remove(msg, "key");
-       cl_msg_list_add_string(msg, "key", "hello2");
-       cl_log(LOG_INFO, "msg: %s", msg2string(msg));
-#if 0
-       ha_msg_del(msg);        
-       msg = cim_get_msg(GET_CRM_CONFIG, NULL, NULL);
-       cl_log(LOG_INFO, "msg: %s", msg2string(msg));
-       msg = cim_get_msg(GET_DC, NULL, NULL);
-       cl_log(LOG_INFO, "msg: %s", msg2string(msg));
-       msg = cim_get_msg(GET_HB_CONFIG, NULL, NULL);
-       cl_log(LOG_INFO, "msg: %s", msg2string(msg));
-       msg = cim_get_msg(GET_RSC_LIST, NULL, NULL);
-       cl_log(LOG_INFO, "msg: %s", msg2string(msg));
-       msg = cim_get_msg(GET_RSC_ATTRIBUTES, "DcIPaddr", NULL);
-       cl_log(LOG_INFO, "msg: %s", msg2string(msg));
-
-       msg = cim_get_msg(GET_RSC_OPERATIONS, "DcIPaddr", NULL);
-       cl_log(LOG_INFO, "msg: %s", msg2string(msg));
-
-       msg = string2msg(msg2string(msg), strlen(msg2string(msg)));
-       cl_log(LOG_INFO, "msg: %s", msg2string(msg));
-
-       msg = cl_get_struct(msg, "op.0");
-       cl_log(LOG_INFO, "msg: %s", msg2string(msg));
-#endif
+       
+       m = cim_get_rscops("child_DoFencing:1");
+       cim_debug_msg(m, "operations");
         return 0;
 }
===================================================================
RCS file: /home/cvs/linux-ha/linux-ha/cim/subresource_provider.c,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -3 -r1.2 -r1.3
--- subresource_provider.c      10 Apr 2006 10:28:30 -0000      1.2
+++ subresource_provider.c      13 Apr 2006 08:35:16 -0000      1.3
@@ -109,7 +109,7 @@
                 char *         subid;
                 
                 subid = cim_list_index(sublist, i);
-                rsctype = cim_get_rsc_type(subid);
+                rsctype = cim_get_rsctype(subid);
 
                 if (rsctype == TID_RES_PRIMITIVE ) {
                         crname = PrimitiveClassName;




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

Message: 2
Date: Thu, 13 Apr 2006 03:08:38 -0600 (MDT)
From: [email protected]
Subject: [Linux-ha-cvs] Linux-HA CVS: membership by zhenh from 
To: [EMAIL PROTECTED]
Message-ID: <[EMAIL PROTECTED]>

linux-ha CVS committal

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

Dir     : linux-ha/membership/ccm


Modified Files:
        ccmclient.c ccmlib.h ccmlib_memapi.c 


Log Message:
send out the node name list for new membership, fix the bug 1181, related to 
autojoin
===================================================================
RCS file: /home/cvs/linux-ha/linux-ha/membership/ccm/ccmclient.c,v
retrieving revision 1.39
retrieving revision 1.40
diff -u -3 -r1.39 -r1.40
--- ccmclient.c 16 Mar 2006 10:24:14 -0000      1.39
+++ ccmclient.c 13 Apr 2006 09:08:37 -0000      1.40
@@ -1,4 +1,4 @@
-/* $Id: ccmclient.c,v 1.39 2006/03/16 10:24:14 davidlee Exp $ */
+/* $Id: ccmclient.c,v 1.40 2006/04/13 09:08:37 zhenh Exp $ */
 /* 
  * client.c: Consensus Cluster Client tracker
  *
@@ -56,6 +56,7 @@
 static GMemChunk *ipc_misc_chk = NULL;
 
 static gboolean membership_ready     = FALSE;
+static void refresh_llm_msg(llm_info_t *llm);
 
 
 /* 
@@ -115,11 +116,9 @@
        case CCM_INFLUX:
                send_message(ccm_client, ipc_misc_message);
                break;
-       case CCM_LLM:   
-               send_message(ccm_client, ipc_llm_message);
-               break;
        case CCM_NEW_MEMBERSHIP:
                if(membership_ready) {
+                       send_message(ccm_client, ipc_llm_message);
                        send_message(ccm_client, ipc_mem_message);
                }
                break;
@@ -139,7 +138,8 @@
 }
 
 static 
-void  send_func_done(struct IPC_MESSAGE *ipcmsg)
+void  
+send_func_done(struct IPC_MESSAGE *ipcmsg)
 {
        ccm_ipc_t *ccmipc = (ccm_ipc_t *)ipcmsg->msg_private;
        int count = --(ccmipc->count);
@@ -257,7 +257,6 @@
        ccm_client->ccm_ipc_client = ipc_client;
        ccm_client->ccm_flags = CL_INIT;
 
-       send_func(ipc_client, ccm_client, (gpointer)CCM_LLM);
        send_func(ipc_client, ccm_client, (gpointer)CCM_NEW_MEMBERSHIP);
 
        g_hash_table_insert(ccm_hashclient, ipc_client, ccm_client);
@@ -418,7 +417,7 @@
        ipc_mem_message = create_message(ipc_mem_chk, ccm, 
                        (sizeof(ccm_meminfo_t) + n*sizeof(born_t)));
        ipc_mem_message->count++;
-
+       refresh_llm_msg(&info->llm);
 #if 1
        ccm_debug(LOG_DEBUG, "delivering new membership to %d clients: ",
               g_hash_table_size(ccm_hashclient));
@@ -470,17 +469,35 @@
        ccm_debug2(LOG_DEBUG, "membership state: evicted");
 }
 
-
 void 
 client_llm_init(llm_info_t *llm)
 {
        char memstr[] = "membership chunk";
        char miscstr[] = "misc chunk";
        int  maxnode = llm_get_nodecount(llm);
+
+       refresh_llm_msg(llm);
+       ipc_mem_chk = g_mem_chunk_new(memstr,
+                               sizeof(ccm_ipc_t)+
+                               sizeof(ccm_meminfo_t)+
+                               maxnode*sizeof(born_t), 
+                               MAXIPC, G_ALLOC_AND_FREE);
+       ipc_misc_chk = g_mem_chunk_new(miscstr,
+                               sizeof(ccm_ipc_t)+
+                               sizeof(int), 
+                               MAXIPC, G_ALLOC_AND_FREE);
+       return;
+}
+
+static void 
+refresh_llm_msg(llm_info_t *llm)
+{
+       int  maxnode = llm_get_nodecount(llm);
                int size = sizeof(ccm_llm_t)+ maxnode*sizeof(struct node_s);
        ccm_llm_t *data = (ccm_llm_t *)g_malloc(size);
        int  i;
 
+       data->ev = CCM_LLM;
        /* copy the relevent content of llm into data */
        CLLM_SET_NODECOUNT(data,maxnode);
        CLLM_SET_MYNODE(data, llm_get_myindex(llm));
@@ -490,19 +507,13 @@
 
        }
 
+       if(ipc_llm_message && --(ipc_llm_message->count)==0){
+               delete_message(ipc_llm_message);
+       }
        ipc_llm_message = create_message(NULL, data, size);
+       ipc_llm_message->count++;
        g_free(data);
-       ipc_llm_message->count++; /* make sure it never gets
-                                       dellocated */
-
-       ipc_mem_chk = g_mem_chunk_new(memstr,
-                               sizeof(ccm_ipc_t)+
-                               sizeof(ccm_meminfo_t)+
-                               maxnode*sizeof(born_t), 
-                               MAXIPC, G_ALLOC_AND_FREE);
-       ipc_misc_chk = g_mem_chunk_new(miscstr,
-                               sizeof(ccm_ipc_t)+
-                               sizeof(int), 
-                               MAXIPC, G_ALLOC_AND_FREE);
+       
        return;
 }
+
===================================================================
RCS file: /home/cvs/linux-ha/linux-ha/membership/ccm/ccmlib.h,v
retrieving revision 1.21
retrieving revision 1.22
diff -u -3 -r1.21 -r1.22
--- ccmlib.h    13 Mar 2006 07:54:05 -0000      1.21
+++ ccmlib.h    13 Apr 2006 09:08:37 -0000      1.22
@@ -1,4 +1,4 @@
-/* $Id: ccmlib.h,v 1.21 2006/03/13 07:54:05 zhenh Exp $ */
+/* $Id: ccmlib.h,v 1.22 2006/04/13 09:08:37 zhenh Exp $ */
 /*
  * ccmlib.h: internal definations for ccm library files.
  *
@@ -64,6 +64,7 @@
 } ccm_born_t;
 
 typedef struct ccm_llm_s { /* information about low level membership info */
+       int        ev;
        uint       n;           /* number of nodes in the cluster  */
        int        mynode;       /* index of mynode */
        struct  node_s {
===================================================================
RCS file: /home/cvs/linux-ha/linux-ha/membership/ccm/ccmlib_memapi.c,v
retrieving revision 1.42
retrieving revision 1.43
diff -u -3 -r1.42 -r1.43
--- ccmlib_memapi.c     13 Mar 2006 08:14:53 -0000      1.42
+++ ccmlib_memapi.c     13 Apr 2006 09:08:37 -0000      1.43
@@ -1,4 +1,4 @@
-/* $Id: ccmlib_memapi.c,v 1.42 2006/03/13 08:14:53 zhenh Exp $ */
+/* $Id: ccmlib_memapi.c,v 1.43 2006/04/13 09:08:37 zhenh Exp $ */
 /* 
  * ccmlib_memapi.c: Consensus Cluster Membership API
  *
@@ -122,7 +122,10 @@
 {
        unsigned long len = msg->msg_len;
        int     numnodes;
-
+       
+       if (mem->llm != NULL) {
+               g_free(mem->llm);
+       }
        mem->llm = (ccm_llm_t *)g_malloc(len);
        memcpy(mem->llm, msg->msg_body, len);
 
@@ -130,9 +133,8 @@
                                g_direct_equal);
 
        numnodes = CLLM_GET_NODECOUNT(mem->llm);
+       
        mem->cookie = NULL;
-
-
        return;
 }
 
@@ -597,6 +599,8 @@
                                                NULL,NULL);
                        }
                        break;
+               case CCM_LLM:
+                       on_llm_msg(private, msg);
                }
 
                
@@ -796,7 +800,8 @@
        private->magiccookie = 0xabcdef;
        private->client_report = FALSE;
        private->special = 0; /* no special behaviour */
-
+       private->llm = NULL; 
+       
        attrs = g_hash_table_new(g_str_hash,g_str_equal);
        g_hash_table_insert(attrs, path, ccmfifo);
        ch = ipc_channel_constructor(IPC_DOMAIN_SOCKET, attrs);




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

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


End of Linux-ha-cvs Digest, Vol 29, Issue 83
********************************************

Reply via email to