[multipathd] add "show wildcards" cli command
[platform/upstream/multipath-tools.git] / multipathd / main.c
index f68dc41..84fb5c4 100644 (file)
@@ -121,7 +121,7 @@ coalesce_maps(struct vectors *vecs, vector nmpv)
                         * remove all current maps not allowed by the
                         * current configuration
                         */
-                       if (dm_flush_map(ompp->alias, DEFAULT_TARGET)) {
+                       if (dm_flush_map(ompp->alias)) {
                                condlog(0, "%s: unable to flush devmap",
                                        ompp->alias);
                                /*
@@ -159,7 +159,8 @@ sync_map_state(struct multipath *mpp)
 
        vector_foreach_slot (mpp->pg, pgp, i){
                vector_foreach_slot (pgp->paths, pp, j){
-                       if (pp->state <= PATH_UNCHECKED)
+                       if (pp->state == PATH_UNCHECKED || 
+                           pp->state == PATH_WILD)
                                continue;
                        if ((pp->dmstate == PSTATE_FAILED ||
                             pp->dmstate == PSTATE_UNDEF) &&
@@ -191,7 +192,7 @@ flush_map(struct multipath * mpp, struct vectors * vecs)
         * clear references to this map before flushing so we can ignore
         * the spurious uevent we may generate with the dm_flush_map call below
         */
-       if (dm_flush_map(mpp->alias, DEFAULT_TARGET)) {
+       if (dm_flush_map(mpp->alias)) {
                /*
                 * May not really be an error -- if the map was already flushed
                 * from the device mapper by dmsetup(8) for instance.
@@ -240,7 +241,7 @@ ev_add_map (struct sysfs_device * dev, struct vectors * vecs)
 
        map_present = dm_map_present(alias);
 
-       if (map_present && dm_type(alias, DEFAULT_TARGET) <= 0) {
+       if (map_present && dm_type(alias, TGT_MPATH) <= 0) {
                condlog(4, "%s: not a multipath map", alias);
                return 0;
        }
@@ -558,7 +559,7 @@ map_discovery (struct vectors * vecs)
        struct multipath * mpp;
        unsigned int i;
 
-       if (dm_get_maps(vecs->mpvec, "multipath"))
+       if (dm_get_maps(vecs->mpvec))
                return 1;
 
        vector_foreach_slot (vecs->mpvec, mpp, i)
@@ -691,7 +692,9 @@ uxlsnrloop (void * ap)
                return NULL;
 
        set_handler_callback(LIST+PATHS, cli_list_paths);
+       set_handler_callback(LIST+PATHS+FMT, cli_list_paths_fmt);
        set_handler_callback(LIST+MAPS, cli_list_maps);
+       set_handler_callback(LIST+STATUS, cli_list_status);
        set_handler_callback(LIST+MAPS+STATUS, cli_list_maps_status);
        set_handler_callback(LIST+MAPS+STATS, cli_list_maps_stats);
        set_handler_callback(LIST+MAPS+TOPOLOGY, cli_list_maps_topology);
@@ -700,6 +703,7 @@ uxlsnrloop (void * ap)
        set_handler_callback(LIST+CONFIG, cli_list_config);
        set_handler_callback(LIST+BLACKLIST, cli_list_blacklist);
        set_handler_callback(LIST+DEVICES, cli_list_devices);
+       set_handler_callback(LIST+WILDCARDS, cli_list_wildcards);
        set_handler_callback(ADD+PATH, cli_add_path);
        set_handler_callback(DEL+PATH, cli_del_path);
        set_handler_callback(ADD+MAP, cli_add_map);