#include <switchgroup.h>
#include <sysfs/libsysfs.h>
#include <print.h>
+#include <alias.h>
#include "main.h"
#include "pgpolicies.h"
if (!pp)
return NULL;
- if(safe_sprintf(pp->dev, "%s", buff)) {
- fprintf(stderr, "pp->dev too small\n");
- exit(1);
- }
+ strncpy(pp->dev, buff, FILE_NAME_SIZE);
+
if (pathinfo(pp, conf->hwtable, DI_SYSFS | DI_WWID))
return NULL;
*/
refwwid = get_mpe_wwid(conf->dev);
- if (refwwid)
- return STRDUP(refwwid);
-
/*
- * or directly a wwid
+ * or a binding
*/
- refwwid = MALLOC(WWID_SIZE);
+ if (!refwwid)
+ refwwid = get_user_friendly_wwid(conf->dev);
+ /*
+ * or directly a wwid
+ */
if (!refwwid)
- return NULL;
+ refwwid = conf->dev;
- strncpy(refwwid, conf->dev, WWID_SIZE);
- return refwwid;
+ return STRDUP(refwwid);
}
return NULL;
}
if (conf->dev && blacklist(conf->blist, conf->dev))
goto out;
+ /*
+ * scope limiting must be translated into a wwid
+ * failing the translation is fatal (by policy)
+ */
+ if (conf->dev) {
+ refwwid = get_refwwid(pathvec);
+
+ if (!refwwid) {
+ condlog(3, "scope is nul");
+ goto out;
+ }
+ }
+
condlog(3, "load path identifiers cache");
cache_load(pathvec);
print_all_paths(pathvec);
}
- /*
- * scope limiting must be translated into a wwid
- * failing the translation is fatal (by policy)
- */
- if (conf->dev) {
- refwwid = get_refwwid(pathvec);
-
- if (!refwwid) {
- condlog(3, "scope is nul");
- goto out;
- }
- }
-
get_path_layout(&pl, pathvec);
if (get_dm_mpvec(curmp, pathvec, refwwid))