libzfs_jni_main.c revision c8e9ed14d97e244b9753db14caf8481f181f5750
/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License, Version 1.0 only
* (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 2005 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#pragma ident "%Z%%M% %I% %E% SMI"
#include <priv.h>
#include "libzfs_jni_main.h"
#include "libzfs_jni_util.h"
#include "libzfs_jni_dataset.h"
#include "libzfs_jni_property.h"
#include "libzfs_jni_pool.h"
#include "libzfs_jni_diskmgt.h"
#include "libzfs_jni_disk.h"
/*
* Function prototypes
*/
static void handle_error(const char *, va_list);
static void init();
/*
* Static functions
*/
char libzfs_err[1024];
static void
{
/* Save the error message in case it's needed */
#ifdef DEBUG
#endif
}
/*
* Initialize the library. Sets the error handler.
*/
static void
init()
{
libzfs_err[0] = '\0';
/* libzfs error handler */
/* diskmgt.o error handler */
}
/*
* JNI functions
*/
/*
* Class: com_sun_zfs_common_model_SystemDataModel
* Method: getImportablePools
*/
/* ARGSUSED */
int error;
int argc = 0;
zjni_ArrayCallbackData_t data = {0};
zjni_ArrayList_t list_obj = {0};
if (!priv_ineffect(PRIV_SYS_CONFIG)) {
"cannot discover pools: permission denied\n");
return (NULL);
}
return (NULL);
}
/* Count elements */
}
/* Create an array list to hold each ImportablePoolBean */
/* Iterate through all importable pools, building list */
if (error) {
return (NULL);
}
ZFSJNI_PACKAGE_DATA "ImportablePool"));
}
/*
* Class: com_sun_zfs_common_model_SystemDataModel
* Method: getPools
*/
/* ARGSUSED */
{
int result;
/* Create an array list */
zjni_ArrayList_t list_obj = {0};
/* Must not call any more Java methods to preserve exception */
return (NULL);
}
ZFSJNI_PACKAGE_DATA "Pool"));
}
/*
* Class: com_sun_zfs_common_model_SystemDataModel
* Method: getPool
*/
/* ARGSUSED */
{
}
/*
* Class: com_sun_zfs_common_model_SystemDataModel
* Method: getFileSystems
*/
/* ARGSUSED */
{
ZFSJNI_PACKAGE_DATA "FileSystem"));
}
/*
* Class: com_sun_zfs_common_model_SystemDataModel
* Method: getFileSystem
*/
/* ARGSUSED */
{
}
/*
* Class: com_sun_zfs_common_model_SystemDataModel
* Method: getVolumes
*/
/* ARGSUSED */
{
ZFSJNI_PACKAGE_DATA "Volume"));
}
/*
* Class: com_sun_zfs_common_model_SystemDataModel
* Method: getVolume
*/
/* ARGSUSED */
{
}
/*
* Class: com_sun_zfs_common_model_SystemDataModel
* Method: getSnapshots
*/
/* ARGSUSED */
{
ZFSJNI_PACKAGE_DATA "Snapshot"));
}
/*
* Class: com_sun_zfs_common_model_SystemDataModel
* Method: getSnapshot
*/
/* ARGSUSED */
{
}
/*
* Class: com_sun_zfs_common_model_SystemDataModel
* Method: getDatasets
*/
/* ARGSUSED */
{
if (containerUTF == NULL) {
}
ZFSJNI_PACKAGE_DATA "Dataset"));
}
/*
* Class: com_sun_zfs_common_model_SystemDataModel
* Method: getDataset
*/
/* ARGSUSED */
{
}
/*
* Class: com_sun_zfs_common_model_SystemDataModel
* Method: getVirtualDevice
*/
/* ARGSUSED */
{
NULL);
}
}
}
return (vdev);
}
/*
* Class: com_sun_zfs_common_model_SystemDataModel
* Method: getVirtualDevices
*/
/* ARGSUSED */
/* CSTYLED */
{
NULL);
/* Is the pool valid? */
}
}
}
return (vdevs);
}
/*
* Class: com_sun_zfs_common_model_SystemDataModel
* Method: getVirtualDevices
*/
/* ARGSUSED */
/* CSTYLED */
{
/* Is the pool valid? */
}
}
return (vdevs);
}
/*
* Class: com_sun_zfs_common_model_SystemDataModel
* Method: getAvailableDisks
*/
/* ARGSUSED */
{
int error;
zjni_ArrayCallbackData_t data = {0};
/* Create an array list */
zjni_ArrayList_t list_obj = {0};
if (error) {
} else {
ZFSJNI_PACKAGE_DATA "DiskDevice");
}
return (array);
}
/*
* Class: com_sun_zfs_common_model_SystemDataModel
* Method: getDependents
*/
/* ARGSUSED */
{
}
/*
* Class: com_sun_zfs_common_model_SystemDataModel
* Method: getPropertyDefault
*/
/* ARGSUSED */
{
if (prop != ZFS_PROP_INVAL) {
}
return (defProperty);
}
typedef struct zjni_class_type_map {
char *class;
/*
* Class: com_sun_zfs_common_model_SystemDataModel
* Method: getValidPropertyNames
*/
/* ARGSUSED */
{
int i;
/* Mappings of class names to zfs_type_t */
static zjni_class_type_map_t mappings[] = {
};
/* Create an array list for the property names */
zjni_ArrayList_t list_obj = {0};
/* For each mapping... */
for (i = 0; i < nmappings; i++) {
/*
* Is the given class an instance of the class in the mapping?
*/
if (isInstance == JNI_TRUE) {
/* Add name of property to list */
(*env)->CallBooleanMethod(
env,
((zjni_Collection_t *)list)->
}
}
break;
}
}
return (zjni_Collection_to_array(
}