MP_GetMultipathLusPlugin.c revision 466684c022bb4e5ef29d4f485bc72a8c12eb39ba
/*
* 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 2009 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#include <syslog.h>
#include <errno.h>
#include <unistd.h>
#include <stropts.h>
#include "mp_utils.h"
#include <libdevinfo.h>
{
int numNodes = 0;
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 not online. */
if (di_state(sv_child_node) != 0) {
continue;
}
instNum =
" - instance number is: %llx",
instNum);
}
++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);
}