[multipathd] change last CLI command syntax
authorChristophe Varoqui <root@xa-s05.(none)>
Fri, 16 Dec 2005 20:48:37 +0000 (21:48 +0100)
committerChristophe Varoqui <root@xa-s05.(none)>
Fri, 16 Dec 2005 20:48:37 +0000 (21:48 +0100)
"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.

libmultipath/configure.c
libmultipath/print.c
libmultipath/print.h
multipath/main.c
multipathd/cli.c
multipathd/cli.h
multipathd/cli_handlers.c
multipathd/cli_handlers.h
multipathd/main.c

index 2df0fc9..e79ff12 100644 (file)
@@ -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,
index 67a5a9e..0cdf936 100644 (file)
@@ -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;
index 81a18e1..d4145ce 100644 (file)
@@ -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);
index 77883ac..ebf45f8 100644 (file)
@@ -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);
index e3d7e34..fa24187 100644 (file)
@@ -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);
index 3bd7771..eec3f42 100644 (file)
@@ -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
 
index 262caea..db025b7 100644 (file)
@@ -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
index 5fbf022..dea061d 100644 (file)
@@ -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);
index 318428c..0770386 100644 (file)
@@ -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);