fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * CDDL HEADER START
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * The contents of this file are subject to the terms of the
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * Common Development and Distribution License (the "License").
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * You may not use this file except in compliance with the License.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * See the License for the specific language governing permissions
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * and limitations under the License.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * When distributing Covered Code, include this CDDL HEADER in each
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * If applicable, add the following below this CDDL HEADER, with the
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * fields enclosed by brackets "[]" replaced with your own identifying
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * information: Portions Copyright [yyyy] [name of copyright owner]
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * CDDL HEADER END
570de38f63910201fdd77246630b7aa8f9dc5661Surya Prakki * Copyright 2010 Sun Microsystems, Inc. All rights reserved.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * Use is subject to license terms.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte for (s = target; i < NSC_MAXPATH && (*s = *device++); i++) {
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte if (*s == 'r' && rdsk == 0 && strncmp(device, "dsk/", 4) == 0)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte gettext("can not check volume %s against mount table"),
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* Assume the worst, that it is mounted */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* found something before EOF */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte/* Needs to match parsing code in rdcboot.c and rdcadm.c */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forterdc_msg(char *prefix, spcs_s_info_t *status, char *string, va_list ap)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte (void) fprintf(stderr, "Remote Mirror: %s\n", prefix);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte (void) fprintf(stderr, "%s: %s: ", program, prefix);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forterdc_warn(spcs_s_info_t *status, char *string, ...)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte rc = RDC_IOCTL(RDC_STATUS, &rdc_status, 0, 0, 0, 0, ustatus);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * Look up a set in libcfg to find the setnumber.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * ASSUMPTIONS:
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * - a valid cfg handle
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * cfg - cfg handle
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * tohost - secondary hostname
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * tofile - secondary volume
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * set number if found, otherwise -1 for an error
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Fortefind_setnumber_in_libcfg(CFGFILE *cfg, char *ctag, char *tohost, char *tofile)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte rdc_warn(NULL, "cfg is NULL while looking up set number");
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte return (-1);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte for (setnumber = 1; setnumber <= entries; setnumber++) {
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* filter this out */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* Check secondary volume name first, will get less hits */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forteget_group_diskq(CFGFILE *cfg, char *group, char *diskq)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte for (i = 1; ; i++) {
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte if (cfg_get_cstring(cfg, key, &buf, sizeof (buf)) < 0)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte if (cfg_get_cstring(cfg, key, diskq, CFG_MAX_BUF) < 0) {
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forteget_cfg_setid(CFGFILE *cfg, char *ctag, char *tohost, char *tofile)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte return (-1);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte setnum = find_setnumber_in_libcfg(cfg, ctag, tohost, tofile);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte (void) snprintf(key, CFG_MAX_KEY, "sndr.set%d.options", setnum);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte if (cfg_get_single_option(cfg, CFG_SEC_CONF, key, "setid",
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte return (-1);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* If in a Sun Cluster, SetIDs need to have a ctag */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte if (cfg_get_cstring(cfg, "setid.set1.value", buf, CFG_MAX_BUF) < 0) {
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte if (cfg_put_cstring(cfg, "setid", "1", CFG_MAX_BUF) < 0) {
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte if (cfg_put_cstring(cfg, "setid.set1.value", buf, CFG_MAX_BUF) < 0) {
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* Restore old ctag if in a Sun Cluster */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte if (sigprocmask(SIG_BLOCK, &allsigs, &origmask) < 0)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte rdc_warn(NULL, gettext("Unable to block signals"));
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte if (sigprocmask(SIG_SETMASK, &origmask, NULL) < 0)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte rdc_warn(NULL, gettext("Unable to unblock signals"));