1. Introduction 1.1. Project/Component Working Name: libstmf interfaces for setting stmf properties 1.2. Name of Document Author/Supplier: Author: Vijitha Dugganapalli 1.3 Date of This Document: xxx 4. Technical Description 4.1 Summary This case is to add two new interfaces to libstmf (PSARC 2007/523) that can be used to define/set the default stmf properties 4.2 Problem Currently, there is no mechanism in stmf which allows users to specify the default behavior for logical units/targets as per their requirement 4.3 Proposal The proposed solution is adding two new interfaces to libstmf (PSARC 2007/523) for setting and retrieving default stmf properties to logical units and targets, allowing user to set/define the default behavior for logical units/targets that needs to be configured during new registrations or starting up stmf service 4.5 Interfaces ------------------------------------------------------------------ Interface Name Comm.Level Comments ------------------------------------------------------------------ stmfSetStmfProp(3STMF) Committed To set the default properties stmfGetStmfProp(3STMF) Committed To get the default properties Prototype: int stmfSetStmfProp(uint8_t propType, char *propVal) int stmfGetStmfProp(uint8_t propType, char *propVal, size_t *propLen) 4.6 Man page changes: New manpages stmfSetStmfProp(3STMF), stmfGetStmfProp(3STMF) are required see Appendix A 4.7 Release Binding Minor binding is requested. 4.8 References libstmf(3LIB) PSARC 2007/523 Appendix A: manpage for stmfSetStmfProp(3STMF) SCSI Target Mode Framework Library Functions stmfGetStmfProp(3STMF) NAME stmfSetStmfProp - set default stmf properties for luns and targets. SYNOPSIS cc [ flag... ] file... -lstmf [ library... ] #include int stmfSetStmfProp(uint8_t propType, char *propVal); PARAMETERS propType A property type value. See DESCRIPTION for valid types. propVal A property value. DESCRIPTION This function sets the default properties for specified property type. All property values are expressed in human-readable form. The propType argument can be one of the following values: STMF_DEFAULT_LU_STATE Sets the default state for luns. The new setting will only take effect after a service enable/restart on the stmf service. Valid propVal are "online" or "offline" STMF_DEFAULT_TARGET_PORT_STATE Sets the default state for target ports The new setting will only take effect after a service enable/restart on the stmf service. Valid propVal are "online" or "offline" RETURN VALUES The following values are returned: STMF_STATUS_SUCCESS The API call was successful. STMF_ERROR_INVALID_ARG propType is invalid. ATTRIBUTES See attributes(5) for descriptions of the following attributes ______________________________________________________________________ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | |_____________________________|_____________________________| | Interface Stability | Committed | |_____________________________|_____________________________| | MT-Level | Safe | |_____________________________|_____________________________| SEE ALSO libstmf(3LIB), stmfGetStmfProp(3STMF), attributes(5) Manpage for stmfGetStmfProp(3STMF) SCSI Target Mode Framework Library Functions stmfGetStmfProp(3STMF) NAME stmfGetStmfProp - retrieves default stmf properties for luns and targets. SYNOPSIS cc [ flag... ] file... -lstmf [ library... ] #include int stmfGetStmfProp(uint8_t propType, char *propVal); PARAMETERS propType A property type value. See DESCRIPTION for valid values. propVal A property value. propLen The length of the specified property value. If propLen was of an insufficient size to the hold the returned property value, propLen will contain the required size of the buffer and STMF_ERROR_INVALID_ARG will be returned. DESCRIPTION This function gets the default properties for specified property type. All property values are expressed in human-readable form. The propType argument can be one of the following values: STMF_DEFAULT_LU_STATE propType to retrieve the current default state for luns Default propVal: "online" STMF_DEFAULT_TARGET_PORT_STATE propType to retrieve the current default state for target ports Default propVal: "online" RETURN VALUES The following values are returned: STMF_STATUS_SUCCESS The API call was successful. STMF_ERROR_INVALID_ARG Either propType or propVal is unrecognized. STMF_ERROR_NOT_FOUND Specified propType not found in the system ATTRIBUTES See attributes(5) for descriptions of the following attributes ______________________________________________________________________ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | |_____________________________|_____________________________| | Interface Stability | Committed | |_____________________________|_____________________________| | MT-Level | Safe | |_____________________________|_____________________________| SEE ALSO libstmf(3LIB), stmfSetStmfProp(3STMF), attributes(5)