[multipathd] 'show maps xxx' CLI tweaks
authorChristophe Varoqui <root@xa-s05.(none)>
Mon, 2 Jan 2006 10:24:16 +0000 (11:24 +0100)
committerChristophe Varoqui <root@xa-s05.(none)>
Mon, 2 Jan 2006 10:24:16 +0000 (11:24 +0100)
o rename PRINT_MAP_FAILBACK to PRINT_MAP_STATUS
o 'print maps' command renamed to 'print maps status'
o 'print maps' now use the PRINT_MAP_NAMES layout, ie name|dm_name|wwid
o remove the dm_name field from PRINT_MAP_STATUS and PRINT_MAP_STATS

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

index d4145ce..ea7f3ba 100644 (file)
@@ -1,8 +1,9 @@
 #define PRINT_PATH_LONG      "%w %i %d %D %p %t%T %s"
 #define PRINT_PATH_INDENT    " \\_ %i %d %D %t%T"
 #define PRINT_PATH_CHECKER   "%i %d %D %p %t%T %C"
-#define PRINT_MAP_FAILBACK   "%n %d %F %Q %N %t"
-#define PRINT_MAP_STATS      "%w %d %0 %1 %2 %3 %4"
+#define PRINT_MAP_STATUS     "%n %F %Q %N %t"
+#define PRINT_MAP_STATS      "%n %0 %1 %2 %3 %4"
+#define PRINT_MAP_NAMES      "%n %d %w"
 #define PRINT_PG_INDENT      "\\_ %s [prio=%p]%t"
 
 #define MAX_LINE_LEN  80
index a6b4f34..c1ac93a 100644 (file)
@@ -136,6 +136,7 @@ load_keys (void)
        r += add_key(keys, "multipath", MAP, 1);
        r += add_key(keys, "group", GROUP, 1);
        r += add_key(keys, "reconfigure", RECONFIGURE, 0);
+       r += add_key(keys, "status", STATUS, 0);
        r += add_key(keys, "stats", STATS, 0);
        r += add_key(keys, "topology", TOPOLOGY, 0);
 
index eec3f42..9c6b1fb 100644 (file)
@@ -13,6 +13,7 @@ enum {
        __MAP,
        __GROUP,
        __RECONFIGURE,
+       __STATUS,
        __STATS,
        __TOPOLOGY,
 };
@@ -31,6 +32,7 @@ enum {
 #define MAP            (1 << __MAP)
 #define GROUP          (1 << __GROUP)
 #define RECONFIGURE    (1 << __RECONFIGURE)
+#define STATUS         (1 << __STATUS)
 #define STATS          (1 << __STATS)
 #define TOPOLOGY       (1 << __TOPOLOGY)
 
index cdd4a20..49f2c88 100644 (file)
@@ -195,7 +195,17 @@ cli_list_maps (void * v, char ** reply, int * len, void * data)
 
        condlog(3, "list maps (operator)");
 
-       return show_maps(reply, len, vecs, PRINT_MAP_FAILBACK);
+       return show_maps(reply, len, vecs, PRINT_MAP_NAMES);
+}
+
+int
+cli_list_maps_status (void * v, char ** reply, int * len, void * data)
+{
+       struct vectors * vecs = (struct vectors *)data;
+
+       condlog(3, "list maps status (operator)");
+
+       return show_maps(reply, len, vecs, PRINT_MAP_STATUS);
 }
 
 int
@@ -203,7 +213,7 @@ cli_list_maps_stats (void * v, char ** reply, int * len, void * data)
 {
        struct vectors * vecs = (struct vectors *)data;
 
-       condlog(3, "list maps (operator)");
+       condlog(3, "list maps stats (operator)");
 
        return show_maps(reply, len, vecs, PRINT_MAP_STATS);
 }
index dea061d..b6a04b0 100644 (file)
@@ -1,5 +1,6 @@
 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_status (void * v, char ** reply, int * len, void * data);
 int cli_list_maps_stats (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);
index 0638b2a..85d1632 100644 (file)
@@ -989,6 +989,7 @@ uxlsnrloop (void * ap)
 
        add_handler(LIST+PATHS, cli_list_paths);
        add_handler(LIST+MAPS, cli_list_maps);
+       add_handler(LIST+MAPS+STATUS, cli_list_maps_status);
        add_handler(LIST+MAPS+STATS, cli_list_maps_stats);
        add_handler(LIST+MAPS+TOPOLOGY, cli_list_maps_topology);
        add_handler(LIST+MAP+TOPOLOGY, cli_list_map_topology);