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


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

Message: 1
Date: Mon,  3 Apr 2006 03:10: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/lrm


Modified Files:
        clientlib.c 


Log Message:
fixing for bug 1083
===================================================================
RCS file: /home/cvs/linux-ha/linux-ha/lib/lrm/clientlib.c,v
retrieving revision 1.63
retrieving revision 1.64
diff -u -3 -r1.63 -r1.64
--- clientlib.c 13 Jan 2006 20:08:32 -0000      1.63
+++ clientlib.c 3 Apr 2006 09:10:51 -0000       1.64
@@ -938,7 +938,7 @@
 static GList*
 rsc_get_cur_state (lrm_rsc_t* rsc, state_flag_t* cur_state)
 {
-       GList* op_list = NULL;
+       GList* op_list = NULL, * tmplist = NULL;
        struct ha_msg* msg = NULL;
        struct ha_msg* ret = NULL;
        struct ha_msg* op_msg = NULL;
@@ -1015,6 +1015,39 @@
                ha_msg_del(op_msg);
        }
        g_list_sort(op_list, compare_call_id);
+
+       /* Delete the duplicate op for call_id */
+#if 0  
+       cl_log(LOG_WARNING, "Before uniquing");
+       tmplist = g_list_first(op_list);
+       while (tmplist != NULL) {
+               cl_log(LOG_WARNING, "call_id=%d", 
((lrm_op_t*)(tmplist->data))->call_id);
+               tmplist = g_list_next(tmplist);
+       }
+#endif
+
+       tmplist = g_list_first(op_list);
+       while (tmplist != NULL) {
+               if (NULL != g_list_previous(tmplist)) {
+                       if 
(((lrm_op_t*)(g_list_previous(tmplist)->data))->call_id
+                            == ((lrm_op_t*)(tmplist->data))->call_id) {
+                               op_list = g_list_remove_link (op_list, tmplist);
+                               free_op((lrm_op_t *)tmplist->data);
+                               g_list_free_1(tmplist);
+                               tmplist = g_list_first(op_list);
+                       }
+               }
+               tmplist = g_list_next(tmplist);
+       }
+
+#if 0
+       cl_log(LOG_WARNING, "After uniquing");
+       while (tmplist != NULL) {
+               cl_log(LOG_WARNING, "call_id=%d", 
((lrm_op_t*)(tmplist->data))->call_id);
+               tmplist = g_list_next(tmplist);
+       }
+#endif
+
        return op_list;
 }
 




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

Message: 2
Date: Mon,  3 Apr 2006 03:41:36 -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/cib


Modified Files:
        io.c 


Log Message:
Allow XML to be optionally written to disk compressed in the bzip2 format





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

Message: 3
Date: Mon,  3 Apr 2006 03:41:36 -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_verify.c crmadmin.c 


Log Message:
Allow XML to be optionally written to disk compressed in the bzip2 format

===================================================================
RCS file: /home/cvs/linux-ha/linux-ha/crm/admin/crm_verify.c,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -3 -r1.5 -r1.6
--- crm_verify.c        29 Mar 2006 06:11:52 -0000      1.5
+++ crm_verify.c        3 Apr 2006 09:41:36 -0000       1.6
@@ -1,4 +1,4 @@
-/* $Id: crm_verify.c,v 1.5 2006/03/29 06:11:52 andrew Exp $ */
+/* $Id: crm_verify.c,v 1.6 2006/04/03 09:41:36 andrew Exp $ */
 
 /* 
  * Copyright (C) 2004 Andrew Beekhof <[EMAIL PROTECTED]>
@@ -202,7 +202,7 @@
                );
 
        if(cib_save != NULL) {
-               write_xml_file(cib_object, cib_save);
+               write_xml_file(cib_object, cib_save, FALSE);
        }
        
 #if 0
===================================================================
RCS file: /home/cvs/linux-ha/linux-ha/crm/admin/crmadmin.c,v
retrieving revision 1.62
retrieving revision 1.63
diff -u -3 -r1.62 -r1.63
--- crmadmin.c  26 Jan 2006 11:36:58 -0000      1.62
+++ crmadmin.c  3 Apr 2006 09:41:36 -0000       1.63
@@ -1,4 +1,4 @@
-/* $Id: crmadmin.c,v 1.62 2006/01/26 11:36:58 andrew Exp $ */
+/* $Id: crmadmin.c,v 1.63 2006/04/03 09:41:36 andrew Exp $ */
 
 /* 
  * Copyright (C) 2004 Andrew Beekhof <[EMAIL PROTECTED]>
@@ -591,7 +591,8 @@
                                        received_responses);
                                
                                filename[filename_len - 1] = '\0';
-                               if (0 > write_xml_file(new_input->xml, 
filename)) {
+                               if (0 > write_xml_file(
+                                           new_input->xml, filename, FALSE)) {
                                        crm_crit("Could not save response to"
                                                 " %s", filename);
                                }




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

Message: 4
Date: Mon,  3 Apr 2006 03:41:36 -0600 (MDT)
From: [email protected]
Subject: [Linux-ha-cvs] Linux-HA CVS: include by andrew from 
To: [EMAIL PROTECTED]
Message-ID: <[EMAIL PROTECTED]>

linux-ha CVS committal

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

Dir     : linux-ha/include/crm/common


Modified Files:
        xml.h 


Log Message:
Allow XML to be optionally written to disk compressed in the bzip2 format

===================================================================
RCS file: /home/cvs/linux-ha/linux-ha/include/crm/common/xml.h,v
retrieving revision 1.42
retrieving revision 1.43
diff -u -3 -r1.42 -r1.43
--- xml.h       31 Mar 2006 12:45:02 -0000      1.42
+++ xml.h       3 Apr 2006 09:41:36 -0000       1.43
@@ -1,4 +1,4 @@
-/* $Id: xml.h,v 1.42 2006/03/31 12:45:02 andrew Exp $ */
+/* $Id: xml.h,v 1.43 2006/04/03 09:41:36 andrew Exp $ */
 /* 
  * Copyright (C) 2004 Andrew Beekhof <[EMAIL PROTECTED]>
  * 
@@ -186,7 +186,8 @@
 
 extern crm_data_t *string2xml(const char *input);
 
-extern int write_xml_file(crm_data_t *xml_node, const char *filename);
+extern int write_xml_file(
+       crm_data_t *xml_node, const char *filename, gboolean compress);
 
 extern char *dump_xml_formatted(const crm_data_t *msg);
 




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

Message: 5
Date: Mon,  3 Apr 2006 03:41:37 -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:
Allow XML to be optionally written to disk compressed in the bzip2 format

===================================================================
RCS file: /home/cvs/linux-ha/linux-ha/lib/crm/common/xml.c,v
retrieving revision 1.63
retrieving revision 1.64
diff -u -3 -r1.63 -r1.64
--- xml.c       31 Mar 2006 12:45:02 -0000      1.63
+++ xml.c       3 Apr 2006 09:41:36 -0000       1.64
@@ -1,4 +1,4 @@
-/* $Id: xml.c,v 1.63 2006/03/31 12:45:02 andrew Exp $ */
+/* $Id: xml.c,v 1.64 2006/04/03 09:41:36 andrew Exp $ */
 /* 
  * Copyright (C) 2004 Andrew Beekhof <[EMAIL PROTECTED]>
  * 
@@ -38,7 +38,9 @@
 #include <crm/common/xml.h>
 
 #include <clplumbing/md5.h>
-
+#if HAVE_BZLIB_H
+#  include <bzlib.h>
+#endif
 #include <crm/dmalloc_wrapper.h>
 
 int is_comment_start(const char *input);
@@ -582,13 +584,14 @@
 }
 
 int
-write_xml_file(crm_data_t *xml_node, const char *filename) 
+write_xml_file(crm_data_t *xml_node, const char *filename, gboolean compress) 
 {
        int res = 0;
        char *now_str = NULL;
        time_t now;
 
        CRM_CHECK(filename != NULL, return -1);
+
        crm_debug_3("Writing XML out to %s", filename);
        crm_validate_data(xml_node);
        if (xml_node == NULL) {
@@ -613,16 +616,58 @@
                        cl_perror("Cannot write to %s", filename);
                        
                } else {
+                       gboolean is_done = FALSE;
                        char *buffer = dump_xml_formatted(xml_node);
                        CRM_CHECK(buffer != NULL && strlen(buffer) > 0, return 
-1);
-                       if(buffer != NULL && strlen(buffer) > 0) {
+                       if(buffer == NULL || strlen(buffer) <= 0) {
+                               is_done = TRUE;
+                       }
+#if HAVE_BZLIB_H
+                       if(compress && is_done == FALSE) {
+                               int rc = BZ_OK;
+                               BZFILE *bz_file = NULL;
+                               unsigned int in = 0, out = 0;
+                               is_done = TRUE;
+                               bz_file = BZ2_bzWriteOpen(
+                                       &rc, file_output_strm, 5, 0, 0);
+                               if(rc != BZ_OK) {
+                                       is_done = FALSE;
+                                       crm_err("bzWriteOpen failed: %d", rc);
+                               }
+                               if(is_done) {
+                                       BZ2_bzWrite(&rc, bz_file,
+                                                   buffer, strlen(buffer));
+                                       if(rc != BZ_OK) {
+                                               crm_err("bzWrite() failed: %d", 
rc);
+                                               is_done = FALSE;
+                                       }
+                               }
+                               if(is_done) {
+                                       BZ2_bzWriteClose(&rc, bz_file, 0, &in, 
&out);
+                                       if(rc != BZ_OK) {
+                                               crm_err("bzWriteClose() failed: 
%d",rc);
+                                               is_done = FALSE;
+                                       } else {
+                                               crm_debug("%s: In: %d, out: %d",
+                                                         filename, in, out);
+                                       }
+                               }
+                       }
+#endif
+                       if(compress && is_done == FALSE) {
+                               compress = FALSE;
+                               crm_warn("bzlib failed or not installed."
+                                        "  Writing uncompressed data to: %s",
+                                        filename);
+                       }
+                       if(is_done == FALSE) {
                                res = fprintf(file_output_strm, "%s", buffer);
                                if(res < 0) {
                                        cl_perror("Cannot write output to %s",
                                                  filename);
                                }
+                               fflush(file_output_strm);
                        }
-                       fflush(file_output_strm);
                        fclose(file_output_strm);
                        crm_free(buffer);
                }




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

_______________________________________________
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 3
*******************************************

Reply via email to