stmfAddViewEntryList - add a list of view entries for a given logical unit
cc [ flag... ] file... –lstmf [ library... ] #include <libstmf.h> int stmfAddViewEntryList(stmfGuid *logicalUnit, stmfViewEntryList *viewEntryList, void **opData);
The identifier of the logical unit to which all view entries in the list are being added.
The list of view entries to be added to the specified logical unit identifier.
A pointer to a pointer to void. On successful return, opData will contains the information about the list of view entries added. On failure, opData may contain appropriate information depending on the error value returned. For some types of failure it is set to NULL.
The stmfAddViewEntryList() function adds all view entries mentioned in the list for the specified logical unit. Details of the view entries to be added are passed to the function using the stmfViewEntry structure.
If the caller set the field luNbrValid to B_FALSE, the system will automatically choose a logical unit number (LUN) per initiator associated with host group mentioned in the view entry. Otherwise, the caller can specify a fixed LUN using the field luNbr along with the field luNbrValid set to B_TRUE. In this case, the system will map the specified LUN to the given logical unit for all initiators associated with the host group mentioned in the view entry, if the given LUN does not conflict with any other fixed LUN already existing in the system for any one of the above mentioned initiators. If the specified fixed LUN is in conflict with another system-chosen automatic LUN, the system-chosen automatic LUN will be remapped to another number to avoid the conflict.
If any one of the given view entries in the list fails the system validity checks or causes conflicts, none of the specified view entries will be added to the system. The opData parameter will be populated with the details which caused the failure. The information in opData needs to be interpreted depending on the return value of the function. If the function call succeeds, opData will be populated with information regarding newly added view entries. Some of the failure types may set this parameter to NULL. If the library returns data through parameter opData, the caller should call stmfFreeMemory(3STMF) when that data are no longer needed.
The following values are returned:
The API call was successful. This failure also sets opData to a pointer to a pointer to a stmfViewList structure with the information about view entries added to the specified logical unit.
One or more target group names mentioned in the view entry structure are invalid. This failure sets opData to a pointer to a pointer to a stmfViewList structure with view entries that caused the error
One or more host group name mentioned in the view entry structure are invalid. This failure sets opData to a pointer to a pointer to a stmfViewList structure with view entries that caused the error.
One or more view entries has an invalid value. Examples for invalid view entry values are providing a bad luNbr field with the luNbrValid field set to TRUE or providing a bad or used veIndex value with the veIndexValid field set to TRUE. This failure sets opData to a pointer to a pointer to a stmfViewList structure with view entries that caused the error.
One ore more view entries mentioned in the viewEntryList already exist in the system This failure sets opData to a pointer to a pointer to a stmfViewList structure with view entries that caused the error.
See attributes(5) for descriptions of the following attributes: