/*
* 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
*/
/*
*/
#include <syslog.h>
#include <errno.h>
#include <unistd.h>
#include <stropts.h>
#include "mp_utils.h"
#include <libdevinfo.h>
/*
* Checks whether there is online path or not.
* - no path found returns -1.
*/
{
== DI_PATH_NIL) {
" - No path found");
return (-1);
}
do {
/* ignore the path that is neither online nor standby. */
(state == DI_PATH_STATE_STANDBY)) {
return (1);
}
/* return 0 for the case that there is no online path to the node. */
return (0);
}
{
int instNum;
int majorNum;
if (DI_NODE_NIL == sv_node) {
" - di_drv_first_node() failed");
return (-1);
}
while (DI_NODE_NIL != sv_child_node) {
/* skip the node which is offline, down or detached. */
if ((state & DI_DEVICE_DOWN) ||
(state & DI_DEVICE_OFFLINE)) {
continue;
}
/*
* skip if the node doesn't have any path avaialble.
* If any path is found from the DINFOCACHE snaphost
* that means the driver keeps track of the path regadless
* of state.
*/
continue;
}
"instNum = %d", instNum);
"majorNum = %d", majorNum);
osn = 0;
osn;
}
++numNodes;
}
"getOidList()",
" - numNodes: %d",
numNodes);
return (numNodes);
}
{
int numNodes = 0;
int i = 0;
if (DI_NODE_NIL == root_node) {
" - di_init() failed");
return (MP_STATUS_FAILED);
}
if (numNodes < 0) {
"MP_GetMultipathLusPlugin()",
" - unable to get OID list.");
" - error exit");
return (MP_STATUS_FAILED);
}
if (0 == numNodes) {
"MP_GetMultipathLusPlugin()",
" - unable to create OID list.");
return (MP_STATUS_INSUFFICIENT_MEMORY);
}
" - returning empty list.");
return (MP_STATUS_SUCCESS);
}
"no memory for *ppList");
" - error exit");
return (MP_STATUS_INSUFFICIENT_MEMORY);
}
"(*ppList)->oids[%d].objectType = %d",
"(*ppList)->oids[%d].ownerId = %d",
"(*ppList)->oids[%d].objectSequenceNumber = %llx",
}
return (MP_STATUS_SUCCESS);
}