diff options
author | Nattuvetty Bhavyan <Nattuvetty.Bhavyan@Sun.COM> | 2009-07-17 11:20:16 -0700 |
---|---|---|
committer | Nattuvetty Bhavyan <Nattuvetty.Bhavyan@Sun.COM> | 2009-07-17 11:20:16 -0700 |
commit | 2f624233c43c1f4fe0d930648d6ece6fffe7aa49 (patch) | |
tree | acf41e00b0b469235feff513fbd6f68acd96fb3e /usr/src/lib/libstmf | |
parent | ccd826d5ed39105e7097be686438edfdba1506be (diff) | |
download | illumos-joyent-2f624233c43c1f4fe0d930648d6ece6fffe7aa49.tar.gz |
6812611 Add Management Network Address VPD (85h) support to sbd
6856759 groupMemberListIoctl() frees memory it hasn't allocated
6855914 fw_63 iSCSI failing SCSI compliance WHQL test
6840755 page_length for VPD page 80 isn't set for all conditions in sbd inquiry handler
Diffstat (limited to 'usr/src/lib/libstmf')
-rw-r--r-- | usr/src/lib/libstmf/common/libstmf.h | 1 | ||||
-rw-r--r-- | usr/src/lib/libstmf/common/libstmf_impl.h | 2 | ||||
-rw-r--r-- | usr/src/lib/libstmf/common/stmf.c | 67 |
3 files changed, 64 insertions, 6 deletions
diff --git a/usr/src/lib/libstmf/common/libstmf.h b/usr/src/lib/libstmf/common/libstmf.h index 7394e00490..cf926e637b 100644 --- a/usr/src/lib/libstmf/common/libstmf.h +++ b/usr/src/lib/libstmf/common/libstmf.h @@ -129,6 +129,7 @@ enum { STMF_LU_PROP_FILENAME, STMF_LU_PROP_GUID, STMF_LU_PROP_META_FILENAME, + STMF_LU_PROP_MGMT_URL, STMF_LU_PROP_NEW, STMF_LU_PROP_SIZE, STMF_LU_PROP_WRITE_PROTECT, diff --git a/usr/src/lib/libstmf/common/libstmf_impl.h b/usr/src/lib/libstmf/common/libstmf_impl.h index cd32c932e4..5c6e0ae9b3 100644 --- a/usr/src/lib/libstmf/common/libstmf_impl.h +++ b/usr/src/lib/libstmf/common/libstmf_impl.h @@ -55,6 +55,8 @@ typedef struct _diskResource { uint32_t companyId; boolean_t luAliasValid; char luAlias[256]; + boolean_t luMgmtUrlValid; + char luMgmtUrl[1024]; boolean_t vidValid; char vid[8]; boolean_t pidValid; diff --git a/usr/src/lib/libstmf/common/stmf.c b/usr/src/lib/libstmf/common/stmf.c index b75fdd4e38..7e8fa6c083 100644 --- a/usr/src/lib/libstmf/common/stmf.c +++ b/usr/src/lib/libstmf/common/stmf.c @@ -1078,6 +1078,7 @@ createDiskLu(diskResource *disk, stmfGuid *createdGuid) int metaFileNameLen = 0; int serialNumLen = 0; int luAliasLen = 0; + int luMgmtUrlLen = 0; int sluBufSize = 0; int bufOffset = 0; int fd = 0; @@ -1117,6 +1118,11 @@ createDiskLu(diskResource *disk, stmfGuid *createdGuid) sluBufSize += luAliasLen + 1; } + if (disk->luMgmtUrlValid) { + luMgmtUrlLen = strlen(disk->luMgmtUrl); + sluBufSize += luMgmtUrlLen + 1; + } + /* * 8 is the size of the buffer set aside for * concatenation of variable length fields @@ -1161,6 +1167,14 @@ createDiskLu(diskResource *disk, stmfGuid *createdGuid) bufOffset += luAliasLen + 1; } + if (disk->luMgmtUrlValid) { + sbdLu->slu_mgmt_url_valid = 1; + sbdLu->slu_mgmt_url_off = bufOffset; + bcopy(disk->luMgmtUrl, &(sbdLu->slu_buf[bufOffset]), + luMgmtUrlLen + 1); + bufOffset += luMgmtUrlLen + 1; + } + if (disk->luSizeValid) { sbdLu->slu_lu_size_valid = 1; sbdLu->slu_lu_size = disk->luSize; @@ -1665,6 +1679,7 @@ validateModifyDiskProp(uint32_t prop) switch (prop) { case STMF_LU_PROP_ALIAS: case STMF_LU_PROP_SIZE: + case STMF_LU_PROP_MGMT_URL: case STMF_LU_PROP_WRITE_PROTECT: case STMF_LU_PROP_WRITE_CACHE_DISABLE: return (STMF_STATUS_SUCCESS); @@ -1680,6 +1695,7 @@ modifyDiskLu(diskResource *disk, stmfGuid *luGuid, const char *fname) { int ret = STMF_STATUS_SUCCESS; int luAliasLen = 0; + int luMgmtUrlLen = 0; int mluBufSize = 0; int bufOffset = 0; int fd = 0; @@ -1710,6 +1726,11 @@ modifyDiskLu(diskResource *disk, stmfGuid *luGuid, const char *fname) mluBufSize += luAliasLen + 1; } + if (disk->luMgmtUrlValid) { + luMgmtUrlLen = strlen(disk->luMgmtUrl); + mluBufSize += luMgmtUrlLen + 1; + } + /* * 8 is the size of the buffer set aside for * concatenation of variable length fields @@ -1732,6 +1753,14 @@ modifyDiskLu(diskResource *disk, stmfGuid *luGuid, const char *fname) bufOffset += luAliasLen + 1; } + if (disk->luMgmtUrlValid) { + sbdLu->mlu_mgmt_url_valid = 1; + sbdLu->mlu_mgmt_url_off = bufOffset; + bcopy(disk->luMgmtUrl, &(sbdLu->mlu_buf[bufOffset]), + luMgmtUrlLen + 1); + bufOffset += luMgmtUrlLen + 1; + } + if (disk->luSizeValid) { sbdLu->mlu_lu_size_valid = 1; sbdLu->mlu_lu_size = disk->luSize; @@ -2123,6 +2152,16 @@ loadDiskPropsFromDriver(luResourceImpl *hdl, sbd_lu_props_t *sbdProps) diskLu->serialNum, sbdProps->slp_serial_size); } + if (sbdProps->slp_mgmt_url_valid) { + diskLu->luMgmtUrlValid = B_TRUE; + if (strlcpy(diskLu->luMgmtUrl, + (char *)&(sbdProps->slp_buf[sbdProps->slp_mgmt_url_off]), + sizeof (diskLu->luMgmtUrl)) >= + sizeof (diskLu->luMgmtUrl)) { + return (STMF_STATUS_ERROR); + } + } + if (sbdProps->slp_alias_valid) { diskLu->luAliasValid = B_TRUE; if (strlcpy(diskLu->luAlias, @@ -2250,6 +2289,16 @@ getDiskProp(luResourceImpl *hdl, uint32_t prop, char *propVal, size_t *propLen) return (STMF_ERROR_INVALID_ARG); } break; + case STMF_LU_PROP_MGMT_URL: + if (diskLu->luMgmtUrlValid == B_FALSE) { + return (STMF_ERROR_NO_PROP); + } + if ((reqLen = strlcpy(propVal, diskLu->luMgmtUrl, + *propLen)) >= *propLen) { + *propLen = reqLen + 1; + return (STMF_ERROR_INVALID_ARG); + } + break; case STMF_LU_PROP_GUID: if (diskLu->luGuidValid == B_FALSE) { return (STMF_ERROR_NO_PROP); @@ -2463,6 +2512,14 @@ setDiskProp(luResourceImpl *hdl, uint32_t resourceProp, const char *propVal) } diskLu->luMetaFileNameValid = B_TRUE; break; + case STMF_LU_PROP_MGMT_URL: + if ((strlcpy(diskLu->luMgmtUrl, propVal, + sizeof (diskLu->luMgmtUrl))) >= + sizeof (diskLu->luMgmtUrl)) { + return (STMF_ERROR_INVALID_PROPSIZE); + } + diskLu->luMgmtUrlValid = B_TRUE; + break; case STMF_LU_PROP_PID: if ((propSize = strlen(propVal)) > sizeof (diskLu->pid)) { @@ -3076,9 +3133,8 @@ groupListIoctl(stmfGroupList **groupList, int groupType) } (*groupList)->cnt = stmfIoctl.stmf_obuf_nentries; for (i = 0; i < stmfIoctl.stmf_obuf_nentries; i++) { - bcopy(iGroupList->name, (*groupList)->name[i], + bcopy(iGroupList[i].name, (*groupList)->name[i], sizeof (stmfGroupName)); - iGroupList++; } done: @@ -3224,10 +3280,9 @@ groupMemberListIoctl(stmfGroupName *groupName, stmfGroupProperties **groupProps, (*groupProps)->cnt = stmfIoctl.stmf_obuf_nentries; for (i = 0; i < stmfIoctl.stmf_obuf_nentries; i++) { (*groupProps)->name[i].identLength = - iGroupMembers->ident_size; - bcopy(iGroupMembers->ident, (*groupProps)->name[i].ident, - iGroupMembers->ident_size); - iGroupMembers++; + iGroupMembers[i].ident_size; + bcopy(iGroupMembers[i].ident, (*groupProps)->name[i].ident, + iGroupMembers[i].ident_size); } done: |