mgmt_media.c revision cee0fb94c0d4227de0a00efc162fb2739844b641
/*
* 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 <libgen.h>
#include <stdio.h>
#include <stdlib.h>
#include <door.h>
#include <fcntl.h>
#include "mms_mgmt.h"
#include "mgmt_acsls.h"
#include "mmp_defs.h"
#include "mgmt_media.h"
#include "mgmt_sym.h"
#include "mgmt_util.h"
static char *mmsmntdoor = "/var/run/mmsmnt_door";
static int
static int
static char *label_fname = " ";
static mms_mgmt_setopt_t cartridgegrpopts[] = {
};
/*
* Note that O_APPS (string array) is required for CartridgeGroupApplication.
* Add a CGA for each application specified in the array.
*/
static mms_mgmt_setopt_t cgappopts[] = {
};
/*
* mms_mgmt_discover_media()
*
* Finds ACSLS media, optionally filtered by library acs & lsm.
* Those already configured for use with MMS are filtered out unless
* 'showall' is TRUE.
*
* Required opts are:
* acshost
* acsport (if not the default)
* -- or --
* library
* If library specified, get ACS information from LIBRARY object.
*/
int
{
int st;
int count = 0;
int i;
char tid[64];
char cmd[8192];
void *response;
int ost;
return (MMS_MGMT_NOARG);
}
/*
* we need either the ACSLS host or one or more libraries to
* proceed.
*/
return (st);
}
if (st == 0) {
} else {
return (st);
}
}
/* get list of libs MMS knows about */
if (st != 0) {
goto done;
}
if (!acshost) {
/* only supporting a single ACSLS server for V1 */
goto done;
}
}
if (count > 0) {
/* remove libraries not in our list */
for (i = 0; i < count; i++) {
break;
}
}
if (!found) {
/* remove */
}
}
}
/* all of the volumes from the ACSLS server */
if (st != 0) {
goto done;
}
/* weed out volumes for libraries we're not interested in */
continue;
}
break;
}
}
if (!found) {
} else {
}
}
}
/* fetch the list of cartridges MMS knows about */
(void) mms_gen_taskid(tid);
"show task['%s'] reportmode[namevalue] "
"report[CARTRIDGE.'CartridgePCL' CARTRIDGE.'CartridgeTypeName' "
"CARTRIDGE.'LibraryName' CARTRIDGE.'CartridgeGroupName'] ", tid);
if (count > 0) {
for (i = 0; i < count; i++) {
continue;
}
sizeof (cmd));
}
}
if (st == 0) {
}
if (st != 0) {
goto done;
}
/*
* TODO: this will break horribly if barcodes are not unique for
* all libs. Fix this to be more library-aware.
*/
if (ost == 0) {
if (!showall) {
} else {
if (ost == 0) {
}
}
}
}
done:
if (volattrs) {
}
if (st != 0) {
}
return (st);
}
int
{
int st;
int count = 0;
int i;
if (!nvl) {
return (MMS_MGMT_NOARG);
}
if (!mgmt_chk_auth("solaris.mms.create")) {
return (EACCES);
}
if (st == 0) {
/* save original values */
for (i = 0; i < count; i++) {
continue;
}
/* put back a single value */
if (st != 0) {
break;
}
}
/* put back original values */
if (varray) {
count);
}
}
return (st);
}
int
{
int st;
int count = 0;
int i;
char cmd[8192];
char tid[64];
void *response;
char *mpool;
char *val;
/* get list of apps, if new list != old list, update */
if (!mgmt_chk_auth("solaris.mms.modify")) {
return (EACCES);
}
if (!nvl) {
return (MMS_MGMT_NOARG);
}
if (st != 0) {
return (st);
}
/* error or nothing to do? */
return (0);
}
/* get list of already-established apps */
(void) mms_gen_taskid(tid);
"show task['%s'] reportmode[namevalue] "
"match[streq(CARTRIDGEGROUPAPPLICATION.'CartridgeGroupName' '%s')] "
"report[CARTRIDGEGROUPAPPLICATION.'ApplicationName'];",
if (st != 0) {
goto done;
}
}
&response);
if (st == 0) {
&cgattrs);
}
if (st != 0) {
goto done;
}
/* see if we need to add any apps */
for (i = 0; i < count; i++) {
continue;
}
if (!new) {
}
if (st != 0) {
break;
}
}
}
/* and if we need to remove any */
if (!val) {
/* can't happen? */
continue;
}
for (i = 0; i < count; i++) {
break;
}
}
if (found) {
continue;
}
(void) mms_gen_taskid(tid);
"delete task['%s'] type[CARTRIDGEGROUPAPPLICATION] "
"match[and "
"(streq(CARTRIDGEGROUPAPPLICATION.'CartridgeGroupName' "
"'%s') "
"streq(CARTRIDGEGROUPAPPLICATION.'ApplicationName' "
"'%s'))];",
&response);
if (st != 0) {
break;
}
}
done:
if (new) {
}
if (cgattrs) {
}
if (sess) {
(void) mms_goodbye(sess, 0);
}
return (st);
}
/*
* verify no cartridges 'allocated'
* force? remove cart anyway
* remove all carts
* remove cartridgegroupapplications
* remove cartridgegroup
*/
int
{
int st;
void *response;
char tid[64];
char cmd[8192];
if (!mpool) {
return (MMS_MGMT_NOARG);
}
if (!mgmt_chk_auth("solaris.mms.delete")) {
return (EACCES);
}
if (st != 0) {
return (st);
}
if (!session) {
if (st != 0) {
return (st);
}
}
if (st != 0) {
goto done;
}
(void) mms_gen_taskid(tid);
"delete task['%s'] type[CARTRIDGEGROUPAPPLICATION] "
"match[streq"
"(CARTRIDGEGROUPAPPLICATION.'CartridgeGroupName' '%s')];",
&response);
if (st != 0) {
goto done;
}
(void) mms_gen_taskid(tid);
"delete task['%s'] type[CARTRIDGEGROUP] "
"match[streq(CARTRIDGEGROUP.'CartridgeGroupName' '%s')];",
&response);
if (st != 0) {
goto done;
}
done:
if (nvl) {
}
return (st);
}
int
{
int st;
char *mpool;
char *libname;
int count;
int i;
char tid[64];
char cmd[8192];
char *volstr;
void *response;
char *volxml = "</token><token>volume</token><token>";
if (!nvl) {
return (MMS_MGMT_NOARG);
}
if (!mgmt_chk_auth("solaris.mms.media")) {
return (EACCES);
}
if (st != 0) {
return (st);
}
if (st != 0) {
return (st);
}
if (st != 0) {
return (st);
}
return (st);
}
if (st != 0) {
return (st);
}
}
/* get the library information */
if (st != 0) {
goto done;
}
break;
}
}
goto done;
}
/* get the volume info from the ACSLS server */
for (i = 0; i < count; i++) {
}
len++; /* include trailing nul */
goto done;
}
volstr[0] = '\0';
for (i = 0; i < count; i++) {
if (i > 0) {
}
}
if (st != 0) {
goto done;
}
/* requested volumes don't appear in the returned list */
for (i = 0; i < count; i++) {
if (volarr[i]) {
}
}
goto done;
}
/* list to be used when creating PARTITIONs */
if (st != 0) {
goto done;
}
/* pre-populate with constant values */
for (i = 0; i < count; i++) {
break;
}
}
/* should never happen */
continue;
}
(void) mms_gen_taskid(tid);
"create task['%s'] type[CARTRIDGE] "
"set[CARTRIDGE.'CartridgePCL' '%s'] "
"set[CARTRIDGE.'CartridgeTypeName' '%s'] "
"set[CARTRIDGE.'CartridgeGroupName' '%s'] "
"set[CARTRIDGE.'LibraryName' '%s']; ",
&response);
if (st != 0) {
break;
}
/* create the PARTITION */
if (st != 0) {
break;
}
}
done:
if (sess) {
(void) mms_goodbye(sess, 0);
}
if (cart) {
}
return (st);
}
int
{
int st;
char tid[64];
char cmd[8192];
char *val;
if (!nvl) {
return (MMS_MGMT_NOARG);
}
if (!mgmt_chk_auth("solaris.mms.media")) {
return (EACCES);
}
if (st != 0) {
return (st);
}
if (st != 0) {
return (st);
}
if (st != 0) {
return (st);
}
if (!sessp) {
if (st != 0) {
return (st);
}
}
/* see if we've already got this type */
if (st != 0) {
goto done;
}
/* we'll get an empty list if it isn't already defined */
if (st == 0) {
/* make sure all attributes match */
&val);
goto done;
}
goto done;
}
/* all matched, nothing to do */
goto done;
}
if (st != 0) {
goto done;
}
if (st != 0) {
goto done;
}
/* make sure requested media type is supported */
if (st != 0) {
st = EOPNOTSUPP;
}
goto done;
}
/* create the new type */
(void) mms_gen_taskid(tid);
"create task['%s'] type[CARTRIDGETYPE] "
"set[CARTRIDGETYPE.'CartridgeTypeName' '%s'] "
"set[CARTRIDGETYPE.'CartridgeTypeNumberSides' '1'] "
"set[CARTRIDGETYPE.'CartridgeTypeMediaType' 'data'] "
"set[CARTRIDGETYPE.'CartridgeTypeMediaLength' '%s'] "
"set[CARTRIDGETYPE.'CartridgeShapeName' '%s'];",
&response);
done:
if (sess) {
(void) mms_goodbye(sess, 0);
}
if (stypes) {
}
return (st);
}
static int
{
int st;
char tid[64];
char cmd[8192];
if (!voltype) {
return (MMS_MGMT_NOARG);
}
/* first, check to see if any cartridges are using this type */
(void) mms_gen_taskid(tid);
"show task['%s'] reportmode[namevalue unique] "
"report[CARTRIDGE.'CartridgeTypeName'] "
"match[streq(CARTRIDGETYPE.'CartridgeTypeName' '%s')];",
if (!sessp) {
if (st != 0) {
return (st);
}
}
if (st == 0) {
}
if (st == 0) {
}
}
if (sess) {
(void) mms_goodbye(sess, 0);
}
if (clist) {
}
return (st);
}
int
{
int st;
char tid[64];
char cmd[8192];
if (!voltype) {
return (MMS_MGMT_NOARG);
}
if (!mgmt_chk_auth("solaris.mms.media")) {
return (EACCES);
}
if (!sessp) {
if (st != 0) {
return (st);
}
}
/* first, check to see if any cartridges are using this type */
if (st == 0) {
(void) mms_gen_taskid(tid);
"delete task['%s'] type[CARTRIDGETYPE] "
"match[streq(CARTRIDGETYPE.'CartridgeTypeName' '%s')];",
&response);
}
if (sess) {
(void) mms_goodbye(sess, 0);
}
return (st);
}
int
{
int st;
char tid[64];
char cmd[8192];
char buf[1024];
if (!nvl) {
return (MMS_MGMT_NOARG);
}
if (!mgmt_chk_auth("solaris.mms.media")) {
return (EACCES);
}
if (st != 0) {
return (st);
}
if (!sessp) {
if (st != 0) {
return (st);
}
}
/* first, check to see if any cartridges are using this type */
if (st != 0) {
goto done;
}
goto done;
}
(void) mms_gen_taskid(tid);
"attribute task['%s'] type[CARTRIDGETYPE] "
"match[streq(CARTRIDGETYPE.'CartridgeTypeName' '%s')]",
tid);
if (sz) {
" set[CARTRIDGETYPE.'CartridgeTypeMediaLength' '%s']",
sz);
}
if (mtype) {
"set[CARTRIDGETYPE.'CartridgeShapeName' '%s'];",
mtype);
}
done:
if (sess) {
(void) mms_goodbye(sess, 0);
}
return (st);
}
int
{
int st;
char tid[64];
char cmd[8192];
char buf[1024];
if (!nvl) {
return (MMS_MGMT_NOARG);
}
/* if voltype is NULL, return a list of all found */
(void) mms_gen_taskid(tid);
"show task['%s'] reportmode[namevalue] "
"report[CARTRIDGETYPE]", tid);
" match[streq (CARTRIDGETYPE.'CartridgeTypeName' '%s')]",
voltype);
}
if (!sessp) {
if (st != 0) {
return (st);
}
}
&response);
if (st == 0) {
}
if (sess) {
(void) mms_goodbye(sess, 0);
}
return (st);
}
int
{
int st;
char *mpool;
void *response;
char *val;
char *vname;
char tid[64];
char cmd[8192];
int skipped = 0;
if (!mgmt_chk_auth("solaris.mms.media")) {
return (EACCES);
}
if (st != 0) {
return (st);
}
/* nothing to remove */
return (0);
}
if (!session) {
if (st != 0) {
return (st);
}
}
/* tell the list function not to translate the var names */
if (st != 0) {
goto done;
}
/* Create a temporary nvlist to store PCL & Library */
if (st != 0) {
goto done;
}
/* vols is now a list of the volumes we're supposed to remove */
if (st != 0) {
continue;
}
if (st != 0) {
continue;
}
if (!force) {
&val);
if (st != 0) {
/* don't remove it if we can't tell state */
continue;
}
/* fail */
skipped++;
}
}
if (skip) {
continue;
}
/* remove partitions and vols if necessary */
if (st != 0) {
continue;
}
(void) mms_gen_taskid(tid);
"delete task['%s'] type[CARTRIDGE] "
"match[and (streq(CARTRIDGE.'CartridgeGroupName' '%s') "
"streq(CARTRIDGE.'CartridgePCL' '%s'))];",
&response);
if (st != 0) {
continue;
}
/* check for disk cartridges, remove the on-disk files if yes */
if (st == 0) {
(void) nvlist_lookup_string(vlist,
"CartridgeMountPoint", &mntp);
(void) nvlist_lookup_string(vlist,
"CartridgePath", &rpath);
ENOENT);
continue;
}
if (st != 0) {
}
}
}
}
if (pclnv) {
}
done:
if (sess) {
(void) mms_goodbye(sess, 0);
}
if (vols) {
}
}
return (st);
}
/*
* list by mpool, by mpool&cartridge id or all
*/
int
{
int st;
int count;
char tid[64];
char cmd[8192];
void *response;
int i;
char *key = "volid";
if (!nvl) {
return (MMS_MGMT_NOARG);
}
key = "CartridgePCL";
}
st = 0;
/* special case for all volumes */
}
}
if (st != 0) {
goto done;
}
}
if (!session) {
if (st != 0) {
return (st);
}
}
/*
* get the cartridges from MMS.
*/
if (all) {
(void) mms_gen_taskid(tid);
"show task['%s'] reportmode[namevalue] "
"report[CARTRIDGE] ", tid);
if (!mpool) {
} else {
"match[streq(CARTRIDGE.'CartridgeGroupName' '",
sizeof (cmd));
}
&response);
if (st == 0) {
vol_list);
}
} else {
for (i = 0; i < count; i++) {
(void) mms_gen_taskid(tid);
"show task['%s'] reportmode[namevalue] "
"report[CARTRIDGE] ", tid);
if (mpool) {
sizeof (cmd));
"CARTRIDGE.'CartridgeGroupName' '",
sizeof (cmd));
}
sizeof (cmd));
if (mpool) {
}
"show cartridges", &response);
if (st == 0) {
} else {
break;
}
}
}
if (st == 0) {
}
done:
if (sess) {
(void) mms_goodbye(sess, 0);
}
return (st);
}
int
{
int st;
int count;
char tid[64];
char cmd[8192];
char buf[1024];
void *response;
int i;
int vcount = 0;
char *val;
return (MMS_MGMT_NOARG);
}
if (!session) {
if (st != 0) {
return (st);
}
}
(void) mms_gen_taskid(tid);
"show task['%s'] reportmode[namevalue] "
"report[CARTRIDGEGROUP]",
tid);
if (count > 1) {
} else if (count == 1) {
}
for (i = 0; i < count; i++) {
" streq (CARTRIDGEGROUP.'%s' '%s')",
}
if (count > 0) {
} else {
}
if (st == 0) {
}
if (st != 0) {
goto done;
}
if (st != 0) {
continue;
}
(void) mms_gen_taskid(tid);
"show task['%s'] reportmode[namevalue] "
"report[CARTRIDGE.'CartridgePCL' "
"CARTRIDGETYPE.'CartridgeShapeName' "
"CARTRIDGETYPE.'CartridgeTypeMediaLength' "
"PARTITION.'PartitionSize'] "
"match[streq(CARTRIDGEGROUP.'CartridgeGroupName' '%s')];",
&response);
if (st == 0) {
}
if (st != 0) {
continue;
}
cmd[0] = '\0';
poolsz = 0;
vcount = 0;
if (st != 0) {
continue;
}
vcount++;
&val);
if (st == 0) {
}
}
&val);
if (st == 0) {
} else {
"CartridgeTypeMediaLength", &val);
if (st == 0) {
}
}
}
}
}
done:
if (sess) {
(void) mms_goodbye(sess, 0);
}
if (names) {
}
return (st);
}
int
{
int st;
void *response;
char tid[64];
char cmd[8192];
if (!mgmt_chk_auth("solaris.mms.media")) {
return (EACCES);
}
if (!nvl) {
return (MMS_MGMT_NOARG);
}
if (st != 0) {
return (st);
}
if (st != 0) {
}
if (!session) {
if (st != 0) {
return (st);
}
}
(void) mms_gen_taskid(tid);
"show task['%s'] reportmode[namevalue] report[CARTRIDGE] "
"match[and (streq(CARTRIDGE.'LibraryName' '%s') "
"streq(CARTRIDGE.'CartridgePCL' '%s'))];",
if (st == 0) {
}
if (st != 0) {
goto done;
}
(void) mms_gen_taskid(tid);
"create task['%s'] type[PARTITION] "
"set[PARTITION.'PartitionName' 'part1'] "
"set[PARTITION.'SideName' 'side 1'] "
"set[PARTITION.'CartridgePCL' '%s'] "
"set[PARTITION.'LibraryName' '%s'];",
done:
if (sess) {
(void) mms_goodbye(sess, 0);
}
if (carts) {
}
return (st);
}
int
{
int st;
void *response;
char tid[64];
char cmd[8192];
if (!mgmt_chk_auth("solaris.mms.media")) {
return (EACCES);
}
if (!nvl) {
return (MMS_MGMT_NOARG);
}
if (st != 0) {
return (st);
}
if (st != 0) {
}
if (!session) {
if (st != 0) {
return (st);
}
}
/* check for existing volumes */
if (st != 0) {
goto done;
}
if (vols) {
(void) mms_gen_taskid(tid);
"delete task['%s'] type[VOLUME] "
"match[and (streq(PARTITION.'CartridgePCL' '%s') "
"streq(PARTITION.'LibraryName' '%s'))];",
&response);
if (st != 0) {
goto done;
}
}
/* now the partitions */
(void) mms_gen_taskid(tid);
"delete task['%s'] type[PARTITION] "
"match[and (streq (PARTITION.'LibraryName' '%s') "
"streq(PARTITION.'CartridgePCL' '%s'))];",
&response);
done:
if (sess) {
(void) mms_goodbye(sess, 0);
}
if (carts) {
}
if (vols) {
}
return (st);
}
int
{
int st;
int rst = 0;
int count = 0;
int i;
if (!mgmt_chk_auth("solaris.mms.media")) {
return (EACCES);
}
if (!nvl) {
return (MMS_MGMT_NOARG);
}
if (!varr) {
return (st);
}
if (!session) {
if (st != 0) {
return (st);
}
}
for (i = 0; i < count; i++) {
if (st != 0) {
/* save return status */
if (rst == 0) {
}
}
}
/* set 'name' back to the way it started */
if (sess) {
(void) mms_goodbye(sess, 0);
}
return (rst);
}
int
{
int st;
void *response;
char tid[64];
char cmd[8192];
char buf[1024];
char *pcl;
char *lib;
char *app;
if (!mgmt_chk_auth("solaris.mms.media")) {
return (EACCES);
}
if (!nvl) {
return (MMS_MGMT_NOARG);
}
if (st != 0) {
return (st);
}
if (st != 0) {
return (st);
}
if (st != 0) {
return (st);
}
if (!session) {
if (st != 0) {
return (st);
}
}
/* check if partition for cartridge exists. if no, create */
if (st != 0) {
goto done;
}
} else {
if (nva) {
/* got more than 1, not supported */
goto done;
}
}
}
/* check for existing volumes */
if (st != 0) {
goto done;
}
if (!attrs) {
/* create a volume */
(void) mms_gen_taskid(tid);
"allocate task['%s'] newvolname['%s'] "
"who['%s'] "
"match[and (streq(CARTRIDGE.'CartridgePCL' '%s') "
"streq(CARTRIDGE.'LibraryName' '%s'))];",
&response);
if (st != 0) {
goto done;
}
} else if (!force) {
goto done;
}
/* filename is 17 spaces - tells MM to re-init volume */
/* ok, mount with appropriate options */
if (st == 0) {
}
done:
if (sess) {
(void) mms_goodbye(sess, 0);
}
if (attrs) {
}
return (st);
}
static int
{
int st;
void *response;
char tid[64];
char cmd[8192];
return (MMS_MGMT_NOARG);
}
if (st != 0) {
return (st);
}
if (!session) {
if (st != 0) {
return (st);
}
}
(void) mms_gen_taskid(tid);
"show task['%s'] report[PARTITION] reportmode[namevalue] "
"match[and (streq(PARTITION.'CartridgePCL' '%s') "
"streq(PARTITION.'LibraryName' '%s'))];",
if (st == 0) {
&plist);
}
if (st == 0) {
if (nvp) {
} else {
}
}
return (st);
}
static int
{
int st;
void *response;
char tid[64];
char cmd[8192];
return (MMS_MGMT_NOARG);
}
if (st != 0) {
return (st);
}
if (!session) {
if (st != 0) {
return (st);
}
}
(void) mms_gen_taskid(tid);
"show task['%s'] report[VOLUME] reportmode[namevalue] "
"match[and (streq(PARTITION.'CartridgePCL' '%s') "
"streq(PARTITION.'LibraryName' '%s'))];",
if (st == 0) {
}
if (st == 0) {
if (!nvp) {
/* nothing there */
} else {
}
}
return (st);
}
static int
{
int st;
int doorfd = -1;
int count;
/* LINTED [warning: pointer cast may result in improper alignment] */
int saverr;
char *cmd[2];
return (MMS_MGMT_NOARG);
}
/* will get overwritten with correct status as appropriate */
/* try 5 times to get connected, then give up */
if (doorfd == -1) {
/* server is not running. Try to start it */
cmd);
} else {
return (st);
}
}
/*
* try to contact the server - if door_call successful,
* status will be set by the server
*/
if (st == 0) {
/* connected ok, return error from daemon */
break;
}
doorfd = -1;
/*
* server was not running when we opened
* the door file
*/
/* give the server a chance to start */
/* A non-recoverable error occurred */
"Could not contact the mmsmnt process, %d", st);
return (st);
}
}
if (doorfd != -1) {
}
return (st);
}
int
{
int st;
char tid[64];
char cmd[8192];
char mbuf[7168];
char buf[1024];
char *pcl;
char *lib;
char *val;
char *vname;
int others = 0;
int count = 0;
int i;
if (!mgmt_chk_auth("solaris.mms.io.read")) {
return (EACCES);
}
/* this function is unique, in that it returns the session */
if (!nvl) {
return (MMS_MGMT_NOARG);
}
if (st != 0) {
return (st);
}
if (st != 0) {
return (st);
}
if (st != 0) {
/* if not specified, see if we can mount as admin */
st = 0;
app = "MMS";
} else {
return (st);
}
}
if (!sessp) {
if (st != 0) {
return (st);
}
}
/* check for volumes. If one doesn't exist, fail */
if (st == 0) {
if (!attrs) {
}
}
if (st != 0) {
goto done;
}
if (st != 0) {
goto done;
}
if (st != 0) {
continue;
}
continue;
}
/* found a valid volume */
break;
}
goto done;
}
if (st != 0) {
goto done;
}
/* see what type of cartridge this is */
(void) mms_gen_taskid(tid);
"show task['%s'] report[CARTRIDGETYPE.'CartridgeShapeName'] "
"reportmode[namevalue] "
"match[and (streq(CARTRIDGE.'CartridgePCL' '%s') "
"streq(LIBRARY.'LibraryName' '%s'))];",
&response);
if (st == 0) {
&cattrs);
}
if (st == 0) {
}
}
/* reset */
if (cattrs) {
}
st = 0;
}
usernm = "root";
}
}
/* at last, create the mount command */
(void) mms_gen_taskid(tid);
"mount task['%s'] user['%s'] type[VOLUME] "
"match[and (streq(LIBRARY.'LibraryName' '%s') "
"streq(CARTRIDGE.'CartridgePCL' '%s'))] "
"report[MOUNTLOGICAL] reportmode[namevalue] ",
if (mfile) {
mfile);
}
if (st == 0) {
}
} else {
}
st = 0;
/* get the firstmount and accessmodes */
mbuf[0] = '\0';
/* The 17-space filename indicates we're labeling */
} else {
/* all options go into accessmode otherwise */
}
/* get the rest of the options */
if (isdsk) {
others++;
}
if (st == 0) {
others++;
}
others++;
}
if (st == 0) {
others++;
}
for (i = 0; i < count; i++) {
if (!varray[i]) {
continue;
}
others++;
}
count = 0;
if (st == 0) {
} else {
}
others++;
}
if (others > 0) {
}
/*
* Call the mount daemon. If successful, the handle will be
* returned.
*/
if (pass) {
}
if (inst) {
}
if (app) {
}
if (st == 0) {
}
done:
if (sess) {
(void) mms_goodbye(sess, 0);
}
if (attrs) {
}
if (mntattrs) {
}
return (st);
}
int
{
int st;
char tid[64];
char cmd[8192];
if (!mgmt_chk_auth("solaris.mms.io.read")) {
return (EACCES);
}
if (st != 0) {
return (st);
}
if (pcl[0] == '/') {
} else {
}
return (st);
}
if (lib) {
}
/* could specify all the options, but unlikely */
if (st == 0) {
}
if (!app) {
app = "MMS";
}
/* make sure user is permitted to unmount this volume */
if (st != 0) {
return (st);
}
(void) mms_gen_taskid(tid);
if (pcl[0] == '/') {
"show task['%s'] report[MOUNTPHYSICAL] "
"reportmode[namevalue] "
"match[and "
"(streq(MOUNTPHYSICAL.'ApplicationName' '%s') "
"streq(MOUNTLOGICAL.'MountLogicalHandle' '%s'))];",
} else {
"show task['%s'] report[MOUNTPHYSICAL] "
"reportmode[namevalue] "
"match[and "
"(streq(MOUNTPHYSICAL.'ApplicationName' '%s') "
"streq(MOUNTPHYSICAL.'CartridgePCL' '%s'))];",
}
&resp);
if (st == 0) {
}
if (st == 0) {
}
}
(void) mms_goodbye(sess, 0);
if (st != 0) {
return (st);
}
}
/* see if they want the cartridge physically unloaded */
if (phys) {
}
return (st);
}