Skip to contentSkip to conversation

multipath: make sure all the hwe attributes get merged

PATCH In review Benjamin Marzinski 2 participants 2 messages Oct 5, 2011 Device mapper

lore
Share & tools
lore

Benjamin Marzinski

author maintainer
#0 lore raw

PATCH 1/1 multipath: make sure all the hwe attributes get merged

Not all of the hwe attributes were getting merged. Also, multipathd show config was putting an extra set of quotes around the entries in the devices section.

---
 libmultipath/config.c |    4 ++++
 libmultipath/print.c  |    2 +-
 2 files changed, 5 insertions(+), 1 deletion(-)
libmultipath/config.c +4 -0
Index: multipath-tools-110916/libmultipath/config.c
===================================================================
@@ -320,6 +320,10 @@ merge_hwe (struct hwentry * dst, struct
 	merge_num(no_path_retry);
 	merge_num(minio);
 	merge_num(minio_rq);
+	merge_num(pg_timeout);
+	merge_num(flush_on_last_del);
+	merge_num(fast_io_fail);
+	merge_num(dev_loss);
 
 	return 0;
 }
libmultipath/print.c +1 -1
Index: multipath-tools-110916/libmultipath/print.c
===================================================================
@@ -860,7 +860,7 @@ snprint_hwentry (char * buff, int len, s
 	if (fwd > len)
 		return len;
 	iterate_sub_keywords(rootkw, kw, i) {
-		fwd += snprint_keyword(buff + fwd, len - fwd, "\t\t%k \"%v\"\n",
+		fwd += snprint_keyword(buff + fwd, len - fwd, "\t\t%k %v\n",
 				kw, hwe);
 		if (fwd > len)
 			return len;
#1 lore raw
Quoted 4 lines · Benjamin Marzinski

Not all of the hwe attributes were getting merged. Also, multipathd show config was putting an extra set of quotes around the entries in the devices section.

Merged.

I haven't checked recently with arrays with whitespaces in their vendor/product/rev strings. I remember resorting to the value quoting because of those. Might be worth checking if the parser behaves now without the quotes.

Regards,
cvaroqui

Quoted 34 lines
---
 libmultipath/config.c |    4 ++++
 libmultipath/print.c  |    2 +-
 2 files changed, 5 insertions(+), 1 deletion(-)

Index: multipath-tools-110916/libmultipath/config.c
===================================================================

libmultipath/config.c +4 -0
@@ -320,6 +320,10 @@ merge_hwe (struct hwentry * dst, struct
 	merge_num(no_path_retry);
 	merge_num(minio);
 	merge_num(minio_rq);
+	merge_num(pg_timeout);
+	merge_num(flush_on_last_del);
+	merge_num(fast_io_fail);
+	merge_num(dev_loss);
 
 	return 0;
 }

Index: multipath-tools-110916/libmultipath/print.c
===================================================================

libmultipath/print.c +1 -1
@@ -860,7 +860,7 @@ snprint_hwentry (char * buff, int len, s
 	if (fwd > len)
 		return len;
 	iterate_sub_keywords(rootkw, kw, i) {
-		fwd += snprint_keyword(buff + fwd, len - fwd, "\t\t%k \"%v\"\n",
+		fwd += snprint_keyword(buff + fwd, len - fwd, "\t\t%k %v\n",
 				kw, hwe);
 		if (fwd > len)
 			return len;