mgmt_remove.c revision f3861e1a2ceec23a5b699c24d814b7775a9e0b52
/*
* 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 2006 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#pragma ident "%Z%%M% %I% %E% SMI"
/*
* This file deals with XML data for removing various configuration data.
*/
#include <errno.h>
#include <strings.h>
#include <unistd.h>
#include <iscsitgt_impl.h>
#include "utility.h"
#include "queue.h"
#include "target.h"
#include "iscsi_cmd.h"
#include "errcode.h"
static char *remove_target(tgt_node_t *x);
static char *remove_initiator(tgt_node_t *x);
static char *remove_tpgt(tgt_node_t *x);
static char *remove_zfs(tgt_node_t *x);
/*ARGSUSED*/
void
{
tgt_node_t *x;
char msgbuf[80],
} else {
x = p->x_child;
reply_msg = remove_target(x);
reply_msg = remove_initiator(x);
reply_msg = remove_tpgt(x);
reply_msg = remove_zfs(x);
} else {
"Unknown object '%s' for delete element",
x->x_name);
}
}
}
static char *
remove_zfs(tgt_node_t *x)
{
char *prop,
return (msg);
}
!= NULL) {
break;
}
/*
* We're unsharing a target. If we don't have a reference
* then there's no problem.
*/
return (msg);
}
False) {
return (msg);
}
/*
* Wait until here to issue a logout to any initiators that
* might be logged into the target. Certain initiators are
* sneaky in that if asked to logout they will, but turn right
* around and log back into the target. By waiting until here
* to issue the logout we'll have removed reference to the target
* such that this can't happen.
*/
return (msg);
}
static char *
{
*list,
*c = NULL;
int lun_num;
return (msg);
}
NULL) {
break;
}
return (msg);
}
return (msg);
}
NULL) {
return (msg);
}
goto error;
}
tgt_node_free(c);
change_made = True;
}
return (msg);
}
NULL) {
return (msg);
}
goto error;
}
tgt_node_free(c);
change_made = True;
}
False) {
return (msg);
}
/*
* Save the iscsi-name which we'll need to remove LUNs.
*/
False) {
return (msg);
}
goto error;
change_made = True;
}
if (change_made == True) {
} else {
}
return (msg);
if (c != NULL)
tgt_node_free(c);
return (msg);
}
static char *
{
*name;
return (msg);
}
NULL) {
break;
}
return (msg);
}
return (msg);
}
return (msg);
}
static char *
{
*c = NULL;
return (msg);
}
NULL) {
break;
}
return (msg);
}
return (msg);
}
goto error;
}
tgt_node_free(c);
change_made = True;
}
if ((change_made != True) &&
change_made = True;
}
if (change_made == True) {
} else {
}
return (msg);
if (c != NULL)
tgt_node_free(c);
return (msg);
}