Go to main content

man pages section 3: Extended Library Functions, Volume 4

Exit Print View

Updated: Thursday, June 13, 2019
 
 

stmfAddViewEntryList(3STMF)

Name

stmfAddViewEntryList - add a list of view entries for a given logical unit

Synopsis

cc [ flag... ] file... –lstmf [ library... ]
#include <libstmf.h>

int stmfAddViewEntryList(stmfGuid *logicalUnit,
     stmfViewEntryList *viewEntryList, void **opData);

Parameters

logicalUnit

The identifier of the logical unit to which all view entries in the list are being added.

viewEntryList

The list of view entries to be added to the specified logical unit identifier.

opData

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.

Description

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.

Return Values

The following values are returned:

STMF_STATUS_SUCCESS

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.

STMF_ERROR_INVALID_TG

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

STMF_ERROR_INVALID_HG

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.

STMF_ERROR_INVALID_ARG

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.

STMF_ERROR_EXISTS

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.

Attributes

See attributes(7) for descriptions of the following attributes:

ATTRIBUTE TYPE
ATTRIBUTE VALUE
Interface Stability
Committed
MT-Level
Safe

See Also

libstmf(3LIB), stmfFreeMemory(3STMF), attributes(7)