[Pacemaker] Pacemaker-1.1.4, when?
Andrew Beekhof
andrew at beekhof.net
Tue Nov 9 12:24:57 UTC 2010
On Tue, Nov 9, 2010 at 1:17 PM, Lars Kellogg-Stedman <lars at oddbit.com> wrote:
>> It seems however, that there is more interest in running 1.1 on EPEL5
>> than I previously realized.
>> We're going to try and figure out how to make it happen for 1.1.5
>
> There are a *lot* of people out here still on RHEL5-derived platforms!
> We're often restricted by organizational policy or by particular
> vendor software requirements. I would be very happy to see continued
> EPEL5 compatibility in the 1.1 series.
The following patch should be most of the solution.
If someone can finish it off and confirm it works, I'll make sure it
gets applied.
diff -r dd75da218e4f configure.ac
--- a/configure.ac Fri Oct 29 12:12:45 2010 +0200
+++ b/configure.ac Tue Nov 09 13:20:55 2010 +0100
@@ -654,7 +654,7 @@ AC_MSG_RESULT(using $GLIBCONFIG)
AC_CHECK_LIB(glib-2.0, g_hash_table_get_values)
if test "x$ac_cv_lib_glib_2_0_g_hash_table_get_values" != x""yes; then
- AC_MSG_ERROR(Your version of Glib is too old, you need at least 2.14)
+ AC_MSG_WARN(Your version of Glib is too old, you should have at least 2.14)
fi
#
diff -r dd75da218e4f include/crm/common/util.h
--- a/include/crm/common/util.h Fri Oct 29 12:12:45 2010 +0200
+++ b/include/crm/common/util.h Tue Nov 09 13:20:55 2010 +0100
@@ -298,4 +298,59 @@ extern int node_score_infinity;
extern xmlNode *create_operation_update(xmlNode *parent, lrm_op_t
*op, const char *caller_version, int target_rc, const char *origin,
int level);
extern void free_lrm_op(lrm_op_t *op);
+#if HAVE_LIBGLIB_2_0
+
+#else
+
+typedef struct fake_ghi
+{
+ int offset;
+ GHashTable *hash;
+ GList *values;
+
+} GHashTableIter;
+
+static inline g_hash_append_value(gpointer key, gpointer value,
gpointer user_data)
+{
+ GList *values = (GList *)*user_data;
+ values = g_list_append(values, value);
+}
+
+static inline GList *g_hash_table_get_values(GHashTable *hash_table);
+{
+ GList *values = NULL;
+ g_hash_table_foreach(hash_table, g_hash_append_value, &values);
+}
+
+static inline void g_hash_table_iter_init(GHashTableIter *iter,
GHashTable *hash_table)
+{
+ iter->offset = 0;
+ iter->hash = hash_table;
+
+ /* iter->values = g_hash_table_get_values(hash_table); */
+
+ /* We could cache the values, but then we need to clean up the list
+ * later which doesn't fit the glib2 API
+ * So instead we calculate it in _next() every time its needed
+ */
+}
+
+
+static inline gboolean g_hash_table_iter_next(GHashTableIter *iter,
gpointer *key, gpointer *value)
+{
+ GList *values = iter->values;
+ if(iter->values == NULL) {
+ values = g_hash_table_get_values(hash_table);
+ }
+
+ iter->offset++;
+ *value = g_list_nth_data(values, iter->offset);
+
+ if(iter->values == NULL) {
+ g_list_free(values);
+ }
+}
+
#endif
+
+#endif
More information about the Pacemaker
mailing list