• R/O
  • SSH

pm_diskd: Commit

※ リポジトリは、pm-diskd ブランチが https://github.com/linux-ha-japan/pm_diskd-1.0 へ、pm-diskd-2.0ブランチが https://github.com/linux-ha-japan/pm_diskd へ移行しました。

Pacemaker 対応ディスク故障監視機能。

Pacemaker-1.0公式リポジトリのクローンに対し、パッチ作成用のブランチを作成して管理する。
ブランチ名: pm-diskd

初回 hg clone 実行後は、hg update -r pm-diskd を実行すること。

Heartbeat-2.1.4 用 hb-diskd(*) のPacemaker対応版
(*) http://sourceforge.jp/projects/linux-ha/releases/?package_id=10555


Commit MetaInfo

Revision9e27099ebeed15ed72629f7ffcfb19f1b7a36374 (tree)
Time2010-04-08 17:37:52
AuthorAndrew Beekhof <andrew@beek...>
CommiterAndrew Beekhof

Log Message

Medium: PE: Bug lf#2391 - Ensure important options (notify, unique, etc) are always exposed during resource operations

Change Summary

Incremental Difference

diff -r b68267dad625 -r 9e27099ebeed pengine/allocate.c
--- a/pengine/allocate.c Tue Mar 30 15:05:54 2010 +0200
+++ b/pengine/allocate.c Thu Apr 08 10:37:52 2010 +0200
@@ -53,6 +53,7 @@
5353 native_expand,
5454 complex_migrate_reload,
5555 complex_stonith_ordering,
56+ native_append_meta,
5657 },
5758 {
5859 group_merge_weights,
@@ -68,6 +69,7 @@
6869 group_expand,
6970 complex_migrate_reload,
7071 complex_stonith_ordering,
72+ group_append_meta,
7173 },
7274 {
7375 native_merge_weights,
@@ -83,6 +85,7 @@
8385 clone_expand,
8486 complex_migrate_reload,
8587 complex_stonith_ordering,
88+ clone_append_meta,
8689 },
8790 {
8891 native_merge_weights,
@@ -98,6 +101,7 @@
98101 clone_expand,
99102 complex_migrate_reload,
100103 complex_stonith_ordering,
104+ master_append_meta,
101105 }
102106 };
103107
diff -r b68267dad625 -r 9e27099ebeed pengine/allocate.h
--- a/pengine/allocate.h Tue Mar 30 15:05:54 2010 +0200
+++ b/pengine/allocate.h Thu Apr 08 10:37:52 2010 +0200
@@ -51,7 +51,7 @@
5151 void (*migrate_reload)(resource_t *, pe_working_set_t *);
5252 void (*stonith_ordering)(
5353 resource_t *, action_t *, pe_working_set_t *);
54-
54+ void (*append_meta)(resource_t *rsc, xmlNode *xml);
5555 };
5656
5757 extern GListPtr native_merge_weights(
@@ -82,6 +82,7 @@
8282 extern void complex_stonith_ordering(
8383 resource_t *rsc, action_t *stonith_op, pe_working_set_t *data_set);
8484 extern void complex_migrate_reload(resource_t *rsc, pe_working_set_t *data_set);
85+extern void native_append_meta(resource_t *rsc, xmlNode *xml);
8586
8687 extern GListPtr group_merge_weights(
8788 resource_t *rsc, const char *rhs, GListPtr nodes, const char *attr, int factor, gboolean allow_rollback);
@@ -100,6 +101,7 @@
100101 action_t *lh_action, resource_t *rsc, order_constraint_t *order);
101102 extern void group_rsc_location(resource_t *rsc, rsc_to_node_t *constraint);
102103 extern void group_expand(resource_t *rsc, pe_working_set_t *data_set);
104+extern void group_append_meta(resource_t *rsc, xmlNode *xml);
103105
104106 extern int clone_num_allowed_nodes(resource_t *rsc);
105107 extern node_t *clone_color(resource_t *rsc, pe_working_set_t *data_set);
@@ -118,6 +120,7 @@
118120 extern gboolean clone_create_probe(
119121 resource_t *rsc, node_t *node, action_t *complete, gboolean force,
120122 pe_working_set_t *data_set);
123+extern void clone_append_meta(resource_t *rsc, xmlNode *xml);
121124
122125 extern gboolean master_unpack(resource_t *rsc, pe_working_set_t *data_set);
123126 extern node_t *master_color(resource_t *rsc, pe_working_set_t *data_set);
@@ -126,6 +129,8 @@
126129 resource_t *rsc, pe_working_set_t *data_set);
127130 extern void master_rsc_colocation_rh(
128131 resource_t *lh_rsc, resource_t *rh_rsc, rsc_colocation_t *constraint);
132+extern void master_append_meta(resource_t *rsc, xmlNode *xml);
133+
129134
130135
131136 /* extern resource_object_functions_t resource_variants[]; */
diff -r b68267dad625 -r 9e27099ebeed pengine/clone.c
--- a/pengine/clone.c Tue Mar 30 15:05:54 2010 +0200
+++ b/pengine/clone.c Thu Apr 08 10:37:52 2010 +0200
@@ -1706,3 +1706,26 @@
17061706
17071707 return any_created;
17081708 }
1709+
1710+void clone_append_meta(resource_t *rsc, xmlNode *xml)
1711+{
1712+ char *name = NULL;
1713+ clone_variant_data_t *clone_data = NULL;
1714+ get_clone_variant_data(clone_data, rsc);
1715+
1716+ name = crm_meta_name(XML_RSC_ATTR_UNIQUE);
1717+ crm_xml_add(xml, name, is_set(rsc->flags, pe_rsc_unique)?"true":"false");
1718+ crm_free(name);
1719+
1720+ name = crm_meta_name(XML_RSC_ATTR_NOTIFY);
1721+ crm_xml_add(xml, name, is_set(rsc->flags, pe_rsc_notify)?"true":"false");
1722+ crm_free(name);
1723+
1724+ name = crm_meta_name(XML_RSC_ATTR_INCARNATION_MAX);
1725+ crm_xml_add_int(xml, name, clone_data->clone_max);
1726+ crm_free(name);
1727+
1728+ name = crm_meta_name(XML_RSC_ATTR_INCARNATION_NODEMAX);
1729+ crm_xml_add_int(xml, name, clone_data->clone_node_max);
1730+ crm_free(name);
1731+}
diff -r b68267dad625 -r 9e27099ebeed pengine/graph.c
--- a/pengine/graph.c Tue Mar 30 15:05:54 2010 +0200
+++ b/pengine/graph.c Thu Apr 08 10:37:52 2010 +0200
@@ -533,27 +533,11 @@
533533
534534 g_hash_table_foreach(action->meta, hash2metafield, args_xml);
535535 if(action->rsc != NULL) {
536- int lpc = 0;
537- char *value = NULL;
538- const char *key = NULL;
539- const char *meta_list[] = {
540- XML_RSC_ATTR_UNIQUE,
541- XML_RSC_ATTR_INCARNATION,
542- XML_RSC_ATTR_INCARNATION_MAX,
543- XML_RSC_ATTR_INCARNATION_NODEMAX,
544- XML_RSC_ATTR_MASTER_MAX,
545- XML_RSC_ATTR_MASTER_NODEMAX,
546- };
547-
548- for(lpc = 0; lpc < DIMOF(meta_list); lpc++) {
549- key = meta_list[lpc];
550- value = g_hash_table_lookup(action->rsc->meta, key);
551- if(value != NULL) {
552- char *key_copy = crm_strdup(key); /* fucking glib */
553- hash2metafield(key_copy, value, args_xml);
554- crm_free(key_copy);
555- }
556- }
536+ resource_t *parent = action->rsc;
537+ while(parent != NULL) {
538+ parent->cmds->append_meta(parent, args_xml);
539+ parent = parent->parent;
540+ }
557541 }
558542
559543 sorted_xml(args_xml, action_xml, FALSE);
diff -r b68267dad625 -r 9e27099ebeed pengine/group.c
--- a/pengine/group.c Tue Mar 30 15:05:54 2010 +0200
+++ b/pengine/group.c Thu Apr 08 10:37:52 2010 +0200
@@ -516,3 +516,7 @@
516516 clear_bit(rsc->flags, pe_rsc_merging);
517517 return nodes;
518518 }
519+
520+void group_append_meta(resource_t *rsc, xmlNode *xml)
521+{
522+}
diff -r b68267dad625 -r 9e27099ebeed pengine/master.c
--- a/pengine/master.c Tue Mar 30 15:05:54 2010 +0200
+++ b/pengine/master.c Thu Apr 08 10:37:52 2010 +0200
@@ -870,3 +870,20 @@
870870
871871 return;
872872 }
873+
874+void master_append_meta(resource_t *rsc, xmlNode *xml)
875+{
876+ char *name = NULL;
877+ clone_variant_data_t *clone_data = NULL;
878+ get_clone_variant_data(clone_data, rsc);
879+
880+ clone_append_meta(rsc, xml);
881+
882+ name = crm_meta_name(XML_RSC_ATTR_MASTER_MAX);
883+ crm_xml_add_int(xml, name, clone_data->master_max);
884+ crm_free(name);
885+
886+ name = crm_meta_name(XML_RSC_ATTR_MASTER_NODEMAX);
887+ crm_xml_add_int(xml, name, clone_data->master_node_max);
888+ crm_free(name);
889+}
diff -r b68267dad625 -r 9e27099ebeed pengine/native.c
--- a/pengine/native.c Tue Mar 30 15:05:54 2010 +0200
+++ b/pengine/native.c Thu Apr 08 10:37:52 2010 +0200
@@ -2205,3 +2205,15 @@
22052205 do_crm_log_unlikely(level+1, "%s nothing to do", rsc->id);
22062206 }
22072207 }
2208+
2209+void native_append_meta(resource_t *rsc, xmlNode *xml)
2210+{
2211+ char *value = g_hash_table_lookup(rsc->meta, XML_RSC_ATTR_INCARNATION);
2212+ if(value) {
2213+ char *name = NULL;
2214+ name = crm_meta_name(XML_RSC_ATTR_INCARNATION);
2215+ crm_xml_add(xml, name, value);
2216+ crm_free(name);
2217+ }
2218+}
2219+
Show on old repository browser