* [Cluster-devel] [PATCH] rgmanager: Exit uncleanly only when CMAN_SHUTDOWN_ANYWAY is set
@ 2012-07-27 17:07 Ryan McCabe
2012-07-27 19:33 ` Fabio M. Di Nitto
0 siblings, 1 reply; 2+ messages in thread
From: Ryan McCabe @ 2012-07-27 17:07 UTC (permalink / raw)
To: cluster-devel.redhat.com
Only exit uncleanly when the CMAN_SHUTDOWN_ANYWAY flag is set in the
argument passed when handling the CMAN_REASON_TRY_SHUTDOWN event.
This fixes the case where args is 2, where we want to refuse to
shut down.
Resolves: rhbz#769730
Signed-off-by: Ryan McCabe <rmccabe@redhat.com>
---
rgmanager/src/clulib/msg_cluster.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/rgmanager/src/clulib/msg_cluster.c b/rgmanager/src/clulib/msg_cluster.c
index e864853..e4b6b39 100644
--- a/rgmanager/src/clulib/msg_cluster.c
+++ b/rgmanager/src/clulib/msg_cluster.c
@@ -211,7 +211,7 @@ poll_cluster_messages(int timeout)
if (cman_dispatch(ch, 0) < 0) {
process_cman_event(ch, NULL,
- CMAN_REASON_TRY_SHUTDOWN, 1);
+ CMAN_REASON_TRY_SHUTDOWN, CMAN_SHUTDOWN_ANYWAY);
}
ret = 0;
}
@@ -987,7 +987,9 @@ process_cman_event(cman_handle_t handle, void *private, int reason, int arg)
printf("EVENT: %p %p %d %d\n", handle, private, reason, arg);
#endif
- if (reason == CMAN_REASON_TRY_SHUTDOWN && !arg) {
+ if (reason == CMAN_REASON_TRY_SHUTDOWN &&
+ !(arg & CMAN_SHUTDOWN_ANYWAY))
+ {
cman_replyto_shutdown(handle, 0);
return;
}
--
1.7.11.2
^ permalink raw reply related [flat|nested] 2+ messages in thread
* [Cluster-devel] [PATCH] rgmanager: Exit uncleanly only when CMAN_SHUTDOWN_ANYWAY is set
2012-07-27 17:07 [Cluster-devel] [PATCH] rgmanager: Exit uncleanly only when CMAN_SHUTDOWN_ANYWAY is set Ryan McCabe
@ 2012-07-27 19:33 ` Fabio M. Di Nitto
0 siblings, 0 replies; 2+ messages in thread
From: Fabio M. Di Nitto @ 2012-07-27 19:33 UTC (permalink / raw)
To: cluster-devel.redhat.com
ACK
we will need an upstream/rhel6 equivalent too for this one. See my
comment in BZ.
Fabio
On 07/27/2012 07:07 PM, Ryan McCabe wrote:
> Only exit uncleanly when the CMAN_SHUTDOWN_ANYWAY flag is set in the
> argument passed when handling the CMAN_REASON_TRY_SHUTDOWN event.
>
> This fixes the case where args is 2, where we want to refuse to
> shut down.
>
> Resolves: rhbz#769730
>
> Signed-off-by: Ryan McCabe <rmccabe@redhat.com>
> ---
> rgmanager/src/clulib/msg_cluster.c | 6 ++++--
> 1 file changed, 4 insertions(+), 2 deletions(-)
>
> diff --git a/rgmanager/src/clulib/msg_cluster.c b/rgmanager/src/clulib/msg_cluster.c
> index e864853..e4b6b39 100644
> --- a/rgmanager/src/clulib/msg_cluster.c
> +++ b/rgmanager/src/clulib/msg_cluster.c
> @@ -211,7 +211,7 @@ poll_cluster_messages(int timeout)
>
> if (cman_dispatch(ch, 0) < 0) {
> process_cman_event(ch, NULL,
> - CMAN_REASON_TRY_SHUTDOWN, 1);
> + CMAN_REASON_TRY_SHUTDOWN, CMAN_SHUTDOWN_ANYWAY);
> }
> ret = 0;
> }
> @@ -987,7 +987,9 @@ process_cman_event(cman_handle_t handle, void *private, int reason, int arg)
> printf("EVENT: %p %p %d %d\n", handle, private, reason, arg);
> #endif
>
> - if (reason == CMAN_REASON_TRY_SHUTDOWN && !arg) {
> + if (reason == CMAN_REASON_TRY_SHUTDOWN &&
> + !(arg & CMAN_SHUTDOWN_ANYWAY))
> + {
> cman_replyto_shutdown(handle, 0);
> return;
> }
>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2012-07-27 19:33 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-07-27 17:07 [Cluster-devel] [PATCH] rgmanager: Exit uncleanly only when CMAN_SHUTDOWN_ANYWAY is set Ryan McCabe
2012-07-27 19:33 ` Fabio M. Di Nitto
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).