/*
* 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 <fcntl.h>
#include <unistd.h>
#include <stropts.h>
#include <stdio.h>
#include <errno.h>
#include <libintl.h>
#include <locale.h>
#include <stdlib.h>
typedef struct volcount_s {
int count;
} volcount_t;
char *
{
return (buf);
}
/*
* SV type functions.
*/
static void
{
int set;
if (volhash) {
return;
}
volhash = nsc_create_hash();
break;
}
if (!self_check(host1)) {
/* next one had better be ours */
if (!self_check(host2)) {
continue;
}
}
/* primary vol may be used more than once */
if (volcount) {
} else {
}
/* bitmap ought to be only used once */
if (volcount) {
/* argh */
} else {
}
}
}
int
{
int fd;
return (-1);
}
" a character device", vol);
return (-1);
}
if (fd < 0) {
return (-1);
}
if (errno != SV_EENABLED) {
RDC_NONFATAL, 0);
return (-1);
}
}
return (1);
}
int
{
} else {
}
return (-1);
return (-1);
if (fd < 0)
return (-1);
/* SV enable the volume */
if (errno != SV_EENABLED) {
gettext("unable to enable %s"),
return (-1);
}
}
/* SV enable the bitmap disable the vol on error */
if (errno != SV_EENABLED) {
gettext("unable to enable %s"),
gettext("unable to disable %s"),
return (-1);
}
}
if (fd >= 0)
return (1);
}
int
{
} else {
}
"auto sv enable failed for %s", vol);
return (-1);
}
}
"auto sv enable failed for %s", vol);
return (-1);
}
}
return (1);
}
int
{
} else {
}
"auto sv disable failed for %s", vol);
} else if (!vc) {
"Unable to find %s in config", vol);
}
"auto sv disable failed for %s", bmp);
} else if (!vc) {
"Unable to find %s in config", bmp);
}
return (1);
}
/*
* do sv enables for the appropriate vol
* and bitmap. If called without persistance
* it will follow a chain and sv enable all
* otherwise, it will enable only the one
* set.
*/
int
{
return (sv_enable_nocfg(rdcp));
return (-1);
}
return (1);
}
int
{
return (1);
return (-1);
}
return (1);
}
/*
* disable the appropriate bitmap in rdc
* and replace it with bitmap
*/
int
{
int fail = 0;
"auto sv disable failed for %s", oldbmp);
}
if (cfg_vol_enable(cfg,
"auto sv enable failed for %s", newbmp);
fail++;
}
}
if (fail)
return (-1);
}
return (1);
}
/*
* SNDR functions
*/
/*
* add_to_rdc_cfg
* this adds the successfully created rdc sets to libdscfg,
* also, as auto_sv stuff is part of libdscfg, it does the
* auto_sv stuff and enables the correct volumes
*/
int
{
char *buf;
if (!buf) {
return (NULL);
}
return (-1);
}
return (-1);
}
while (rdcp) {
return (-1);
}
}
if (!cfg_commit(cfg)) {
return (-1);
}
return (0);
}
int
{
int setnum;
int numsets = 0;
return (-1);
}
continue;
return (-1);
}
continue;
break;
}
return (setnum);
}
void
{
while (rdcp) {
}
}
}
/*ARGSUSED*/
int
{
return (1);
}
/*
* this will set the value at "field" in dscfg to the
* value contained in entry.
* for things like bitmap reconfigs, only pass one rdc
* not a chain
*/
int
{
int setnum;
int ispbmp = 0;
int issbmp = 0;
ispbmp++;
issbmp++;
*newentry = '-';
else
return (-1);
}
return (-1);
}
while (rdcp) {
return (-1);
}
key);
}
return (-1);
}
return (-1);
}
}
return (1);
}
/*
* reverse_in_cfg
* used by RDC_OPT_REVERSE_ROLE
* swaps primary info and secondary info
*/
int
{
int setnum;
return (-1);
}
return (-1);
}
while (rdcp) {
goto badconfig;
}
goto badconfig;
}
goto badconfig;
}
goto badconfig;
}
goto badconfig;
}
goto badconfig;
}
goto badconfig;
}
}
if (!cfg_commit(cfg)) {
return (-1);
}
return (0);
return (-1);
}