}
char *
-get_user_friendly_alias(char *wwid, char *file, char *prefix)
+get_user_friendly_alias(char *wwid, char *file, char *prefix,
+ int bindings_read_only)
{
char *alias;
int fd, scan_fd, id;
return NULL;
}
- if (!alias && can_write)
+ if (!alias && can_write && !bindings_read_only)
alias = allocate_binding(fd, wwid, id, prefix);
fclose(f);
"# alias wwid\n" \
"#\n"
-char *get_user_friendly_alias(char *wwid, char *file, char *prefix);
+char *get_user_friendly_alias(char *wwid, char *file, char *prefix,
+ int bindings_readonly);
char *get_user_friendly_wwid(char *alias, char *file);
conf->minio = 1000;
conf->max_fds = 0;
conf->bindings_file = DEFAULT_BINDINGS_FILE;
+ conf->bindings_read_only = 0;
conf->multipath_dir = set_default(DEFAULT_MULTIPATHDIR);
conf->flush_on_last_del = 0;
conf->attribute_flags = 0;
int rr_weight;
int no_path_retry;
int user_friendly_names;
+ int bindings_read_only;
int pg_timeout;
int max_fds;
int force_reload;
if (conf->user_friendly_names) {
select_alias_prefix(mp);
mp->alias = get_user_friendly_alias(mp->wwid,
- conf->bindings_file, mp->alias_prefix);
+ conf->bindings_file, mp->alias_prefix, conf->bindings_read_only);
}
if (mp->alias == NULL)
mp->alias = dm_get_name(mp->wwid);
condlog(0, "multipath tools need sysfs mounted");
exit(1);
}
- while ((arg = getopt(argc, argv, ":dhl::FfM:v:p:b:r")) != EOF ) {
+ while ((arg = getopt(argc, argv, ":dhl::FfM:v:p:b:Br")) != EOF ) {
switch(arg) {
case 1: printf("optarg : %s\n",optarg);
break;
case 'b':
conf->bindings_file = optarg;
break;
+ case 'B':
+ conf->bindings_read_only = 1;
+ break;
case 'd':
conf->dry_run = 1;
break;
.RB [\| \-v\ \c
.IR verbosity \|]
.RB [\| \-d \|]
-.RB [\| \-h | \-l | \-ll | \-f | \-F \|]
+.RB [\| \-h | \-l | \-ll | \-f | \-F | \-B \|]
.RB [\| \-p\ \c
.BR failover | multibus | group_by_serial | group_by_prio | group_by_node_name \|]
.RB [\| device \|]
.B \-F
flush all unused multipath device maps
.TP
+.B \-B
+treat the bindings file as read only
+.TP
.BI \-p " policy"
force maps to specified policy:
.RS 1.2i