pcp_utils.c revision 9404882939d18ddd3c94a5bd3da7a0449c195a5d
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync * CDDL HEADER START
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync * The contents of this file are subject to the terms of the
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync * Common Development and Distribution License (the "License").
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync * You may not use this file except in compliance with the License.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync * See the License for the specific language governing permissions
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync * and limitations under the License.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync * When distributing Covered Code, include this CDDL HEADER in each
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync * If applicable, add the following below this CDDL HEADER, with the
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync * fields enclosed by brackets "[]" replaced with your own identifying
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync * information: Portions Copyright [yyyy] [name of copyright owner]
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync * CDDL HEADER END
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync * Copyright 2007 Sun Microsystems, Inc. All rights reserved.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync * Use is subject to license terms.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync * Implements auxiliary routines declared in pcp_utils.h to facilitate
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync * finding the appropriate communication transport & device path for a
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync * given service. This supports the transition from the legacy service channel
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync * transport (glvc) to the logical domain channel (vldc) transport native
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync * to platforms running Logical Domains (LDoms).
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync#pragma ident "%Z%%M% %I% %E% SMI"
#include <strings.h>
#include <stdlib.h>
#include <libgen.h>
#include <unistd.h>
#include <stdio.h>
#include <libdevinfo.h>
#include "pcp_utils.h"
* "/devices/virtual-devices@100/sunvts@a:glvc"
* "/devices/virtual-devices@100/channel-devices@200/virtual-channel@3:sunvts"
static bool_t
char *devname, *s;
if (s++ == NULL) {
goto end;
if (match)
ret = true;
goto end;
ret = false;
goto end;
} else if (match) {
ret = true;
goto end;
end:
return (ret);
static bool_t
int len;
ret = false;
goto end;
ret = false;
goto end;
ret = false;
if (*match)
end:
return (ret);
return (sname);
return (NULL);
return (vldc_path);
return (glvc_path);
return (NULL);
char *glvc_path;
char *minor_name;
return (NULL);
return (dev_path);
return (dev_path);
char *vldc_path;
char *minor_name;
return (dev_path);
return (dev_path);
char *pathn_p;
char *service;
return (NULL);
return (pathn_p);