From: Martin Wilck <mwilck@suse.com>
To: Christophe Varoqui <christophe.varoqui@opensvc.com>,
Hannes Reinecke <hare@suse.de>
Cc: dm-devel@redhat.com, Xose Vazquez Perez <xose.vazquez@gmail.com>
Subject: [PATCH v2 4/8] libmultipath: merge_hwe: fix queue_if_no_path logic
Date: Tue, 20 Jun 2017 13:46:10 +0200 [thread overview]
Message-ID: <20170620114614.26261-5-mwilck@suse.com> (raw)
In-Reply-To: <20170620114614.26261-1-mwilck@suse.com>
The logic applied here should match the logic in select_features().
This is achieved by calling reconcile_features_with_options().
Signed-off-by: Martin Wilck <mwilck@suse.com>
---
libmultipath/config.c | 20 +++++++++++---------
1 file changed, 11 insertions(+), 9 deletions(-)
diff --git a/libmultipath/config.c b/libmultipath/config.c
index 61bbba91..4f1ecee3 100644
--- a/libmultipath/config.c
+++ b/libmultipath/config.c
@@ -25,6 +25,7 @@
#include "prio.h"
#include "devmapper.h"
#include "mpath_cmd.h"
+#include "propsel.h"
static int
hwe_strmatch (struct hwentry *hwe1, struct hwentry *hwe2)
@@ -318,6 +319,8 @@ set_param_str(char * str)
static int
merge_hwe (struct hwentry * dst, struct hwentry * src)
{
+ int id_len;
+ char *id;
merge_str(vendor);
merge_str(product);
merge_str(revision);
@@ -353,15 +356,14 @@ merge_hwe (struct hwentry * dst, struct hwentry * src)
merge_num(san_path_err_forget_rate);
merge_num(san_path_err_recovery_time);
- /*
- * Make sure features is consistent with
- * no_path_retry
- */
- if (dst->no_path_retry == NO_PATH_RETRY_FAIL)
- remove_feature(&dst->features, "queue_if_no_path");
- else if (dst->no_path_retry != NO_PATH_RETRY_UNDEF)
- add_feature(&dst->features, "queue_if_no_path");
-
+ id_len = strlen(dst->vendor) + strlen(dst->product) + 2;
+ id = MALLOC(id_len);
+ if (id != NULL)
+ snprintf(id, id_len, "%s/%s", dst->vendor, dst->product);
+ reconcile_features_with_options(id, &dst->features,
+ &dst->no_path_retry,
+ &dst->retain_hwhandler);
+ FREE(id);
return 0;
}
--
2.13.1
next prev parent reply other threads:[~2017-06-20 11:46 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-06-20 11:46 [PATCH v2 0/8] multipath-tools: no_path_retry/queue_if_no_path logic Martin Wilck
2017-06-20 11:46 ` [PATCH v2 1/8] libmultipath: load_config: skip setting unnecessary defaults Martin Wilck
2017-06-20 14:36 ` Hannes Reinecke
2017-06-20 16:25 ` Benjamin Marzinski
2017-06-20 18:28 ` [PATCH] Clarify commit message in select_max_sectors_kb() Martin Wilck
2017-06-20 11:46 ` [PATCH v2 2/8] libmultipath: add/remove_feature: use const char* for feature Martin Wilck
2017-06-20 15:01 ` Hannes Reinecke
2017-06-20 11:46 ` [PATCH v2 3/8] libmultipath: clarify option conflicts for "features" Martin Wilck
2017-06-20 11:46 ` Martin Wilck [this message]
2017-06-20 11:46 ` [PATCH v2 5/8] libmultipath: assemble_map: fix queue_if_no_path logic Martin Wilck
2017-06-20 11:46 ` [PATCH v2 6/8] multipath.conf.5: document no_path_retry vs. queue_if_no_path Martin Wilck
2017-06-20 11:46 ` [PATCH v2 7/8] multipath.conf.5: Remove ??? and other minor fixes Martin Wilck
2017-06-20 11:46 ` [PATCH v2 8/8] libmultipath: add deprecated warning for some features settings Martin Wilck
2017-06-20 18:44 ` [PATCH v2 0/8] multipath-tools: no_path_retry/queue_if_no_path logic Benjamin Marzinski
2017-06-20 19:04 ` Martin Wilck
2017-06-20 21:54 ` Martin Wilck
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20170620114614.26261-5-mwilck@suse.com \
--to=mwilck@suse.com \
--cc=christophe.varoqui@opensvc.com \
--cc=dm-devel@redhat.com \
--cc=hare@suse.de \
--cc=xose.vazquez@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox