From: Christophe Varoqui Date: Fri, 16 Dec 2005 20:48:37 +0000 (+0100) Subject: [multipathd] change last CLI command syntax X-Git-Tag: 0.4.7~68 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=d1e62b7249b8f91132979eabb997e74ccc849cc5;p=platform%2Fupstream%2Fmultipath-tools.git [multipathd] change last CLI command syntax "show multipaths" was confusing because "show maps" looks so awfuly close. Now : 1) "multipaths" is a "maps" synomym 2) "show multipaths topology" shows what "show multipaths" did There is a bit of function naming sanitizing in the lib too. --- diff --git a/libmultipath/configure.c b/libmultipath/configure.c index 2df0fc9..e79ff12 100644 --- a/libmultipath/configure.c +++ b/libmultipath/configure.c @@ -287,7 +287,7 @@ domap (struct multipath * mpp) * last chance to quit before touching the devmaps */ if (conf->dry_run) { - print_mp(mpp, conf->verbosity); + print_multipath_topology(mpp, conf->verbosity); return 0; } @@ -357,7 +357,7 @@ domap (struct multipath * mpp) #ifndef DAEMON dm_switchgroup(mpp->alias, mpp->bestpg); if (mpp->action != ACT_NOTHING) - print_mp(mpp, conf->verbosity); + print_multipath_topology(mpp, conf->verbosity); #else mpp->stat_map_loads++; condlog(2, "%s: load table [0 %llu %s %s]", mpp->alias, diff --git a/libmultipath/print.c b/libmultipath/print.c index 67a5a9e..0cdf936 100644 --- a/libmultipath/print.c +++ b/libmultipath/print.c @@ -625,16 +625,18 @@ snprint_pathgroup (char * line, int len, char * format, } extern void -print_mp (struct multipath * mpp, int verbosity) +print_multipath_topology (struct multipath * mpp, int verbosity) { char buff[MAX_LINE_LEN * MAX_LINES]; - snprint_mp(&buff[0], MAX_LINE_LEN * MAX_LINES, mpp, verbosity); + snprint_multipath_topology(&buff[0], MAX_LINE_LEN * MAX_LINES, + mpp, verbosity); printf("%s", buff); } extern int -snprint_mp (char * buff, int len, struct multipath * mpp, int verbosity) +snprint_multipath_topology (char * buff, int len, struct multipath * mpp, + int verbosity) { int j, i, fwd = 0; struct path * pp = NULL; diff --git a/libmultipath/print.h b/libmultipath/print.h index 81a18e1..d4145ce 100644 --- a/libmultipath/print.h +++ b/libmultipath/print.h @@ -37,9 +37,10 @@ int snprint_path_header (char *, int, char *); int snprint_multipath_header (char *, int, char *); int snprint_path (char *, int, char *, struct path *); int snprint_multipath (char *, int, char *, struct multipath *); -int snprint_mp (char *, int, struct multipath * mpp, int verbosity); +int snprint_multipath_topology (char *, int, struct multipath * mpp, + int verbosity); -void print_mp (struct multipath * mpp, int verbosity); +void print_multipath_topology (struct multipath * mpp, int verbosity); void print_path (struct path * pp, char * style); void print_multipath (struct multipath * mpp, char * style); void print_pathgroup (struct pathgroup * pgp, char * style); diff --git a/multipath/main.c b/multipath/main.c index 77883ac..ebf45f8 100644 --- a/multipath/main.c +++ b/multipath/main.c @@ -182,7 +182,7 @@ get_dm_mpvec (vector curmp, vector pathvec, char * refwwid) disassemble_status(mpp->status, mpp); if (conf->list) - print_mp(mpp, conf->verbosity); + print_multipath_topology(mpp, conf->verbosity); if (!conf->dry_run) reinstate_paths(mpp); diff --git a/multipathd/cli.c b/multipathd/cli.c index e3d7e34..fa24187 100644 --- a/multipathd/cli.c +++ b/multipathd/cli.c @@ -130,12 +130,13 @@ load_keys (void) r += add_key(keys, "fail", FAIL, 0); r += add_key(keys, "paths", PATHS, 0); r += add_key(keys, "maps", MAPS, 0); + r += add_key(keys, "multipaths", MAPS, 0); r += add_key(keys, "path", PATH, 1); r += add_key(keys, "map", MAP, 1); r += add_key(keys, "group", GROUP, 1); r += add_key(keys, "reconfigure", RECONFIGURE, 0); r += add_key(keys, "stats", STATS, 0); - r += add_key(keys, "multipaths", MULTIPATHS, 0); + r += add_key(keys, "topology", TOPOLOGY, 0); if (r) { free_keys(keys); diff --git a/multipathd/cli.h b/multipathd/cli.h index 3bd7771..eec3f42 100644 --- a/multipathd/cli.h +++ b/multipathd/cli.h @@ -14,7 +14,7 @@ enum { __GROUP, __RECONFIGURE, __STATS, - __MULTIPATHS, + __TOPOLOGY, }; #define LIST (1 << __LIST) @@ -32,7 +32,7 @@ enum { #define GROUP (1 << __GROUP) #define RECONFIGURE (1 << __RECONFIGURE) #define STATS (1 << __STATS) -#define MULTIPATHS (1 << __MULTIPATHS) +#define TOPOLOGY (1 << __TOPOLOGY) #define INITIAL_REPLY_LEN 1000 diff --git a/multipathd/cli_handlers.c b/multipathd/cli_handlers.c index 262caea..db025b7 100644 --- a/multipathd/cli_handlers.c +++ b/multipathd/cli_handlers.c @@ -55,7 +55,7 @@ show_paths (char ** r, int * len, struct vectors * vecs, char * style) } int -show_multipaths (char ** r, int * len, struct vectors * vecs) +show_maps_topology (char ** r, int * len, struct vectors * vecs) { int i; struct multipath * mpp; @@ -73,8 +73,8 @@ show_multipaths (char ** r, int * len, struct vectors * vecs) c = reply; vector_foreach_slot(vecs->mpvec, mpp, i) - c += snprint_mp(c, reply + maxlen - c, - mpp, 2); + c += snprint_multipath_topology(c, reply + maxlen - c, + mpp, 2); again = ((c - reply) == (maxlen - 1)); @@ -98,13 +98,13 @@ cli_list_paths (void * v, char ** reply, int * len, void * data) } int -cli_list_multipaths (void * v, char ** reply, int * len, void * data) +cli_list_maps_topology (void * v, char ** reply, int * len, void * data) { struct vectors * vecs = (struct vectors *)data; condlog(3, "list multipaths (operator)"); - return show_multipaths(reply, len, vecs); + return show_maps_topology(reply, len, vecs); } int diff --git a/multipathd/cli_handlers.h b/multipathd/cli_handlers.h index 5fbf022..dea061d 100644 --- a/multipathd/cli_handlers.h +++ b/multipathd/cli_handlers.h @@ -1,8 +1,8 @@ int cli_list_paths (void * v, char ** reply, int * len, void * data); int cli_list_maps (void * v, char ** reply, int * len, void * data); int cli_list_maps_stats (void * v, char ** reply, int * len, void * data); -int cli_list_multipath (void * v, char ** reply, int * len, void * data); -int cli_list_multipaths (void * v, char ** reply, int * len, void * data); +int cli_list_map_topology (void * v, char ** reply, int * len, void * data); +int cli_list_maps_topology (void * v, char ** reply, int * len, void * data); int cli_add_path (void * v, char ** reply, int * len, void * data); int cli_del_path (void * v, char ** reply, int * len, void * data); int cli_add_map (void * v, char ** reply, int * len, void * data); diff --git a/multipathd/main.c b/multipathd/main.c index 318428c..0770386 100644 --- a/multipathd/main.c +++ b/multipathd/main.c @@ -998,7 +998,7 @@ uxlsnrloop (void * ap) add_handler(LIST+PATHS, cli_list_paths); add_handler(LIST+MAPS, cli_list_maps); add_handler(LIST+MAPS+STATS, cli_list_maps_stats); - add_handler(LIST+MULTIPATHS, cli_list_multipaths); + add_handler(LIST+MAPS+TOPOLOGY, cli_list_maps_topology); add_handler(ADD+PATH, cli_add_path); add_handler(DEL+PATH, cli_del_path); add_handler(ADD+MAP, cli_add_map);