Print this page
ba_path->module + lost file
Split |
Close |
Expand all |
Collapse all |
--- old/usr/src/lib/libbe/common/libbe_priv.h
+++ new/usr/src/lib/libbe/common/libbe_priv.h
1 1 /*
2 2 * CDDL HEADER START
3 3 *
4 4 * The contents of this file are subject to the terms of the
5 5 * Common Development and Distribution License (the "License").
6 6 * You may not use this file except in compliance with the License.
7 7 *
8 8 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9 9 * or http://www.opensolaris.org/os/licensing.
10 10 * See the License for the specific language governing permissions
11 11 * and limitations under the License.
12 12 *
13 13 * When distributing Covered Code, include this CDDL HEADER in each
14 14 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15 15 * If applicable, add the following below this CDDL HEADER, with the
16 16 * fields enclosed by brackets "[]" replaced with your own identifying
17 17 * information: Portions Copyright [yyyy] [name of copyright owner]
18 18 *
19 19 * CDDL HEADER END
20 20 */
21 21
22 22 /*
23 23 * Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved.
24 24 */
25 25
26 26 /*
27 27 * Copyright 2011 Nexenta Systems, Inc. All rights reserved.
28 28 */
29 29
30 30 #ifndef _LIBBE_PRIV_H
31 31 #define _LIBBE_PRIV_H
32 32
33 33 #include <libnvpair.h>
34 34 #include <libzfs.h>
35 35 #include <instzones_api.h>
36 36
37 37 #ifdef __cplusplus
38 38 extern "C" {
39 39 #endif
40 40
41 41 #define ARCH_LENGTH MAXNAMELEN
↓ open down ↓ |
41 lines elided |
↑ open up ↑ |
42 42 #define BE_AUTO_NAME_MAX_TRY 3
43 43 #define BE_AUTO_NAME_DELIM '-'
44 44 #define BE_DEFAULTS "/etc/default/be"
45 45 #define BE_DFLT_BENAME_STARTS "BENAME_STARTS_WITH="
46 46 #define BE_CONTAINER_DS_NAME "ROOT"
47 47 #define BE_DEFAULT_CONSOLE "text"
48 48 #define BE_POLICY_PROPERTY "org.opensolaris.libbe:policy"
49 49 #define BE_UUID_PROPERTY "org.opensolaris.libbe:uuid"
50 50 #define BE_PLCY_STATIC "static"
51 51 #define BE_PLCY_VOLATILE "volatile"
52 -#define BE_GRUB_MENU "/boot/grub/menu.lst"
52 +#define BE_GRUB_MENU "/boot/illumos.cfg"
53 53 #define BE_SPARC_MENU "/boot/menu.lst"
54 54 #define BE_GRUB_COMMENT "#============ End of LIBBE entry ============="
55 55 #define BE_GRUB_SPLASH "splashimage /boot/solaris.xpm"
56 56 #define BE_GRUB_FOREGROUND "foreground 343434"
57 57 #define BE_GRUB_BACKGROUND "background F7FBFF"
58 58 #define BE_GRUB_DEFAULT "default 0"
59 59 #define BE_WHITE_SPACE " \t\r\n"
60 60 #define BE_CAP_FILE "/boot/grub/capability"
61 61 #define BE_INSTALL_GRUB "/sbin/installgrub"
62 62 #define BE_STAGE_1 "/boot/grub/stage1"
63 63 #define BE_STAGE_2 "/boot/grub/stage2"
64 64 #define ZFS_CLOSE(_zhp) \
65 65 if (_zhp) { \
66 66 zfs_close(_zhp); \
67 67 _zhp = NULL; \
68 68 }
69 69
70 70 #define BE_ZONE_PARENTBE_PROPERTY "org.opensolaris.libbe:parentbe"
71 71 #define BE_ZONE_ACTIVE_PROPERTY "org.opensolaris.libbe:active"
72 72 #define BE_ZONE_SUPPORTED_BRANDS "ipkg labeled"
73 73 #define BE_ZONE_SUPPORTED_BRANDS_DELIM " "
74 74
75 75 /* Maximum length for the BE name. */
76 76 #define BE_NAME_MAX_LEN 64
77 77
78 78 #define MAX(a, b) ((a) > (b) ? (a) : (b))
79 79 #define MIN(a, b) ((a) < (b) ? (a) : (b))
80 80
81 81 typedef struct be_transaction_data {
82 82 char *obe_name; /* Original BE name */
83 83 char *obe_root_ds; /* Original BE root dataset */
84 84 char *obe_zpool; /* Original BE pool */
85 85 char *obe_snap_name; /* Original BE snapshot name */
86 86 char *obe_altroot; /* Original BE altroot */
87 87 char *nbe_name; /* New BE name */
88 88 char *nbe_root_ds; /* New BE root dataset */
89 89 char *nbe_zpool; /* New BE pool */
90 90 char *nbe_desc; /* New BE description */
91 91 nvlist_t *nbe_zfs_props; /* New BE dataset properties */
92 92 char *policy; /* BE policy type */
93 93 } be_transaction_data_t;
94 94
95 95 typedef struct be_mount_data {
96 96 char *altroot; /* Location of where to mount BE */
97 97 boolean_t shared_fs; /* Mount shared file sytsems */
98 98 boolean_t shared_rw; /* Mount shared file systems rw */
99 99 } be_mount_data_t;
100 100
101 101 typedef struct be_unmount_data {
102 102 char *altroot; /* Location of where BE is mounted */
103 103 boolean_t force; /* Forcibly unmount */
104 104 } be_unmount_data_t;
105 105
106 106 typedef struct be_destroy_data {
107 107 boolean_t destroy_snaps; /* Destroy snapshots of BE */
108 108 boolean_t force_unmount; /* Forcibly unmount BE if mounted */
109 109 uuid_t gz_be_uuid; /* UUID of the global zone BE */
110 110 } be_destroy_data_t;
111 111
112 112 typedef struct be_demote_data {
113 113 zfs_handle_t *clone_zhp; /* clone dataset to promote */
114 114 time_t origin_creation; /* snapshot creation time of clone */
115 115 const char *snapshot; /* snapshot of dataset being demoted */
116 116 boolean_t find_in_BE; /* flag noting to find clone in BE */
117 117 } be_demote_data_t;
118 118
119 119 typedef struct be_fs_list_data {
120 120 char *altroot;
121 121 char **fs_list;
122 122 int fs_num;
123 123 } be_fs_list_data_t;
124 124
125 125 typedef struct be_plcy_list {
126 126 char *be_plcy_name;
127 127 int be_num_max;
128 128 int be_num_min;
129 129 time_t be_age_max;
130 130 int be_usage_pcnt;
131 131 struct be_plcy_list *be_next_plcy;
132 132 }be_plcy_list_t;
133 133
134 134 struct be_defaults {
135 135 boolean_t be_deflt_rpool_container;
136 136 char be_deflt_bename_starts_with[ZFS_MAXNAMELEN];
137 137 };
138 138
139 139 /* Library globals */
140 140 extern libzfs_handle_t *g_zfs;
141 141 extern boolean_t do_print;
142 142
143 143 /* be_create.c */
144 144 int be_set_uuid(char *);
145 145 int be_get_uuid(const char *, uuid_t *);
146 146
147 147 /* be_list.c */
148 148 int _be_list(char *, be_node_list_t **);
149 149 int be_get_zone_be_list(char *, char *, be_node_list_t **);
150 150
151 151 /* be_mount.c */
152 152 int _be_mount(char *, char **, int);
153 153 int _be_unmount(char *, int);
154 154 int be_mount_pool(zfs_handle_t *, char **, char **, boolean_t *);
155 155 int be_unmount_pool(zfs_handle_t *, char *, char *);
156 156 int be_mount_zone_root(zfs_handle_t *, be_mount_data_t *);
157 157 int be_unmount_zone_root(zfs_handle_t *, be_unmount_data_t *);
158 158 int be_get_legacy_fs(char *, char *, char *, char *, be_fs_list_data_t *);
159 159 void be_free_fs_list(be_fs_list_data_t *);
160 160 char *be_get_ds_from_dir(char *);
161 161 int be_make_tmp_mountpoint(char **);
162 162
163 163 /* be_snapshot.c */
164 164 int _be_create_snapshot(char *, char **, char *);
165 165 int _be_destroy_snapshot(char *, char *);
166 166
167 167 /* be_utils.c */
168 168 boolean_t be_zfs_init(void);
169 169 void be_zfs_fini(void);
170 170 void be_make_root_ds(const char *, const char *, char *, int);
171 171 void be_make_container_ds(const char *, char *, int);
172 172 char *be_make_name_from_ds(const char *, char *);
173 173 int be_append_menu(char *, char *, char *, char *, char *);
174 174 int be_remove_menu(char *, char *, char *);
175 175 int be_update_menu(char *, char *, char *, char *);
176 176 int be_default_grub_bootfs(const char *, char **);
177 177 boolean_t be_has_menu_entry(char *, char *, int *);
178 178 int be_run_cmd(char *, char *, int, char *, int);
179 179 int be_change_grub_default(char *, char *);
180 180 int be_update_vfstab(char *, char *, char *, be_fs_list_data_t *, char *);
181 181 int be_update_zone_vfstab(zfs_handle_t *, char *, char *, char *,
182 182 be_fs_list_data_t *);
183 183 int be_maxsize_avail(zfs_handle_t *, uint64_t *);
184 184 char *be_auto_snap_name(void);
185 185 char *be_auto_be_name(char *);
186 186 char *be_auto_zone_be_name(char *, char *);
187 187 char *be_default_policy(void);
188 188 boolean_t valid_be_policy(char *);
189 189 boolean_t be_valid_auto_snap_name(char *);
190 190 boolean_t be_valid_be_name(const char *);
191 191 void be_print_err(char *, ...);
192 192 int be_find_current_be(be_transaction_data_t *);
193 193 int zfs_err_to_be_err(libzfs_handle_t *);
194 194 int errno_to_be_err(int);
195 195
196 196 /* be_activate.c */
197 197 int _be_activate(char *);
198 198 int be_activate_current_be(void);
199 199 boolean_t be_is_active_on_boot(char *);
200 200
201 201 /* be_zones.c */
202 202 void be_make_zoneroot(char *, char *, int);
203 203 int be_find_active_zone_root(zfs_handle_t *, char *, char *, int);
204 204 int be_find_mounted_zone_root(char *, char *, char *, int);
205 205 boolean_t be_zone_supported(char *);
206 206 zoneBrandList_t *be_get_supported_brandlist(void);
207 207 int be_zone_get_parent_uuid(const char *, uuid_t *);
208 208
209 209 /* check architecture functions */
210 210 char *be_get_default_isa(void);
211 211 boolean_t be_is_isa(char *);
212 212 boolean_t be_has_grub(void);
213 213
214 214 /* callback functions */
215 215 int be_exists_callback(zpool_handle_t *, void *);
216 216 int be_find_zpool_callback(zpool_handle_t *, void *);
217 217 int be_zpool_find_current_be_callback(zpool_handle_t *, void *);
218 218 int be_zfs_find_current_be_callback(zfs_handle_t *, void *);
219 219 int be_check_be_roots_callback(zpool_handle_t *, void *);
220 220
221 221 /* defaults */
222 222 void be_get_defaults(struct be_defaults *defaults);
223 223
224 224 #ifdef __cplusplus
225 225 }
226 226 #endif
227 227
228 228 #endif /* _LIBBE_PRIV_H */
↓ open down ↓ |
166 lines elided |
↑ open up ↑ |
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX