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

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