Blame SOURCES/0126-RHBZ-1211383-alias-collision.patch

f20720
---
f20720
 libmultipath/config.c    |    4 ++++
f20720
 libmultipath/config.h    |    1 +
f20720
 libmultipath/configure.c |    3 +++
f20720
 libmultipath/dict.c      |   33 +++++++++++++++++++++++++++++++++
f20720
 4 files changed, 41 insertions(+)
f20720
f20720
Index: multipath-tools-130222/libmultipath/configure.c
f20720
===================================================================
f20720
--- multipath-tools-130222.orig/libmultipath/configure.c
f20720
+++ multipath-tools-130222/libmultipath/configure.c
f20720
@@ -422,6 +422,9 @@ select_action (struct multipath * mpp, v
f20720
 		condlog(2, "%s: unable to rename %s to %s (%s is used by %s)",
f20720
 			mpp->wwid, cmpp->alias, mpp->alias,
f20720
 			mpp->alias, cmpp_by_name->wwid);
f20720
+		/* reset alias to existing alias */
f20720
+		FREE(mpp->alias);
f20720
+		mpp->alias = STRDUP(cmpp->alias);
f20720
 		mpp->action = ACT_NOTHING;
f20720
 		return;
f20720
 	}
f20720
Index: multipath-tools-130222/libmultipath/config.c
f20720
===================================================================
f20720
--- multipath-tools-130222.orig/libmultipath/config.c
f20720
+++ multipath-tools-130222/libmultipath/config.c
f20720
@@ -675,6 +675,7 @@ load_config (char * file, struct udev *u
f20720
 	conf->processed_main_config = 0;
f20720
 	conf->retrigger_tries = DEFAULT_RETRIGGER_TRIES;
f20720
 	conf->retrigger_delay = DEFAULT_RETRIGGER_DELAY;
f20720
+	conf->new_bindings_in_boot = 0;
f20720
 
f20720
 	/*
f20720
 	 * preload default hwtable
f20720
@@ -794,6 +795,9 @@ load_config (char * file, struct udev *u
f20720
 	if (conf->ignore_new_boot_devs)
f20720
 		in_initrd();
f20720
 
f20720
+	if (conf->new_bindings_in_boot == 0 && in_initrd())
f20720
+		conf->bindings_read_only = 1;
f20720
+
f20720
 	return 0;
f20720
 out:
f20720
 	free_config(conf);
f20720
Index: multipath-tools-130222/libmultipath/config.h
f20720
===================================================================
f20720
--- multipath-tools-130222.orig/libmultipath/config.h
f20720
+++ multipath-tools-130222/libmultipath/config.h
f20720
@@ -141,6 +141,7 @@ struct config {
f20720
 	int delay_wait_checks;
f20720
 	int retrigger_tries;
f20720
 	int retrigger_delay;
f20720
+	int new_bindings_in_boot;
f20720
 	unsigned int version[3];
f20720
 
f20720
 	char * dev;
f20720
Index: multipath-tools-130222/libmultipath/dict.c
f20720
===================================================================
f20720
--- multipath-tools-130222.orig/libmultipath/dict.c
f20720
+++ multipath-tools-130222/libmultipath/dict.c
f20720
@@ -871,6 +871,29 @@ def_retrigger_delay_handler(vector strve
f20720
 	return 0;
f20720
 }
f20720
 
f20720
+static int
f20720
+def_new_bindings_in_boot_handler(vector strvec)
f20720
+{
f20720
+	char * buff;
f20720
+
f20720
+	buff = set_value(strvec);
f20720
+
f20720
+	if (!buff)
f20720
+		return 1;
f20720
+
f20720
+	if ((strlen(buff) == 2 && !strcmp(buff, "no")) ||
f20720
+	    (strlen(buff) == 1 && !strcmp(buff, "0")))
f20720
+		conf->new_bindings_in_boot = 0;
f20720
+	else if ((strlen(buff) == 3 && !strcmp(buff, "yes")) ||
f20720
+		 (strlen(buff) == 1 && !strcmp(buff, "1")))
f20720
+		conf->new_bindings_in_boot = 1;
f20720
+	else
f20720
+		conf->new_bindings_in_boot = 0;
f20720
+
f20720
+	FREE(buff);
f20720
+	return 0;
f20720
+}
f20720
+
f20720
 /*
f20720
  * blacklist block handlers
f20720
  */
f20720
@@ -3238,6 +3261,15 @@ snprint_def_retrigger_delay (char * buff
f20720
 }
f20720
 
f20720
 static int
f20720
+snprint_def_new_bindings_in_boot(char * buff, int len, void * data)
f20720
+{
f20720
+	if (conf->new_bindings_in_boot == 1)
f20720
+		return snprintf(buff, len, "yes");
f20720
+	else
f20720
+		return snprintf(buff, len, "no");
f20720
+}
f20720
+
f20720
+static int
f20720
 snprint_ble_simple (char * buff, int len, void * data)
f20720
 {
f20720
 	struct blentry * ble = (struct blentry *)data;
f20720
@@ -3313,6 +3345,7 @@ init_keywords(void)
f20720
 	install_keyword("delay_wait_checks", &def_delay_wait_checks_handler, &snprint_def_delay_wait_checks);
f20720
 	install_keyword("retrigger_tries", &def_retrigger_tries_handler, &snprint_def_retrigger_tries);
f20720
 	install_keyword("retrigger_delay", &def_retrigger_delay_handler, &snprint_def_retrigger_delay);
f20720
+	install_keyword("new_bindings_in_boot", &def_new_bindings_in_boot_handler, &snprint_def_new_bindings_in_boot);
f20720
 	__deprecated install_keyword("default_selector", &def_selector_handler, NULL);
f20720
 	__deprecated install_keyword("default_path_grouping_policy", &def_pgpolicy_handler, NULL);
f20720
 	__deprecated install_keyword("default_uid_attribute", &def_uid_attribute_handler, NULL);