/*
* 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 2013 Nexenta Systems, Inc. All rights reserved.
* Copyright 2016 Toomas Soome <tsoome@me.com>
* Copyright (c) 2015 by Delphix. All rights reserved.
*/
#ifndef _LIBBE_PRIV_H
#define _LIBBE_PRIV_H
#include <libnvpair.h>
#include <libzfs.h>
#include <instzones_api.h>
#ifdef __cplusplus
extern "C" {
#endif
if (_zhp) { \
}
/* Maximum length for the BE name. */
#define MAX(a, b) ((a) > (b) ? (a) : (b))
#define MIN(a, b) ((a) < (b) ? (a) : (b))
typedef struct be_transaction_data {
typedef struct be_mount_data {
typedef struct be_unmount_data {
typedef struct be_destroy_data {
typedef struct be_demote_data {
typedef struct be_fs_list_data {
char *altroot;
char **fs_list;
int fs_num;
typedef struct be_plcy_list {
char *be_plcy_name;
int be_num_max;
int be_num_min;
int be_usage_pcnt;
struct be_defaults {
};
/* Library globals */
extern libzfs_handle_t *g_zfs;
/* be_create.c */
int be_set_uuid(char *);
int be_get_uuid(const char *, uuid_t *);
/* be_list.c */
int _be_list(char *, be_node_list_t **);
int be_get_zone_be_list(char *, char *, be_node_list_t **);
/* be_mount.c */
int _be_mount(char *, char **, int);
int _be_unmount(char *, int);
int be_unmount_pool(zfs_handle_t *, char *, char *);
int be_get_legacy_fs(char *, char *, char *, char *, be_fs_list_data_t *);
void be_free_fs_list(be_fs_list_data_t *);
char *be_get_ds_from_dir(char *);
int be_make_tmp_mountpoint(char **);
/* be_snapshot.c */
int _be_create_snapshot(char *, char **, char *);
int _be_destroy_snapshot(char *, char *);
/* be_utils.c */
boolean_t be_zfs_init(void);
void be_zfs_fini(void);
void be_make_root_ds(const char *, const char *, char *, int);
void be_make_container_ds(const char *, char *, int);
char *be_make_name_from_ds(const char *, char *);
int be_append_menu(char *, char *, char *, char *, char *);
int be_remove_menu(char *, char *, char *);
int be_update_menu(char *, char *, char *, char *);
int be_default_grub_bootfs(const char *, char **);
boolean_t be_has_menu_entry(char *, char *, int *);
int be_run_cmd(char *, char *, int, char *, int);
int be_change_grub_default(char *, char *);
int be_update_vfstab(char *, char *, char *, be_fs_list_data_t *, char *);
int be_update_zone_vfstab(zfs_handle_t *, char *, char *, char *,
char *be_auto_snap_name(void);
char *be_auto_be_name(char *);
char *be_auto_zone_be_name(char *, char *);
char *be_default_policy(void);
boolean_t valid_be_policy(char *);
boolean_t be_valid_auto_snap_name(char *);
boolean_t be_valid_be_name(const char *);
void be_print_err(char *, ...);
int zfs_err_to_be_err(libzfs_handle_t *);
int errno_to_be_err(int);
/* be_activate.c */
int _be_activate(char *);
int be_activate_current_be(void);
boolean_t be_is_active_on_boot(char *);
/* be_zones.c */
void be_make_zoneroot(char *, char *, int);
int be_find_active_zone_root(zfs_handle_t *, char *, char *, int);
int be_find_mounted_zone_root(char *, char *, char *, int);
boolean_t be_zone_supported(char *);
int be_zone_get_parent_uuid(const char *, uuid_t *);
int be_zone_set_parent_uuid(char *, uuid_t);
boolean_t be_zone_compare_uuids(char *);
/* check architecture functions */
char *be_get_default_isa(void);
char *be_get_platform(void);
boolean_t be_has_grub(void);
/* callback functions */
int be_exists_callback(zpool_handle_t *, void *);
int be_find_zpool_callback(zpool_handle_t *, void *);
int be_zpool_find_current_be_callback(zpool_handle_t *, void *);
int be_zfs_find_current_be_callback(zfs_handle_t *, void *);
int be_check_be_roots_callback(zpool_handle_t *, void *);
/* defaults */
#ifdef __cplusplus
}
#endif
#endif /* _LIBBE_PRIV_H */