lm_lcom.c revision d1d2228c6cf3ec632d28262810ab7902932a5d33
/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License (the "License").
* You may not use this file except in compliance with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*
* Copyright 2008 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#include "lm_acs.h"
int lm_library_config(char *, char *, char *);
#define CFG_SLOT "slot [\"%s\" \"panel %d\" \"group %d\" \
\"%s\" \"%s\" true true] "
#define DELE_SLOT "delslots [\"%s\"] "
/* The following command formats differ from those in the IEEE */
/* spec in the drive name. The reason this was done is that when the */
/* LM is activated initally, it does not know what the logical */
/* names are for the drives in the library, it only knows a geometry */
/* from the acsls perspective. Thus during the inital activation config */
/* LM sends up the acsls geometry and MM matches this with the geoemetry */
/* attribute of a drive. This same scheme was carried over for the */
/* partial configs assocatied when mounts and unmounts are done, even though */
/* LM knows the logical name at that time. */
#define TEXT_CART "\"%s\" "
#define CFG_DRIVE "drive [\"%s\" \"%d,%d,%d,%d\" \"panel %d\" \"%s\" %s %s] "
#define CONFIG_MOUNT "config task [\"%d\"] scope [partial] \
slot [\"%s\" \"panel %d\" \"group %d\" \"none\" \"%s\" false true] \
drive [\"%s\" \"%d,%d,%d,%d\" \"panel %d\" \"%s\" true true]; "
#define CONFIG_UNMOUNT "config task [\"%d\"] scope [partial] \
slot [\"%s\" \"panel %d\" \"group %d\" \"%s\" \"%s\" true true] \
drive [\"%s\" \"%d,%d,%d,%d\" \"panel %d\" \"none\" false true]; "
#define CONFIG_CART_EVENT "config task [\"%d\"] scope [partial] \
slot [\"%s\" \"panel %d\" \"group %d\" \"%s\" \"%s\" true true]; "
#define CONFIG_DRIVE_EVENT "config task [\"%d\"] scope [partial] \
drive [\"%s\" \"%d,%d,%d,%d\" \"panel %d\" \"%s\" %s %s]; "
#define LM_SHOW_DRIVE "show task [\"%d\"] \
match [streq(DRIVE.\"DriveName\" \"%s\")] \
report[DRIVE.\"DriveGeometry\"] reportmode[namevalue]; "
#define LM_SHOW_SERIAL "show task [\"%d\"] \
match [streq(DRIVE.\"DriveName\" \"%s\")] \
report[DRIVE.\"DriveSerialNum\"] reportmode[namevalue]; "
int
/* LINTED argument unused in function */
{
return (LM_OK);
}
int
{
int i;
int j;
int rc;
int lmpl_tid;
int panel;
char *kw;
char *cptr;
char *cptr1;
char *pptr;
char *serial;
char *geometry;
char drive_name[20];
char msg_str[256];
char text_str[1024];
char cfg_str[1024];
char drive_list[1024];
!= NULL) {
"lm_mount: Query mount on Cartridge PCL - %s",
return (LM_ERROR);
}
"query_mount()");
"query_mount() failed, status - %s",
return (LM_ERROR);
}
"lm_mount: volume %s not found in slot "
"prior to query mount, status - %s",
return (LM_ERROR);
}
drive_list[0] = '\0';
for (i = 0, j = 0; i < (int)mnt_sp->drive_count; i++) {
"lm_mount: drive %d,%d,%d,%d "
"not available for mount, status - %s",
continue;
}
if (j != 0)
j++;
"\"%d,%d,%d,%d\"",
}
text_str, "");
return (LM_OK);
}
"trying to generate show command for event");
return (LM_ERROR);
}
"encountered while processing LMPL show cmd");
return (LM_ERROR);
} else if (rc != LMPL_FINAL_OK) {
"a successful response");
return (LM_ERROR);
}
"attribute found in response to show cmd");
return (LM_ERROR);
}
"found in response to show cmd");
return (LM_ERROR);
}
mms_pn_token(side));
return (LM_ERROR);
}
"query_volume()");
"query_volume() failed, status - %s",
return (LM_ERROR);
}
"prior to mount, status - %s",
return (LM_ERROR);
}
!= LM_OK) {
"for drive with serial number %s failed", serial);
/* Error return message set in function */
return (LM_ERROR);
}
"with serial number of %s", serial);
return (LM_ERROR);
}
*pptr = '\0';
*pptr = '\0';
*pptr = '\0';
return (LM_ERROR);
}
"lm_mount: Received final response for acs_mount()");
"lm_mount: response from acs_mount() failed, "
return (LM_ERROR);
}
/* Clean up from drive show command */
"to generate config command for mount");
return (LM_ERROR);
}
"encountered while processing lmpl config command");
return (LM_ERROR);
} else if (rc != LMPL_FINAL_OK) {
/* unmount cartridge and send error response */
"cartridge %s after mount's config failed",
else {
"due to mount's config failure",
}
return (LM_ERROR);
}
"config command");
NULL);
msg_str);
return (LM_OK);
return (LM_ERROR);
}
int
{
int i;
int rc;
int lmpl_tid;
int panel;
char *kw;
char *cptr;
char *cptr1;
char *pptr;
char *serial;
char *geometry;
char msg_str[256];
char text_str[256];
char cfg_str[1024];
"trying to generate show command for event");
return (LM_ERROR);
}
"encountered while processing LMPL show cmd");
return (LM_ERROR);
} else if (rc != LMPL_FINAL_OK) {
"a successful response");
return (LM_ERROR);
}
"attribute found in response to show cmd");
return (LM_ERROR);
}
"found in response to show cmd");
return (LM_ERROR);
}
mms_pn_token(side));
mms_pn_token(side));
!= LM_OK) {
"for drive with serial number %s failed", serial);
/* Error return message set in function */
return (LM_ERROR);
}
"with serial number of %s", serial);
return (LM_ERROR);
}
*pptr = '\0';
*pptr = '\0';
*pptr = '\0';
return (LM_ERROR);
}
"acs_dismount()");
"failed, status - %s",
return (LM_ERROR);
}
"drive %s (geometry - %s), the acs_dismount() "
"shows that actually cartridge %s was unmounted from "
NULL);
}
/* Clean up from drive show command */
i = 0;
return (LM_ERROR);
"query_volume()");
"query_volume() failed, status - %s",
return (LM_ERROR);
}
"lm_unmount: volume %s is in transit "
"retrying acs_query_volume()",
(void) sleep(2);
if (i < 5) {
i++;
goto unmount_retry;
}
"lm_unmount: volume %s seems to be "
"stuck in transit sending back error "
"response");
}
return (LM_ERROR);
}
"lm_unmount: vol %s is now in location %d,%d,%d,%d,%d "
"lm_unmount: lm_obtain_task_id failed trying "
"to generate config command for unmount");
return (LM_ERROR);
}
"encountered while processing lmpl config command");
return (LM_ERROR);
} else if (rc != LMPL_FINAL_OK) {
"cartridge %s after unmount's config failed",
else {
"due to unmount's config failure",
}
return (LM_ERROR);
}
"config command");
NULL);
msg_str);
return (LM_OK);
return (LM_ERROR);
}
int
/* LINTED argument unused in function */
{
char msg_str[256];
return (LM_OK);
}
int
{
int i;
int j;
int rc;
int lmpl_tid;
int slot_spec_size;
char *kw;
char *slot_spec;
char msg_str[256];
char text_str[256];
char cfg_str[1024];
char carts[2048];
char err_carts[2048];
char text_cart[12];
char text_carts[2048];
/* Create default final error response due to */
/* internal processing error */
carts[0] = '\0';
/* Obtain slotgroup (Name of cap to use) */
/* If more than one lsm can exist within the acs, */
/* the lsm will need to be determined */
/* Make sure that the cap actually exists in */
/* the library, some libraries have optional */
/* caps */
if (!acs_cap->cap_config) {
"Physcial cap associated with "
"slotgroup %s is not available in"
NULL);
msg_str);
return (LM_ERROR);
}
break;
}
}
"associated with slotgroup - %s",
return (LM_ERROR);
}
LM_ERROR) {
return (LM_ERROR);
}
"lm_inject: Received final response for acs_enter()");
"lm_inject: response for acs_enter() failed, "
return (LM_ERROR);
}
/* Check status of each cartridge that was in the cap */
j = 0;
continue;
}
}
/* There were cartridges in CAP, but none were */
/* successfully injected into the library */
"lm_inject: Cartridges %s were not injected "
"into library");
NULL);
return (LM_ERROR);
}
/* Some of the cartridges in the CAP did not get */
/* injected */
"not all cartridges were injected into the library");
/* Ignore return value from lm_message */
}
/* Determine if any cartridges were added to the cap */
if (j != 0) {
slot_spec_size = 100 * j;
"for slot spec definitions");
return (LM_ERROR);
}
"lm_inject: lm_obtain_task_id failed "
"trying to generate config cmd for slot creation");
return (LM_ERROR);
}
"config task[\"%d\"] scope[partial] ",
lmpl_tid);
return (LM_ERROR);
}
err_carts[0] = '\0';
text_carts[0] = '\0';
"query_volume() failed, status - %s",
return (LM_ERROR);
}
"query_volume() - %d does not equal number of "
return (LM_ERROR);
}
"%s not found in slot",
continue;
}
"lm_inject: Slot spec - %s", cfg_str);
}
"lm_inject: Internal processing error "
"encountered while processing lmpl config command");
return (LM_ERROR);
} else if (rc != LMPL_FINAL_OK) {
ret_msg);
return (LM_ERROR);
}
if (err_carts[0] != '\0') {
/* Some cartridges that were successfully */
/* injected into library could not be found */
/* in a slot of the library */
"library, but were not found in a slot of the "
"library", err_carts);
}
"slot creation config command");
if (text_carts[0] != '\0') {
} else {
text_str[0] = '\0';
}
msg_str);
} else {
"CAP was empty, No cartridges injected into library");
NULL);
msg_str, "");
}
return (LM_OK);
return (LM_ERROR);
}
int
{
int i, j;
int rc;
int lmpl_tid;
int accessible = 0;
int occupied = 0;
int slot_spec_size;
int drive_spec_size;
char *drive_spec = NULL;
char carts[2048];
char err_carts[2048];
char msg_str[256];
char cfg_str[1024];
char cmd_str[1024];
char geometry[128];
/* See if scan is for cartridge(s) */
!= NULL) {
/* Generate list of cartridges to scan for */
/* Obtain slot-name */
NULL);
if (i == MAX_ID) {
"lm_scan: Number of slots to "
"scan exceeded the max of %d, skipping "
"cartridge %s", MAX_ID,
mms_pn_token(slot));
} else {
"lm_scan: scan for cartridge "
vol_id_list[i++].external_label[
EXTERNAL_LABEL_SIZE] = '\0';
}
}
/* Query for cartridges in library */
return (LM_ERROR);
"lm_scan: Recevied sucess final response for "
"query_volume()");
"query_volume() failed, status - %s",
return (LM_ERROR);
}
slot_spec_size = 100 * i;
"for slot spec definitions");
return (LM_ERROR);
}
"trying to generate config command for scan");
return (LM_ERROR);
}
/* Setup to send partial config for any cartridges */
/* found in a cell of the library */
"config task[\"%d\"] scope[partial] ",
lmpl_tid);
carts[0] = '\0';
err_carts[0] = '\0';
/* Check each cartridge to see if it is in a cell */
/* of the library, only those in a cell can be */
/* configed */
"found in a cell, status - %s",
continue;
}
"lm_scan: Slot spec - %s", cfg_str);
}
/* Send LMPL config command to define */
/* any cartridges that were found in */
/* slots of the library */
if (carts[0] != '\0') {
"lm_scan: SLOT_SPEC:\n%s", slot_spec);
/* Send LMPL config command for cartridge(s) */
/* found in a cell of the library */
== LM_ERROR) {
"lm_scan: Internal processing "
"error encountered while processing lmpl "
"config command");
return (LM_ERROR);
} else if (rc != LMPL_FINAL_OK) {
"success response for lmpl config command "
"while processing scan command");
ret_msg);
return (LM_ERROR);
}
"for scan config command");
} else {
/* Since no config was sent clean up */
/* for the taskid that was not used */
"lm_scan: No cartridges were found "
"in slots of the library");
LM_7120_MSG, NULL);
}
if (err_carts[0] != '\0') {
"indicate not all cartridges were found to "
"be present in the library, %s", err_carts);
}
}
NULL);
"lm_scan: scan for cartridges from %s to %s",
"supported on a ACSLS controlled library, sending error "
"response for scan command");
return (LM_ERROR);
NULL);
"lm_scan: lm_obtain_task_id "
"failed trying to generate show command "
"for scan");
return (LM_ERROR);
}
"lm_scan: show cmd for scan drive:\n%s", cmd_str);
LM_ERROR) {
"lm_scan: Internal processing "
"error encountered while processing LMPL "
"show cmd");
return (LM_ERROR);
} else if (rc != LMPL_FINAL_OK) {
"receive a successful response, unable "
"to get drive %s's geometry",
continue;
}
"lm_scan: show cmd got sucess final response");
"attribute found in response to show cmd "
continue;
}
"lm_scan: No DriveGeometry value"
" found in response to show cmd for drive "
continue;
}
/* Pull apart geometry string for DRIVEID */
/* structure used in query_drive */
/* Set err_buf for drive geometry */
NULL));
"lm_scan: missing drive geometry for"
"drive %s");
(void)
"temporary");
err_buf);
return (LM_ERROR);
}
"lm_scan:, Drive %s has a geometry of "
cptr);
"lm_scan: missing/incomplete"
" drive geometry for"
"drive %s, geometry = %s",
cptr);
"temporary");
err_buf);
return (LM_ERROR);
}
*pptr = '\0';
"lm_scan: missing/incomplete"
" drive geometry for"
"drive %s, geometry = %s",
cptr);
"temporary");
err_buf);
return (LM_ERROR);
}
*pptr = '\0';
"lm_scan: missing/incomplete"
" drive geometry for"
"drive %s, geometry = %s",
cptr);
"temporary");
err_buf);
return (LM_ERROR);
}
*pptr = '\0';
/* free the err_buf for drive geometry */
if (++i == MAX_ID) {
"lm_scan: Number of drives to "
"scan exceeded the max allowed of %d",
MAX_ID);
break;
}
}
/* Query for drives in library */
return (LM_ERROR);
"query_drive");
"query_drive() failed, status - %s",
return (LM_ERROR);
}
drive_spec_size = 100 * i;
"for drive spec definitions");
return (LM_ERROR);
}
/* Setup to send partial config for any drives */
/* found in library */
(void) strcpy(drive_spec,
"config task[\"%d\"] scope[partial] ");
carts[0] = '\0';
err_carts[0] = '\0';
/* Check each drive to see if it is found in */
/* the library, also verify if is online and if */
/* a cartridge exists in the drive */
occupied = 1;
occupied = 0;
else {
"failed query_drive with a status - %s",
"%d,%d,%d,%d",
continue;
}
accessible = 1;
"%d,%d,%d,%d",
"Trying to obtain serial number "
"for drive with ACSLS geometry %s "
"failed", geometry);
return (LM_ERROR);
}
"No serial number found for drive "
"with ACSLS geometry of %s",
geometry);
}
"lm_scan: Drive Spec - %s", cfg_str);
"%d,%d,%d,%d",
accessible = 0;
!= LM_OK) {
"lm_scan: Unable to get serial "
"number for drive %s", cmd_str);
return (LM_ERROR);
}
}
"trying to generate config command for scan");
return (LM_ERROR);
}
(void) snprintf(drive_spec,
lmpl_tid);
/* Send LMPL config command to define */
/* any drives that were found in library */
if (carts[0] != '\0') {
"lm_scan: DRIVE_SPEC:\n%s", drive_spec);
== LM_ERROR) {
"lm_scan: Internal processing "
"error encountered while processing lmpl "
"config cmd");
return (LM_ERROR);
} else if (rc != LMPL_FINAL_OK) {
"success response for lmpl config command "
"while processing scan command");
ret_msg);
return (LM_ERROR);
}
"for scan config drive command");
} else {
/* Since no config was sent clean up */
/* for the taskid that was not used */
"in library");
LM_7122_MSG, NULL);
}
if (err_carts[0] != '\0') {
"indicate not all drives were found to be "
"present in the library, %s", err_carts);
}
} else {
"to MM. Unable to set state to not ready");
}
return (LM_ERROR);
}
"lm_scan: rescan of entire library completed");
"to MM. Unable to set state to ready");
return (LM_ERROR);
}
NULL);
}
return (LM_OK);
return (LM_ERROR);
}
/*
* lm_activate()()
*
* Parameters:
* - cmd Parse tree of LMPM activate command being processed.
* - tid Task id of LMPM activate command being processed.
* - ret_msg Ptr to final response string. If an error message is
* to be sent to MM for the activate command because of
* a failure, the error response is created here.
*
* This function executes the necessary steps that are ACSLS library specific
* for the LM to process the activate command. This routine is responsible
* for establishing the connection to the ACSLS SSI process and doing
* the entire library configuration portion during an LM activation.
*
* Return Values:
* - LM_OK If function completed successfully
* - LM_ERROR If function detected something that does not
* allow the LM to become active. In some cases
* depending on the error, ret_msg may be updated to
* reflect the error that was encountered as to why
* the LM cannot become active.
*/
int
/* LINTED argument unused in function */
{
int rc;
int pkt_ver;
int lmpl_tid;
char cmd_str[512];
char msg_str[256];
char env_ssi_port[128];
SEQ_NO s;
return (LM_ERROR);
}
"for private command to obtain libraries ACS number");
return (LM_ERROR);
}
"lm_activate: Obtain library acs cmd - \n%s", cmd_str);
"processing error encountered while processing "
"private command to obtain library acs");
return (LM_ERROR);
} else if (rc != LMPL_FINAL_OK) {
"lm_activate: Error encountered while sending "
"private command to obtain library acs");
return (LM_ERROR);
}
"lm_activate: Private cmd got success final response");
== NULL) {
"lm_activate: No text clause found in finial "
"success response of private command to obtain library "
"ACS");
return (LM_ERROR);
}
"lm_activate: No ACS attribute found in final "
"success response of private command to obtain library "
"ACS");
return (LM_ERROR);
}
"response of private command to obtain library ACS");
return (LM_ERROR);
}
/* Set LibraryLSM */
"lm_activate: No LSM attribute found in final "
"success response of private command to obtain library "
return (LM_ERROR);
}
"response of private command to obtain library LSM");
return (LM_ERROR);
}
/* Set SSI Port number */
"lm_activate: No SSI Port found in final "
"success response of private command to obtain library "
"info ");
return (LM_ERROR);
}
" value found in final "
"response of private command to obtain library info");
return (LM_ERROR);
}
"ACSAPI_SSI_SOCKET=%d",
lm.lm_ssiport);
(void) putenv(env_ssi_port);
/* See if SSI is running by query acsls server */
"status - %s, check to make sure SSI is running",
acs_status(status));
return (LM_ERROR);
}
/* Obtain response for query_server() */
do {
/* Internal error encountered */
return (LM_ERROR);
"for query_server failed %s",
acs_status(status));
ret_msg);
return (LM_ERROR);
}
"acknowledge response for query_server()");
continue;
"response for query_server()");
"intermediate response for query_server()");
} else {
"response type for query_server() - %d",
continue;
}
"of %d and LM is using a version of %d. LM and ACSLS "
return (LM_ERROR);
}
return (LM_ERROR);
}
return (LM_ERROR);
}
return (LM_OK);
}
int
/* LINTED argument unused in function */
{
"full reset of an ACSLS library");
return (LM_OK);
}
"lm_reset: Nothing defined to do for a partial reset "
"of an ACSLS library");
return (LM_OK);
}
int
{
int i = 0;
int j;
int rc;
int lmpl_tid;
int slot_spec_size;
char *kw;
char *slot_spec;
char msg_str[256];
char text_str[256];
char tmp_str[256];
char dele_str[1024];
char carts[2048];
char err_carts[2048];
char text_cart[12];
char text_carts[2048];
char nbuf[20];
/* Create default final error response due to */
/* internal processing error */
/* Obtain slotgroup (Name of cap to use) */
/* If more than one lsm can exist within the acs, */
/* the lsm will need to be determined */
"lm_eject: Physical cap associated "
/* Make sure that the cap actually exists in */
/* the library, some libraries have optional */
/* caps */
if (!acs_cap->cap_config) {
"associated with slotgroup %s is not "
"available in the library - %s",
NULL);
msg_str);
return (LM_ERROR);
}
break;
}
}
"associated with slotgroup - %s",
return (LM_ERROR);
}
/* NOTE The number of cartridges that can be ejected cannot exceed */
/* the size of the CAP, Currently the ACSLS libraries that we */
/* support CAP size's do not exceed what can be contained in one */
/* VOLID[MAX_ID]. If the CAP hardware is larger than MAX_ID (43) */
/* then the code needs to be able to break the eject into multiple */
/* acs_eject commands */
i = 0;
"lm_eject: eject cartridge %s from slot %s",
"cartridges than the cap can hold, max is %d "
msg_str);
return (LM_ERROR);
}
}
return (LM_ERROR);
}
"lm_eject: Received final response for acs_eject()");
"lm_eject: response from ace_eject() failed, "
return (LM_ERROR);
}
"lm_eject: response from ace_eject() does not "
"include the correct number of cartridges "
"to be ejected, expected %d, actual %d", i,
}
"for delete slot definitions");
return (LM_ERROR);
}
"trying to generate config cmd for slot deletion");
return (LM_ERROR);
}
"config task[\"%d\"] scope[partial] ", lmpl_tid);
carts[0] = '\0';
err_carts[0] = '\0';
text_carts[0] = '\0';
"lm_eject: Ejection of cartridge %s "
} else {
"lm_eject: Cartridge %s was ejected "
sizeof (text_carts));
}
}
if (carts[0] != '\0') {
"lm_eject: Internal processing error "
"encountered while processing lmpl config "
"command");
return (LM_ERROR);
} else if (rc != LMPL_FINAL_OK) {
ret_msg);
return (LM_ERROR);
}
"slot deletion config command for cartridges - %s", carts);
} else {
"lm_eject:, No cartridges were successfully ejected");
return (LM_ERROR);
}
NULL);
}
if (err_carts[0] != '\0') {
/* Some cartridges did not successfully get ejected */
"Cartridges %s were not ejected from library",
}
if (text_carts[0] != '\0') {
} else {
text_str[0] = '\0';
}
msg_str);
return (LM_OK);
return (LM_ERROR);
}
int
/* LINTED argument unused in function */
{
char msg_str[256];
return (LM_OK);
}
/*
* lm_private()()
*
* Parameters:
* - cmd Parse tree of LMPM private command being processed.
* - tid Task id of LMPM private command being processed.
* - ret_msg Ptr to final response string. If an error message is
* to be sent to MM for the private command because of
* a failure, the error response is created here.
*
* This function executes the necessary steps that are ACSLS library specific
* for the LM to process the private command. This routine is responsible
* for calling lm_validate_private(), which validates that all data
* elements in the get, set, and unset clauses are valid names.
*
* Return Values:
* - LM_OK If function completed successfully
* - LM_ERROR If function detected something that does not
* allow the LM to become active. In some cases
* depending on the error, ret_msg may be updated to
* reflect the error that was encountered as to why
* the LM cannot successfully process the command.
*/
int
{
return (LM_ERROR);
}
/* No get-name operations for ACSLS libraries, return a */
/* empty string */
return (LM_OK);
}
int
/* LINTED argument unused in function */
{
char msg_str[512];
return (LM_OK);
}
int
{
SEQ_NO s;
int rc;
int panel;
int lmpl_tid;
int count;
int accessible = 0;
int occupied = 0;
char *cptr;
char *pptr;
char *obj_val;
char cmd_str[1024];
char cfg_str[1024];
== NULL) {
return (LM_ERROR);
}
"lm_event: Event %s is for library %s, skipping",
return (LM_OK);
} else {
"lm_event: Event %s is for this library, %s",
}
"lm_event: lm_obtain_task_id failed "
"trying to generate config command for event");
return (LM_ERROR);
}
cmd_str);
"lm_event: Internal processing error "
"encountered while processing LMPL show cmd");
return (LM_ERROR);
} else if (rc != LMPL_FINAL_OK) {
"a successful response");
return (LM_ERROR);
}
"lm_event: show cmd got sucess final response");
"attribute found in response to show cmd");
return (LM_ERROR);
}
"found in response to show cmd");
return (LM_ERROR);
}
*pptr = '\0';
*pptr = '\0';
*pptr = '\0';
count = 1;
!= STATUS_SUCCESS) {
return (LM_ERROR);
}
do {
/* Internal error encountered */
return (LM_ERROR);
"for query_drive failed, status "
return (LM_ERROR);
}
"acknowledge response for query_drive");
continue;
"lm_event: Received unknown "
"response type of query_drive - %d",
continue;
}
"query_drive");
"query_drive() failed, status is %s",
return (LM_ERROR);
}
occupied = 1;
accessible = 1;
"lm_event: lm_obtain_task_id failed "
"trying to generate config command for event");
return (LM_ERROR);
}
} else
"lm_event: Config new cartridge %s", obj_val);
return (LM_ERROR);
"query_volume()");
"query_volume() failed, status - %s",
return (LM_ERROR);
}
"for cartridge %s, cartridge status - %s",
return (LM_ERROR);
}
"lm_event: lm_obtain_task_id failed "
"trying to generate config command for event");
return (LM_ERROR);
}
} else {
return (LM_ERROR);
}
"encountered while processing lmpl config command");
return (LM_ERROR);
} else if (rc != LMPL_FINAL_OK) {
"processing LMPM event command");
return (LM_ERROR);
}
"lm_event: Got successful response for event config command");
return (LM_OK);
"LMPM command event encountered an invalid or missing "
return (LM_ERROR);
}
int
{
int rc;
int i;
int count;
int lmpl_tid;
int freecells = 0;
int cell_size;
int accessible;
int occupied;
int rsp_cnt;
int spec_stop;
int loop_stop = 0;
char cfg_str[1024];
char geometry[128];
char *slot_spec;
char *drive_spec;
char *serial;
SEQ_NO s;
/* for L180, L500, or L700, libraries */
/* lsm is always set to 0 */
count = 1;
return (LM_ERROR);
}
/* obtain number of freecells */
do {
/* Internal error encountered */
return (LM_ERROR);
"for query_lsm failed, status - %s",
acs_status(status));
ret_msg);
return (LM_ERROR);
}
"acknowledge response for query_lsm");
continue;
"lm_library_config: Received unknown "
"response type for query_lsm() - %d",
continue;
}
"query_lsm");
/* Get number of free cells in lsm */
"for query_lsm not success status is %s",
return (LM_ERROR);
}
"ready broken command to MM.");
}
return (LM_ERROR);
}
"lm_library_config: lm_obtain_task_id failed "
"trying to generate config command for bay creation");
return (LM_ERROR);
}
== LM_ERROR) {
return (LM_ERROR);
}
"lm_library_config: Internal processing error "
"encountered while processing lmpl config command");
return (LM_ERROR);
} else if (rc != LMPL_FINAL_OK) {
return (LM_ERROR);
}
"full config command");
"for slotp spec definitions");
return (LM_ERROR);
}
count = 0;
return (LM_ERROR);
}
do {
"loop");
"lm_library_config: lm_obtain_task_id "
"failed trying to generate config cmd for slot "
"creation");
return (LM_ERROR);
}
"config task[\"%d\"] scope[partial] ", lmpl_tid);
rsp_cnt = 0;
spec_stop = 0;
do {
/* Internal error encountered */
return (LM_ERROR);
}
"acs_response() for query_volume2 failed, "
ret_msg);
return (LM_ERROR);
}
"lm_library_config: Received "
"acknowledge response for query_volume2()");
continue;
"lm_library_config: Recevied "
"final response for query_volume2()");
"lm_library_config: Received "
"intermediate response for "
"query_volume2()");
} else {
"lm_library_config: Received "
"unknow response type for query_volume2() "
continue;
}
"lm_library_config: response "
"from query_volume2() failed, status is %s",
return (LM_ERROR);
}
"lm_library_config: count of response "
"lm_library_config: "
"volume %s found in drive",
continue;
}
"lm_library_config: "
"Skip volume %s, wrong ACS",
continue;
}
"Slot spec - %s", cfg_str);
rsp_cnt++;
}
/* See if we should stop processing */
/* query vol responses */
spec_stop = 1;
loop_stop = 1;
"processing error encountered while processing "
"lmpl config command");
return (LM_ERROR);
} else if (rc != LMPL_FINAL_OK) {
ret_msg);
return (LM_ERROR);
}
"Got successful response "
"for slot creation config command");
} while (loop_stop != 1);
else
"for drive spec definitions, errno - %d",
return (LM_ERROR);
}
count = 0;
return (LM_ERROR);
}
loop_stop = 0;
do {
"Configuring drive spec loop");
"lm_library_config: lm_obtain_task_id "
"failed trying to generate config command for "
"drive creation");
return (LM_ERROR);
}
"config task[\"%d\"] scope[partial] ", lmpl_tid);
rsp_cnt = 0;
spec_stop = 0;
do {
/* Internal error encountered */
return (LM_ERROR);
}
"acs_response() for query_drive failed, "
ret_msg);
return (LM_ERROR);
}
"lm_library_config: Received "
"acknowledge response for query_drive()");
continue;
"lm_library_config: Recevied "
"final response for query_drive()");
"lm_library_config: Received "
"intermediate response for query_drive()");
} else {
"lm_library_config: Received "
"unknow response type for query_drive() "
continue;
}
"lm_library_config: response "
"from query_drive() failed, status is %s",
ret_msg);
return (LM_ERROR);
}
"lm_library_config: count of response "
occupied = 0;
accessible = 0;
"lm_library_config: "
"Skip drive, Wrong ACS -%d",
acs);
continue;
}
sizeof (cfg_str),
rsp_cnt++;
occupied = 1;
}
accessible = 1;
}
"%d,%d,%d,%d",
"Trying to obtain serial number "
"for drive with ACSLS geometry %s "
"failed", geometry);
return (LM_ERROR);
}
"No serial number found for drive "
"with ACSLS geometry of %s",
geometry);
}
occupied ?
"drive spec - %s", cfg_str);
rsp_cnt++;
}
spec_stop = 1;
loop_stop = 1;
"processing error encountered while processing "
"lmpl config command");
return (LM_ERROR);
} else if (rc != LMPL_FINAL_OK) {
ret_msg);
return (LM_ERROR);
}
"Got successful response "
"for drive creation config command");
} while (loop_stop != 1);
return (LM_OK);
}