public inbox for cluster-cvs@sourceware.org help / color / mirror / Atom feed
From: Chris Feist <cfeist@fedoraproject.org> To: cluster-cvs-relay@redhat.com Subject: The tag: cmirror-kernel_0_1_17 has been created Date: Tue, 14 Oct 2008 19:47:00 -0000 [thread overview] Message-ID: <20081014192049.B4EF2C07B8@lists.fedorahosted.org> (raw) Gitweb: http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=5dc473236dc19be6295beb422b8732b684a1fde8 Commit: 5dc473236dc19be6295beb422b8732b684a1fde8 Parent: 1bdbccd4f017a628027644bf232910d0becd0579 Author: David Teigland <teigland@redhat.com> AuthorDate: Tue Oct 14 14:02:35 2008 -0500 Committer: David Teigland <teigland@redhat.com> CommitterDate: Tue Oct 14 14:04:06 2008 -0500 gfs_control: improve ls output copy what was done with fence_tool and dlm_tool. Signed-off-by: David Teigland <teigland@redhat.com> --- group/gfs_control/main.c | 114 +++++++++++++++++++++++++++++++--------------- group/tool/main.c | 11 ++++- 2 files changed, 86 insertions(+), 39 deletions(-) diff --git a/group/gfs_control/main.c b/group/gfs_control/main.c index 7b90987..4bfb392 100644 --- a/group/gfs_control/main.c +++ b/group/gfs_control/main.c @@ -169,58 +169,92 @@ void do_leave(char *table) fprintf(stderr, "gfs_controld leave error %d\n", rv); } -char *gfsc_mf_str(uint32_t flags) +char *mg_flags_str(uint32_t flags) { static char str[128]; + int i = 0; memset(str, 0, sizeof(str)); - if (flags & GFSC_MF_JOINING) - strcat(str, "joining "); - if (flags & GFSC_MF_LEAVING) - strcat(str, "leaving "); - if (flags & GFSC_MF_KERNEL_STOPPED) - strcat(str, "kernel_stopped "); - if (flags & GFSC_MF_KERNEL_MOUNT_DONE) - strcat(str, "kernel_mount_done "); - if (flags & GFSC_MF_KERNEL_MOUNT_ERROR) - strcat(str, "kernel_mount_error "); - if (flags & GFSC_MF_FIRST_RECOVERY_NEEDED) - strcat(str, "first_recovery_needed "); + if (flags & GFSC_MF_LOCAL_RECOVERY_BUSY) { + i++; + strcat(str, "recover"); + } + if (flags & GFSC_MF_FIRST_RECOVERY_NEEDED) { + strcat(str, i++ ? "," : ""); + strcat(str, "need_first"); + } + if (flags & GFSC_MF_KERNEL_MOUNT_ERROR) { + strcat(str, i++ ? "," : ""); + strcat(str, "error"); + } + if (flags & GFSC_MF_KERNEL_MOUNT_DONE) { + strcat(str, i++ ? "," : ""); + strcat(str, "mounted"); + } + if (flags & GFSC_MF_KERNEL_STOPPED) { + strcat(str, i++ ? "," : ""); + strcat(str, "blocked"); + } + if (flags & GFSC_MF_LEAVING) { + strcat(str, i++ ? "," : ""); + strcat(str, "leave"); + } + if (flags & GFSC_MF_JOINING) { + strcat(str, i++ ? "," : ""); + strcat(str, "join"); + } + + /* leave this one out, it will often be set and we don't need + to see it */ + /* if (flags & GFSC_MF_FIRST_RECOVERY_MSG) strcat(str, "first_recovery_msg "); - if (flags & GFSC_MF_LOCAL_RECOVERY_BUSY) - strcat(str, "local_recovery_busy "); - + */ return str; } -char *gfsc_nf_str(uint32_t flags) +char *node_mount_str(uint32_t flags) { static char str[128]; + int i = 0; memset(str, 0, sizeof(str)); - if (flags & GFSC_NF_MEMBER) - strcat(str, "member "); - if (flags & GFSC_NF_START) - strcat(str, "start "); - if (flags & GFSC_NF_DISALLOWED) - strcat(str, "disallowed "); - if (flags & GFSC_NF_KERNEL_MOUNT_DONE) - strcat(str, "kernel_mount_done "); - if (flags & GFSC_NF_KERNEL_MOUNT_ERROR) - strcat(str, "kernel_mount_error "); - if (flags & GFSC_NF_READONLY) - strcat(str, "readonly "); - if (flags & GFSC_NF_SPECTATOR) - strcat(str, "spectator "); - if (flags & GFSC_NF_CHECK_DLM) - strcat(str, "check_dlm "); + if (flags & GFSC_NF_KERNEL_MOUNT_DONE) { + i++; + strcat(str, "done"); + } + if (flags & GFSC_NF_KERNEL_MOUNT_ERROR) { + strcat(str, i++ ? "," : ""); + strcat(str, "error"); + } + if (flags & GFSC_NF_READONLY) { + strcat(str, i++ ? "," : ""); + strcat(str, "ro"); + } + if (flags & GFSC_NF_SPECTATOR) { + strcat(str, i++ ? "," : ""); + strcat(str, "spect"); + } + + if (!i) + strcat(str, "none"); + + /* ignoring CHECK_DLM */ return str; } +int member_int(struct gfsc_node *n) +{ + if (n->flags & GFSC_NF_DISALLOWED) + return -1; + if (n->flags & GFSC_NF_MEMBER) + return 1; + return 0; +} + char *condition_str(int cond) { switch (cond) { @@ -266,7 +300,7 @@ static void show_mg(struct gfsc_mountgroup *mg) printf("name %s\n", mg->name); printf("id 0x%08x\n", mg->global_id); printf("flags 0x%08x %s\n", - mg->flags, gfsc_mf_str(mg->flags)); + mg->flags, mg_flags_str(mg->flags)); printf("change member %d joined %d remove %d failed %d seq %d,%d\n", mg->cg_prev.member_count, mg->cg_prev.joined_count, mg->cg_prev.remove_count, mg->cg_prev.failed_count, @@ -318,9 +352,15 @@ static void show_all_nodes(int count, struct gfsc_node *nodes) int i; for (i = 0; i < count; i++) { - printf("nodeid %d jid %d add_seq %u rem_seq %u failed %d flags 0x%x %s\n", - n->nodeid, n->jid, n->added_seq, n->removed_seq, - n->failed_reason, n->flags, gfsc_nf_str(n->flags)); + printf("nodeid %d jid %d member %d failed %d start %d seq_add %u seq_rem %u mount %s\n", + n->nodeid, + n->jid, + member_int(n), + n->failed_reason, + (n->flags & GFSC_NF_START) ? 1 : 0, + n->added_seq, + n->removed_seq, + node_mount_str(n->flags)); n++; } } diff --git a/group/tool/main.c b/group/tool/main.c index 9feb36b..d7283a0 100644 --- a/group/tool/main.c +++ b/group/tool/main.c @@ -37,6 +37,7 @@ static int operation; static int opt_ind; static int verbose; static int all_daemons; +static int ls_all_nodes; static int print_header_done; @@ -84,6 +85,8 @@ static void print_usage(void) printf("\n"); printf("Options:\n"); printf(" -v Verbose output, extra event information\n"); + printf(" -a fence_tool ls; dlm_tool ls; gfs_control ls\n"); + printf(" -n Show all node information with -a\n"); printf(" -h Print this help, then exit\n"); printf(" -V Print program version information, then exit\n"); printf("\n"); @@ -103,7 +106,7 @@ static void print_usage(void) printf("\n"); } -#define OPTION_STRING "ahVv" +#define OPTION_STRING "ahVvn" static void decode_arguments(int argc, char **argv) { @@ -118,6 +121,10 @@ static void decode_arguments(int argc, char **argv) all_daemons = 1; break; + case 'n': + ls_all_nodes = 1; + break; + case 'v': verbose = 1; break; @@ -609,7 +616,7 @@ int main(int argc, char **argv) switch (operation) { case OP_LIST: if (all_daemons) { - if (verbose) { + if (verbose || ls_all_nodes) { system("fence_tool ls -n"); system("dlm_tool ls -n"); system("gfs_control ls -n");
reply other threads:[~2008-10-14 19:47 UTC|newest] Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=20081014192049.B4EF2C07B8@lists.fedorahosted.org \ --to=cfeist@fedoraproject.org \ --cc=cluster-cvs-relay@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: linkBe 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 read-only IMAP folder(s) and NNTP newsgroup(s).