<p>Corosync 2.0 is the new stable, the newer distros are packaging it rather than the flat iron branch</p>
<p> _<br>
/-\ ndrew Niemantsverdriet<br>
Linux Systems Administrator<br>
Rocky Mountain College<br>
Sent from my phone </p>
<div class="gmail_quote">On Jul 24, 2012 8:06 PM, "Yunkai Zhang" <<a href="mailto:yunkai.me@gmail.com">yunkai.me@gmail.com</a>> wrote:<br type="attribution"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Should we compatible with corosync 1.4.x? Or maybe we should update<br>
related manuals to tell user what have been changed.<br>
<br>
On Wed, Jul 25, 2012 at 1:06 AM, MORITA Kazutaka<br>
<<a href="mailto:morita.kazutaka@lab.ntt.co.jp">morita.kazutaka@lab.ntt.co.jp</a>> wrote:<br>
> It seems that CPG_* error codes are not defined in corosync 2.0.  This<br>
> patch uses CS_* instead of them.<br>
><br>
> Signed-off-by: MORITA Kazutaka <<a href="mailto:morita.kazutaka@lab.ntt.co.jp">morita.kazutaka@lab.ntt.co.jp</a>><br>
> ---<br>
>  sheep/cluster/corosync.c |   18 +++++++++---------<br>
>  1 files changed, 9 insertions(+), 9 deletions(-)<br>
><br>
> diff --git a/sheep/cluster/corosync.c b/sheep/cluster/corosync.c<br>
> index 8a65e89..b3f6471 100644<br>
> --- a/sheep/cluster/corosync.c<br>
> +++ b/sheep/cluster/corosync.c<br>
> @@ -186,9 +186,9 @@ static int send_message(enum corosync_message_type type,<br>
>  retry:<br>
>         ret = cpg_mcast_joined(cpg_handle, CPG_TYPE_AGREED, iov, iov_cnt);<br>
>         switch (ret) {<br>
> -       case CPG_OK:<br>
> +       case CS_OK:<br>
>                 break;<br>
> -       case CPG_ERR_TRY_AGAIN:<br>
> +       case CS_ERR_TRY_AGAIN:<br>
>                 dprintf("failed to send message: retrying\n");<br>
>                 sleep(1);<br>
>                 goto retry;<br>
> @@ -655,13 +655,13 @@ static int corosync_join(struct sd_node *myself,<br>
>  retry:<br>
>         ret = cpg_join(cpg_handle, &cpg_group);<br>
>         switch (ret) {<br>
> -       case CPG_OK:<br>
> +       case CS_OK:<br>
>                 break;<br>
> -       case CPG_ERR_TRY_AGAIN:<br>
> +       case CS_ERR_TRY_AGAIN:<br>
>                 dprintf("failed to join the sheepdog group: retrying\n");<br>
>                 sleep(1);<br>
>                 goto retry;<br>
> -       case CPG_ERR_SECURITY:<br>
> +       case CS_ERR_SECURITY:<br>
>                 eprintf("permission denied to join the sheepdog group\n");<br>
>                 return -1;<br>
>         default:<br>
> @@ -710,8 +710,8 @@ static void corosync_handler(int listen_fd, int events, void *data)<br>
>                 goto out;<br>
>         }<br>
><br>
> -       ret = cpg_dispatch(cpg_handle, CPG_DISPATCH_ALL);<br>
> -       if (ret != CPG_OK) {<br>
> +       ret = cpg_dispatch(cpg_handle, CS_DISPATCH_ALL);<br>
> +       if (ret != CS_OK) {<br>
>                 eprintf("cpg_dispatch returned %d\n", ret);<br>
>                 goto out;<br>
>         }<br>
> @@ -732,7 +732,7 @@ static int corosync_init(const char *option)<br>
>         };<br>
><br>
>         ret = cpg_initialize(&cpg_handle, &cb);<br>
> -       if (ret != CPG_OK) {<br>
> +       if (ret != CS_OK) {<br>
>                 eprintf("failed to initialize cpg (%d) - "<br>
>                         "is corosync running?\n", ret);<br>
>                 return -1;<br>
> @@ -754,7 +754,7 @@ static int corosync_init(const char *option)<br>
>         this_node.pid = getpid();<br>
><br>
>         ret = cpg_fd_get(cpg_handle, &fd);<br>
> -       if (ret != CPG_OK) {<br>
> +       if (ret != CS_OK) {<br>
>                 eprintf("failed to get cpg file descriptor (%d)\n", ret);<br>
>                 return -1;<br>
>         }<br>
> --<br>
> 1.7.2.5<br>
><br>
> --<br>
> sheepdog mailing list<br>
> <a href="mailto:sheepdog@lists.wpkg.org">sheepdog@lists.wpkg.org</a><br>
> <a href="http://lists.wpkg.org/mailman/listinfo/sheepdog" target="_blank">http://lists.wpkg.org/mailman/listinfo/sheepdog</a><br>
<br>
<br>
<br>
--<br>
Yunkai Zhang<br>
Work at Taobao<br>
--<br>
sheepdog mailing list<br>
<a href="mailto:sheepdog@lists.wpkg.org">sheepdog@lists.wpkg.org</a><br>
<a href="http://lists.wpkg.org/mailman/listinfo/sheepdog" target="_blank">http://lists.wpkg.org/mailman/listinfo/sheepdog</a><br>
</blockquote></div>