cluster-devel.redhat.com archive mirror
 help / color / mirror / Atom feed
From: Fabio M. Di Nitto <fdinitto@redhat.com>
To: cluster-devel.redhat.com
Subject: [Cluster-devel] [PATCH] rgmanager: Present flags in clustat output
Date: Wed, 12 Jan 2011 18:06:59 +0100	[thread overview]
Message-ID: <4D2DDFB3.803@redhat.com> (raw)
In-Reply-To: <1294850669-10189-1-git-send-email-lhh@redhat.com>

ACK?ed

Fabio

On 1/12/2011 5:44 PM, Lon Hohberger wrote:
> This is a clean cherry-pick in to the RHEL6 branch
> 
> Resolves: rhbz#634298
> 
> Signed-off-by: Lon Hohberger <lhh@redhat.com>
> ---
>  rgmanager/src/utils/clustat.c |   31 +++++++++++++++++++++++++++++--
>  1 files changed, 29 insertions(+), 2 deletions(-)
> 
> diff --git a/rgmanager/src/utils/clustat.c b/rgmanager/src/utils/clustat.c
> index f56d3f5..b3a2b4f 100644
> --- a/rgmanager/src/utils/clustat.c
> +++ b/rgmanager/src/utils/clustat.c
> @@ -454,6 +454,7 @@ _txt_rg_state(rg_state_t *rs, cluster_member_list_t *members, int flags,
>  	      int svcsize, int nodesize, int statsize)
>  {
>  	char owner[MAXHOSTNAMELEN+1];
> +	char state_string[255] = "";
>  	char *name = rs->rs_name, *ptr;
>  	int l;
>  
> @@ -481,11 +482,22 @@ _txt_rg_state(rg_state_t *rs, cluster_member_list_t *members, int flags,
>  		snprintf(owner, sizeof(owner)-1, "%-.*s", nodesize,
>  			 my_memb_id_to_name(members, rs->rs_owner));
>  	}
> +
> +	/* Show a frozen service */
> +	if (rs->rs_flags & RG_FLAG_FROZEN) {
> +		snprintf(state_string, sizeof(state_string), 
> +			 "%-*.*s[Z]", statsize-3, statsize-3,
> +			 rg_state_str(rs->rs_state));
> +	} else {
> +		snprintf(state_string, sizeof(state_string),
> +			 "%-*.*s", statsize, statsize,
> +			 rg_state_str(rs->rs_state));
> +	}
>  	
>  	printf(" %-*.*s %-*.*s %-*.*s\n",
>  	       svcsize, svcsize, rs->rs_name,
>  	       nodesize, nodesize, owner,
> -	       statsize, statsize, rg_state_str(rs->rs_state));
> +	       statsize, statsize, state_string);
>  }
>  
>  
> @@ -493,10 +505,20 @@ static void
>  _txt_rg_state_v(rg_state_t *rs, cluster_member_list_t *members, int flags)
>  {
>  	time_t t;
> +	char flags_string[255] = "";
> +
> +	rg_flags_str(flags_string, sizeof(flags_string), rs->rs_flags,
> +		     (char *)", ");
>  
>  	printf("Service Name      : %s\n", rs->rs_name);
>  	printf("  Current State   : %s (%d)\n",
>  	       rg_state_str(rs->rs_state), rs->rs_state);
> +	if (rs->rs_flags)
> +		printf("  Flags           : %s (%d)\n",
> +		       flags_string, rs->rs_flags);
> +	else
> +		printf("  Flags           : none (%d)\n",
> +		       rs->rs_flags);
>  	printf("  Owner           : %s\n",
>  	       my_memb_id_to_name(members, rs->rs_owner));
>  	printf("  Last Owner      : %s\n",
> @@ -522,6 +544,7 @@ static void
>  xml_rg_state(rg_state_t *rs, cluster_member_list_t *members, int flags)
>  {
>  	char time_str[32];
> +	char flags_string[255] = "";
>  	int x;
>  	time_t t;
>  
> @@ -535,12 +558,16 @@ xml_rg_state(rg_state_t *rs, cluster_member_list_t *members, int flags)
>  		}
>  	}
>  
> -	printf("    <group name=\"%s\" state=\"%d\" state_str=\"%s\" "
> +	printf("    <group name=\"%s\" state=\"%d\" state_str=\"%s\""
> +	       " flags=\"%d\" flags_str=\"%s\""
>  	       " owner=\"%s\" last_owner=\"%s\" restarts=\"%d\""
>  	       " last_transition=\"%llu\" last_transition_str=\"%s\"/>\n",
>  	       rs->rs_name,
>  	       rs->rs_state,
>  	       rg_state_str(rs->rs_state),
> +	       rs->rs_flags,
> +	       rg_flags_str(flags_string, sizeof(flags_string),
> +			    rs->rs_flags, (char *)" "),
>  	       my_memb_id_to_name(members, rs->rs_owner),
>  	       my_memb_id_to_name(members, rs->rs_last_owner),
>  	       rs->rs_restarts,



      reply	other threads:[~2011-01-12 17:06 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-01-12 16:44 [Cluster-devel] [PATCH] rgmanager: Present flags in clustat output Lon Hohberger
2011-01-12 17:06 ` Fabio M. Di Nitto [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4D2DDFB3.803@redhat.com \
    --to=fdinitto@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).