<P>
<BR>
>Right. There should be no limit. The intention was to replace<BR>
>res->me and res->peer by a list. I guess this is what you have<BR>
>done, right?<BR>
><BR>
Initially, i thought of implementing this way. This would require<BR>
changes in the code at many places. So, I have implemented in different<BR>
way with minimal impact. Logic i followed is<BR>
<BR>
1) Getting the value from the command line when -h <argument> is <BR>
specified. It will be stored in "peer_host" global variable.<BR>
2) Added a new function called "find_peer_host()" in drbdadm_main.c <BR>
file. From adm_connect(), this new function is called with <BR>
res->all_hosts and "peer_host" as arguments to this new function.<BR>
It will compare the "peer_host" value with the hosts->name. If <BR>
found,then returns the pointer to that host otherwise NULL.<BR>
3) In adm_connect(), it is made sure that peer host will not be <BR>
local host and if -h option is not specified on the command line<BR>
then the last 'on' section in the 'resource' is selected as <BR>
peer host. This logic can be improved by using DEFAULT keyword<BR>
as you suggested below.<BR>
<BR>
For reference, i will send the two files (drbdadm_parser.c and<BR>
drbdadm_main.c). Please go through the code and let me know if i am<BR>
going wrong anywhere.<BR>
<BR>
>In case there is no '-h <peer-name>' option on the command line _AND_<BR>
>there are only two 'on' sections _AND_ on of the one sections matches<BR>
>my own local host name, then the peer is the other 'on' section.<BR>
><BR>
This is taken care in my code.<BR>
<BR>
>In order to specify a default peer, there should be an additional<BR>
>keyword. E.g. "default". That keyword might only be specified in<BR>
>two of the 'on' sections.<BR>
><BR>
I understood the above statement like this<BR>
<BR>
on node2 {<BR>
device /dev/drbd0;<BR>
disk /dev/loop0;<BR>
address 10.1.40.37:1234;<BR>
meta-disk internal;<BR>
default-peer yes; ---> new parameter added<BR>
}<BR>
<BR>
Is this way you are telling me to implement default peer host?<BR>
<BR>
<BR>
>I do not think it is a good idea to make the default selection<BR>
>dependend on the order of the sections in the config file, since<BR>
>we advise our users to use the same config file on all nodes of<BR>
>the cluster.<BR>
><BR>
<BR>
I think the above logic what i told will take care this also.<BR>
<BR>
Thanks,<BR>
Azeez<BR>
<BR>
</P>
<br><br>
<Table border=0 Width=644 Height=57 cellspacing=0 cellpadding=0 style='font-family:Verdana;font-size:11px;line-height:15px;'><TR><td><a href='http://adworks.rediff.com/cgi-bin/AdWorks/click.cgi/www.rediff.com/signature-home.htm/1050715198@Middle5/2092210_2084731/2092364/1?PARTNER=3&OAS_QUERY=null' target=new ><img src ='http://imadworks.rediff.com/cgi-bin/AdWorks/adimage.cgi/2092210_2084731/creative_2092364.gif' alt='IPL' border=0></a></td></TR></Table>