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

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