"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.
* 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;
}
#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,
}
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;
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);
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);
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);
__GROUP,
__RECONFIGURE,
__STATS,
- __MULTIPATHS,
+ __TOPOLOGY,
};
#define LIST (1 << __LIST)
#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
}
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;
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));
}
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
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);
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);