cluster/rgmanager include/list.h include/resli ...
CVSROOT: /cvs/cluster
Module name: cluster
Branch: RHEL4
Changes by: lhh at sourceware.org 2007-03-20 19:40:06
Modified files:
rgmanager/include: list.h reslist.h rgmanager/src/daemons: fo_domain.c reslist.c resrules.c restree.c test.c rgmanager/src/daemons/tests: delta-test002-test003.expected delta-test003-test004.expected delta-test004-test005.expected delta-test005-test006.expected delta-test006-test007.expected delta-test007-test008.expected delta-test008-test009.expected delta-test009-test010.expected delta-test010-test011.expected delta-test011-test012.expected delta-test012-test013.expected delta-test013-test014.expected delta-test014-test015.expected delta-test015-test016.expected test003.expected test004.expected test005.expected test006.expected test007.expected test008.expected test009.expected test010.expected test011.expected test012.expected test013.expected test014.expected test015.expected test016.expected
Log message:
Fix rgmanager's start/stop resource ordering for defined types & undefined types; update test run expected outputs
Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/rgmanager/include/list.h.diff?cvsroot=cluster&only_with_tag=RHEL4&r1=1.2.2.2&r2=1.2.2.3
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/rgmanager/include/reslist.h.diff?cvsroot=cluster&only_with_tag=RHEL4&r1=1.8.2.5&r2=1.8.2.6
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/rgmanager/src/daemons/fo_domain.c.diff?cvsroot=cluster&only_with_tag=RHEL4&r1=1.5.2.4&r2=1.5.2.5
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/rgmanager/src/daemons/reslist.c.diff?cvsroot=cluster&only_with_tag=RHEL4&r1=1.6.2.9&r2=1.6.2.10
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/rgmanager/src/daemons/resrules.c.diff?cvsroot=cluster&only_with_tag=RHEL4&r1=1.9.2.6&r2=1.9.2.7
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/rgmanager/src/daemons/restree.c.diff?cvsroot=cluster&only_with_tag=RHEL4&r1=1.10.2.13&r2=1.10.2.14
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/rgmanager/src/daemons/test.c.diff?cvsroot=cluster&only_with_tag=RHEL4&r1=1.1.2.3&r2=1.1.2.4
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/rgmanager/src/daemons/tests/delta-test002-test003.expected.diff?cvsroot=cluster&only_with_tag=RHEL4&r1=1.1.2.2&r2=1.1.2.3
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/rgmanager/src/daemons/tests/delta-test003-test004.expected.diff?cvsroot=cluster&only_with_tag=RHEL4&r1=1.1.2.2&r2=1.1.2.3
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/rgmanager/src/daemons/tests/delta-test004-test005.expected.diff?cvsroot=cluster&only_with_tag=RHEL4&r1=1.1.2.2&r2=1.1.2.3
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/rgmanager/src/daemons/tests/delta-test005-test006.expected.diff?cvsroot=cluster&only_with_tag=RHEL4&r1=1.1.2.2&r2=1.1.2.3
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/rgmanager/src/daemons/tests/delta-test006-test007.expected.diff?cvsroot=cluster&only_with_tag=RHEL4&r1=1.1.2.2&r2=1.1.2.3
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/rgmanager/src/daemons/tests/delta-test007-test008.expected.diff?cvsroot=cluster&only_with_tag=RHEL4&r1=1.1.2.2&r2=1.1.2.3
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/rgmanager/src/daemons/tests/delta-test008-test009.expected.diff?cvsroot=cluster&only_with_tag=RHEL4&r1=1.1.2.2&r2=1.1.2.3
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/rgmanager/src/daemons/tests/delta-test009-test010.expected.diff?cvsroot=cluster&only_with_tag=RHEL4&r1=1.1.2.2&r2=1.1.2.3
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/rgmanager/src/daemons/tests/delta-test010-test011.expected.diff?cvsroot=cluster&only_with_tag=RHEL4&r1=1.1.2.2&r2=1.1.2.3
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/rgmanager/src/daemons/tests/delta-test011-test012.expected.diff?cvsroot=cluster&only_with_tag=RHEL4&r1=1.1.2.2&r2=1.1.2.3
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/rgmanager/src/daemons/tests/delta-test012-test013.expected.diff?cvsroot=cluster&only_with_tag=RHEL4&r1=1.1.2.2&r2=1.1.2.3
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/rgmanager/src/daemons/tests/delta-test013-test014.expected.diff?cvsroot=cluster&only_with_tag=RHEL4&r1=1.1.2.2&r2=1.1.2.3
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/rgmanager/src/daemons/tests/delta-test014-test015.expected.diff?cvsroot=cluster&only_with_tag=RHEL4&r1=1.1.2.2&r2=1.1.2.3
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/rgmanager/src/daemons/tests/delta-test015-test016.expected.diff?cvsroot=cluster&only_with_tag=RHEL4&r1=1.1.2.2&r2=1.1.2.3
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/rgmanager/src/daemons/tests/test003.expected.diff?cvsroot=cluster&only_with_tag=RHEL4&r1=1.1.2.2&r2=1.1.2.3
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/rgmanager/src/daemons/tests/test004.expected.diff?cvsroot=cluster&only_with_tag=RHEL4&r1=1.1.2.2&r2=1.1.2.3
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/rgmanager/src/daemons/tests/test005.expected.diff?cvsroot=cluster&only_with_tag=RHEL4&r1=1.1.2.2&r2=1.1.2.3
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/rgmanager/src/daemons/tests/test006.expected.diff?cvsroot=cluster&only_with_tag=RHEL4&r1=1.1.2.2&r2=1.1.2.3
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/rgmanager/src/daemons/tests/test007.expected.diff?cvsroot=cluster&only_with_tag=RHEL4&r1=1.1.2.2&r2=1.1.2.3
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/rgmanager/src/daemons/tests/test008.expected.diff?cvsroot=cluster&only_with_tag=RHEL4&r1=1.1.2.2&r2=1.1.2.3
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/rgmanager/src/daemons/tests/test009.expected.diff?cvsroot=cluster&only_with_tag=RHEL4&r1=1.1.2.2&r2=1.1.2.3
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/rgmanager/src/daemons/tests/test010.expected.diff?cvsroot=cluster&only_with_tag=RHEL4&r1=1.1.2.2&r2=1.1.2.3
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/rgmanager/src/daemons/tests/test011.expected.diff?cvsroot=cluster&only_with_tag=RHEL4&r1=1.1.2.2&r2=1.1.2.3
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/rgmanager/src/daemons/tests/test012.expected.diff?cvsroot=cluster&only_with_tag=RHEL4&r1=1.1.2.2&r2=1.1.2.3
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/rgmanager/src/daemons/tests/test013.expected.diff?cvsroot=cluster&only_with_tag=RHEL4&r1=1.1.2.2&r2=1.1.2.3
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/rgmanager/src/daemons/tests/test014.expected.diff?cvsroot=cluster&only_with_tag=RHEL4&r1=1.1.2.2&r2=1.1.2.3
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/rgmanager/src/daemons/tests/test015.expected.diff?cvsroot=cluster&only_with_tag=RHEL4&r1=1.1.2.2&r2=1.1.2.3
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/rgmanager/src/daemons/tests/test016.expected.diff?cvsroot=cluster&only_with_tag=RHEL4&r1=1.1.2.2&r2=1.1.2.3
rgmanager/include/list.h +36 -3
@@ -29,6 +29,14 @@ } \ } while (0) + +#define list_prepend (list, newnode) \ +do { \ + list_insert(list, newnode); \ + *list = newnode; \ +} while (0) + +#define list_remove (list, oldnode) \ do { \ if (le(oldnode) == le(*list)) { \
@@ -46,6 +54,11 @@ } \ }while (0 ) +/* +list_do(list, node) { +stuff; +} while (!list_done(list, node)); + */#define list_do (list, curr) \ if (*list && (curr = *list)) do
@@ -53,9 +66,29 @@ (curr && (((curr = (void *)le (curr)->le_next)) && (curr == *list)))/* -list_do(list, node) { -stuff; -} while (!list_done(list, node)); +* list_for(list, tmp, counter) { +* stuff; +* } +* +* counter = # of items in list when done. +* * sets cnt to 0 before even checking list; +* * checks for valid list +* * traverses list, incrementing counter. If we get to the for loop, +* there must be at least one item in the list */ +#define list_for (list, curr, cnt) \ + if (!(cnt=0) && list && *list) \ + for (curr = *list; \ + (cnt == 0) || (curr != *list); \ + curr = (void*)le(curr)->le_next, \ + cnt++) + +#define list_for_rev (list, curr, cnt) \ + if (!(cnt=0) && list && *list) \ + for (curr = (void *)(le(*list)->le_prev); \ + (cnt == 0) || ((void *)curr != le(*list)->le_prev); \ + curr = (void*)(le(curr)->le_prev), \ + cnt++) +#endif
rgmanager/include/reslist.h +2 -1
@@ -79,9 +79,10 @@typedef struct _resource_child { -char rc_forbid;int rc_startlevel;int rc_stoplevel; +int rc_forbid; +int rc_flags;char *rc_name; }resource_child_t ;
rgmanager/src/daemons/fo_domain.c +3 -1
@@ -366,12 +366,14 @@ }#endif +if (!strlen (domainname)) +RETURN (FOD_BEST ); +/* * Ok, we've got a failover domain associated with the service. * Let's see if the domain actually exists... */ list_do(domains, fod) { -if (!strcasecmp (fod->fd_name, domainname)) { found =1 ;break ;
rgmanager/src/daemons/reslist.c +39 -4
56 lines not on this page · raw message
rgmanager/src/daemons/resrules.c +5 -2
@@ -529,11 +529,12 @@@param start Start level @param stop Stop level @param forbid Do NOT allow this child type to exist +@param flags set to 1 to note that it was defined inline @return 0 on success, nonzero on failure */ int store_childtype (resource_child_t **childp,char *name,int start,int stop, -int forbid) +int forbid,int flags) {int x =0 ;resource_child_t *child = *childp;
@@ -549,6 +550,7 @@ child[0 ].rc_startlevel = start; child[0 ].rc_stoplevel = stop; child[0 ].rc_forbid = forbid; + child[0 ].rc_flags = flags; child[1 ].rc_name =NULL ; *childp = child;
@@ -565,6 +567,7 @@ child[x].rc_startlevel = start; child[x].rc_stoplevel = stop; child[x].rc_forbid = forbid; + child[x].rc_flags = flags; child[x+1 ].rc_name =NULL ; *childp = child;
@@ -863,7 +866,7 @@*/ if (childname)store_childtype (&rr->rr_childtypes, childname, - startlevel, stoplevel, forbid); + startlevel, stoplevel, forbid,0 ); }return 0 ;
rgmanager/src/daemons/restree.c +455 -96
648 lines not on this page · raw message
rgmanager/src/daemons/test.c +7 -1
@@ -30,8 +30,8 @@"\trules\n\n" +void _no_op_mode(int);void malloc_dump_table (void ); -char *agentpath =RESOURCE_ROOTDIR ;
@@ -59,6 +59,7 @@ } +int test_func (int argc,char **argv) {
@@ -277,6 +278,11 @@shift (); ret =test_func (argc, argv); goto out; + }else if (!strcmp (argv[1 ],"noop" )) { +shift (); +_no_op_mode (1 ); + ret =test_func (argc, argv); + goto out; }else if (!strcmp (argv[1 ],"rules" )) {shift (); ret =rules_func (argc, argv);
rgmanager/src/daemons/tests/delta-test002-test003.expected +2 -0
@@ -11,6 +11,7 @@ Attributes: name = initscript [ primary unique ] file = /etc/init.d/httpd [ unique required ] + service_name [ inherit("service%name") ] Resource type: service [ROOT] Instances: 1/1
@@ -28,5 +29,6 @@ script [ NEEDSTART ] { name = "initscript"; file = "/etc/init.d/httpd"; + service_name = "test1"; } }
rgmanager/src/daemons/tests/delta-test003-test004.expected +4 -0
@@ -4,6 +4,7 @@ Attributes: name = initscript [ primary unique ] file = /etc/init.d/httpd [ unique required ] + service_name [ inherit("service%name") ] Resource type: service [ROOT] Instances: 1/1
@@ -17,6 +18,7 @@ Attributes: name = initscript [ primary unique ] file = /etc/init.d/sshd [ unique required ] + service_name [ inherit("service%name") ] Resource type: service [ROOT] Instances: 1/1
@@ -30,6 +32,7 @@ script [ NEEDSTOP ] { name = "initscript"; file = "/etc/init.d/httpd"; + service_name = "test1"; } } === New Resource Tree ===
@@ -38,5 +41,6 @@ script [ NEEDSTART ] { name = "initscript"; file = "/etc/init.d/sshd"; + service_name = "test1"; } }
rgmanager/src/daemons/tests/delta-test004-test005.expected +12 -6
@@ -4,6 +4,7 @@ Attributes: name = initscript [ primary unique ] file = /etc/init.d/sshd [ unique required ] + service_name [ inherit("service%name") ] Resource type: service [ROOT] Instances: 1/1
@@ -17,6 +18,13 @@ Attributes: name = initscript [ primary unique ] file = /etc/init.d/sshd [ unique required ] + service_name [ inherit("service%name") ] + +Resource type: service [ROOT] +Instances: 1/1 +Agent: service.sh +Attributes: + name = test1 [ primary unique required ] Resource type: ip [NEEDSTART] Instances: 1/1
@@ -24,12 +32,7 @@ Attributes: address = 192.168.1.2 [ primary unique ] monitor_link = 1 - -Resource type: service [ROOT] -Instances: 1/1 -Agent: service.sh -Attributes: - name = test1 [ primary unique required ] + nfslock [ inherit("service%nfslock") ] === Old Resource Tree === service {
@@ -37,6 +40,7 @@ script { name = "initscript"; file = "/etc/init.d/sshd"; + service_name = "test1"; } } === New Resource Tree ===
@@ -45,9 +49,11 @@ ip [ NEEDSTART ] { address = "192.168.1.2"; monitor_link = "1"; + nfslock = "(null)"; } script { name = "initscript"; file = "/etc/init.d/sshd"; + service_name = "test1"; } }
rgmanager/src/daemons/tests/delta-test005-test006.expected +20 -12
@@ -4,6 +4,13 @@ Attributes: name = initscript [ primary unique ] file = /etc/init.d/sshd [ unique required ] + service_name [ inherit("service%name") ] + +Resource type: service [ROOT] +Instances: 1/1 +Agent: service.sh +Attributes: + name = test1 [ primary unique required ] Resource type: ip [NEEDSTOP] Instances: 1/1
@@ -11,12 +18,7 @@ Attributes: address = 192.168.1.2 [ primary unique ] monitor_link = 1 - -Resource type: service [ROOT] -Instances: 1/1 -Agent: service.sh -Attributes: - name = test1 [ primary unique required ] + nfslock [ inherit("service%nfslock") ] === New Resource List === Resource type: script
@@ -24,6 +26,13 @@ Attributes: name = initscript [ primary unique ] file = /etc/init.d/sshd [ unique required ] + service_name [ inherit("service%name") ] + +Resource type: service [ROOT] +Instances: 1/1 +Agent: service.sh +Attributes: + name = test1 [ primary unique required ] Resource type: ip [NEEDSTART] Instances: 1/1
@@ -31,12 +40,7 @@ Attributes: address = 192.168.1.2 [ primary unique ] monitor_link = yes - -Resource type: service [ROOT] -Instances: 1/1 -Agent: service.sh -Attributes: - name = test1 [ primary unique required ] + nfslock [ inherit("service%nfslock") ] === Old Resource Tree === service {
@@ -44,10 +48,12 @@ ip [ NEEDSTOP ] { address = "192.168.1.2"; monitor_link = "1"; + nfslock = "(null)"; } script { name = "initscript"; file = "/etc/init.d/sshd"; + service_name = "test1"; } } === New Resource Tree ===
@@ -56,9 +62,11 @@ ip [ NEEDSTART ] { address = "192.168.1.2"; monitor_link = "yes"; + nfslock = "(null)"; } script { name = "initscript"; file = "/etc/init.d/sshd"; + service_name = "test1"; } }
rgmanager/src/daemons/tests/delta-test006-test007.expected +20 -12
@@ -4,6 +4,13 @@ Attributes: name = initscript [ primary unique ] file = /etc/init.d/sshd [ unique required ] + service_name [ inherit("service%name") ] + +Resource type: service [ROOT] +Instances: 1/1 +Agent: service.sh +Attributes: + name = test1 [ primary unique required ] Resource type: ip [NEEDSTOP] Instances: 1/1
@@ -11,12 +18,7 @@ Attributes: address = 192.168.1.2 [ primary unique ] monitor_link = yes - -Resource type: service [ROOT] -Instances: 1/1 -Agent: service.sh -Attributes: - name = test1 [ primary unique required ] + nfslock [ inherit("service%nfslock") ] === New Resource List === Resource type: script
@@ -24,6 +26,13 @@ Attributes: name = initscript [ primary unique ] file = /etc/init.d/sshd [ unique required ] + service_name [ inherit("service%name") ] + +Resource type: service [ROOT] +Instances: 1/1 +Agent: service.sh +Attributes: + name = test1 [ primary unique required ] Resource type: ip [NEEDSTART] Instances: 1/1
@@ -31,12 +40,7 @@ Attributes: address = 192.168.1.3 [ primary unique ] monitor_link = yes - -Resource type: service [ROOT] -Instances: 1/1 -Agent: service.sh -Attributes: - name = test1 [ primary unique required ] + nfslock [ inherit("service%nfslock") ] === Old Resource Tree === service {
@@ -44,10 +48,12 @@ ip [ NEEDSTOP ] { address = "192.168.1.2"; monitor_link = "yes"; + nfslock = "(null)"; } script { name = "initscript"; file = "/etc/init.d/sshd"; + service_name = "test1"; } } === New Resource Tree ===
@@ -56,9 +62,11 @@ ip [ NEEDSTART ] { address = "192.168.1.3"; monitor_link = "yes"; + nfslock = "(null)"; } script { name = "initscript"; file = "/etc/init.d/sshd"; + service_name = "test1"; } }
rgmanager/src/daemons/tests/delta-test007-test008.expected +28 -19
93 lines not on this page · raw message
rgmanager/src/daemons/tests/delta-test008-test009.expected +31 -20
112 lines not on this page · raw message
rgmanager/src/daemons/tests/delta-test009-test010.expected +36 -22
125 lines not on this page · raw message
rgmanager/src/daemons/tests/delta-test010-test011.expected +74 -42
220 lines not on this page · raw message
rgmanager/src/daemons/tests/delta-test011-test012.expected +101 -51
303 lines not on this page · raw message
rgmanager/src/daemons/tests/delta-test012-test013.expected +103 -51
311 lines not on this page · raw message
rgmanager/src/daemons/tests/delta-test013-test014.expected +138 -73
404 lines not on this page · raw message
rgmanager/src/daemons/tests/delta-test014-test015.expected +165 -87
342 lines not on this page · raw message
rgmanager/src/daemons/tests/delta-test015-test016.expected +165 -87
252 lines not on this page · raw message
rgmanager/src/daemons/tests/test003.expected +2 -0
Lines of this file are not shown. View the raw message.
rgmanager/src/daemons/tests/test004.expected +2 -0
Lines of this file are not shown. View the raw message.
rgmanager/src/daemons/tests/test005.expected +10 -6
Lines of this file are not shown. View the raw message.
rgmanager/src/daemons/tests/test006.expected +10 -6
Lines of this file are not shown. View the raw message.
rgmanager/src/daemons/tests/test007.expected +10 -6
Lines of this file are not shown. View the raw message.
rgmanager/src/daemons/tests/test008.expected +18 -13
Lines of this file are not shown. View the raw message.
rgmanager/src/daemons/tests/test009.expected +18 -12
Lines of this file are not shown. View the raw message.
rgmanager/src/daemons/tests/test010.expected +23 -15
Lines of this file are not shown. View the raw message.
rgmanager/src/daemons/tests/test011.expected +59 -35
94 lines not on this page · raw message
rgmanager/src/daemons/tests/test012.expected +61 -35
96 lines not on this page · raw message
rgmanager/src/daemons/tests/test013.expected +61 -35
96 lines not on this page · raw message
rgmanager/src/daemons/tests/test014.expected +96 -57
153 lines not on this page · raw message
rgmanager/src/daemons/tests/test015.expected +96 -57
153 lines not on this page · raw message
rgmanager/src/daemons/tests/test016.expected +96 -57
153 lines not on this page · raw message
The rest of this diff is not shown. View the raw message.
Part of the diff is not shown here. View the raw message.