Respect "vendor" option in all places.

MFC after:	2 weeks
This commit is contained in:
Alexander Motin 2014-06-15 08:43:52 +00:00
parent e1f92ccc73
commit 5777f09019
2 changed files with 16 additions and 2 deletions

View File

@ -9303,6 +9303,7 @@ ctl_inquiry_evpd_devid(struct ctl_scsiio *ctsio, int alloc_len)
struct ctl_softc *ctl_softc;
struct ctl_lun *lun;
struct ctl_frontend *fe;
char *val;
#ifndef CTL_USE_BACKEND_SN
char tmpstr[32];
#endif /* CTL_USE_BACKEND_SN */
@ -9396,7 +9397,13 @@ ctl_inquiry_evpd_devid(struct ctl_scsiio *ctsio, int alloc_len)
*/
desc->id_type = SVPD_ID_PIV | SVPD_ID_ASSOC_LUN | SVPD_ID_TYPE_T10;
desc->length = sizeof(*t10id) + CTL_DEVID_LEN;
strncpy((char *)t10id->vendor, CTL_VENDOR, sizeof(t10id->vendor));
if (lun == NULL || (val = ctl_get_opt(lun->be_lun, "vendor")) == NULL) {
strncpy((char *)t10id->vendor, CTL_VENDOR, sizeof(t10id->vendor));
} else {
memset(t10id->vendor, ' ', sizeof(t10id->vendor));
strncpy(t10id->vendor, val,
min(sizeof(t10id->vendor), strlen(val)));
}
/*
* desc1 is for the WWPN which is a port asscociation.

View File

@ -2038,6 +2038,7 @@ cfiscsi_devid(struct ctl_scsiio *ctsio, int alloc_len)
struct scsi_vpd_id_t10 *t10id;
struct ctl_lun *lun;
const struct icl_pdu *request;
char *val;
size_t devid_len, wwpn_len;
lun = (struct ctl_lun *)ctsio->io_hdr.ctl_private[CTL_PRIV_LUN].ptr;
@ -2102,7 +2103,13 @@ cfiscsi_devid(struct ctl_scsiio *ctsio, int alloc_len)
desc->proto_codeset = (SCSI_PROTO_ISCSI << 4) | SVPD_ID_CODESET_ASCII;
desc->id_type = SVPD_ID_PIV | SVPD_ID_ASSOC_LUN | SVPD_ID_TYPE_T10;
desc->length = sizeof(*t10id) + CTL_DEVID_LEN;
strncpy((char *)t10id->vendor, CTL_VENDOR, sizeof(t10id->vendor));
if (lun == NULL || (val = ctl_get_opt(lun->be_lun, "vendor")) == NULL) {
strncpy((char *)t10id->vendor, CTL_VENDOR, sizeof(t10id->vendor));
} else {
memset(t10id->vendor, ' ', sizeof(t10id->vendor));
strncpy(t10id->vendor, val,
min(sizeof(t10id->vendor), strlen(val)));
}
/*
* If we've actually got a backend, copy the device id from the