/*
* 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
*/
/*
*/
/*
* Creates and maintains a short-term cache of live upgrade slices.
*/
#include <dirent.h>
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <synch.h>
#include <unistd.h>
#include "libdiskmgt.h"
#include "disks_private.h"
/*
* The list of live upgrade slices in use.
*/
struct lu_list {
char *slice;
char *name;
};
static int load_lu();
/*
* Search the list of devices under live upgrade for the specified device.
*/
int
{
int found = 0;
*errp = 0;
return (found);
}
/*
* We don't want to have to re-read the live upgrade config for
* every slice, but we can't just cache it since there is no event
* when this changes. So, we'll keep the config in memory for
* a short time (1 minute) before reloading it.
*/
(void) mutex_lock(&lu_lock);
}
if (*errp == 0) {
found = 1;
break;
}
}
}
(void) mutex_unlock(&lu_lock);
return (found);
}
static int
{
return (ENOMEM);
}
return (ENOMEM);
}
return (ENOMEM);
}
return (0);
}
/*
* Free the list of liveupgrade entries.
*/
static void
}
}
/*
* Create a list of live upgrade devices.
*/
static int
load_lu(void)
{
int fd;
int status = 0;
} else {
}
}
return (status);
}
/*
* The XML generated by the live upgrade commands is not parseable by the
* standard Solaris XML parser, so we have to do it ourselves.
*/
static int
{
int status;
return (0);
}
char *devp;
char *nmp;
char *ep;
continue;
}
continue;
}
continue;
}
*ep = 0;
/* try to get the mountpoint name */
*ep = 0;
} else {
nmp = "";
}
} else {
nmp = "";
}
break;
}
}
return (status);
}
static int
{
int status = 0;
return (0);
}
char *sp;
char *ep;
int ffd;
continue;
}
continue;
}
continue;
}
*ep = 0;
break;
}
break;
}
}
}
return (status);
}
static int
{
int loc;
/* create the server process */
case 0:
/* child process */
(void) close(1);
(void) close(2);
closefrom(3);
_exit(1);
break;
case -1:
return (0);
default:
/* parent process */
break;
}
/* printf("got 0x%x %d %d\n", loc, WIFEXITED(loc), WEXITSTATUS(loc)); */
return (1);
}
return (0);
}