<P>
<BR>
&gt;Right. There should be no limit. The intention was to replace<BR>
&gt;res-&gt;me and res-&gt;peer by a list. I guess this is what you have<BR>
&gt;done, right?<BR>
&gt;<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>
&nbsp;  1) Getting the value from the command line when -h &lt;argument&gt; is <BR>
&nbsp; &nbsp; &nbsp; specified. It will be stored in &quot;peer_host&quot; global variable.<BR>
&nbsp;  2) Added a new function called &quot;find_peer_host()&quot; in drbdadm_main.c <BR>
&nbsp; &nbsp; &nbsp; file. From adm_connect(), this new function is called with <BR>
&nbsp; &nbsp; &nbsp; res-&gt;all_hosts and &quot;peer_host&quot; as arguments to this new function.<BR>
&nbsp; &nbsp; &nbsp; It will compare the &quot;peer_host&quot; value with the hosts-&gt;name. If <BR>
&nbsp; &nbsp; &nbsp; found,then returns the pointer to that host otherwise NULL.<BR>
&nbsp;  3) In adm_connect(), it is made sure that peer host will not be <BR>
&nbsp; &nbsp; &nbsp; local host and if -h option is not specified on the command line<BR>
&nbsp; &nbsp; &nbsp; then the last 'on' section in the 'resource' is selected as <BR>
&nbsp; &nbsp; &nbsp; peer host. This logic can be improved by using DEFAULT keyword<BR>
&nbsp; &nbsp; &nbsp; 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>
&gt;In case there is no '-h &lt;peer-name&gt;' option on the command line _AND_<BR>
&gt;there are only two 'on' sections _AND_ on of the one sections matches<BR>
&gt;my own local host name, then the peer is the other 'on' section.<BR>
&gt;<BR>
 This is taken care in my code.<BR>
<BR>
&gt;In order to specify a default peer, there should be an additional<BR>
&gt;keyword. E.g. &quot;default&quot;. That keyword might only be specified in<BR>
&gt;two of the 'on' sections.<BR>
&gt;<BR>
I understood the above statement like this<BR>
<BR>
&nbsp; on node2 {<BR>
&nbsp; &nbsp;  device&nbsp; &nbsp; &nbsp; &nbsp; /dev/drbd0;<BR>
&nbsp; &nbsp;  disk&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; /dev/loop0;<BR>
&nbsp; &nbsp;  address&nbsp; &nbsp; &nbsp;  10.1.40.37:1234;<BR>
&nbsp; &nbsp;  meta-disk&nbsp; &nbsp;  internal;<BR>
&nbsp; &nbsp;  default-peer&nbsp; yes;&nbsp;  ---&gt; new parameter added<BR>
&nbsp; }<BR>
<BR>
Is this way you are telling me to implement default peer host?<BR>
<BR>
<BR>
&gt;I do not think it is a good idea to make the default selection<BR>
&gt;dependend on the order of the sections in the config file, since<BR>
&gt;we advise our users to use the same config file on all nodes of<BR>
&gt;the cluster.<BR>
&gt;<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>