summaryrefslogtreecommitdiffstats
path: root/usr.sbin/ctld
diff options
context:
space:
mode:
Diffstat (limited to 'usr.sbin/ctld')
-rw-r--r--usr.sbin/ctld/kernel.c28
1 files changed, 13 insertions, 15 deletions
diff --git a/usr.sbin/ctld/kernel.c b/usr.sbin/ctld/kernel.c
index 0225691..3c958c8 100644
--- a/usr.sbin/ctld/kernel.c
+++ b/usr.sbin/ctld/kernel.c
@@ -113,7 +113,6 @@ struct cctl_lun {
char *serial_number;
char *device_id;
char *cfiscsi_target;
- char *cfiscsi_target_alias;
int cfiscsi_lun;
STAILQ_HEAD(,cctl_lun_nv) attr_list;
STAILQ_ENTRY(cctl_lun) links;
@@ -230,9 +229,6 @@ cctl_end_element(void *user_data, const char *name)
} else if (strcmp(name, "cfiscsi_target") == 0) {
cur_lun->cfiscsi_target = str;
str = NULL;
- } else if (strcmp(name, "cfiscsi_target_alias") == 0) {
- cur_lun->cfiscsi_target_alias = str;
- str = NULL;
} else if (strcmp(name, "cfiscsi_lun") == 0) {
cur_lun->cfiscsi_lun = strtoul(str, NULL, 0);
} else if (strcmp(name, "lun") == 0) {
@@ -640,17 +636,6 @@ kernel_lun_add(struct lun *lun)
assert(lo != NULL);
}
- if (lun->l_target->t_alias != NULL) {
- lo = lun_option_find(lun, "cfiscsi_target_alias");
- if (lo != NULL) {
- lun_option_set(lo, lun->l_target->t_alias);
- } else {
- lo = lun_option_new(lun, "cfiscsi_target_alias",
- lun->l_target->t_alias);
- assert(lo != NULL);
- }
- }
-
asprintf(&tmp, "%d", lun->l_lun);
if (tmp == NULL)
log_errx(1, "asprintf");
@@ -664,6 +649,19 @@ kernel_lun_add(struct lun *lun)
assert(lo != NULL);
}
+ asprintf(&tmp, "%s,lun,%d", lun->l_target->t_name, lun->l_lun);
+ if (tmp == NULL)
+ log_errx(1, "asprintf");
+ lo = lun_option_find(lun, "scsiname");
+ if (lo != NULL) {
+ lun_option_set(lo, tmp);
+ free(tmp);
+ } else {
+ lo = lun_option_new(lun, "scsiname", tmp);
+ free(tmp);
+ assert(lo != NULL);
+ }
+
num_options = 0;
TAILQ_FOREACH(lo, &lun->l_options, lo_next)
num_options++;
OpenPOWER on IntegriCloud