[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

[dm-devel] patch to allow multipath(8) and multipathd(8) to pick up existing alias (if any) from dm device-name



Christophe,

This small patch should allow multipath(8) and multipathd(8) to acquire its
internal alias name from the device-mapper's device-name for the device if a
multipath specific alias (user friendly one or not) has __not__ been set.
Otherwise, assuming that a multipath device has been renamed beforehand by
someone invoking "dm_setup rename", simply invoking "multipath" changes the
device-mapper's device-name for the device back to the multipath assigned
UID name.

Ed

diff --git a/libmultipath/propsel.c b/libmultipath/propsel.c
index 79cee8b..003433e 100644
--- a/libmultipath/propsel.c
+++ b/libmultipath/propsel.c
@@ -15,6 +15,7 @@
 #include "pgpolicies.h"
 #include "alias.h"
 #include "defaults.h"
+#include "devmapper.h"
 
 pgpolicyfn *pgpolicies[] = {
 	NULL,
@@ -165,6 +166,9 @@ select_alias (struct multipath * mp)
 			mp->alias = get_user_friendly_alias(mp->wwid,
 					conf->bindings_file);
 		if (mp->alias == NULL)
+			if ((mp->alias = MALLOC(WWID_SIZE)) != NULL)
+				dm_get_name(mp->wwid, DEFAULT_TARGET,
mp->alias);
+		if (mp->alias == NULL)
 			mp->alias = mp->wwid;
 	}


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]