Skip to contentSkip to conversation

conga ./clustermon.spec.in.in ./conga.spec.in. ...

Cluster-devel [email protected] 1 participant 1 message May 12, 2008

lore
Share & tools
lore
#0 lore raw

CVSROOT: /cvs/cluster
Module name: conga
Branch: RHEL5
Changes by: rmccabe at sourceware.org 2008-05-12 15:13:33

Modified files:
. : clustermon.spec.in.in conga.spec.in.in
luci/site/luci/Extensions: ricci_communicator.py
make : version.in
ricci/common : File.cpp Variable.cpp daemon_init.c utils.cpp
ricci/include : shred_allocator.h
ricci/init.d : ricci
ricci/modules/cluster/clumon: Makefile ricci/modules/cluster/clumon/init.d: modclusterd ricci/modules/cluster/clumon/src/common: Cluster.cpp ricci/modules/storage: ContentFS.cpp ExtendedFS.cpp LV.cpp
Mapper.cpp MountHandler.cpp PTSource.cpp PV.cpp Partition.cpp PartitionTable.cpp parted_wrapper.cpp

Log message:
Fixes from HEAD

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/clustermon.spec.in.in.diff?cvsroot=cluster&only_with_tag=RHEL5&r1=1.18.2.37&r2=1.18.2.38
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/conga.spec.in.in.diff?cvsroot=cluster&only_with_tag=RHEL5&r1=1.45.2.84&r2=1.45.2.85
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/luci/site/luci/Extensions/ricci_communicator.py.diff?cvsroot=cluster&only_with_tag=RHEL5&r1=1.9.2.14&r2=1.9.2.15
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/make/version.in.diff?cvsroot=cluster&only_with_tag=RHEL5&r1=1.21.2.38&r2=1.21.2.39
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/ricci/common/File.cpp.diff?cvsroot=cluster&only_with_tag=RHEL5&r1=1.1.2.4&r2=1.1.2.5
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/ricci/common/Variable.cpp.diff?cvsroot=cluster&only_with_tag=RHEL5&r1=1.8.2.1&r2=1.8.2.2
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/ricci/common/daemon_init.c.diff?cvsroot=cluster&only_with_tag=RHEL5&r1=1.1.2.1&r2=1.1.2.2
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/ricci/common/utils.cpp.diff?cvsroot=cluster&only_with_tag=RHEL5&r1=1.6.2.2&r2=1.6.2.3
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/ricci/include/shred_allocator.h.diff?cvsroot=cluster&only_with_tag=RHEL5&r1=1.2.2.1&r2=1.2.2.2
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/ricci/init.d/ricci.diff?cvsroot=cluster&only_with_tag=RHEL5&r1=1.8.2.4&r2=1.8.2.5
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/ricci/modules/cluster/clumon/Makefile.diff?cvsroot=cluster&only_with_tag=RHEL5&r1=1.4.2.2&r2=1.4.2.3
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/ricci/modules/cluster/clumon/init.d/modclusterd.diff?cvsroot=cluster&only_with_tag=RHEL5&r1=1.2.2.2&r2=1.2.2.3
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/ricci/modules/cluster/clumon/src/common/Cluster.cpp.diff?cvsroot=cluster&only_with_tag=RHEL5&r1=1.6.2.2&r2=1.6.2.3
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/ricci/modules/storage/ContentFS.cpp.diff?cvsroot=cluster&only_with_tag=RHEL5&r1=1.5.2.1&r2=1.5.2.2
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/ricci/modules/storage/ExtendedFS.cpp.diff?cvsroot=cluster&only_with_tag=RHEL5&r1=1.7.2.2&r2=1.7.2.3
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/ricci/modules/storage/LV.cpp.diff?cvsroot=cluster&only_with_tag=RHEL5&r1=1.6.2.4&r2=1.6.2.5
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/ricci/modules/storage/Mapper.cpp.diff?cvsroot=cluster&only_with_tag=RHEL5&r1=1.3.2.1&r2=1.3.2.2
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/ricci/modules/storage/MountHandler.cpp.diff?cvsroot=cluster&only_with_tag=RHEL5&r1=1.5.2.2&r2=1.5.2.3
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/ricci/modules/storage/PTSource.cpp.diff?cvsroot=cluster&only_with_tag=RHEL5&r1=1.2.2.1&r2=1.2.2.2
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/ricci/modules/storage/PV.cpp.diff?cvsroot=cluster&only_with_tag=RHEL5&r1=1.4.2.3&r2=1.4.2.4
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/ricci/modules/storage/Partition.cpp.diff?cvsroot=cluster&only_with_tag=RHEL5&r1=1.3.2.1&r2=1.3.2.2
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/ricci/modules/storage/PartitionTable.cpp.diff?cvsroot=cluster&only_with_tag=RHEL5&r1=1.5.2.1&r2=1.5.2.2
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/ricci/modules/storage/parted_wrapper.cpp.diff?cvsroot=cluster&only_with_tag=RHEL5&r1=1.8.2.4&r2=1.8.2.5

clustermon.spec.in.in +6 -7
@@ -18,7 +18,7 @@
 Name: clustermon
 Version: @@VERS@@
 Release: @@REL@@%{?dist}
-License: GPL
+License: GPLv2
 URL: http://sources.redhat.com/cluster/conga
 
 Group: System Environment/Base
@@ -67,12 +67,11 @@
 make %{?_smp_mflags} clustermon
 
 %install
-rm -rf $RPM_BUILD_ROOT
-make DESTDIR=$RPM_BUILD_ROOT install_clustermon
+rm -rf %{buildroot}
+make DESTDIR=%{buildroot} install_clustermon
 
 %clean
-rm -rf $RPM_BUILD_ROOT
-
+rm -rf %{buildroot}
 
 
 
@@ -191,7 +190,7 @@
 			%{_docdir}/cluster-cim-%{version}/
 
 %post -n cluster-cim
-# pegasus might not be running, don't fail %post
+# pegasus might not be running, don't fail
 /sbin/service tog-pegasus condrestart >&/dev/null
 exit 0
 
@@ -200,7 +199,7 @@
 if [ "$1" == "0" ]; then
 	/sbin/service tog-pegasus condrestart >&/dev/null
 fi
-# pegasus might not be running, don't fail %postun
+# pegasus might not be running, don't fail
 exit 0
 
 
conga.spec.in.in +3 -3
@@ -62,11 +62,11 @@
 make %{?_smp_mflags} conga
 
 %install
-rm -rf $RPM_BUILD_ROOT
-make DESTDIR=$RPM_BUILD_ROOT install_conga
+rm -rf %{buildroot}
+make DESTDIR=%{buildroot} install_conga
 
 %clean
-rm -rf $RPM_BUILD_ROOT
+rm -rf %{buildroot}
 
 
 ####### luci #######
luci/site/luci/Extensions/ricci_communicator.py +3 -3
@@ -169,7 +169,7 @@
 				luci_log.debug_net('RC:UNAUTH0: unauthenticate %s for %s:%d' \
 					% (ret, self.__hostname, self.__port))
 			if ret != '0':
-				raise Exception, 'Invalid response'
+				raise Exception, 'Invalid response: %s' % ret
 
 			try:
 				self.ss.untrust()
@@ -494,7 +494,7 @@
 					% batch_xml.toxml())
 			except:
 				pass
-		raise RicciError, 'Not an XML batch node'
+		raise RicciError, 'Not an XML batch node: %s' % batch_xml.nodeName
 
 	total = 0
 	last = 0
@@ -544,7 +544,7 @@
 		if LUCI_DEBUG_NET is True:
 			luci_log.debug_net_priv('RC:EMS0: Expecting "batch" got "%s"' \
 				% batch_xml.toxml())
-		raise RicciError, 'Invalid XML node; expecting a batch node'
+		raise RicciError, 'Invalid XML node; expecting a batch node: %s' % batch_xml.nodeName
 
 	c = 0
 	for node in batch_xml.childNodes:
make/version.in +2 -2
@@ -1,2 +1,2 @@
-VERSION=0.12.0
-RELEASE=9
+VERSION=0.14.0
+RELEASE=1
ricci/common/File.cpp +5 -5
@@ -139,17 +139,17 @@
 	MutexLocker l(*_mutex);
 
 	long len = size();
-	const auto_ptr<char> buff(new char[len]);
+	char buff[len];
 	try {
 		((fstream *) _pimpl->fs)->seekg(0, ios::beg);
 		check_failed();
-		((fstream *) _pimpl->fs)->read(buff.get(), len);
+		((fstream *) _pimpl->fs)->read(buff, len);
 		check_failed();
-		String ret(buff.get(), len);
-		::shred(buff.get(), len);
+		String ret(buff, len);
+		::shred(buff, len);
 		return ret;
 	} catch ( ... ) {
-		::shred(buff.get(), len);
+		::shred(buff, len);
 		throw;
 	}
 }
ricci/common/Variable.cpp +2 -0
@@ -26,6 +26,8 @@
 
 #include <stdio.h>
 
+#include <vector>
+#include <algorithm>
 using namespace std;
 
 // ##### class Variable #####
ricci/common/daemon_init.c +1 -2
@@ -20,7 +20,7 @@
 /** @file
  * daemon_init function, does sanity checks and calls daemon().
  *
- * $Id: daemon_init.c,v 1.1.2.1 2008/01/17 17:38:36 rmccabe Exp $
+ * $Id: daemon_init.c,v 1.1.2.2 2008/05/12 15:13:32 rmccabe Exp $
  *
  * Author: Jeff Moyer <[email protected]>
  */
@@ -232,5 +232,4 @@
 
 	update_pidfile(prog);
 	nice(-1);
-	//mlockall(MCL_CURRENT | MCL_FUTURE);
 }
ricci/common/utils.cpp +39 -8

87 lines not on this page · raw message

ricci/include/shred_allocator.h +6 -0
@@ -33,6 +33,12 @@
 #ifndef __CONGA_SHRED_ALLOCATOR_H
 #define __CONGA_SHRED_ALLOCATOR_H
 
+extern "C" {
+	#include <unistd.h>
+	#include <stdlib.h>
+	#include <string.h>
+}
+
 #include <new>
 
 template<typename _Tp>
ricci/init.d/ricci +94 -38

197 lines not on this page · raw message

ricci/modules/cluster/clumon/Makefile +1 -0
@@ -11,6 +11,7 @@
 top_srcdir=../../..
 UNINSTALL=${top_srcdir}/scripts/uninstall.pl
 
+include ${top_srcdir}/make/version.in
 include ${top_srcdir}/make/defines.mk
 
 all:
ricci/modules/cluster/clumon/init.d/modclusterd +81 -25

147 lines not on this page · raw message

ricci/modules/cluster/clumon/src/common/Cluster.cpp +2 -1
@@ -25,7 +25,8 @@
 #include <stdio.h>
 
 extern "C" {
-#	include <libcman.h>
+	#include <limits.h>
+	#include <libcman.h>
 }
 
 using namespace std;
ricci/modules/storage/ContentFS.cpp +1 -0
@@ -28,6 +28,7 @@
 #include "BDFactory.h"
 #include "defines.h"
 #include "utils.h"
+#include <algorithm>
 
 
 using namespace std;
ricci/modules/storage/ExtendedFS.cpp +2 -1
@@ -27,8 +27,9 @@
 #include "UMountError.h"
 #include "FileMagic.h"
 
-
+#include <algorithm>
 #include <iostream>
+
 using namespace std;
 
 
ricci/modules/storage/LV.cpp +1 -1
@@ -124,7 +124,7 @@
     long long min  = utils::to_long(xml.get_attr("min"));
     long long max  = utils::to_long(xml.get_attr("max"));
     long long step = utils::to_long(xml.get_attr("step"));
-    long long min_size = (long long ) (size * (usage / 100.0));
+    long long min_size = (long long) (size * usage) / 100;
     if (min_size > min)
       min = min_size;
     else if (min_size > max)
ricci/modules/storage/Mapper.cpp +1 -0
@@ -26,6 +26,7 @@
 #include "BDFactory.h"
 #include "MapperFactory.h"
 #include "MidAir.h"
+#include <algorithm>
 
 
 using namespace std;
ricci/modules/storage/MountHandler.cpp +2 -1
@@ -37,8 +37,9 @@
 #include <sys/file.h>
 #include <errno.h>
 
-
+#include <algorithm>
 #include <iostream>
+
 using namespace std;
 
 
ricci/modules/storage/PTSource.cpp +1 -0
@@ -25,6 +25,7 @@
 #include "PartitionTable.h"
 #include "parted_wrapper.h"
 
+#include <algorithm>
 
 using namespace std;
 
ricci/modules/storage/PV.cpp +1 -0
@@ -26,6 +26,7 @@
 #include "MapperFactory.h"
 #include "utils.h"
 #include "LVMClusterLockingError.h"
+#include <algorithm>
 
 
 using namespace std;
ricci/modules/storage/Partition.cpp +1 -0
@@ -30,6 +30,7 @@
 #include "ContentExtendedPartition.h"
 #include "PV.h"
 
+#include <algorithm>
 
 using namespace std;
 
ricci/modules/storage/PartitionTable.cpp +1 -1
@@ -28,7 +28,7 @@
 #include "MapperFactory.h"
 #include "utils.h"
 
-
+#include <algorithm>
 #include <iostream>
 
 
ricci/modules/storage/parted_wrapper.cpp +7 -5
@@ -24,8 +24,9 @@
 #include "parted_wrapper.h"
 #include "utils.h"
 
-
+#include <algorithm>
 #include <iostream>
+
 using namespace std;
 
 
@@ -667,11 +668,13 @@
   String s = utils::to_lower(utils::strip(size_str));
   long long multiplier;
   // parted defines 1KB as 1000 bytes.
-  if (s.find("b") == s.npos)
+  if (s.find("b") == s.npos) {
     multiplier = 1000 * 1000;  // by old parted behavior, size is in MB
-  else {
+    return (long long) utils::to_long(s) * multiplier;
+  } else {
     if (s.size() < 3)
       throw String("parted size has an invalid value: ") + s;
+	/* This path should never be hit on RHEL5 and later. */
     multiplier = 1;
     if (s[s.size()-2] == 'k')
       multiplier = 1000;
@@ -681,7 +684,6 @@
       multiplier = 1000 * 1000 * 1000;
     else if (s[s.size()-2] == 't')
       multiplier = (long long) 1000 * 1000 * 1000 * 1000;
+    return (long long) utils::to_float(s) * multiplier;
   }
-
-  return (long long) utils::to_float(s) * multiplier;
 }