}
static int
+mp_features_handler(vector strvec)
+{
+ struct mpentry * mpe = VECTOR_LAST_SLOT(conf->mptable);
+
+ if (!mpe)
+ return 1;
+
+ mpe->features = set_value(strvec);
+
+ if (!mpe->features)
+ return 1;
+
+ return 0;
+}
+
+static int
mp_flush_on_last_del_handler(vector strvec)
{
struct mpentry *mpe = VECTOR_LAST_SLOT(conf->mptable);
}
static int
+snprint_mp_features (char * buff, int len, void * data)
+{
+ struct mpentry * mpe = (struct mpentry *)data;
+
+ if (!mpe->features)
+ return 0;
+ if (strlen(mpe->features) == strlen(conf->features) &&
+ !strcmp(mpe->features, conf->features))
+ return 0;
+
+ return snprintf(buff, len, "%s", mpe->features);
+}
+
+static int
snprint_mp_flush_on_last_del (char * buff, int len, void * data)
{
struct mpentry * mpe = (struct mpentry *)data;
install_keyword("rr_min_io_rq", &mp_minio_rq_handler, &snprint_mp_rr_min_io_rq);
install_keyword("pg_timeout", &mp_pg_timeout_handler, &snprint_mp_pg_timeout);
install_keyword("flush_on_last_del", &mp_flush_on_last_del_handler, &snprint_mp_flush_on_last_del);
+ install_keyword("features", &mp_features_handler, &snprint_mp_features);
install_keyword("mode", &mp_mode_handler, &snprint_mp_mode);
install_keyword("uid", &mp_uid_handler, &snprint_mp_uid);
install_keyword("gid", &mp_gid_handler, &snprint_mp_gid);
extern int
select_features (struct multipath * mp)
{
+ struct mpentry * mpe;
+
+ if ((mpe = find_mpe(mp->wwid))) {
+ if (mpe->features) {
+ mp->features = mpe->features;
+ condlog(3, "%s: features = %s (LUN setting)",
+ mp->alias, mp->features);
+ return 0;
+ }
+ }
if (mp->hwe && mp->hwe->features) {
mp->features = mp->hwe->features;
condlog(3, "%s: features = %s (controller setting)",